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, |
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