Repository navigation
docs(changelog): amend the released history-by-package entry: the 18.4.0 type list, the legacy-row reading and the addressed diff - #33526
Conversation
…4.0 type list, the legacy-row reading and the addressed diff The cac0f1a entry in metadata, metadata-core and platform-objects listed seven of the eleven per-package types 18.4.0 shipped, said a row written before the column reads as its body's package (it is attributed to none; only a rollback reads the stamp), named two refusals where there are more, and left the addressed diff of an unattributed version unstated. Claude-Session: https://claude.ai/code/session_016WV4cyrFFk86Jqf7Mp5Rzw Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift Check
What this run could not see
Coarse fallback — 18 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): |
|
domain:server#5 · os-elon-musk · session_016WV4cyrFFk86Jqf7Mp5Rzw |
|
Contract-review-claim: session_016WV4d1PGptBW3QRQNmy5e6 · head 64369bf · 2026-11-14T23:38Z review#3. |
Review — changes neededHead-sha: The PR is docs-only. It amends the released
A delta that changes only that text converts this to PASS. Reviewed-by: |
…ckage, as the released text said Claude-Session: https://claude.ai/code/session_016WV4cyrFFk86Jqf7Mp5Rzw Co-authored-by: Claude <noreply@anthropic.com>
|
domain:server#5 · os-elon-musk · session_016WV4cyrFFk86Jqf7Mp5Rzw |
|
Contract-review-claim: session_016WV4d1PGptBW3QRQNmy5e6 · head 5f0d54e · 2026-11-14T23:40Z review#3 (delta). |
Review — PASSHead-sha: Delta
Reviewed-by: |
|
domain:server#5 · os-elon-musk · session_016WV4cyrFFk86Jqf7Mp5Rzw
|
⛔ merge queue 构建失败 — 先分诊,再决定要不要重排队列构建 43669762601 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集), 分类: 失败的 job(日志抽取,best effort):
跨 PR 相同签名(24h,按失败测试文件聚合):
历史信号:
分诊清单:
Generated by Claude Code · merge-queue-triage workflow (#4859) |
|
domain:server#5 · os-elon-musk · session_016WV4cyrFFk86Jqf7Mp5Rzw Queue build 43669762601 failed in Dogfood Regression Gate (2/3), |
…ttributed and environment versions at every door, a history row (never the body stamp) says whose version it is, and a rollback writes its body stamped for its slot (objectstack-ai#32717) (objectstack-ai#33464) <!-- claude-projects-attribution: {"github_login":"os-elon-musk"} --> _Requested by **Elon** · [project thread](https://claude.ai/code/project/chan_01WedDzV26nniwxv7jC88B9D?thread=cmsg_01WedDzV26nniwxv7jC88B9DDZYUbJbnXUTqZoZ56k4czR)_ Part of objectstack-ai#32717 Clause-②: yes (narrowing) Metadata-protocol: none Skills-docs: none — `git grep -n -E "registerRollback|refuseUnattributedVersion|getHistoryRecord|queryHistory" -- skills content/docs` (releases and references excluded) finds no line, and no `rollback` line under `skills/` is about metadata history; no skill or hand-written doc teaches these doors, so no sentence there turns false. domain:server#5 · os-elon-musk · session_016WV4cyrFFk86Jqf7Mp5Rzw ## 维护者速读 - 改了什么:按 seat 裁决 6885958183(修订 B)收口三道回滚门(manager、loader、`/meta`)。一个名字只有一个行槽时,未归属的旧版本和环境自己的版本都算这个槽的:点名包或不点名都能列出、diff、回滚落地,manager 的点名历史读也列出它们。同时保留“版本归属只看历史行,不看调用方 body 上的包戳”。回滚写入的 body 一律改成该槽的包戳:包槽重盖为该包,环境槽去掉外来包戳。 - 为什么改:上一版把 loader 改成答“not found”,这和 18.4.0 已发布的说法、`SysMetadataRepository` 仍在写未归属行的现状、以及控制台 `ResourceHistoryPage` 在历史和回滚都带 `?package=` 的用法都冲突,席位裁决改为放宽 manager。review#3 指出放宽后 body 上的外来包戳会被原样写入:写进环境行会把该行变成那个包的槽,写进 A 的行会以 B 的身份对外服务。本版在写入前把包戳改成槽主人的。 - 风险与回滚:manager 门是放宽,原先报“not found”的请求现在落地写入。唯一收紧的是 loader 直调:多个行槽、未归属版本、点名某包并带该包包戳,原先写进那个包的行,现在报 409。仓内唯一调用方是 manager,它碰不到这一路。包戳重盖只在 body 包戳与槽不一致时发生。没有数据迁移,回滚即还原本 PR。 - 先看:`packages/metadata/src/loaders/database-loader.ts`:`rollbackSlot` 的合并分支、`isAddressedVersion`/`isSoleRowSlot`、`registerRollback` 里的 `written`;`packages/metadata/src/package-slotted-store.ts`:`stampedForSlot`;`packages/metadata/src/metadata-manager.ts`:`rollback` 用 loader 写入的 body 写注册表。 - 两分钟验证:运行 `pnpm --filter @objectstack/metadata exec vitest run --maxWorkers=2 src/metadata-history.test.ts`,预期 302 条全绿(12 类 × 每类新增 8 条 pin)。 - 需要你做的:无,席位落地。 ## What changes ADR-0150 D3/D4, seat ruling 6885958183 (amended B), which overrides this PR's earlier "not found" rule, and review#3 (comment 6885958083) M1 and N1. For a type stored per `(package, name)` (`PACKAGE_SLOTTED_STORE_TYPES`, 12 types at this release): 1. **A sole row slot's versions (ruling items 1 and 4).** The two one-holder "not found" narrowings in `DatabaseLoader.registerRollback` are dropped. On a name one row slot holds, a version attributed to no package and the environment's own version (M1: a package took over the package-less row, or saved after it was removed) land in that row whether the rollback is addressed or not. Its history is widened to match: `DatabaseLoader.getHistoryRecord` and `queryHistory`, and so `MetadataManager.getHistory`, `diff` and `rollback`, addressed to the name's one row slot, now list those versions (`isAddressedVersion`, `isSoleRowSlot`). This is the `/meta` doors' `isVersionOf` rule, so an addressed history read lists exactly what an addressed rollback restores. FROM "Version N not found in history for TYPE/NAME (package P)" (or `(environment)`) at the manager, while the loader landed it. TO listed and landed at both. 2. **Several row slots (ruling item 2).** Unchanged: such a version is in no addressed history and its rollback answers `409 ambiguous-in-environment` naming every holder, addressed or bare. 3. **Attribution (ruling item 3, kept from the earlier revision).** A version's history row attributes it whenever the row exists. The restored body's package stamp stands in only when there is no row. The one narrowing of this PR comes from here. A direct `registerRollback` addressing a package, to an unattributed version on a name several row slots hold, with a body stamped for a package, used to write the version into that package's row, or answer a plain "the version is package P's" error, or answer `409 not-held-by-qualifier`. It now answers `409 ambiguous-in-environment`. 4. **The body a rollback writes (review#3 M1, and N1).** `registerRollback` writes the restored body stamped for the row slot it lands in (`stampedForSlot`). A package stamp (`_packageId`, or the envelope's `packageId`) that names another package than the slot's is replaced by the slot's package, or removed for the environment's package-less row. A body naming no package, or the slot's own, is written byte for byte. Before this, a foreign stamp written into the environment's row made `rowSlots` key that row as the stamped package's, and one written into package A's row served A's item as `_packageId: B`. One guard covers the unattributed, environment, M1 and A-attributed (N1) versions. `registerRollback` now resolves to the body it wrote (it resolved to nothing before; an additive change), and `MetadataManager.rollback` files and returns that body, so the registry and the row agree. 5. **Docs.** The `sys_metadata_history.package_id` doc comment (metadata-core, shipped in its `dist`) says a NULL row is the version of the name's one row slot, and of no slot while several hold the name. The loader and manager docblocks name the rule and the ruling. Why re-stamp and not refuse (review#3 offered both): under ruling B these versions land on one slot, and refusing a body whose stamp is not the slot's would contradict "lands". The stamp is storage bookkeeping. The slot is decided before the write and is never re-derived from the body, so re-stamping changes whose row is written only in the defect case. Nothing found makes it unsafe. ## Tests `packages/metadata/src/metadata-history.test.ts`: 8 pins, each run once per type (x12). The earlier revision's three "not found" pins and its one-slot stamp pin are replaced. The two-slot stamp pin stays, with an addressed-read leg added. One existing pin moves with the declared widening: the legacy-row pin's `versions(type, { packageId: A })` changes from `[3, 1]` to `[3, 2, 1]`. - One row slot (package A, and the environment): an unattributed version is in the addressed history (`getHistory`, `getHistoryRecord`, `diff`) and rolls back addressed or bare, at the manager and the loader. - M1: the environment's version is in the taking-over package's addressed history and rolls back addressing it, at both doors. The environment address stays `not-held-by-qualifier`. - Two row slots: an addressed read gives `null`, and the rollback is `409 ambiguous-in-environment` at both doors for a body stamped for either holder. - Environment slot (review#3 M1): an unattributed and an environment version, restored with a B-stamped body, bare or addressed to the environment. Each is written unstamped, served without `_packageId`, and leaves the row the environment's. A B-addressed rollback is refused `not-held-by-qualifier` with candidates `[environment]`, and the environment's addressed history reads the new version. - A slot (review#3 M1): an unattributed and an A version, restored with a B-stamped body, are written and served stamped A, and so is the history snapshot. - N1 at the loader: two slots, A's version restored into A's row with a B-stamped body, is written stamped A. B's row is byte-identical. - N1 at the manager: a recorded A version whose snapshot carries B's stamp lands stamped A. `manager.get(A)` serves it stamped A, and `manager.get(B)` is undefined. Red first. The pins were committed (`cfd4f28b16`) before the fix: - Against the pre-fix head (`3300a61212` code): `Tests 84 failed | 218 passed (302)`, 7 pins x12. The two-slot pin was already green there. - Against `origin/main` code (`811b976aa3`), the published behaviour: `Tests 108 failed | 194 passed (302)`, 9 pins x12. This includes the two-slot pin (main wrote into the stamped package's row) and the legacy-row history pin. - Green on the fix: `302 passed (302)`. Ablations. Each one ran through `scripts/ablation-replace.mjs`: the anchor hit 1 -> 0, and the restore was proven by `blob == HEAD` and an empty `git diff HEAD`. The suite imports the loader from source, so there is no `dist` leg. | Ablation | Red (x12 each) | |:---|:---| | A0 `refuseUnattributedVersion` returns at once | 24: F1, two-slot | | A1 `stampedForSlot` returns the body unchanged | 48: env slot, A slot, N1 loader, N1 manager | | A2 addressed history without the sole-slot clause | 48: one-slot (A, env), M1, legacy-row history | | A3 the addressed "not found" re-added | 60: one-slot (A, env), M1, env slot, A slot | | A4 an unattributed row attributed by the body stamp again (main's rule) | 36: two-slot, env slot, A slot | | A5 the manager files the snapshot, not the written body | 12: N1 manager | ## Acceptance notes - **Card item 1** (the released objectstack-ai#32351 changeset text) is carried by the docs-only PR objectstack-ai#33526, not here. - **`/meta` was not edited** (area E1). Its `isVersionOf` already answers the one-slot cases this way. From reading the code only, without a live run, it differs on one case. `POST /meta/TYPE/NAME/rollback?package=P` to an unattributed version on a name several row slots hold reaches `restoreVersion` and answers `404 VERSION_NOT_FOUND`, which says the version belongs to no package and several hold the name. The manager and loader answer `409 ambiguous-in-environment` there, as ruling item 2 states. The bare `/meta` rollback refuses `409` first. This goes to the seat as a note. - **A non-holder address is unchanged.** An addressed history read to a package that holds no row of the name still lists that package's own attributed versions (a removed package's), while the rollback refuses them `409 not-held-by-qualifier` (S8a). `/meta` refuses the read itself. This divergence predates the PR and is outside the ruling. - **A name with no row** (all rows removed): a `/meta` address treats the empty slot as sole (`slots.length === 0`). The manager and loader do not, because their rollback finds no row to write ("not found for rollback"). Unchanged. - **Commit `cfd4f28b16`** is the red-first pin commit, and CI at it is red by construction. CI at `beeac9ccb8` shows `Lint & Repo Gates` and `TypeScript Type Check` failed only because every lane was `cancelled` by the superseding push of `ed9e3a95e2` (`check-typecheck-lanes`/`check-lint-lanes`: "concluded `cancelled` -- expected `success`"). They are not real failures. ## Verification The local runs below were measured at head `ed9e3a95e2`. Readings and sub-topics: <details><summary>Package suites and typecheck</summary> - `@objectstack/metadata`: 79/79 files, 2536/2536 tests. - `@objectstack/metadata-core`: 27/27 files, 1024/1024 tests. - `@objectstack/metadata-protocol` (downstream consumer): 340 files passed and 9 skipped; 22866 tests passed and 43 skipped. - `typecheck` for metadata, metadata-core and metadata-protocol: exit 0 each. - `eslint --no-inline-config` on the five changed source and test files: exit 0. </details> <details><summary>Derived gate families (dispatch-gates)</summary> `--commands` against merge base `811b976aa`: 66 families. 64 exit 0. Two exit 3 (PREREQUISITE NOT MET, full build absent): `check:dual-build-cjs-loads` and `check:lean-entry-closure`. Both are NOT MEASURED locally and left to CI. `--ran` reconciliation: `66 derived, 64 run, 2 NOT-MEASURED, 0 UNRUN`. </details> <details><summary>Dogfood battery (narrowing arm)</summary> `ed9e3a95e2` · closure build then `pnpm --filter @objectstack/dogfood test` under `os-verify-lock`: `VERDICT command-exit 0` · Test Files 467 passed, 3 skipped (470) · Tests 3950 passed, 42 skipped (3992) · no failure. CI at `ed9e3a95e2`: 51 check-runs, 35 success and 16 skipped, none failed. `TypeScript Type Check`, `Lint & Repo Gates`, `Test Core`, `Build Core`, `Check Changeset` and `Dogfood Regression Gate` all succeeded. </details> --- _Generated by [Claude Code](https://claude.ai/code/session_016WV4cyrFFk86Jqf7Mp5Rzw)_ <!-- signed: domain:server#5 · os-elon-musk · session_016WV4cyrFFk86Jqf7Mp5Rzw --> --------- Co-authored-by: Claude <noreply@anthropic.com>
Requested by Elon · project thread
Fixes #32717
Clause-②: no — released-entry text only; no answer moves.
Metadata-protocol: none
维护者速读
cac0f1a(metadata、metadata-core、platform-objects 三处相同),修正 metadata: history-by-package loose ends: one answer per rollback door for unattributed/env versions, stamp fallback only for an absent row, changeset type list and wording (follow-up of #32351) #32717 第 1 项指出的不准确表述。packages/*/CHANGELOG.md行)规定,已发布条目的事实错误只能用独立的纯文档 PR 在原条目里修,不能写进后续条目,也不能搭代码 PR。席位 5 于 2026-11-14 23:32Z 按此安排。packages/metadata/CHANGELOG.md的cac0f1a条目。What changes
The same four corrections in each copy of entry
cac0f1a(packages/metadata/CHANGELOG.md,packages/metadata-core/CHANGELOG.md,packages/platform-objects/CHANGELOG.md):api,agent,skill,action,email_template,permission,flow.PACKAGE_SLOTTED_STORE_TYPESat the@objectstack/metadata@18.4.0tag (181ad7d4) also holdspicklist,mapping,datasetandwebhook, so they are added.package_idstays NULL, and it is read as the package its stored body names, else as attributed to none". "The two refusals" becomes "The refusals", because the entry itself names more than two.database-loader.tsat181ad7d4:recorded !== undefined ? recorded : storedItemPackageId(restoredData)). The reading of a legacy row is unchanged: it is read as its stored body's package (historyRowAttribution→storedRowPackageId), else as attributed to none.diff. "A version attributed to none … is in no address's history" now adds: an addressedgetHistoryleaves it out, and an addresseddiffof it answers "not found" (MetadataManager.diffat181ad7d4reads both versions through the addressedgetHistoryRecord, which never answers an unattributed version).Each correction describes 18.4.0 as shipped. What #33464 (
Part of #32717) changes ships under its own entry.Verification
Text-only diff in three CHANGELOG files. Each replaced phrase was matched exactly once per file, and each corrected claim was read against the 18.4.0 tag's source as cited above.
Generated by Claude Code