Skip to content

fix(metadata)!: a version the platform registered is never restored into a package's row, and adopt-orphans leaves the platform's record - #37640

Merged
os-zhuang merged 8 commits into
mainfrom
claude/issue-37604-platform-record-followups
Nov 26, 2026
Merged

os-zhuang merged 8 commits into
mainfrom
claude/issue-37604-platform-record-followups

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Fixes #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 技能元数据:平台注册的技能要能与同名应用技能并存,平台写入和撤回不碰应用的槽位 #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.

#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.

#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 (#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 feat(metadata): listPackageBindings reads an item's package from its stored row's package column #37187 N3 pin.
Red on base (main 4e10d4b)
  • 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', … }.
Ablations (fix committed first; each mutation landed via scripts/ablation-replace.mjs, rebuilt, dist preflight checked, restored to HEAD and rebuilt)
Suites after the merge of main (33a31dc)
  • @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.

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.ai/code/session_01Q4EjjQkY5yXZrN9BEA3rEK

…red into a package's row and for adopt-orphans over the platform's record (red on base)

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q4EjjQkY5yXZrN9BEA3rEK
…to a package's row; adopt-orphans skips the platform's record; one platform-row reader

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q4EjjQkY5yXZrN9BEA3rEK
…listPackageBindings names a lost loader once; changeset

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q4EjjQkY5yXZrN9BEA3rEK
…into the changelogs

Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q4EjjQkY5yXZrN9BEA3rEK
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 26, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 3 package(s): @objectstack/metadata-protocol, @objectstack/metadata, @objectstack/spec, touching 14 documentable anchor(s). ⚠️ 2 changed file(s) yielded no anchor (packages/metadata/src/index.ts, packages/metadata/src/package-slotted-store.ts), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

19 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: node scripts/docs-audit/affected-docs.mjs --json 33a31dc7b083e1a25310b0323c8cc5d796c3b4b8.

⛔ 7 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails.

What this run could not see
  • 2 changed file(s) yielded no anchor (packages/metadata/src/index.ts, packages/metadata/src/package-slotted-store.ts) — pages documenting those are invisible to this run
  • the SDK route bridge reached 69 of 252 client-bound route-ledger rows — the other 183 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 183: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 59 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 124 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 180 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json 33a31dc7b083e1a25310b0323c8cc5d796c3b4b8 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from cd169a02eca1c1bf751ba07f70997e80e6850777 — the merge of head d96a1a97b72039e0a1ff03a582bbd2705ab5a3d5 into base 33a31dc7b083e1a25310b0323c8cc5d796c3b4b8, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# while this PR is open — GitHub drops the merge commit once it closes
git fetch origin cd169a02eca1c1bf751ba07f70997e80e6850777 && git checkout cd169a02eca1c1bf751ba07f70997e80e6850777
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 33a31dc7b083e1a25310b0323c8cc5d796c3b4b8 d96a1a97b72039e0a1ff03a582bbd2705ab5a3d5 && git checkout -B drift-repro 33a31dc7b083e1a25310b0323c8cc5d796c3b4b8 && git merge --no-ff d96a1a97b72039e0a1ff03a582bbd2705ab5a3d5

node scripts/docs-audit/affected-docs.mjs --json 33a31dc7b083e1a25310b0323c8cc5d796c3b4b8

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs 33a31dc7b083e1a25310b0323c8cc5d796c3b4b8 → pass the list as
args.docs, on the commit named under Which tree this was computed on.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#6 · hotlong · session_01Q4EjjQkY5yXZrN9BEA3rEK

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: d96a1a97b72039e0a1ff03a582bbd2705ab5a3d5
Local-runs: none
Scope: packages/spec/src/contracts/metadata-service.ts + packages/metadata/src/metadata-manager.ts, packages/metadata/src/loaders/database-loader.ts, packages/metadata/src/index.ts, packages/metadata/src/package-slotted-store.ts, packages/metadata-protocol/src/sys-metadata-repository.ts, packages/metadata-protocol/src/protocol-package-commits.ts, packages/metadata-protocol/src/protocol-diff-delete-load.ts, packages/metadata-protocol/src/protocol.ts, .changeset/37604-platform-record-followups.md, and the three test files of the diff
Security-touching: no
Rule-change-verified: none

Read: the diff from merge-base 33a31dc7 to the head; card #37604 with claim 7197321181 and report 7199253774; the PR body; reviews 7182526807, 7179564385 and 7179776919; the head's check-runs and the failed job log. Nothing was built or run locally, so the dev's red-on-base, ablation and suite counts are the dev's readings.

