Repository navigation
fix(metadata-protocol)!: the restore doors refuse the platform's own record, and the history selector refuses a package that neither holds nor ships the name - #37423
Conversation
… whose row is the platform's own record rollbackMetaItem and the restore limb of revertCommit ask the metadata service's rollback refusal (refusePlatformRecordRestore, now exported by @objectstack/metadata) on the row SysMetadataRepository.restoreVersion writes: 409 RESOURCE_CONFLICT, nothing written; revertCommit reports the item in failed[] and reverts the others. Pins per door plus a restart pin. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxba3jmfHtmkWfFXfVTc
…her holds nor ships the name never addresses the package-less row historySlotOf counted the package-less row a read naming the package falls back to as that package's slot whether or not it ships the name. It is now the package's only when the package ships the name (ADR-0150 D4); any other package is refused 409 not-held-by-qualifier, as the selector's description states. The 33308 unit and dogfood fixtures that addressed the environment's slot through a non-shipping package are retargeted. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxba3jmfHtmkWfFXfVTc
…column is listed once, under its column The boot priming pass filed a stored row's body under its body's _packageId stamp while the row loader keys the row by its package column, so list() listed the row twice. register() with skipSourceLoader now files such a body under the column's slot, so a primed process answers as an unprimed one does. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxba3jmfHtmkWfFXfVTc
… reads no column, and a node that finds a legacy row bound answers the bound column N2: a datasource: loader without loadRowBindings makes the answer degraded, naming the loader, instead of an undegraded registration binding. N7: bindReadRowPackage records the column as its re-read finds it, so the node whose boot pass lost the race to bind a legacy row answers the bound package rather than null until restart. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxba3jmfHtmkWfFXfVTc
…or refuse what they answered before Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxba3jmfHtmkWfFXfVTc
📓 Docs Drift CheckThis PR changes 2 package(s): 6 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 4 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 17 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin ad2cc02da96ea9fe63c8c2a4f8705f605e0f3d81 && git checkout ad2cc02da96ea9fe63c8c2a4f8705f605e0f3d81
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin ee11fce924ee0be609807738a3e0770cf6c396a3 43a6758fe8859a4e4b6a96a7ea49cceaae6fae63 && git checkout -B drift-repro ee11fce924ee0be609807738a3e0770cf6c396a3 && git merge --no-ff 43a6758fe8859a4e4b6a96a7ea49cceaae6fae63
node scripts/docs-audit/affected-docs.mjs --json ee11fce924ee0be609807738a3e0770cf6c396a3
|
…ee with the code, and restoreVersion's option sits under its package The unreleased #37013 note named only `rollback` as refusing the platform's own record and said the protocol's restore doors store every body without the mark; all three restore doors refuse it and the protocol's doors strip it from every other restore. Its snapshot sentence now uses the wording of PLATFORM_PROVENANCE's doc. The #37130 note lists restoreVersion's refusePlatformRecord option under @objectstack/metadata-protocol, where SysMetadataRepository ships. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JQwxba3jmfHtmkWfFXfVTc
|
repo:cloud#1 · os-warren · session_01JQwxba3jmfHtmkWfFXfVTc Contract reviewServed-tier: Face: narrowing ( ① Derived judgmentsAccept-set and public-surface changes the diff implies, each judged:
Gate verdicts, read as check-run conclusions on ② Semver level
The new section "Also in Deliberate correction of a pending note:
The correction is confirmed for the three rewritten sentences. ③ Boundary flagsOpen question (the export and the option without a maintainer decision): on the design, option A is right and I find no fork. (a) It is an additive export of a refusal the producer already shipped privately ( On the route, two texts govern and I read them together. Deviations:
Carriers the report names, each answered:
SQL push-down: no finding. No hunk adds a query, an id materialisation or an in-app join. Security line: Read outside the diff, not reviewed, for the seat: ④ Design judgmentNo must-fix, no should-fix. The narrowing against the published spec on Per file, against the card and the cited code:
Nits (none changes correctness or the contract):
Implemented-by: VERDICT: PASS |
|
repo:cloud#1 · os-warren · session_01JQwxba3jmfHtmkWfFXfVTc 席位核对ACCEPT · head Checklist (
Checks at this head: 38 success, 18 expected skip, and 2 failed. Both failures are
Accepted deviations:
Follow-ups. carrier: the area:cloud zone; none are filed here.
Landing: owed the full dogfood battery on this head (the title has |
|
repo:cloud#1 · os-warren · session_01JQwxba3jmfHtmkWfFXfVTc Landing 2026-11-26T05:18Z · head
State: ready + auto-merge. On MERGED, |
|
repo:cloud#1 · os-warren · session_01JQwxba3jmfHtmkWfFXfVTc 维护者速读
Contract review PASS: comment 7182526807, |
…nto a package's row, and adopt-orphans leaves the platform's record (objectstack-ai#37640) Fixes objectstack-ai#37604 Clause-②: yes (narrowing) Metadata-protocol: none Skills-docs: none — no `skills/` page teaches restoring a platform-registered version, adopting orphans over the platform's record, or `listPackageBindings` ## 维护者速读 - 用户能看到什么变化:平台撤回某个内置记录后,管理员按包回滚(或回退某个包的提交)时,如果选中的是平台自己登记的那个版本,会被明确拒绝并提示改为重新保存;"领养孤儿元数据"不再把平台内置记录划进某个包;其余操作不变。 - 为什么做:这是平台内置技能、智能体、工具那一轮收尾留下的两处边角,防止平台自己的内容被悄悄写进某个包里,变成那个包的东西。 - 出错会怎样:只涉及两个少见的管理操作;被拒绝时什么都不写,本改动可直接撤回。 - 要你做什么:无。 ## What changes **Item 1 — a version the platform registered is never restored into a package's row.** Reproduced on main first (pins red on base, readings below): after the platform withdraws its record of a skill, the name's one remaining holder is the package, a version attributed to the environment counts as that package's slot (`isVersionOf` / `isAddressedVersion`, M1), and a rollback naming the package, or bare, answered `Reverted to version 1 (package=com.acme.crm)` and wrote the platform's body into the package's row. It reproduced at all three restore doors: the metadata service's `rollback`, and the protocol's `rollbackMetaItem` and restore limb of `revertCommit` (the last for a commit that names its package, as `recordPackageCommit` always writes it; that limb passes no `versionOf`, so it reaches this whenever the commit's version is one the platform registered). Route taken: **the loud refusal**, `409 RESOURCE_CONFLICT`, the envelope of `refusePlatformRecordRestore`, nothing written; `revertCommit` lands the item in `failed[]` and still reverts the commit's other items. Judged on the four axes: - real business need: the scenario is the one the platform's withdrawal produces for a name a package also ships (the objectstack-ai#37013 slot model), measured at three doors, not a speculative surface; - long-term soundness: one rule in the producer (`@objectstack/metadata`) that all three doors ask, rather than a per-door filter of which versions a package "wrote"; - keeping AI from writing wrong metadata: a refusal that names the fix ("save it again naming the package") beats a silently narrower version list — an author or agent sees why, and nothing is written behind its back; - no scope growth: no new code, reason value, key or route; `restore only the package's own versions` would have meant re-defining the M1 attribution rule that history reads share, a larger change for the same outcome. The refusal lives in `refusePlatformRecordRestore` as an optional fourth argument (the version's history row, its number, and the package whose row is written). The version is judged by its history row with the one reader below: attributed to no package or to the environment, and its body carries the platform's mark and names no package. A version restored into the package-less row (the environment's own item) is left as before. **Item 2 — adopt-orphans leaves the platform's own record.** Reproduced on main: `reassignOrphanedMetadata` rebound the platform's package-less row to the target package. It now skips a row `isPlatformRecordRow` reads as the platform's record, as it skips an artifact-backed overlay; every other orphan is adopted as before. **N5 — one platform-row reader.** `isPlatformRecordRow(row)` is now exported from `@objectstack/metadata` (`database-loader.ts`): the package column names no package (empty, or the environment's history mark) and the body carries the platform's mark and names no package. `refusePlatformRecordRestore`, the protocol's overlay census (`protocol-diff-delete-load.ts`, whose private copy is deleted — the only edit in that file) and the adoption ask it. Consequence: a package-bound row whose body keeps the mark is no longer refused by the row rule (it was refused, prescribing to name the package already named). **N1** — the refusal's prescription now says re-saving a version's body as the environment's own item "holds until the platform's next registration at boot writes its record back". **N2** — new pins ride `rollbackMetaItem` (named and bare) and `revertCommit` with a commit that names its package. **objectstack-ai#37187 N3** — `listPackageBindings` skips, in its row walk, a loader the list walk already lost: named once in `errors`, reported once, its rows not read a second time. **objectstack-ai#37187 N6** — one doc-comment sentence in `packages/spec/src/contracts/metadata-service.ts`: a primed copy answers its row's column as the registry last knew it (the column the boot priming pass wrote when it bound the row, else the column it was read with). **N3 (objectstack-ai#37423 review) — dropped.** `.changeset/37013-platform-skill-own-slot.md` is no longer pending: the prerelease `chore: version packages (next)` (`33a31dc7`) compiled it into `packages/metadata/CHANGELOG.md` and `packages/metadata-protocol/CHANGELOG.md` and moved it to `.changeset/pre/`. The same holds for the 37130 note that N1 mentions, so N1 changes the runtime message only. A factual fix to a compiled entry belongs in a docs-only PR, not here. N4 needed nothing. Serial constraints: `protocol-save.ts` is untouched; `protocol-diff-delete-load.ts` carries only the shared reader (an import swap and the deleted private copy); `sys-metadata-repository.ts` carries one call-site change. Public surface: `isPlatformRecordRow` (new export) and the optional fourth argument of `refusePlatformRecordRestore`. With the two refusals, that is why this declares `Clause-②: yes (narrowing)`, not the claim's `no`. `Metadata-protocol: none`: no key, accepted value, code or route changes; level `patch`, BREAKING banner and ADR-0087 marker in `.changeset/37604-platform-record-followups.md`. ## Tests - `packages/metadata-protocol/src/protocol.platform-mark-rollback.test.ts`: `rollbackMetaItem` naming the package and bare, and `revertCommit` of a commit naming the package, each asserting `code: RESOURCE_CONFLICT`, `status: 409`, the message's "the platform registered", and the rows byte-identical; plus a control that the package's own version still restores. - `packages/metadata-protocol/src/protocol.adopt-orphans-platform-record.test.ts`: the platform's row stays unbound while the environment orphan beside it is adopted; a control that a package-less row whose body names a package is adopted. - `packages/metadata/src/loaders/database-loader.test.ts`: the service door's `rollback` named and bare after a real `register(..., { origin: 'platform' })` + `unregister(..., { origin: 'platform' })`; N5 reader and refusal envelope pins; the objectstack-ai#37187 N3 pin. <details><summary>Red on base (main 4e10d4b)</summary> - protocol door: 2 failed, `expected { success: true, … } to match object { code: 'RESOURCE_CONFLICT', … }`; received message `Reverted to version 1 (package=com.acme.crm) — type=skill, name=helper [seq=3]`. - adopt-orphans: 1 failed, `expected 'app.base' to be null`. - service door: 2 failed, `expected { name: 'data_explorer', … } to match object { code: 'RESOURCE_CONFLICT', … }`. </details> <details><summary>Ablations (fix committed first; each mutation landed via scripts/ablation-replace.mjs, rebuilt, dist preflight checked, restored to HEAD and rebuilt)</summary> - version refusal disabled: `database-loader.test.ts` 2 failed / 498 passed; protocol files 3 failed / 9 passed (the two `rollbackMetaItem` pins and the `revertCommit` pin). - lost-loader skip disabled: the objectstack-ai#37187 N3 pin failed (1 / 500). - reader's column check removed: the two N5 pins failed (2 / 500). - adopt-orphans filter disabled: the adopt pin failed (1 / 2). </details> <details><summary>Suites after the merge of main (33a31dc)</summary> - `@objectstack/metadata` and `@objectstack/metadata-protocol` typecheck: exit 0 (tree of 478efd8). - `@objectstack/metadata` vitest: Test Files 83 passed, Tests 2814 passed (tree of 478efd8). - `@objectstack/metadata-protocol` vitest: Test Files 371 passed / 9 skipped, Tests 23446 passed / 45 skipped (478efd8). The head d96a1a9 adds one module-top import to the new adopt pin (check:test-source-alias asked for it). - `@objectstack/spec` build + `check:generated`: all 14 generated artifacts up to date. - Local gates (exit 0): check-adr-0087-registration, check-changeset-no-major, check-empty-changeset, check-closing-keyword-parity, check-issue-citations, check:durability-log-level, check:startup-registry-verdict, check:doc-authoring, check:nul-bytes, check:undeclared-dep-imports, check:facade-delegation-only, check:engine-double-contract, check:test-source-alias, check:adr-anchors. NOT MEASURED: check:published-readme-exports (exit 3, workspace not built), check:dev-prereqs (workspace not built). The other derived families run in CI. - Full dogfood battery on the final head: running at PR open; its reading goes to the dispatch report. </details> ## Acceptance notes - The two `.changeset/pre/` notes (37013, 37130) still carry "of a failed batch row write" and the unqualified re-save prescription in the compiled changelogs; not edited here (see N3 above). - Other readers of the same fact remain in `database-loader.ts` (the write path's `platformRow` and the platform withdrawal's `taken`); they read `isPlatformOrigin` off the body alone. They were not N5's pair and are left as they are; whether they should ask the shared reader is not measured here. - `restore only versions the package itself wrote` was the alternative route; not taken, for the reasons above. ## Verification Read first: `packages/metadata/src/loaders/database-loader.ts` (`isPlatformRecordRow`, `refusePlatformRecordRestore`, the `registerRollback` call), `packages/metadata-protocol/src/sys-metadata-repository.ts` (`restoreVersion`'s call), `packages/metadata-protocol/src/protocol-package-commits.ts` (the orphan filter). Two minutes: `pnpm --filter @objectstack/metadata-protocol exec vitest run --maxWorkers=2 src/protocol.platform-mark-rollback.test.ts src/protocol.adopt-orphans-platform-record.test.ts` (after building `@objectstack/metadata`) — expect 12 passed. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01Q4EjjQkY5yXZrN9BEA3rEK <!-- signed: repo:objectstack#6 · hotlong · session_01Q4EjjQkY5yXZrN9BEA3rEK --> --------- Co-authored-by: Claude <noreply@anthropic.com>
…ut of step with main (week of 2026-11-25) (objectstack-ai#38289) <!-- claude-projects-attribution: {"github_login":"os-elon-musk"} --> _Requested by **Elon** · [project thread](https://claude.ai/code/project/chan_01WedDzV26nniwxv7jC88B9D?thread=cmsg_01WedDzV26nniwxv7jC88B9DDypKu7B9nwbu5WuV7AEio8)_ Fixes objectstack-ai#37245 Clause-②: no Metadata-protocol: none ## 维护者速读 - 用户能看到什么变化:用户无感;只在十份设计记录里补了带日期的说明,写明主线现在实际怎么做,原有的决定文字一个字没动。 - 为什么做:属于「每周设计记录修订」滚动清单(11 月 25 日这一周);清单每一行指出一处「记录写的和主线不一致」,这次一并补齐,免得照着记录干活的人被过时说法带偏。 - 出错会怎样:最坏是某条补充说明写得不准,读这些设计记录的人会碰到;纯文档、只增不删,可以直接撤回,不影响任何功能。 - 要你做什么:请审这些补充说明并亲手合并(设计记录须由你本人合)。 ## What changes Ten ADR files gain notes dated 2026-11-28. Every diff line is an addition: 239 lines added, 0 removed. No original decision text is rewritten, and no decision changes. Each note follows the note convention its own record already uses. Each row's "what is true now" was read against the code on `main` before it was written. Where a row was wrong or had gone stale, the note says what `main` does, and the table and the list under it say so. | Row (comment id on the card) | ADR and section | Result | |:---|:---|:---| | Card body row (from objectstack-ai#37238) | ADR-0146, the 2026-11-24 amendment, "32 registered types" | **Landed. Row stale.** The row asks for 33; the registry holds 35 entries on `main`. The note states no count and points at the registry and at ADR-0084's table. | | 7155511307, nit 1 | ADR-0160 D1, the door's page cap sentence | **Landed. Row stale.** The row says the door has no page cap. PR objectstack-ai#37354 added one. The note says what `main` does: the list is cut one row under the door's cap, not at it. | | 7155511307, nit 2 | ADR-0160 D1, "only contains braces" | **Landed** as the row asks. | | 7155511307, nit 3 | ADR-0160 D3, the link-field sentence | **Landed as a note that the sentence stands.** | | 7161785832 | ADR-0158, Open items 9 and 12 | **Landed.** | | 7178404228, anchor half | ADR-0066, line 146 | **No edit.** PR objectstack-ai#37621 already landed it (record 7198334624). | | 7178404228, end-state half, with 7201928772 | ADR-0066 D2 ⑧ | **Landed.** Its prerequisite, PR objectstack-ai#37371, is merged. The proposed text is tightened in two places, listed below. | | 7179515770 | ADR-0158 U3, U6, L4, Open item 10 | **Landed.** | | 7184833647 | ADR-0159, Context, "One name already taken" (line 109) | **Landed as a note. The anchor line is untouched.** This is not a no-edit row: the anchor resolves, onto the opposite meaning. See below. | | 7187445064 | ADR-0158 L1, L2, Open items 6, 8, 10 and 11, and a new Open item 13 | **Landed.** | | 7195437501 | ADR-0010, the amendment note of 2026-11-24 | **Landed**, with one arm `main` has gained since the row was written. See below. | | 7212321297, first row | ADR-0067 D3 | **Landed. Row wording wrong.** The note carries the revert rule that the `form` type brought. See below. | | 7212321297, second row | ADR-0160, implementation split, row 7's bullet | **Landed.** The row places the stale path near line 425; it is near line 491. | | 7213085888 | ADR-0048 §3.5 | **Landed.** The row's ready text, dated 2026-11-28, with symbol anchors where it had line numbers. | | 7215202653, corrected by 7215223685, with 7224476684 | ADR-0150 D3, the note of 2026-11-26 | **Landed.** Item 2 of the first row said the two doors were still open. The later row supersedes it: PR objectstack-ai#37948 merged, and both doors now refuse. | | 7217585102 | ui ADR-0057, A2 and A3 | **Landed. Row stale on one line.** The plan-marker line is written as `main` is today, after PR objectstack-ai#37970, and not only as it was after PR objectstack-ai#37720. | Comments that are not rows: 7186949648 (triage note), 7196224618 (a one-row claim), 7196910014 (its report), 7198334624 (its landing record) and 7237786310 (this claim). **No row is held.** Every prerequisite is merged on `main`: PRs objectstack-ai#37219, objectstack-ai#37240, objectstack-ai#37268, objectstack-ai#37354, objectstack-ai#37366 (which carried objectstack-ai#37422), objectstack-ai#37371, objectstack-ai#37389, objectstack-ai#37423, objectstack-ai#37449, objectstack-ai#37640, objectstack-ai#37720, objectstack-ai#37818, objectstack-ai#37931, objectstack-ai#37948, objectstack-ai#37970, objectstack-ai#37065, objectstack-ai#36138 and objectstack-ai#37021. The card has 19 comments as of this pull request; a row added after comment 7237786310 is not in it. ### Where a note differs from its row - **ADR-0146.** The row offers two forms, "give the count" or "point to ADR-0084's table". The note takes the second. A count written today would already be the third reading (32, then 33, now 35). - **ADR-0160 D1, the page cap.** The row's premise was true when it was written and is not now. `RecordContextDoor.pageCap` exists, and both doors answer it. The note records the one-row difference between the amendment's words and the code: a list whose cut plus its probe row would pass the cap is cut one row under the cap. - **ADR-0160 D3, the link field.** The note leaves the wording alone. - **ADR-0066 D2 ⑧.** Two changes to the proposed text. The note says in words that `viewAllFieldsReadVote` replaced `superuserFieldVote`, and anchors only the function that exists. And it does not say that nothing re-opens a lock across sets: another set's `viewAllFields` still makes a hidden field readable, and another set's field row with `editable: true` still grants the edit, because field grants union without deny. - **ADR-0159, line 109.** PR objectstack-ai#37422 was merged into PR objectstack-ai#37366's branch, so the anchor `view.zod.ts#defineForm` resolves and the gate is green on it. It now resolves onto the `form` type's factory, while the paragraph describes the Studio helper, which is `defineMetadataForm` today. The paragraph is Context and describes the tree before the ruling was carried out, so the note leaves it as written and states both names. - **ADR-0010.** The row covers the three restore doors of PR objectstack-ai#37423. The same rule has since gained a second refusal, from PR objectstack-ai#37640: a restore that would write a version the platform registered into a package's row. The note has one sentence on it. That sentence goes beyond the row; cut it if the note should carry the row alone. - **ADR-0067 D3.** The row asks for a note "naming `form` as a translated metadata type". D3 is about undo granularity and has no such notion. The contract reviews of PR objectstack-ai#37422 sent one fact to this record: a `form` item is reverted only after every `view` row its commit edited is put back, and it joins `failed[]` otherwise. The note records that. - **ADR-0048.** The row's text was dated 2026-11-24. The note is dated 2026-11-28, the day it was written into the record. - **ADR-0150.** Besides answering "Not judged yet", the note qualifies one sentence of the 2026-11-26 note that said too much: the draft discard is newly refused only over a stored package-less draft. Where it was already refused, only its sentence moved. - **ADR-0158.** Row 7179515770 points at a draft held by its seat, which this session could not read. The notes are written from the two rows and the code. Open item 13 is a new numbered item at the end of the list, carried from the display card; it is marked not built and not settled. - **ui ADR-0057.** The row asks for "what main does after objectstack-ai#37720". `main` has moved once more: since PR objectstack-ai#37970 the entry's marker stands for a write that waits for approval. The note says that, and that A5's "Not recorded yet" bullet held until that pull request merged. ## Tests Docs only. No package is touched, so no build closure and no package test is owed for the change. No tested behaviour changed, so there is no ablation. What was checked by hand, on the committed text: - Each phrase a note quotes from its ADR was compared with the base file. - Each verbatim maintainer quotation was compared, byte for byte, with its record on GitHub. - Each cited path and symbol exists on `main`. The one exception is deliberate: the ADR-0160 note names `packages/spec/src/ai/skill.form.ts` to say that no such file exists. - Upstream moved ten commits while this was written (`e42520c67b` to `e2a0e90025`). None touches an ADR file or a file a note cites. `overlap-check` answers `VERDICT clean exit 0` against `origin/main` at `e2a0e90025`, and no open pull request shares a file with this branch. The local gate set is the `dispatch-gates --commands` derivation for this change set, 27 commands, run on the final commit `c2c3345747`. Each exit code was captured before any pipe. Reconciliation: `Run reconciliation — 27 derived, 27 run, 0 NOT-MEASURED, 0 UNRUN`, all 27 with a recorded exit code. <details><summary>ADR gates on c2c3345 (all exit 0)</summary> | Command | Exit | Verdict line | |:---|:---|:---| | `pnpm check:adr-symbol-anchors` | 0 | `check-adr-symbol-anchors: 4525 anchors across 164 records resolve`, 0 line anchors survive. On the base commit the same gate reads 4478. | | `node scripts/check-adr-links.mjs` | 0 | `check-adr-links: 1268 relative link destination(s) under docs/adr/ resolve` | | `node scripts/check-adr-links.mjs --self-test` | 0 | | | `pnpm check:adr-anchors` | 0 | | | `pnpm check:adr-index` | 0 | `adr-index --report: OK — docs/adr/README.md is current, every record parsed` | | `pnpm check:doc-authoring` | 0 | | | `pnpm check:nul-bytes` | 0 | `check-nul-bytes: OK (scanned 28605 text file(s)`, no raw control bytes | | `pnpm check:closed-ceremony-text` | 0 | | | `pnpm --filter @objectstack/lint run check:doc-formula-expressions` | 0 | run after building `@objectstack/formula` and `@objectstack/lint` under the verify lock | | `pnpm --dir ui run check:new-line-citations` | 0 | `VERDICT new-cross-file-line-citations: 0 new citation(s)`. Not in the derived list; run because a ui ADR changed. | </details> <details><summary>The other derived families on c2c3345 (all exit 0)</summary> `node scripts/check-closing-keyword-parity.mjs` and its `--self-test`, `node scripts/check-comment-mask-corpus.mjs`, `node scripts/ci/plan-test-core-shards.mjs --self-test`, `pnpm check:ci-filter-parity`, `pnpm check:cross-package-test-inputs`, `pnpm check:driver-memory-census`, `pnpm check:gitlink-declared`, `pnpm check:pm-governed-merges`, `pnpm check:pm-prior-rulings`, `pnpm check:published-files`, `pnpm check:refd-timer-probe`, `pnpm check:registry-log-declared`, `pnpm check:rest-log-spy-declared`, `pnpm check:tier-file-adoption`, `pnpm check:undeclared-dep-imports`, `pnpm check:watch-hint-literal`. Before the push: `node scripts/check-commit-card-trailers.mjs --range origin/main..HEAD` exit 0, one commit message, no card relation and no model identifier in the trailer pair. </details> <details><summary>The ui scripts test family: one prerequisite failure, then green</summary> Derived command: `pnpm --dir ui exec vitest run scripts/`, run under the verify lock with `--maxWorkers=2`. - First run: `VERDICT command-exit 1`. `Test Files 1 failed | 171 passed | 2 skipped (174)`, `Tests 1 failed | 5144 passed | 2 skipped (5147)`. The one failure was `scripts/__tests__/unit-registry-absence-collision.test.ts`, with `Failed to resolve entry for package "@objectstack/client"`. The package had no build output in the fresh worktree. That is a missing prerequisite, not a verdict on this change. - After building the `@objectstack/client` closure under the lock, the same command on the same commit: `VERDICT command-exit 0`. `Test Files 172 passed | 2 skipped (174)`, `Tests 5145 passed | 2 skipped (5147)`. </details> Not run locally: the repository test project behind `test:repo`, which CI runs on the pull request and on the merge group. Every other family CI runs is read from this pull request's check runs, not re-run here. ## Acceptance notes - **Changeset.** None, and the pull request carries `skip-changeset`. `docs/adr/**` and `ui/docs/adr/**` ship in no package: the ui tree's root is a private workspace root and `ui/docs` is under no package directory. - **Governed surface.** `docs/adr/**` lands by the maintainer's hand. This pull request stays a draft; the seat hands it over. - **The registry count.** The card row and the amendment both carry a number. The repository rule for a volatile count is to remove it and not to sync it, so the note adds none. - **Seen and left alone.** These are outside the card and are not changed here. - ADR-0084, near line 226, says `form` is not a registered type. It is about the working names of the 2026-07-01 table, and `form` is registered now. It is a candidate row for next week's card of this name. - One internal skill playbook and ui ADR-0056 still use the Studio form helper's old name. The review of PR objectstack-ai#37366 already recorded both. - Comments in the console's chat scope helper still describe the `app:PKG:build` dock key and the Studio copilot. ## Verification ### Read first 1. `docs/adr/0066-unified-authorization-model.md`, the note of 2026-11-28 under D2 ⑧. It is the highest-risk hunk: one long paragraph on authorization, and it supersedes parts of three earlier notes. Check the sentences on what another set can still re-open, and the sentence that stored sets are read with the new meaning and never rewritten. 2. `docs/adr/0150-behavioural-metadata-addressed-by-package-objects-keep-the-literal-prefix.md`, the amendment note of 2026-11-28. Check the four cells and their remedies (enable, enable, name the package, name the package) against the ruling it quotes. 3. `docs/adr/0158-units-of-measure-standard-unit-table-org-units-quantity-unit-declaration-base-quantity.md`, the notes under Open items 6 and 10 and the new Open item 13. Both notes quote the maintainer, and item 10's records the shape of a new system object. ### Two-minute check Run `git diff --numstat origin/main...HEAD` on this branch. Expect ten rows, nine under `docs/adr/` and one under `ui/docs/adr/`, each with `0` in the removed column, and 239 added lines in total. Then run `pnpm check:adr-symbol-anchors` and expect exit 0 with a line that contains `check-adr-symbol-anchors: 4525 anchors across 164 records resolve`. --- _Generated by [Claude Code](https://claude.ai/code/session_016WV4cxRDKprCtjpEdtiPFW)_ <!-- signed: repo:objectstack#1 · os-elon-musk · session_016WV4cxRDKprCtjpEdtiPFW --> --------- Co-authored-by: Claude <noreply@anthropic.com>
Requested by Warren · project thread
Fixes #37130
Clause-②: yes (narrowing)
Metadata-protocol: none
Skills-docs: none — no
skills/page teaches the protocol's restore doors, the history?package=selector orlistPackageBindings维护者速读
What changes
rollbackMetaItemand the restore limb ofrevertCommitrefuse a restore whose row is the platform's own record, with the metadata service'srollbackrefusal:409 RESOURCE_CONFLICT, its prescription, nothing written. One rule for the three doors: the refusal that lived privately indatabase-loader.tsis nowrefusePlatformRecordRestore(type, name, row), exported by@objectstack/metadata, asked byDatabaseLoader.registerRollbackand bySysMetadataRepository.restoreVersionwhen a door passesrefusePlatformRecord: true(both protocol restore doors do; the two undo writes do not). It is judged on the active rowrestoreVersionitself reads and writes.revertCommitputs the refused item infailed[]and reverts the commit's other items (ADR-0067 D3 as amended). The prescription now also names the environment's route (R23).historySlotOf(the history, diff and rollback doors'?package=selector) refuses a package that neither holds a row of the name nor ships it with409 not-held-by-qualifier, also when the name's package-less row is stored. Before, a read naming such a package fell back to the package-less row and the selector addressed that row. The package-less row is a package's slot only when the package ships the name (ADR-0150 D4).PLATFORM_PROVENANCE's doc names all three refused restore doors, words the snapshot rule exactly (the platform's own record's publish snapshot, served as the answer, keeps the mark at its top; a snapshot nested inside the answer never carries it) and names the two undo writes by what they undo. The strandedstoredRowBodyOfdoc comment indatabase-loader.tssits on its function again.list()listed a stored row twice after the boot priming pass when its body's_packageIdstamp differed from its package column. Measured: the loader keys the row by its column, andregister(…, { skipSourceLoader: true })filed the primed copy under the body's stamp. The fix is in neitherlist()nor the loader: the priming registration files such a stamped body under the column's slot (MetadataManager.primedRowSlot), so a primed process answers as an unprimed one does (one listing; a read naming the column's package answers it; the stamp's answers nothing).listPackageBindingsisdegraded, naming the loader, over adatasource:loader that offers noloadRowBindings. Reason: such a loader's items answerregistration, which is not their rows' binding, and the spec contract already tells a gating consumer to treat a degraded answer as unknown, so this needs no contract change. No such loader ships in the tree.bindReadRowPackagealready re-reads the row; it now records the column as that re-read finds it, so the node whose boot pass lost the race answers the bound package instead ofnulluntil restart.getPublishedappliescarriesPlatformStamp(item)to the top level only and strips every nested snapshot. Its four pins exist indatabase-loader.test.ts("getPublished serves the mark on the top level only when the stored item carries it there").ADR-0010 note, for the weekly ADR revisions card (out of this PR's file surface): the note should say "a restore whose row is the platform's own record is refused (
409 RESOURCE_CONFLICT) at the metadata service'srollbackand at the metadata protocol'srollbackMetaItemand the restore limb ofrevertCommit", in place of "a rollback whose row is the platform's own record is refused (409)".Deliberate correction
check-empty-changesetis red by design on this PR: it rewrites one pending release note it did not add, because this PR made that note false..changeset/37013-platform-skill-own-slot.md(pending, from fix(metadata): a skill the platform registers keeps its own slot beside an app's same-named skill #37021). Corrected at43a6758f, three sentences; the rest of the bullet is byte-identical:rollbackMetaItemand the restore limb ofrevertCommit);" After: "…and so do the metadata protocol's save door and its restore doors (rollbackMetaItemand the restore limb ofrevertCommit) on every restore whose row is not the platform's own record;"rollbackwhose row is the platform's own record is refused (409 RESOURCE_CONFLICT, naming the fix), with nothing written." After: "A restore whose row is the platform's own record is refused (409 RESOURCE_CONFLICT, naming the fix), with nothing written, at all three restore doors:rollback, and the metadata protocol'srollbackMetaItemand the restore limb ofrevertCommit."getPublishedserves it on the answer's top level only when the stored item carries it there, and never inside a publish snapshot;" After: "getPublishedserves it on the answer's top level only when the stored item carries it there (the platform's own record's publish snapshot, served as the answer, keeps the mark it carries at its top), and never on a snapshot nested inside the answer;"CONTRACT_REVIEW_TIERjudges each rewritten sentence (pm-dispatchreferences/landing-operations.md); the seat's ACCEPT points to it.Tests
Read first (by risk):
packages/metadata-protocol/src/protocol-history-slots.ts— theholdsSlotline: the narrowing every?package=history, diff and rollback request passes through.packages/metadata/src/metadata-manager.ts—primedRowSlot, the key a primed stored row is filed under.packages/metadata-protocol/src/sys-metadata-repository.ts— therefusePlatformRecordcheck insiderestoreVersion.New and changed pins:
protocol.platform-mark-rollback.test.ts, new describe:rollbackMetaItemrefused 409 with the row byte-identical;revertCommitputs the item infailed[](codeRESOURCE_CONFLICT) and reverts the other item; RESTART: a process primed from the rows answers a read naming the one package holder with that holder's item andgetPlatformItemwith the platform's v2. Each was red on5bf72422before the door lines (expected { success: true, …(4) },expected [] to have a length of 1,expected 'platform v1' to be 'package rules').protocol-history-slots.test.ts: the case that pinned "P does not ship the name … the environment slot" is replaced by its refusal (the branch the ruling removes), plus a two-holder refusal and a.custompair CONTROL.protocol-diff-history-slots.33308.test.tsand the dogfood filehistory-diff-two-holders-33308.dogfood.test.ts: the case that addressed the environment's slot through a package shipping nothing now addresses it through a shipper (unit) or expects the 409 at the history and diff doors (dogfood).database-loader.test.ts: (a) a newlist()pin, and the 元数据读取:存储的元数据要能按行上记录的包读出绑定,不从正文推断 #37039 bindings case now expectsdiffersonce (it recorded the double listing); N2 and N7 pins.Ablation (each fix line removed, then restored with git checkout)
refusePlatformRecord: trueatrollbackMetaItemrefusePlatformRecord: trueatrevertCommitrestoreVersionholdsSlot = slot !== null && …back toslots.includes(slot)primedRowSlotnot passed towriteRegistryEntrylist()pin and the #37039 bindings casedegraded = truerefusePlatformRecordRestoreanswering nothingrollbackpins of #37013Package runs
pnpm --filter @objectstack/metadata testatabc706ce: Test Files 83 passed (83), Tests 2808 passed (2808).pnpm --filter @objectstack/metadata --filter @objectstack/metadata-protocol typecheckatabc706ce: both Done, exit 0.pnpm --filter @objectstack/metadata-protocol testat955a3452(the last commit touching either package before the changeset and the merge of main, which touched neither): Test Files 370 passed, 9 skipped (379); Tests 23440 passed, 45 skipped (23485). Re-run atabc706ceunder the verify lock: same counts, command exit 0.pnpm --filter @objectstack/dogfood testatabc706ceunder the lock: Test Files 487 passed, 3 skipped (490); Tests 4128 passed, 68 skipped (4196); exit 0.Acceptance notes
Clause-②: no (narrowing…). The diff also widens the public surface (therefusePlatformRecordRestoreexport and therefusePlatformRecordoption ofrestoreVersion), so it declaresyes (narrowing)..changeset/37013-platform-skill-own-slot.mdstill carries two of round 4's texts (R22 c and d: "of a failed batch row write", and the protocol doors reading the mark's one definition) and "never inside a publish snapshot". That file is outside this claim's file surface; carrier: the seat, as a deliberate correction with the next text edit.GET /meta/:type/:name/publishedoverlay branch serves a stored row's own body, as round 4 read it; a snapshot nested in that body is served as stored.Verification
Two-minute check:
pnpm --filter @objectstack/metadata-protocol exec vitest run src/protocol.platform-mark-rollback.test.ts src/protocol-history-slots.test.tsafter building@objectstack/metadata; expect 6 and 17 passed, including the three[#37130]door pins and the two[#37130]selector refusals.Local gates at abc706c
node scripts/pm/dispatch-gates.mjs --commandsderived 72 commands; all 72 run, 70 exit 0 atabc706ce. Two exit 3 (prerequisite not met, NOT MEASURED; CI runs both):node scripts/check-plugin-teardown-shape.mjs --self-test(shallow clone),pnpm check:dual-build-cjs-loads(unbuilt packages outside this diff).pnpm check:type-check-debtre-run: exit 0.dispatch-gates --ran: "72 derived famil(ies) accounted for — 70 run, 2 NOT-MEASURED".overlap-check --pr=37387: merges cleanly with origin/main and #37387.🤖 Generated with Claude Code
https://claude.ai/code/session_01JQwxba3jmfHtmkWfFXfVTc