Skip to content

fix(spec): stop GetMetaItemsRequestSchema.organizationId promising it is always consulted - #16523

Merged
huangyiirene merged 3 commits into
mainfrom
claude/issue-14772-getmetaitems-org-scope-describe
Sep 7, 2026
Merged

fix(spec): stop GetMetaItemsRequestSchema.organizationId promising it is always consulted#16523
huangyiirene merged 3 commits into
mainfrom
claude/issue-14772-getmetaitems-org-scope-describe

Conversation

@huangyiirene

Copy link
Copy Markdown
Collaborator

Fixes #14772

Clause-②: no — no exported symbol, no payload key, no accept-set movement. Confirmed mechanically, not asserted: see Clause ② confirmation below.

What changed

One describe() string, on GetMetaItemsRequestSchema.organizationId in packages/spec/src/api/protocol.zod.ts, plus the generated reference row it compiles into and the owed changeset. No key added, removed or renamed; no export moved; no runtime behaviour touched.

The old text opened with an unconditional "Selects the org partition in the ADR-0005 overlay read order" and closed with "Absent = environment-wide read: only env-level overlays apply and no org partition is consulted." Stating only the absent case invites the converse, and a reader completes it as present ⇒ consulted. A supplied organization is not consulted on every getMetaItems read, so that completion is false.

The correction qualifies the promise instead of implying its converse — the parameter selects the org partition when an org partition applies, and "Supplying a value does not by itself guarantee an org partition is consulted; where none applies, and whenever it is absent, the read is environment-wide and only env-level overlays apply."

Per the maintainer cap on the card (comment 5536474187): no registry clause, the flag is not named, and no new packages/spec key is added. ADR-0131 D6/D7 retires the per-organization partition wholesale, so teaching vocabulary for a mechanism with about one release to live would cost a changeset going in and another coming out. The escape hatch the maintainer offered was not needed: a true, useful sentence exists without naming the mechanism.

Scope: one row of four, deliberately

The four sibling sites share a byte-exact opening. Relocated by symbol, not by line number:

schema line found card's line drift
GetMetaItemsRequestSchema :236 :236 none — fixed here
GetMetaItemRequestSchema :271 :271 none — left alone
GetMetaItemLayeredRequestSchema :441 :441 none — left alone
GetMetaItemCachedRequestSchema :1815 :1815 none — left alone

Population grepped on the opening phrase = 4. The closing phrase returns 2, reproducing the near-miss triage recorded. Control: organizationId occurs 11 times in the file, matching the card's prediction.

The other three rows are not touched. My reading agrees with the PM's that :271 and :441 are now imprecise in the same way, and the downstream trace is in the report on the card — but widening is the maintainer's call under the ADR-0131 clock, and triage wrote the standing instruction for exactly this case: report it, do not act on it. Out of scope here: #14770 remains open, and the ETag question named on the card is untouched.

Clause ② confirmation (mechanical, two-direction)

Both gates green on this diff — and both proven able to say otherwise, on the very schema this PR edits, rather than read as a bare green.

gate on this diff under mutation restored
check:api-surface exit 0 exit 1"0 breaking (removed/narrowed), 1 added" exit 0
check:authorable-surface exit 0 exit 1 — names + api/GetMetaItemsRequest:ablationProbeKey exit 0

The mutation added a public export and a payload key to GetMetaItemsRequestSchema; each leg proved the edit reached disk (blob hash vs the HEAD blob) and, for the dist-resolved gate, reached dist/ via scripts/ablation-dist-preflight.mjs (--absent on the restore leg). Restore is proven by an empty git diff HEAD and the source blob hash returning to HEAD's, not by an exit code.

One confound found and corrected rather than reported as a pass: pnpm --filter @objectstack/spec build regenerates authorable-surface/api.json, so the first attempt at that gate's red leg was masked by its own baseline moving with the mutation. The un-confounded run mutates the source and runs the gate with no rebuild in between.

