Repository navigation
fix(metadata-protocol): the delete heal never registers a picked holder of a name two packages hold - #34092
Conversation
…ervice cannot name a holder A type addressed by (package, name) that the metadata service stores by name alone keeps the item registered last. With two or more registry holders of the name, tier 2 registered that item in the bare slot: a pick between holders (ADR-0150 D3). Return a settled miss there instead. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jUcj2x2Wr4UErwBi12
📓 Docs Drift Check1 anchor(s) derived from 1 changed package(s); no hand-written page names any of them, so this run has nothing to list — not a clean bill of health. This check sees only pages that NAME a derived anchor: one that documents this change in prose, or enumerates it in an authoring dialect, names none and stays invisible to it on every run. What this run could not see
Coarse fallback — 10 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 3e87d87c9ac151830df94d3ed3db1ee2fed4ed04 && git checkout 3e87d87c9ac151830df94d3ed3db1ee2fed4ed04
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin ea6de745cce19d0de551e938a6fc6bbe975dd35e d2aa1132d3d45688ee1604ae421443028e013c3e && git checkout -B drift-repro ea6de745cce19d0de551e938a6fc6bbe975dd35e && git merge --no-ff d2aa1132d3d45688ee1604ae421443028e013c3e
node scripts/docs-audit/affected-docs.mjs --json ea6de745cce19d0de551e938a6fc6bbe975dd35e |
|
domain:server#5 · zhuangjianguo · session_01QsR2jUcj2x2Wr4UErwBi12 Test Core (3/8) red at head
Every other check on this head that ran is green (33 success, 16 skipped). A re-run of the failed job is the seat's stroke. No code change is pushed for this. |
|
domain:server#5 · zhuangjianguo · session_01QsR2jUcj2x2Wr4UErwBi12 Request: review · PR #34092 · area S5 · Fixes #33832 · head
|
|
domain:server#5 · zhuangjianguo · session_01QsR2jRMKz5NhWVrE4E1U5x Review claim · head d2aa113 · 2026-11-15T23:18Z (review-c, S5; ACCEPT read, no contract face) |
|
domain:server#5 · zhuangjianguo · session_01QsR2jRMKz5NhWVrE4E1U5x Review — PASSHead-sha:
No must-fix, no should-fix. Not governed: the area lands this PR per |
|
domain:server#5 · zhuangjianguo · session_01QsR2jUcj2x2Wr4UErwBi12 席位核对Verdict: ACCEPT · head
|
Requested by Steedos · project thread
Fixes #33832
Clause-②: no
Metadata-protocol: none
维护者速读
packages/metadata-protocol/src/protocol-registry-hydration.ts的readHealBaseline开头新增的判断,再看packages/objectql/src/protocol-registry-heal-packageless-refusal.test.ts末尾新增的 describe。pnpm --filter @objectstack/objectql exec vitest run --maxWorkers=2 src/protocol-registry-heal-packageless-refusal.test.ts(需先构建 metadata-protocol),预期 12 个用例全绿。What changes
Ruling: ADR-0150 D3 (a bare read never picks between holders) and epic ruling 6818436831, which says of this heal: "Nothing picks a holder and no baseline is registered. The next bare read is the 409 naming exactly the two holders." Seat ruling 6812637203 Q2 ruled the same footing: "the removed row's entry in the bare slot is retired and no baseline is registered."
readHealBaseline(the delete heal's tier 2) now returns a settled miss, before any service read, for a type that is addressed by(package, name)(isPackageScopedType) but is stored in the metadata service by name alone (outsidePACKAGE_SLOTTED_STORE_TYPES), when the registry holds the name for two or more packages (packageScopedHoldersOf, disabled packages counted). For those types the service keeps only the item registered last and answers it to a read naming any package or none, so its answer there is a pick. Tier 3 then retires only the removed row's own bare-slot entry (its verb refuses a packaged artifact). A name one package holds is read as before.The types this reaches:
dashboard,report,page,app,book,analytics_cube,hook,job,sharing_rule,queue,assignment_rule. Pinned:dashboardandreport, the card's two.No change to
protocol.ts, toapplyRegistryWriteThrough, torestoreArtifactRegistryView's catch branch, to the objectql registry, or to any spec surface.The premise, measured on a real boot (H2 first)
A kernel booted from a compiled artifact with three package bodies (alpha and beta each ship
dashboard mix_dashandreport mix_rep; a third,other, ships neither), the waycreateStandaloneStackcomposes it (MetadataPlugin's artifact door plusAppPluginover the same bundle). Both registration orders, both kernel shapes (environmentId: env_localwith DB hydration, and none), 8 boots, at45dee177. A scratch rig, not committed.com.qa.alpha:mix_dash,com.qa.beta:mix_dash). The metadata service kept only the body registered last, and answered it both bare and forother.PUTofdashboard mix_dashnamingotherwas accepted (row stored, bound toother, kept out of the bare slot). Its delete answeredsuccess: true, logged nothing, and left the last-registered holder's body in the bare slot. After thatregistry.getItem(type, name)answered that holder (it answered the first-registered one before), andregistry.listItems(type)listed that holder twice (3 entries for 2 holders). Forreportthe save was refused (the rig's dataset did not exist), and the delete with no row still ran the heal and planted the same entry.otherwas refused, and the protocol list showed each holder once, before and after. The composite slots answer them.So the card's symptom (a holder's read refused naming the other) is unreachable on a real boot, while its mechanism (tier 2 registers a picked holder) reproduces there. This PR takes the fix route for the mechanism.
FROM → TO
45dee177)registry.listItems(type)entries of the nameregistry.getItem(type, name)Clause-②: no: no accepted or served answer of any door moves; only the registry's internal bare slot does.Tests
packages/objectql/src/protocol-registry-heal-packageless-refusal.test.ts(the shared real-registry heal harness), one new top-level describe on a realSchemaRegistryand a realMetadataManager, in the real boot's shape: each holder in its composite slot, the service keeping the last-registered one, the non-holder's stored row hydrated byloadMetaFromDband kept out of the bare slot.dashboardandreport, each in both registration orders: afterdeleteMetaItemnaming the non-holder, the bare slot is empty, the registry lists each holder once, each holder's read serves its own item, the bare read is the 409 naming both holders in registration order, and the heal logs nothing.dashboardwith one holder: the same delete still registers that holder's baseline in the bare slot.Ablation, once, with the fix committed first. objectql pins resolve
@objectstack/metadata-protocolthroughdist/, so each leg was rebuilt and preflighted.scripts/ablation-replace.mjs: the guard'sreturnline replaced by a marker assignment (anchor 1 → 0, blob5b888bd3→8f51c415).pnpm --filter @objectstack/metadata-protocol buildexit 0;ablation-dist-preflightexit 0 (marker indist/index.jsanddist/index.cjs).expected 'shipped:com.acme.beta' to be undefined(alpha first) andexpected 'shipped:com.acme.alpha' to be undefined(beta first). The CONTROL and the 7 existing cases passed.5b888bd3= HEAD,git diff HEADempty, rebuilt (exit 0),ablation-dist-preflight --absentexit 0 (marker absent from all 24 built files, tree clean). Restored run: 12 passed (12).Acceptance notes
success: trueand ran the heal (thereportrig above). With this change it registers nothing for a two-holder name. Recorded for the seat, not filed.Verification
Readings at the heads named.
HEAD929fc53e43is the final head (origin/main merged in twice; the second merge brought #33851's edits to the same file, in other functions).Package suites and typechecks
9c4f75f36e(first merge of main), under the verify lock:@objectstack/metadata-protocoltypecheck exit 0, test exit 0 (341 files passed, 9 skipped; 22894 tests passed, 43 skipped).@objectstack/objectqltypecheck exit 0, test exit 0 (596 files, 13177 tests). Direct dependents:@objectstack/resttest exit 0 (412 files; 8442 passed, 332 skipped),@objectstack/runtimetest exit 0 (605 files; 10958 passed, 19 skipped).929fc53e43, after the second merge (closure rebuilt, exit 0): the heal harnessprotocol-registry-heal-packageless-refusal.test.ts12/12; metadata-protocolprotocol.registry-heal-package-read.test.tsplusprotocol.revert-commit-honest-outcome.test.ts(metadata-protocol: registry write-through faults for non-object types are only logged, so revertCommit cannot report them #33851's pins on the same walk) 48/48; metadata-protocol and objectql typecheck exit 0. The full suites were not re-run at this head; CI'sTest Coreruns them.Derived gates
dispatch-gates --commands --repo objectstack-ai/objectstackat929fc53e43: 67 families derived; 65 run unlocked, each exit 0 (the PR-body gates read this body throughGITHUB_EVENT_PATH);check:type-check-debtrun under the verify lock, exit 0 (0 raw tsc errors above the ledger).check:dual-build-cjs-loadsNOT MEASURED (needs a full-repodist/), left to CI.--ranreconciliation: 67 derived, 66 run, 0 not measured, 1 unrun (that one).--no-inline-config) over the two touched source and test files: exit 0.Declaration self-check
Clause-②: noandMetadata-protocol: none, as claimed: no door's accepted or served answer moves (the protocol reads were read before and after on the real boot), no export or spec surface changes, so no!, no BREAKING banner and no ADR-0087 marker.dispatch-gates --tier: no path-derived mandate, 117 changed lines. Compared with #33646 (yes (narrowing)with!: served → refused answers) and #33769 (yes (widening): new exports): neither shape applies here.🤖 Generated with Claude Code
https://claude.ai/code/session_01QsR2jUcj2x2Wr4UErwBi12