Repository navigation
fix(metadata-protocol): a package-less doc row beside one holder hydrates as the environment's own item - #39338
objectstack-fleet[bot] wants to merge 2 commits into
Conversation
…c row Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6CY1DVmttnuNH77G3ht
…ates as the environment's own item Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6CY1DVmttnuNH77G3ht
📓 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 4f6278171adb3020f2015abc6956433817b99a57 && git checkout 4f6278171adb3020f2015abc6956433817b99a57
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin ccc0838e804151f3923399b79fb58f93473aba23 d511f6480f63c2cab8631634c22edd1a2d092f14 && git checkout -B drift-repro ccc0838e804151f3923399b79fb58f93473aba23 && git merge --no-ff d511f6480f63c2cab8631634c22edd1a2d092f14
node scripts/docs-audit/affected-docs.mjs --json ccc0838e804151f3923399b79fb58f93473aba23 |
|
repo:objectstack@os-bill · os-bill · session_01Utp6CY1DVmttnuNH77G3ht Hold · 2026-12-03T13:37Z — |
Fixes #38952
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
The boot hydration (
loadMetaFromDb) graded a package-less storeddocrow as the environment's own item only when two or more packages ship the name. With exactly one enabled holder the row fell to the one-holder envelope lookup and was registered stamped_packageId: HOLDER,_provenance: package, so the bareGET /meta/doc/NAMEserved the package's doc instead of the environment's own (ruling 6942962369: the environment's own item answers first on every read naming no package, whatever the number of holders).The
environmentDocpredicate inprotocol-registry-hydration.tsnow holds for one or more shipping packages. The comment citing epic ruling 6817768147 ("it wears its one holder's") is narrowed: that ruling rules the five overlay types a holder's item is customized in (email_template, dashboard, report, view, translation) and sealed types;docis neither, so it does not binddocand does not conflict with 6942962369.Read first (by risk):
packages/metadata-protocol/src/protocol-registry-hydration.tsaround theenvironmentDocpredicate (the only behavioural hunk).packages/runtime/src/domains/meta-bare-read-own-envelope-38659.test.ts, the new top-level[#38952]describe.Two-minute check:
pnpm --filter @objectstack/runtime exec vitest run --maxWorkers=2 src/domains/meta-bare-read-own-envelope-38659.test.tsafter building the runtime closure: 40 tests pass, including the 12 new[#38952]cells.Tests
New top-level describe in the existing shared harness for this rig (artifact-door kernel, one doc
shared_doc, package-lesssys_metadatarow, in-processprotocol.loadMetaFromDbafter the artifacts), four cells: one holder in both registration orders, and two holders in both orders as CONTROL. Each cell asserts: the registry bare slot holds the row unstamped (_packageIdabsent,_provenance: org); the bare read on the dispatcher,RestServerand in-processgetMetaItemservesenvironment docwith no_packageId/_packageVersion/packageId, and_provenance/provenanceorg(the envelope assertion carried from comment 7327944668); CONTROL: each holder's?package=read keeps its own doc under its own envelope.Red on origin/main dc4a2cd (ablation: the predicate as it was)
Test file run against
main's builtmetadata-protocolwith only the pin added:Tests 4 failed | 36 passed (40). The four reds are the one-holder cells (both orders) of the registry-slot and bare-read assertions; received["environment doc", "com.qa.alpha", "package"]for the slot, and the bare read servedlabel: alpha doc,_packageId: com.qa.alpha,provenance: package. Two-holder cells and every exact-read CONTROL were green.Green at d511f64
pnpm --filter @objectstack/runtime exec vitest run --maxWorkers=2 src/domains/meta-bare-read-own-envelope-38659.test.ts src/domains/meta-disabled-holder-artifact-door.test.ts:Test Files 2 passed (2),Tests 89 passed | 6 skipped (95).pnpm --filter @objectstack/metadata-protocol test:Test Files 384 passed | 9 skipped (393),Tests 23966 passed | 45 skipped (24011);typecheckexit 0;pnpm --filter @objectstack/runtime typecheckexit 0.Acceptance notes
metadata-protocolcannot host (the artifact-door rig needsAppPluginfrom@objectstack/runtime), so the pin is a new top-level describe in the existing runtime harness for the same rig (shared-harness ruling 6583487846) rather than a new file inmetadata-protocol.GET /meta/doclists the environment's own doc under the first registered holder's envelope, while the bare read serves it as the environment's (#38659) #38977 (the env-wide list door) is untouched.Verification
Derived gate families at d511f64
dispatch-gates --ran: 71 derived, 66 run with exit 0, 5 NOT MEASURED, 0 unrun. NOT MEASURED, left to CI:check-comment-mask-corpus(timeout on the shared box),check-plugin-teardown-shape --self-test(shallow clone cannot reach its pinned control commit),check:dual-build-cjs-loads(needs every package's dist),check:query-options-erasureandcheck:type-check-debt(timeouts on the shared box).check-nul-bytesexit 0.Generated by Claude Code
🤖 Generated with Claude Code
https://claude.ai/code/session_01Utp6CY1DVmttnuNH77G3ht