Independently, neither artifact records describe() text at all, while GetMetaItemsRequest is present in authorable-surface/api.json — so these greens mean "the gate looked at this schema and no key moved", not "the gate never looked".

Verification

  • Regenerated with the repo's own tooling only — check:generated proved content/docs/references/** the single stale artifact and --fix regenerated exactly that one. No generated artifact was hand-edited.
  • Measured regeneration footprint: 3 files — 1 tracked (content/docs/references/api/protocol.mdx, one table row) and 2 gitignored (packages/spec/json-schema/api/GetMetaItemsRequest.json, packages/spec/json-schema/objectstack.json). The gitignored half is counted, not omitted. Four further gitignored packages/spec/dist/api/* files carry the string as build output.
  • check:generated exit 0 afterwards — all 15 artifacts up to date.
  • Derived the gate families mechanically from the change set (scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack): 89 of 90 ran green, reconciled with --ran. The one unrun is check:dual-build-cjs-loads, which refused with PREREQUISITE NOT MET (exit 3, explicitly not a pass) because 33 packages have no dist/; it needs a whole-repo build and is declared to CI.
  • @objectstack/spec: typecheck exit 0; tests 483 files / 13129 passed.
  • Three gates that first returned exit 3 / a build-prerequisite refusal were re-run after building @objectstack/lint, @objectstack/formula and @objectstack/client-react; all three then genuinely measured and passed. None was recorded as a pass while unmeasured.
  • Every proof is anchored to the literal sha c383352cb752245899b6ca7e2dc7d233405113ee. origin/main moved under this container mid-run (to a5eccf9257); the anchor did not.

Draft on purpose: not flipped ready and not enqueued — that is the PM's call.


Generated by Claude Code

… is always consulted

The describe() said the parameter "Selects the org partition" unconditionally and
closed with "Absent = environment-wide read: ... no org partition is consulted",
which a reader completes as "present => consulted". A supplied organization is not
always consulted on this read, so state that directly instead of implying the
converse.

Claude-Session: https://claude.ai/code/session_01T6HeZvT9wdSJD1ZxJb5Eno
Co-authored-by: Claude <noreply@anthropic.com>
…ribe

Produced by `pnpm --filter @objectstack/spec check:generated --fix`, which proved
content/docs/references/** was the only stale artifact and regenerated only it.

Claude-Session: https://claude.ai/code/session_01T6HeZvT9wdSJD1ZxJb5Eno
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/s documentation Improvements or additions to documentation tooling labels Sep 7, 2026
@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

1 anchor(s) derived from 1 changed package(s); no hand-written page names any of them, so this run has nothing to listnot 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
  • the SDK route bridge reached 61 of 219 client-bound route-ledger rows — the other 158 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 158: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 56 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 102 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.

Coarse fallback — 130 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json a83482c5d0f689d9b855cd7c7fab23cf760c09d3packageMentionDocs.

Which tree this was computed on

This run read content/docs from cd8ea830025cec6412921e65302e1b8107280d22 — the merge of head e81ea68b46d88753e622a355c91fe7b42d7aeda1 into base a83482c5d0f689d9b855cd7c7fab23cf760c09d3, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# while this PR is open — GitHub drops the merge commit once it closes
git fetch origin cd8ea830025cec6412921e65302e1b8107280d22 && git checkout cd8ea830025cec6412921e65302e1b8107280d22
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin a83482c5d0f689d9b855cd7c7fab23cf760c09d3 e81ea68b46d88753e622a355c91fe7b42d7aeda1 && git checkout -B drift-repro a83482c5d0f689d9b855cd7c7fab23cf760c09d3 && git merge --no-ff e81ea68b46d88753e622a355c91fe7b42d7aeda1

node scripts/docs-audit/affected-docs.mjs --json a83482c5d0f689d9b855cd7c7fab23cf760c09d3

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/s tooling

Projects

None yet

2 participants