Uh oh!
There was an error while loading. Please reload this page.
fix(spec): declare MetadataProtocol.getMetaItemLayered; drop the dead 'overlay' lockSource arm (#9740) - #9773
Conversation
… 'overlay' lockSource arm Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016D9wdJR14KKCxz1WgdAzcw
… the closed lockSource vocabulary Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016D9wdJR14KKCxz1WgdAzcw
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016D9wdJR14KKCxz1WgdAzcw
📓 Docs Drift CheckThis PR changes 2 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 seeCoarse fallback — 116 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 5be3ad513d16044838aa3a599cb1ebca2b478ce5 && git checkout 5be3ad513d16044838aa3a599cb1ebca2b478ce5
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin e9534a4acab63aa91a67dfb76110b6695be68df0 e1ed96c9fb920f74ba0dab2649e07701f2996c81 && git checkout -B drift-repro e9534a4acab63aa91a67dfb76110b6695be68df0 && git merge --no-ff e1ed96c9fb920f74ba0dab2649e07701f2996c81
node scripts/docs-audit/affected-docs.mjs --json e9534a4acab63aa91a67dfb76110b6695be68df0
|
Uh oh!
There was an error while loading. Please reload this page.
Fixes#9740
What
Two mechanical edits, exactly the card's fix shape — declared-surface catch-up, zero runtime behaviour change:
packages/spec/src/api/protocol.zod.ts—MetadataProtocolnow declares the optional membergetMetaItemLayered?(request: GetMetaItemLayeredRequest): Promise< GetMetaItemLayeredResponse >(spelled with the schemas' inferred types), replacing the blocker comment [finding] The spec's three meta-read request schemas omitorganizationId, which the protocol implementation accepts and honours #9726's PR left at that exact spot (the comment pointed at MetadataProtocol cannot declare getMetaItemLayered: the implementation's inline lockSource annotation carries an 'overlay' arm its producer never emits #9740; retired with this fix). Optional like itsgetMetaItemCached/deleteMetaItemsiblings — additive to a shipped contract, implementation predating declaration.packages/metadata-protocol/src/protocol.ts—getMetaItemLayered's inline return-type annotation drops the dead'overlay'arm onlockSourceand annotates withMetadataLockSourcedirectly (type import added).Plus type-level pins in
packages/spec/src/api/protocol.test.ts(theexpectTypeOfpattern fromtranslation-typegen.test.ts, compiled by spec's test typecheck): the member's presence/shape against the layered schemas, and the closed lockSource vocabulary (artifact | package | env-forced — no 'overlay' arm).⛔ Not done, per the card's own analysis and PD#10: widening
MetadataLockSourceSchema— a wire-vocabulary change on every metadata read envelope and on stored_lockSource, with no producer needing it. No REST call-site changes (nothing became purely mechanical; left for #9741's track — #9741 is not addressed here and remains open).Ownership trace for the
:10888'overlay'producer (the measurement that could have flipped this card)Measured on
origin/main(2065e31) before editing:packages/metadata-protocol/src/protocol.ts:10888—return { lock: p.lock, lockReason: p.lockReason, lockSource: 'overlay' }— sits insidegetEffectiveLock(private, declared at:10852, return type annotatedlockSource: 'artifact' | 'overlay' | undefinedat:10859).getEffectiveLock's only call sites are:11047(insidelockWriteRefusal, declared:11037) and:11115(insideassertLockAllowsDelete, declared:11106) — both write/delete-door helpers. Neither feeds any read response.getMetaItemLayered(:6060–:6321) never callsgetEffectiveLock. Its response'slockSourcehas exactly one producer:...(lockState.lockSource !== undefined ? { lockSource: lockState.lockSource } : {})at:6312, wherelockState = resolveLockState(code ?? overlay ?? {}, artifactBacked)(:6269–:6270).resolveLockState(packages/spec/src/kernel/metadata-protection.zod.ts:208) returnslockSource: MetadataLockSource | undefined;extractProtection(:141) admits a raw_lockSourceonly whenMetadataLockSourceSchema.options.includes(...)(:166–:168), enum['artifact', 'package', 'env-forced'](:54).'overlay'can never come out of it.grep -n "lockSource: 'overlay'"over the whole file: one hit,:10888.Verdict: the card holds — the
'overlay'arm was an over-wide annotation, not enforced behaviour; the layered read path cannot emit it.Reverse verification (TS2416, both readings; probe =
npx tsc --noEmitinpackages/metadata-protocol)origin/mainsources: 63 errors (exactly the ledgered count inscripts/check-type-check-coverage.mjs), zero TS2416.src/protocol.ts(6060,11): error TS2416whose innermost incompatibility isType '"overlay"' is not assignable to type '"artifact" | "package" | "env-forced" | undefined'— the exact error the card measured, proven against the rebuilt.d.ts(this is also the cross-package reverse verification: the new spec member reached metadata-protocol's tsc throughdist).'overlay'turns spec's test typecheck red (TS2344at the pin line); restored from the branch commit.Verification (all at head
e1ed96cunless noted)pnpm --filter @objectstack/spec test: 413 files / 10989 tests passed (ran one tree before head; head differs from that tree only by.changeset/layered-interface-member.md, which no spec test reads —check:cross-package-test-inputsgreen pins declared test inputs).pnpm --filter @objectstack/spec typecheckate1ed96c: green (tsc + scripts + test typecheck; test debt held at 55 files / 263, unchanged).pnpm --filter @objectstack/metadata-protocol test: 122 files passed / 2 skipped, 1684 tests passed / 10 skipped.pnpm --filter @objectstack/spec check:generatedafter rebuild: all 13 artifacts up to date (api-surfaceregenerated via--fix— records export existence only, so no diff;check:docs,check:liveness,check:strictness-ledgergreen inside it).turbo run build --filter='./packages/*' --filter='./packages/*/*'— 70/70 build tasks green (all workspace packages, a superset of@objectstack/spec's and@objectstack/metadata-protocol's downstream consumers).pnpm check:type-check-debt --re-measureat head: 33 ledger entries re-measured, none above recorded (metadata-protocol steady at 63).node scripts/pm/dispatch-gates.mjs, no paths passed): all matched + convention gates run and green —check:filter-alias-parity(new vs dispatch list),check:merge-driver,check:objectui-changeset,check:spec-parsed-alias,check:type-source-resolution,check:cross-package-test-inputs,check:dev-prereqs,check:adr-0087-registration,check:changeset-no-major,check:empty-changeset,docs-audit/check-affected-docs,check:nul-bytes,check:query-options-erasure,check:type-check-coverage,check:engine-double-contract,check:where-matcher, speccheck:empty-state/check:liveness/check:strictness-ledger/check:variant-docs.Changeset:
@objectstack/specminor (public type face +1 optional member),@objectstack/metadata-protocolpatch (dead annotation arm dropped; type-level only).Generated by Claude Code