① Derived judgments

  • Overlay census reader (L1 item 1). The deleted private copy read any non-empty package_id as a package; the shared isPlatformRecordRow reads the sys_metadata sentinel as none (storedRowColumnPackageId).
    • The answer differs only for a row whose own column holds the sentinel and whose body carries the mark and names no package.
    • No current writer puts the sentinel in sys_metadata.package_id: historySnapshotPackageColumn and historySnapshotPackage write it to the history table only, and DatabaseLoader writes a package column only for a real package. So no reachable row changes its census answer.
    • Where it would differ, the new answer is the right one: the sentinel names no package, as the adopt-orphans filter and storedRowColumnPackageId already read it.
    • Unparseable and object bodies read the same as before.
  • Row rule, N5 direction (L1 item 2). A row bound to a package by its column, with a body that keeps the mark, now passes the row rule. Nothing 元数据平台标记收尾:已发布读取只按顶层标记、平台自己的记录回滚保留标记 #37130 relied on is reopened.
    • 元数据平台标记收尾:已发布读取只按顶层标记、平台自己的记录回滚保留标记 #37130's refusal protects the package-less row the platform's registration writes; that row still has an empty column and is still refused at all three doors.
    • The row that now passes is the package's by column. In DatabaseLoader its slot is keyed by the column first (storedRowPackageId) and the written body is stamped for that slot; in the repository the write goes to the stated package's row.
    • The new version rule covers the one harmful write into such a row, the platform's version.
  • Version rule, false positives (L1 item 3). I found no path where a package's own version is refused.
  • Version rule, false negatives (L1 item 3). I found none at the three doors.
    • Service rollback, slotted types: intoPackageId is slot.packageId, so a row bound by body stamp alone is covered too. With two slots, rollbackSlot still refuses the owner mismatch first, as before.
    • Service rollback, other types: intoPackageId is the existing row's column, and the version is read by historyVersionRow. With history untracked there is no version to restore.
    • rollbackMetaItem always states packageId (the addressed slot's, the served row's column, or resolveOverlayPackageBinding); revertCommit states the commit's package. Active-state put writes exactly the stated package's row.
    • A restore into the package-less row passes, as the card intends.
  • adopt-orphans (L1 item 4). No orphan that should be adopted is left behind.
    • The filter excludes only a package-less row whose body carries the mark and names no package.
    • Only register with origin: 'platform' stamps the mark; every authoring door strips or refuses it, so an environment-authored orphan never matches.
    • The control pin adopts a package-less row whose body names a package.
    • Every later loop in reassignOrphanedMetadata iterates orphans, so the skipped row is not touched downstream.
  • listPackageBindings (feat(metadata): listPackageBindings reads an item's package from its stored row's package column #37187 N3). A loader lost in the list walk is named once and not re-read. The answer is degraded either way, and the contract tells consumers to treat a degraded answer as unknown.
  • Spec edit (L1 item 6). packages/spec/src/contracts/metadata-service.ts changes one JSDoc sentence inside listPackageBindings' doc. No signature, type, schema or export moves; check:generated is reported up to date and Lint & Repo Gates is green on the head. The sentence agrees with readRowColumnOf and bindReadRowPackage.

② Semver level

patch on @objectstack/metadata and @objectstack/metadata-protocol, with the BREAKING banner and the ADR-0087 not-required (no-migration-prescription) marker, is right per AGENTS.md Post-Task step 3.

  • Clause-②: yes (narrowing) is the correct reading; the claim's no was a pre-measurement estimate. The diff adds an export (isPlatformRecordRow), adds an optional fourth argument to an exported function, and refuses or leaves out two writes that happened before.
  • Metadata-protocol: none holds. No key, accepted value, metadata type, code or route changes; the refused body stays writable by saving it naming the package. A non-protocol breaking change ships patch and keeps its banner and disposition.
  • Changeset body carries both declaration lines, one marker and a "What to do" line per break. The shape matches the accepted 元数据平台标记收尾:已发布读取只按顶层标记、平台自己的记录回滚保留标记 #37130 note (.changeset/pre/37130-platform-record-restore-doors.md). Check Changeset and Lint & Repo Gates are green.
  • @objectstack/spec has no entry of its own. The edit is a doc comment and the package sits in the same fixed group, so it versions with the two bumped packages.

③ Boundary flags

  • Author. PR user.login is objectstack-fleet[bot]; no off-relay author to name.
  • SQL push-down. No new id materialisation or in-app join. The adoption filter runs over rows the method already read; the service door adds one keyed history read per non-slotted rollback.
  • open_questions. Empty.
  • Dev flag: compiled 37013 / 37130 notes. Agreed that N3 is dropped: both notes are under .changeset/pre/ on the head, compiled by 33a31dc7. A wording fix to a compiled CHANGELOG entry is a prose-face follow-up for the seat.
  • Dev flag: remaining body-only readers. See N2.
  • Dev flag: model-free commit trailer. A process deviation for the seat; no contract effect.
  • Check-runs on the head (L1 item 7), at 17:39Z. 68 runs: 56 success, 11 skipped, 1 in progress (Test Core (5/10), attempt 2 of run 45861944929, started 17:36Z).
    • Attempt 1 failed at step "Run this shard's tests" with first error Test timed out in 5000ms at packages/cli/test/start-deployment-durability.integration.test.ts:281 ("none set: exit 1, naming all three").
    • I judge it unrelated to this diff. The diff touches no file under packages/cli. The test spawns os start and expects a refusal before boot, under the default 5000 ms test timeout.
    • The same step and first error line appear in job 139971655655 of merge-group run 45837486482 (queue branch for PR fix(lint)!: four publish-time checks for data-model metadata that saves and does not work #37513, 14:46Z), before this PR existed.
    • It is not a merge-base red: Test Core (5/10) is green on base 33a31dc7. The all-green landing condition therefore still rests on attempt 2, which the seat must read before any request for approval.

④ Design judgment

  • metadata-service.ts (hit). The corrected sentence closes feat(metadata): listPackageBindings reads an item's package from its stored row's package column #37187's N6 and holds against the code it describes. It cannot change what a consumer does; the sentence still ends by telling it to treat a degraded answer as unknown.
  • Route for item 1. The loud refusal in the producer is sound: one rule in @objectstack/metadata, asked by all three doors, reusing 元数据平台标记收尾:已发布读取只按顶层标记、平台自己的记录回滚保留标记 #37130's envelope and naming the fix. It leaves the M1 attribution rule that history reads share untouched.
  • Narrowing against the published spec. It takes no declared capability away at the consumer. No contract promised that the platform's version could become a package's item by rollback, or that adoption rebinds the platform's record.
  • Pins. They cover the three doors named and bare, revertCommit with a commit that names its package (N2), the adoption with a control, and the N5 reader. The protocol pins mark the history rows by hand; the service-door pin goes through a real register and unregister with origin: 'platform'.
  • N1 message. The clause now states that the re-save lasts until the platform's next registration.

No must-fix, no should-fix.

  • N1 (nit) — SysMetadataRepository.restoreVersion computes intoPackageId from the raw opts.packageId or raw column, without the sentinel normalisation the shared reader and the DatabaseLoader door apply.
    • On a sys_metadata row whose own column held sys_metadata and whose body is unmarked, the protocol doors would refuse a platform version "into package 'sys_metadata''s row" while the service door would pass it.
    • No current writer stores the sentinel in that column, so no reachable row is affected.
  • N2 (nit) — the doc calls isPlatformRecordRow "the one reader of the fact", and the three askers it lists do ask it. database-loader.ts still has body-only readers (platformRow on the write path, taken and the non-slotted platformOnly branch of delete), which the PR body discloses.
    • Rows that the pre-fix adoption already rebound keep the mark under a package column and are not repaired here.
    • For a non-slotted type the withdrawal's body-only read could take such a row. Read, not measured; a follow-up card candidate.

Implemented-by: claude/issue-37604-platform-record-followups
Reviewed-by: session_01Q4EjjQkY5yXZrN9BEA3rEK

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#6 · hotlong · session_01Q4EjjQkY5yXZrN9BEA3rEK

维护者速读

  • 修两处可能悄悄写错数据的地方:平台撤回自带记录(内置技能/智能体/工具)以后,再回滚时不会再把平台那一版写进某个包的数据里;「领养孤儿元数据」时不会再把平台自带的记录领走。
  • 两处都先在主干上复现了问题,再修;会被拦下时给出明确的报错和改法(把那一版重新以包的名义保存即可),不影响正常回滚。
  • 已经被旧版本领走的记录这次不修复,另立卡 metadata platform record: second follow-ups after #37604 (body-only readers, sentinel in restoreVersion, compiled CHANGELOG wording) #37656 先测量再决定。
  • 要你做的:用 os-zhuang 账号批准本 PR(收窄类改动需授权批准)。契约审核 PASS 记录 7199461447,Head-sha d96a1a97b72039e0a1ff03a582bbd2705ab5a3d5。

席位意见:两级审核在这个 head 上都通过,CI 全绿(唯一一次红是 CLI 包里一个与本 PR 无关的测试超时,重跑已过);剩余小问题立卡 #37656。建议批准。

席位核对 — ACCEPT · repo:objectstack#6 · head d96a1a97b72039e0a1ff03a582bbd2705ab5a3d5

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#6 · hotlong · session_01Q4EjjQkY5yXZrN9BEA3rEK

Review requested: this narrowing PR lands by an authorized APPROVED review or an enqueue by an approver. Records at head d96a1a97b72039e0a1ff03a582bbd2705ab5a3d5: seat ACCEPT 7200052586, contract review PASS 7199461447 at CONTRACT_REVIEW_TIER, maintainer brief in 7200052586; check-runs 58 success, 11 skipped, 0 failed. On approval the seat readies it and enables auto-merge.

@objectstack-fleet objectstack-fleet Bot added the pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue label Nov 26, 2026
@os-zhuang
os-zhuang marked this pull request as ready for review November 26, 2026 18:33
@os-zhuang
os-zhuang added this pull request to the merge queue Nov 26, 2026
@objectstack-fleet objectstack-fleet Bot removed the pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue label Nov 26, 2026
Merged via the queue into main with commit 6679160 Nov 26, 2026
121 of 123 checks passed
@os-zhuang
os-zhuang deleted the claude/issue-37604-platform-record-followups branch November 26, 2026 18:59
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

metadata platform record: follow-ups after #37130 (rollback-by-package edge, adoptOrphans, contract-review nits)

3 participants