Uh oh!
There was an error while loading. Please reload this page.
feat(spec): declare organizationId on the meta-read request schemas - #9742
Conversation
…9726) The metadata-protocol implementation accepts and honours organizationId on getMetaItems / getMetaItem / getMetaItemCached — it selects the org partition in the ADR-0005 overlay read order — but none of the three request schemas declared it. Declare the member (optional string, matching the enforced shape), plus GetMetaItemLayeredRequestSchema mirroring the layered verb's inline parameter type next to its already-declared response schema. The MetadataProtocol interface member for getMetaItemLayered is deliberately NOT added: tsc proves the implementation's inline lockSource annotation carries an 'overlay' arm its producer (resolveLockState) can never emit, so declaring the member today would either widen the wire enum untruthfully or break the implementing class. Filed separately. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016D9wdJR14KKCxz1WgdAzcw
📓 Docs Drift CheckThis PR changes 1 package(s): 1 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 — 115 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 1397435ef4bd60732c5bfe79dec6fde496d01c32 && git checkout 1397435ef4bd60732c5bfe79dec6fde496d01c32
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 4d80e8bcc050919e874d6ccb629c1f9cb3b1dc0e f59cf5609e070fb4aece931d597bcac4362dae07 && git checkout -B drift-repro 4d80e8bcc050919e874d6ccb629c1f9cb3b1dc0e && git merge --no-ff f59cf5609e070fb4aece931d597bcac4362dae07
node scripts/docs-audit/affected-docs.mjs --json 4d80e8bcc050919e874d6ccb629c1f9cb3b1dc0e
|
Uh oh!
There was an error while loading. Please reload this page.
⛔ merge queue 构建失败 — 先分诊,再决定要不要重排队列构建 32186054425 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集), 失败的 job(日志抽取,best effort):
历史信号:
分诊清单:
Generated by Claude Code · merge-queue-triage workflow (#4859) |
os-elon
commented
Aug 18, 2026
Merge-queue ejection triage (spec seat,
Generated by Claude Code |
Fixes#9726
What
Declared-contract catch-up on the metadata read verbs (
packages/spec/src/api/protocol.zod.ts), matching the shapespackages/metadata-protocol/src/protocol.tsalready accepts and honours (read-only reference here — not edited):GetMetaItemsRequestSchema,GetMetaItemRequestSchema,GetMetaItemCachedRequestSchema: add optionalorganizationId(string), with.describe()docs stating what the member does — it selects the org partition in the ADR-0005 overlay read order (org overlay wins over env-wide wins over packaged artifact), i.e. it decides which tenant's row is served; on the cached verb it also enters the ETag (Org-overridable metadata (view,dashboard) is accepted with a 200state:'active'receipt but served by no read door #9454). Optionality mirrors the enforced inline types exactly (organizationId?: string); absent = environment-wide read, all three verbs.GetMetaItemLayeredRequestSchema+GetMetaItemLayeredRequest: the request shape ofGET /api/v1/meta/:type/:name/layers, mirroring the implementation's inline parameter type member for member (type,name,packageId?,organizationId?), next to the already-declared layered response schema (GET /meta/:type/:name?layers=true应答一个 spec 未声明的第三形状 —— 路由只声明了一个responseSchema#5882).getMetaItemLayered disposition (measured, per dispatch)
The request schema is folded in (same-shape catch-up: response schema and route already declared, request mirrors the enforced inline type exactly). The
MetadataProtocolinterface member is NOT added: declaring it makes tsc check the implementing class againstGetMetaItemLayeredResponse, and that check fails (TS2416, measured) on exactly one member — the implementation's inline return type annotateslockSourcewith an'overlay'arm that its only producer on that path (resolveLockState, typedMetadataLockSource | undefined, values filtered against the enum options) can never emit. Fixing that requires editing the read-only implementation file (narrow the dead annotation arm) or untruthfully widening the wire enum. Filed as unassigned follow-up #9740; a comment at the exact interface spot records the blocker. #9740 is not addressed here and remains open.REST call-site casts — follow-up material, not dropped here
The
as anycasts at the REST read doors (packages/rest/src/rest-server.ts: the list door, the cached and uncached single-item doors) cannot drop yet: each call also threads at least one still-undeclared key (previewDrafts,state,environmentId). Removing the casts is therefore not mechanical in this diff. Filed as unassigned #9741 (also not addressed here).Tests
packages/spec/src/api/protocol.test.ts: each of the four request schemas acceptsorganizationIdand preserves it through parse (the pre-change failure mode was silent stripping by the non-strict object, sosuccessalone proves nothing); stays valid without it (env-wide read); rejects non-string values; the layered request's member set is pinned against the inline type.GetMetaItemLayeredRequestpinned isomorphic (Iso853), count 839 → 840 with receipt.Verification (all at head
f59cf56)pnpm --filter @objectstack/spec test— 413 files / 10985 tests passed.pnpm --filter @objectstack/spec typecheck— green.pnpm --filter @objectstack/spec check:generated— all 13 artifacts current (api-surface, export-origins, references docs, strictness-ledger counts regenerated; authorable-surface/json-schema.manifest moved by the build).pnpm build(71 tasks green) andpnpm --workspace-concurrency=2 --filter '...@objectstack/spec' typecheck— 61 downstream consumer packages green (filter direction: consumers of spec, not dependencies).npx tsc --noEmit -p packages/metadata-protocol, no typecheck script there): 63 errors, all pre-existing ledgered test-layer debt, none naming the changed surfaces; with the interface member present the count was 64, the delta being exactly the TS2416 documented above — that measurement is the basis for leaving the member out.Changeset: minor for
@objectstack/spec(accept-set widening catch-up; no runtime behaviour change).Generated by Claude Code