Repository navigation
fix(metadata-protocol)!: a save naming no package at a bundle member only the dependent holds writes the row-held base's row the bare read addresses - #37069
Conversation
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J8VVAj3FYe91JCMQZPS88h
…t-only member Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J8VVAj3FYe91JCMQZPS88h
… the dependent holds Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J8VVAj3FYe91JCMQZPS88h
…lows the row-held base Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J8VVAj3FYe91JCMQZPS88h
…er a forwarding call Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J8VVAj3FYe91JCMQZPS88h
📓 Docs Drift CheckThis PR changes 1 package(s): 2 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 2 release-owned page(s) also name something this change touched. These are read-only:
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
|
|
repo:objectstack#2 · huangyiirene · session_01J8VVAj3FYe91JCMQZPS88h Final green head for review, 2026-11-25T10:22Z: |
|
repo:objectstack#2 · huangyiirene · session_01J8VVAo7qz23KxTeCEv1faj 席位核对L1 · ACCEPT · 2026-11-25T10:25Z · head
|
|
repo:objectstack#2 · huangyiirene · session_01J8VVAo7qz23KxTeCEv1faj Contract-review-claim: session_01J8VVAo7qz23KxTeCEv1faj · head db0a77a · 2026-11-25T10:26Z L1-c (L1 ACCEPT 7159693982) runs the owed |
Requested by Irene · project thread
Fixes #35524
Clause-②: no (narrowing)
Metadata-protocol: none
Skills-docs: none — the moved cell is an authored (row-held) base with an email_template locale only its dependent stores; no skills/** or content/docs page teaches where a save naming no package lands there, and skills/objectstack-platform/SKILL.md's customization paragraph covers the code-shipped base, whose bare save this diff leaves unchanged (pinned in the new test's controls); the spec packageId sentence is #35529's
维护者速读
What changes
At a named non-canonical member of a bundled type's name no package ships (today
email_template, e.g.fr-FR), where an authored base package holds the canonical member as a stored row and only a package declaring that base holds a row of the member, the read naming no package takes the base's address (rowHeldBaseAddressOf, the S1-guarded arm; unchanged, pinned inmeta-disabled-holder-served-stack.test.tsM1, M2, S2) and answers 404. The doors naming no package that write or address that member's draft now resolve the same address:packagelessRowHeldBaseAddress(protocol-save.ts) also answers the base where the member's active rows are bound to exactly one package, that package is not the base, and the read's own judgment names the base (rowHeldBaseAddressOf, asked, not copied). Two or more holders answer exactly as before (metadata-protocol: with a bundled base and a dependent both holding a member, the bare write doors still answer 409 naming both while the bare read now answers the base #34681).packagelessDraftAddress, behind the draft save, the strict draft read, the per-item publish and the draft discard) is wrapped by the newpackagelessRowHeldBaseDraftAddress: at this cell it answers the base's draft, promoted into the base's row. The draft save sets the base as its package (the repository otherwise resolves its own write head), as the metadata-protocol: with a bundled base and a dependent both holding a member, the bare write doors still answer 409 naming both while the bare read now answers the base #34681 follow arm does, so the named-base rule and the late override re-judgment judge the base.Ruling route: the write follows the read (epic ruling 6781691009, 「a write resolves its address exactly as the read at the same address resolves it」; #34348 ruling (b), 「reads and writes give the same answer」). The read is not changed.
FROM to TO (BREAKING, the narrowing arm):
PUT, in process),active: the dependent's row silently updated, read after it 404 (or 409) → the base's row written at the member, as?package=BASEwrites it; the dependent's row byte-unchanged; read after it 200 at the base.?package=BASE.404 NO_DRAFTnaming that draft; discard removed it →200receipt that discards nothing and names the remaining draft. Both equal the same request naming the base.Files:
packages/metadata-protocol/src/protocol-save.ts(the helper's one-holder arm, the publish-mode and draft-mode save address, the new draft-address wrapper),packages/metadata-protocol/src/protocol.ts(the facade'spackagelessDraftAddressforwards through the wrapper; still one forwarding call,check:facade-delegation-onlygreen). Pins:packages/runtime/src/domains/meta-bare-save-dependent-only-member-35524.test.ts(new, named for this card, the #34681 fixture shape). Changeset:.changeset/35524-bare-save-follows-base-dependent-member.md(@objectstack/metadata-protocolpatch, both declaration lines, BREAKING banner, ADR-0087 dispositionnot-required (no-migration-prescription)).No spec touch: the save request's
packageIddescription's row-held-base exception sentence stays true (it covers a member the base and the dependent both hold). Its earlier sentence, "anactivesave then writes the row of the one package the item's active rows are bound to", now has this cell as a second exception; that text is left to sibling card #35529 (see Acceptance notes).Declarations:
Clause-②: no (narrowing)because a published accept set narrows (the bare publish of the dependent's lone draft at this member moves from 200 to 404NO_DRAFT) and what a bare write lands in moves (the dependent's row → the base's row), the epic ruling's "D's row silently updated → E's row (narrowing)" shape.Metadata-protocol: none: no key, accepted value or meaning of authored metadata moves; what moves is the row a request naming no package addresses, as PR #35450 declared for the sibling move.Read first (by risk):
protocol-save.ts,packagelessRowHeldBaseAddress: the new equalityaddress.candidates.includes(base) === address.candidates.length > 1(two or more: the base among them; one: the base is not that one).protocol-save.ts,packagelessRowHeldBaseDraftAddressand the draft save's widened follow condition (draftAddress.into !== null).protocol.ts, the facade'spackagelessDraftAddress, now the one resolution every bare draft door shares.Two-minute check:
pnpm --filter @objectstack/runtime exec vitest run --maxWorkers=2 src/domains/meta-bare-save-dependent-only-member-35524.test.tsafter building@objectstack/metadata-protocol; expectTests 6 passed (6).Tests
The card's 3-step sequence, measured on main a73edb3 and on this head (booted kernel, real protocol and sqlite store)
Fixture: authored WA holds
en-US, authored WD (declares WA) holdsfr-FR, sameemail_templatename.GET ?member=fr-FRPUTfr-FR, no packageGET ?member=fr-FRWhy step 3 answered 409 on main: only where the rows were stored after boot. The registry then held no row of WA's; the save's registry write-through registered WD's fr-FR item, so the registry named WD the name's one holder, and the read, at the base's address, was refused by the exact-qualifier judgment ("not held by package WA ... held by package WD").
?package=WA&member=fr-FRanswered the same 409. On a kernel booted over the rows (registry hydrated with both), step 3 answered 404. Either way the save wrote a row the read did not serve.The save naming WA at fr-FR on main (in process and REST
PUT ?package=WA): 200, writes a new WA row at fr-FR, WD's row untouched, and the bare read then serves it (200 at WA). So the stop rule did not trigger; this head makes the bare save answer exactly that.Per-door conclusions at the cell (main → this head)
NO_DRAFT, equal to?package=WA).?package=WA).historySlotOf's two-or-more guard). See Acceptance notes.Pins (new file) and controls
meta-bare-save-dependent-only-member-35524.test.ts, 6 tests:PUTand in-process save on a kernel booted over the rows: step 1 404; WD's row byte-identical before and after (every stored column); rows equal to the save naming WA; no package-unbound row; bare read 200 at WA,?package=WDstill WD's; and after a restart.?package=WAanswers;?package=WDpublishes it.WRITABLE_PACKAGE_REQUIREDnaming the base, as?package=BASE(was the same code naming the dependent).Unchanged and green:
meta-disabled-holder-served-stack.test.ts(M1, M2, S2 untouched) andmeta-bare-write-doors-follow-base-34681.test.ts:Test Files 3 passed (3),Tests 178 passed (178)at 80f540b.Ablations (one per moved pin; mutation through scripts/ablation-replace.mjs, rebuild, dist preflight, restore to the HEAD blob)
const resolved = base ?? address.packageIdread asaddress.packageId): marker present in dist; tests 1, 2 and 5 red (Tests 3 failed | 3 passed (6)); restored, blob == HEAD,git diff HEADempty.packagelessRowHeldBaseDraftAddressreturning the stored address: tests 3 and 4 red (Tests 2 failed | 4 passed (6)), re-run on 80f540b with the same reading; restored, blob == HEAD.package=com.qa.authoredaddon(Tests 1 failed | 5 passed (6)); restored, blob == HEAD.Tests 6 passed (6).Acceptance notes
SaveMetaItemRequestSchema.packageId's sentence "anactivesave then writes the row of the one package the item's active rows are bound to" now has this cell as an exception at the member grain, androwHeldBaseAddressOf's docblock says the writes ask it only with two or more holders. Both are text for sibling card metadata-protocol: follow-ups from the #35450 contract review: the spec exception text, three door-request comments, and a rollback pin over real history #35529, which rewrites those descriptions; untouched here.RESOURCE_CONFLICT; observation only.Verification
Local runs at the final head 80f540b
@objectstack/metadata-protocoltest:Test Files 369 passed | 9 skipped (378),Tests 23389 passed | 45 skipped (23434)(run at b7be6fc; the later commit only reshapes the facade wrapper's argument).@objectstack/metadata-protocoltypecheck: exit 0 at 80f540b;@objectstack/runtimetypecheck (with its test-typecheck): exit 0.Tests 178 passed (178)at 80f540b.dispatch-gates.mjs --commands, 75 families): 73 exit 0;check:dual-build-cjs-loadsandcheck-plugin-teardown-shape.mjs --self-testexit 3 PREREQUISITE NOT MET (no full-tree dist / shallow clone): NOT MEASURED locally, CI's reading.check:facade-delegation-onlywent red on the first tree and is green after the fix commit.--ranreconciliation: 75 derived, 73 run, 2 NOT-MEASURED, 0 UNRUN.test:repo,pnpm lintand the full farm: CI's.os-verify-lock: VERDICT command-exit 0,Test Files 487 passed | 3 skipped (490),Tests 4128 passed | 68 skipped (4196), no failures (an earlier run at 80f540b was also green, its reading in the dev report on the card).🤖 Generated with Claude Code
https://claude.ai/code/session_01J8VVAj3FYe91JCMQZPS88h