feat(spec): declare the save door's request members and de-cast the REST PUT literal (#12004) - #13599

Merged
os-warren merged 5 commits into
mainfrom
claude/issue-12004-save-meta-item-request-schema
Aug 31, 2026
Merged

feat(spec): declare the save door's request members and de-cast the REST PUT literal (#12004)#13599
os-warren merged 5 commits into
mainfrom
claude/issue-12004-save-meta-item-request-schema

Conversation

@os-warren

Copy link
Copy Markdown
Collaborator

Fixes#12004

PUT /api/v1/meta/:type/:name was the biggest remaining request-shape gap in the meta write family: saveMetaItem is a REQUIRED protocol member, but SaveMetaItemRequestSchema declared 3 of the ~11 members the REST door sends, so the call-site literal was cast as any — pure request-shape smuggling (TS2353 on every undeclared key once the cast comes off), never member-existence feature detection. This lands the #11006 maintainer-ruled pattern (2026-08-22, option B: per-member protocol-vs-transport walk, mirror the implementation's parameter type member for member) exactly as PR #12003 landed it for the audit and reset doors and PR #13521 for the history door.

Per-member verdicts (triage 2026-08-25, executed here)

MemberVerdictBasis
organizationId (optional string)DECLAREDstraight #11426/#11679-lineage; selects the ADR-0005 overlay partition and the audit-row scope; refused 403 for non-overridable types
parentVersion (optional, string or null)DECLARED, nullableimplementation declares string-or-null and, unlike the reset twin (which folds a present null back to the current hash), passes null through to the repository conflict check: null is the first-write pin, absent is unpinned last-write-wins — a real, enforced absent-vs-null distinction
actor (optional string)DECLARED#11679 lineage; recorded on the history event and audit row; the REST door's one producer is the authenticated identity, never a header
force (optional boolean)DECLAREDthe destructive-change acknowledgement (query param force=true); only object saves reach that diff
mode (optional, draft or publish)DECLARED, closed enumADR-0005 lifecycle; anything but draft (absent included) is the legacy straight-to-live default
packageId (optional, string or null)DECLARED, nullableADR-0048 binding; the absent-vs-null distinction the publish schema already documents; a named read-only base package is refused
writeFace (optional, closed enum of the three faces)DECLARED after the four-axis walk (below)server-stated per #10888 — declared because it is a real implementation parameter with three server-side producers
environmentIdNOT declaredtransport-level by the #9741 ruling; rides the rest wrapper TransportScopedMetaRequest, pinned shape-absent
sourceNOT declarednever sent by any door — its only producer is the implementation's own internal migrate call; the #11426 publish precedent leaves it out until a producer on this contract pulls it; pinned shape-absent

The writeFace walk (converged: declare)

The de-cast, and its reverse verification

The literal is now a named const typed TransportScopedMetaRequest wrapping SaveMetaItemRequest — the reset-door spelling, because this door still spreads the transport-level environmentId (long-standing wire shape, deliberately unchanged). Wire payload byte-identical: same keys, same conditional spreads, same server-stated face; the rest-server diff adds a type annotation and a comment, nothing else.

Reverse verification (predicted red, from the committed fix): a smuggledKey pasted into the literal turned the rest typecheck red with

src/rest-server.ts(5831,25): error TS2353: Object literal may only specify known properties, and 'smuggledKey' does not exist in type 'TransportScopedMetaRequest...'

and the error text prints the widened member list from the rebuilt spec dist — proving the literal compiles against the regenerated declarations, not a cache. Restore proven byte-identical: git diff HEAD empty, worktree blob hash equals the HEAD blob hash, zero grep hits for the smuggled key.

One measured behaviour pin rode along: the untouched item: z.unknown() member is key-REQUIRED at parse (absent key refused; a present explicit null parses and is then refused 400 by the implementation's own guard) — pre-existing contract behaviour, now pinned instead of silent.

Verification (all quoted verdicts from head 397d9ea; census repair at 722b069, union re-run on that final head reported on the card)

  • spec build: check-dts-emitted: @objectstack/spec - 34/34 declared declaration file(s) present. — VERDICT command-exit 0
  • spec typecheck (tsc + test-layer): check:test-typecheck: OK — @objectstack/spec's test layer compiles — VERDICT command-exit 0
  • spec targeted suites (protocol.test.ts + type-alias-convention.pin.test.ts): Test Files 2 passed (2) · Tests 181 passed (181) — the existing Iso135 isomorphism pin still holds (widening adds only optional/nullable/enum members, no defaults or transforms)
  • rest dependency graph build (turbo, 26 packages): Tasks: 25 successful, 25 total
  • rest typecheck: check:test-typecheck: OK — @objectstack/rest's test layer compiles — VERDICT command-exit 0
  • rest door suites (9 files: capability gate, compound force/mode parity, write org-scope, query multiplicity, org-scope url spelling, rest.test.ts, 4xx truncation, unknown-type refusal): 110 passed + 261 passed
  • spec generated artifacts: check:generated proved exactly one stale (content/docs/references — the new describe() rows) and --fix regenerated only it; check:authorable-surface, check:api-surface, check:export-origins, check:strictness-ledger all green (no new z.object sites, no new exports — the authorable-surface api.json picked up the seven new member rows from the rebuilt schema, as the history precedent's did)
  • system-context census: the door diff shifted eight rest-server.ts isSystem anchors (+1 import, +17 door block); --fix refused as in the history landing, anchors re-pointed by hand; check-system-context-census: OK — 109 elevation read sites in 20 packages across 45 files, all anchored; 145 anchors resolve, 27 declared non-read.
  • derived-gate union (dispatch-gates.mjs, no paths — 62 commands): first pass 56 exit-0; census repaired to green as above; check-test-completeness and check:pm-half-states exit 3 (locally unmeasurable by design — CI shard attestation and the PM board sweep); the three workspace-build-prerequisite gates re-run after a full turbo run build, and the whole union re-runs on the final head — quoted verdicts land in the card report

skip-changeset does not apply: this PR publishes a spec minor and a rest patch (changeset pair mirrors the merged history precedent).

Out of scope, untouched here: the door's 501 envelope, tenant-scoping questions, and the dispatcher door's own literals (#13598 records the adjacent runtime service-handle casts). #12004 is the only card addressed by this PR.

Generated by Claude Code


Generated by Claude Code

…EST PUT literal (wip)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PBjwYLS6BciTQW3c9xQiD2
…liberate non-declarations
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PBjwYLS6BciTQW3c9xQiD2
…ons the save-door diff shifted
check-system-context-census caught pure line rot: the new import line shifted
every site below it by +1 and the de-cast door block shifted the three sites
below it by +17. The gate's --fix refused (same population-sanity reason as
the history-door landing), so the eight anchors are rewritten by hand to the
lines the census and ledger already resolve to. Census now: 109 sites all
anchored, 145 anchors resolve, 27 declared non-read.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PBjwYLS6BciTQW3c9xQiD2
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 2 package(s): @objectstack/rest, @objectstack/spec, touching 9 documentable anchor(s). ⚠️2 changed file(s) yielded no anchor (packages/rest/src/rest-server.ts, packages/spec/authorable-surface/api.json), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

16 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: node scripts/docs-audit/affected-docs.mjs --json 3d0897459577835a78fc96a8f718eb3b139708a3.

2 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails.

What this run could not see
  • 2 changed file(s) yielded no anchor (packages/rest/src/rest-server.ts, packages/spec/authorable-surface/api.json) — pages documenting those are invisible to this run
  • the SDK route bridge reached 47 of 219 client-bound route-ledger rows — the other 172 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 172: 14 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 — 128 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 3d0897459577835a78fc96a8f718eb3b139708a3packageMentionDocs.

Which tree this was computed on

This run read content/docs from 88612888280db45443f56bed4a6c0786d8660a68 — the merge of head 722b069fa7f5c361b7d94861404e4bdd940e0264 into base 3d0897459577835a78fc96a8f718eb3b139708a3, 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 88612888280db45443f56bed4a6c0786d8660a68 && git checkout 88612888280db45443f56bed4a6c0786d8660a68
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 3d0897459577835a78fc96a8f718eb3b139708a3 722b069fa7f5c361b7d94861404e4bdd940e0264 && git checkout -B drift-repro 3d0897459577835a78fc96a8f718eb3b139708a3 && git merge --no-ff 722b069fa7f5c361b7d94861404e4bdd940e0264
node scripts/docs-audit/affected-docs.mjs --json 3d0897459577835a78fc96a8f718eb3b139708a3

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

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs 3d0897459577835a78fc96a8f718eb3b139708a3 → pass the list as
args.docs, on the commit named under Which tree this was computed on.

@os-warrenClaude

Copy link
Copy Markdown
CollaboratorAuthor

Released by maintainer instruction. Provenance: maintainer, live PM session chat, 2026-08-31 ~04:0xZ, verbatim 「pr 绿了为什么不合并」 — read as a personal release of the green parked contract-face PRs, per the recorded #12606 precedent (「12606 绿了」= personal release lifting the needs:contract-review park). Not a self-release: the dispatching seat acts on the maintainer's word, citing it here. Pre-release verification: all 36 check runs on head 722b069f completed success/skipped (zero red); PM checklist review of record: ACCEPT on #12004 (comment 5473171979), run at claude-fable-5; dispatch tier claude-fable-5 (not below CONTRACT_REVIEW_TIER); the one member carrying its own verdict (writeFace, four-axis converged to declare) is named in that review; no governed surface in the diff. Stripping needs:contract-review from both carriers, flipping ready, arming the queue. — session_01PBjwYLS6BciTQW3c9xQiD2


Generated by Claude Code

@os-warren
os-warren marked this pull request as ready for review August 31, 2026 04:07
@os-warren
os-warren enabled auto-merge August 31, 2026 04:07
@os-warren
os-warren added this pull request to the merge queueAug 31, 2026
Merged via the queue into main with commit 87075b1Aug 31, 2026
41 checks passed
@os-warren
os-warren deleted the claude/issue-12004-save-meta-item-request-schema branch August 31, 2026 04:31
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentationImprovements or additions to documentationsize/mteststooling

Projects

None yet

2 participants

@os-warren@claude
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

feat(spec): declare the save door's request members and de-cast the REST PUT literal (#12004) - #13599

Merged
os-warren merged 5 commits into
mainfrom
claude/issue-12004-save-meta-item-request-schema
Aug 31, 2026
Merged

feat(spec): declare the save door's request members and de-cast the REST PUT literal (#12004)#13599
os-warren merged 5 commits into
mainfrom
claude/issue-12004-save-meta-item-request-schema

Conversation

@os-warren

Copy link
Copy Markdown
Collaborator

Fixes#12004

PUT /api/v1/meta/:type/:name was the biggest remaining request-shape gap in the meta write family: saveMetaItem is a REQUIRED protocol member, but SaveMetaItemRequestSchema declared 3 of the ~11 members the REST door sends, so the call-site literal was cast as any — pure request-shape smuggling (TS2353 on every undeclared key once the cast comes off), never member-existence feature detection. This lands the #11006 maintainer-ruled pattern (2026-08-22, option B: per-member protocol-vs-transport walk, mirror the implementation's parameter type member for member) exactly as PR #12003 landed it for the audit and reset doors and PR #13521 for the history door.

Per-member verdicts (triage 2026-08-25, executed here)

MemberVerdictBasis
organizationId (optional string)DECLAREDstraight #11426/#11679-lineage; selects the ADR-0005 overlay partition and the audit-row scope; refused 403 for non-overridable types
parentVersion (optional, string or null)DECLARED, nullableimplementation declares string-or-null and, unlike the reset twin (which folds a present null back to the current hash), passes null through to the repository conflict check: null is the first-write pin, absent is unpinned last-write-wins — a real, enforced absent-vs-null distinction
actor (optional string)DECLARED#11679 lineage; recorded on the history event and audit row; the REST door's one producer is the authenticated identity, never a header
force (optional boolean)DECLAREDthe destructive-change acknowledgement (query param force=true); only object saves reach that diff
mode (optional, draft or publish)DECLARED, closed enumADR-0005 lifecycle; anything but draft (absent included) is the legacy straight-to-live default
packageId (optional, string or null)DECLARED, nullableADR-0048 binding; the absent-vs-null distinction the publish schema already documents; a named read-only base package is refused
writeFace (optional, closed enum of the three faces)DECLARED after the four-axis walk (below)server-stated per #10888 — declared because it is a real implementation parameter with three server-side producers
environmentIdNOT declaredtransport-level by the #9741 ruling; rides the rest wrapper TransportScopedMetaRequest, pinned shape-absent
sourceNOT declarednever sent by any door — its only producer is the implementation's own internal migrate call; the #11426 publish precedent leaves it out until a producer on this contract pulls it; pinned shape-absent

The writeFace walk (converged: declare)

The de-cast, and its reverse verification

The literal is now a named const typed TransportScopedMetaRequest wrapping SaveMetaItemRequest — the reset-door spelling, because this door still spreads the transport-level environmentId (long-standing wire shape, deliberately unchanged). Wire payload byte-identical: same keys, same conditional spreads, same server-stated face; the rest-server diff adds a type annotation and a comment, nothing else.

Reverse verification (predicted red, from the committed fix): a smuggledKey pasted into the literal turned the rest typecheck red with

src/rest-server.ts(5831,25): error TS2353: Object literal may only specify known properties, and 'smuggledKey' does not exist in type 'TransportScopedMetaRequest...'

and the error text prints the widened member list from the rebuilt spec dist — proving the literal compiles against the regenerated declarations, not a cache. Restore proven byte-identical: git diff HEAD empty, worktree blob hash equals the HEAD blob hash, zero grep hits for the smuggled key.

One measured behaviour pin rode along: the untouched item: z.unknown() member is key-REQUIRED at parse (absent key refused; a present explicit null parses and is then refused 400 by the implementation's own guard) — pre-existing contract behaviour, now pinned instead of silent.

Verification (all quoted verdicts from head 397d9ea; census repair at 722b069, union re-run on that final head reported on the card)

  • spec build: check-dts-emitted: @objectstack/spec - 34/34 declared declaration file(s) present. — VERDICT command-exit 0
  • spec typecheck (tsc + test-layer): check:test-typecheck: OK — @objectstack/spec's test layer compiles — VERDICT command-exit 0
  • spec targeted suites (protocol.test.ts + type-alias-convention.pin.test.ts): Test Files 2 passed (2) · Tests 181 passed (181) — the existing Iso135 isomorphism pin still holds (widening adds only optional/nullable/enum members, no defaults or transforms)
  • rest dependency graph build (turbo, 26 packages): Tasks: 25 successful, 25 total
  • rest typecheck: check:test-typecheck: OK — @objectstack/rest's test layer compiles — VERDICT command-exit 0
  • rest door suites (9 files: capability gate, compound force/mode parity, write org-scope, query multiplicity, org-scope url spelling, rest.test.ts, 4xx truncation, unknown-type refusal): 110 passed + 261 passed
  • spec generated artifacts: check:generated proved exactly one stale (content/docs/references — the new describe() rows) and --fix regenerated only it; check:authorable-surface, check:api-surface, check:export-origins, check:strictness-ledger all green (no new z.object sites, no new exports — the authorable-surface api.json picked up the seven new member rows from the rebuilt schema, as the history precedent's did)
  • system-context census: the door diff shifted eight rest-server.ts isSystem anchors (+1 import, +17 door block); --fix refused as in the history landing, anchors re-pointed by hand; check-system-context-census: OK — 109 elevation read sites in 20 packages across 45 files, all anchored; 145 anchors resolve, 27 declared non-read.
  • derived-gate union (dispatch-gates.mjs, no paths — 62 commands): first pass 56 exit-0; census repaired to green as above; check-test-completeness and check:pm-half-states exit 3 (locally unmeasurable by design — CI shard attestation and the PM board sweep); the three workspace-build-prerequisite gates re-run after a full turbo run build, and the whole union re-runs on the final head — quoted verdicts land in the card report

skip-changeset does not apply: this PR publishes a spec minor and a rest patch (changeset pair mirrors the merged history precedent).

Out of scope, untouched here: the door's 501 envelope, tenant-scoping questions, and the dispatcher door's own literals (#13598 records the adjacent runtime service-handle casts). #12004 is the only card addressed by this PR.

Generated by Claude Code


Generated by Claude Code

…EST PUT literal (wip)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PBjwYLS6BciTQW3c9xQiD2
…liberate non-declarations
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PBjwYLS6BciTQW3c9xQiD2
…ons the save-door diff shifted
check-system-context-census caught pure line rot: the new import line shifted
every site below it by +1 and the de-cast door block shifted the three sites
below it by +17. The gate's --fix refused (same population-sanity reason as
the history-door landing), so the eight anchors are rewritten by hand to the
lines the census and ledger already resolve to. Census now: 109 sites all
anchored, 145 anchors resolve, 27 declared non-read.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PBjwYLS6BciTQW3c9xQiD2
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 2 package(s): @objectstack/rest, @objectstack/spec, touching 9 documentable anchor(s). ⚠️2 changed file(s) yielded no anchor (packages/rest/src/rest-server.ts, packages/spec/authorable-surface/api.json), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

16 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: node scripts/docs-audit/affected-docs.mjs --json 3d0897459577835a78fc96a8f718eb3b139708a3.

2 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails.

What this run could not see
  • 2 changed file(s) yielded no anchor (packages/rest/src/rest-server.ts, packages/spec/authorable-surface/api.json) — pages documenting those are invisible to this run
  • the SDK route bridge reached 47 of 219 client-bound route-ledger rows — the other 172 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 172: 14 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 — 128 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 3d0897459577835a78fc96a8f718eb3b139708a3packageMentionDocs.

Which tree this was computed on

This run read content/docs from 88612888280db45443f56bed4a6c0786d8660a68 — the merge of head 722b069fa7f5c361b7d94861404e4bdd940e0264 into base 3d0897459577835a78fc96a8f718eb3b139708a3, 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 88612888280db45443f56bed4a6c0786d8660a68 && git checkout 88612888280db45443f56bed4a6c0786d8660a68
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 3d0897459577835a78fc96a8f718eb3b139708a3 722b069fa7f5c361b7d94861404e4bdd940e0264 && git checkout -B drift-repro 3d0897459577835a78fc96a8f718eb3b139708a3 && git merge --no-ff 722b069fa7f5c361b7d94861404e4bdd940e0264
node scripts/docs-audit/affected-docs.mjs --json 3d0897459577835a78fc96a8f718eb3b139708a3

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

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs 3d0897459577835a78fc96a8f718eb3b139708a3 → pass the list as
args.docs, on the commit named under Which tree this was computed on.

@os-warrenClaude

Copy link
Copy Markdown
CollaboratorAuthor

Released by maintainer instruction. Provenance: maintainer, live PM session chat, 2026-08-31 ~04:0xZ, verbatim 「pr 绿了为什么不合并」 — read as a personal release of the green parked contract-face PRs, per the recorded #12606 precedent (「12606 绿了」= personal release lifting the needs:contract-review park). Not a self-release: the dispatching seat acts on the maintainer's word, citing it here. Pre-release verification: all 36 check runs on head 722b069f completed success/skipped (zero red); PM checklist review of record: ACCEPT on #12004 (comment 5473171979), run at claude-fable-5; dispatch tier claude-fable-5 (not below CONTRACT_REVIEW_TIER); the one member carrying its own verdict (writeFace, four-axis converged to declare) is named in that review; no governed surface in the diff. Stripping needs:contract-review from both carriers, flipping ready, arming the queue. — session_01PBjwYLS6BciTQW3c9xQiD2


Generated by Claude Code

@os-warren
os-warren marked this pull request as ready for review August 31, 2026 04:07
@os-warren
os-warren enabled auto-merge August 31, 2026 04:07
@os-warren
os-warren added this pull request to the merge queueAug 31, 2026
Merged via the queue into main with commit 87075b1Aug 31, 2026
41 checks passed
@os-warren
os-warren deleted the claude/issue-12004-save-meta-item-request-schema branch August 31, 2026 04:31
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentationImprovements or additions to documentationsize/mteststooling

Projects

None yet

2 participants

@os-warren@claude
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

feat(spec): declare the save door's request members and de-cast the REST PUT literal (#12004) - #13599

Merged
os-warren merged 5 commits into
mainfrom
claude/issue-12004-save-meta-item-request-schema
Aug 31, 2026
Merged

feat(spec): declare the save door's request members and de-cast the REST PUT literal (#12004)#13599
os-warren merged 5 commits into
mainfrom
claude/issue-12004-save-meta-item-request-schema

Conversation

@os-warren

Copy link
Copy Markdown
Collaborator

Fixes#12004

PUT /api/v1/meta/:type/:name was the biggest remaining request-shape gap in the meta write family: saveMetaItem is a REQUIRED protocol member, but SaveMetaItemRequestSchema declared 3 of the ~11 members the REST door sends, so the call-site literal was cast as any — pure request-shape smuggling (TS2353 on every undeclared key once the cast comes off), never member-existence feature detection. This lands the #11006 maintainer-ruled pattern (2026-08-22, option B: per-member protocol-vs-transport walk, mirror the implementation's parameter type member for member) exactly as PR #12003 landed it for the audit and reset doors and PR #13521 for the history door.

Per-member verdicts (triage 2026-08-25, executed here)

MemberVerdictBasis
organizationId (optional string)DECLAREDstraight #11426/#11679-lineage; selects the ADR-0005 overlay partition and the audit-row scope; refused 403 for non-overridable types
parentVersion (optional, string or null)DECLARED, nullableimplementation declares string-or-null and, unlike the reset twin (which folds a present null back to the current hash), passes null through to the repository conflict check: null is the first-write pin, absent is unpinned last-write-wins — a real, enforced absent-vs-null distinction
actor (optional string)DECLARED#11679 lineage; recorded on the history event and audit row; the REST door's one producer is the authenticated identity, never a header
force (optional boolean)DECLAREDthe destructive-change acknowledgement (query param force=true); only object saves reach that diff
mode (optional, draft or publish)DECLARED, closed enumADR-0005 lifecycle; anything but draft (absent included) is the legacy straight-to-live default
packageId (optional, string or null)DECLARED, nullableADR-0048 binding; the absent-vs-null distinction the publish schema already documents; a named read-only base package is refused
writeFace (optional, closed enum of the three faces)DECLARED after the four-axis walk (below)server-stated per #10888 — declared because it is a real implementation parameter with three server-side producers
environmentIdNOT declaredtransport-level by the #9741 ruling; rides the rest wrapper TransportScopedMetaRequest, pinned shape-absent
sourceNOT declarednever sent by any door — its only producer is the implementation's own internal migrate call; the #11426 publish precedent leaves it out until a producer on this contract pulls it; pinned shape-absent

The writeFace walk (converged: declare)

The de-cast, and its reverse verification

The literal is now a named const typed TransportScopedMetaRequest wrapping SaveMetaItemRequest — the reset-door spelling, because this door still spreads the transport-level environmentId (long-standing wire shape, deliberately unchanged). Wire payload byte-identical: same keys, same conditional spreads, same server-stated face; the rest-server diff adds a type annotation and a comment, nothing else.

Reverse verification (predicted red, from the committed fix): a smuggledKey pasted into the literal turned the rest typecheck red with

src/rest-server.ts(5831,25): error TS2353: Object literal may only specify known properties, and 'smuggledKey' does not exist in type 'TransportScopedMetaRequest...'

and the error text prints the widened member list from the rebuilt spec dist — proving the literal compiles against the regenerated declarations, not a cache. Restore proven byte-identical: git diff HEAD empty, worktree blob hash equals the HEAD blob hash, zero grep hits for the smuggled key.

One measured behaviour pin rode along: the untouched item: z.unknown() member is key-REQUIRED at parse (absent key refused; a present explicit null parses and is then refused 400 by the implementation's own guard) — pre-existing contract behaviour, now pinned instead of silent.

Verification (all quoted verdicts from head 397d9ea; census repair at 722b069, union re-run on that final head reported on the card)

  • spec build: check-dts-emitted: @objectstack/spec - 34/34 declared declaration file(s) present. — VERDICT command-exit 0
  • spec typecheck (tsc + test-layer): check:test-typecheck: OK — @objectstack/spec's test layer compiles — VERDICT command-exit 0
  • spec targeted suites (protocol.test.ts + type-alias-convention.pin.test.ts): Test Files 2 passed (2) · Tests 181 passed (181) — the existing Iso135 isomorphism pin still holds (widening adds only optional/nullable/enum members, no defaults or transforms)
  • rest dependency graph build (turbo, 26 packages): Tasks: 25 successful, 25 total
  • rest typecheck: check:test-typecheck: OK — @objectstack/rest's test layer compiles — VERDICT command-exit 0
  • rest door suites (9 files: capability gate, compound force/mode parity, write org-scope, query multiplicity, org-scope url spelling, rest.test.ts, 4xx truncation, unknown-type refusal): 110 passed + 261 passed
  • spec generated artifacts: check:generated proved exactly one stale (content/docs/references — the new describe() rows) and --fix regenerated only it; check:authorable-surface, check:api-surface, check:export-origins, check:strictness-ledger all green (no new z.object sites, no new exports — the authorable-surface api.json picked up the seven new member rows from the rebuilt schema, as the history precedent's did)
  • system-context census: the door diff shifted eight rest-server.ts isSystem anchors (+1 import, +17 door block); --fix refused as in the history landing, anchors re-pointed by hand; check-system-context-census: OK — 109 elevation read sites in 20 packages across 45 files, all anchored; 145 anchors resolve, 27 declared non-read.
  • derived-gate union (dispatch-gates.mjs, no paths — 62 commands): first pass 56 exit-0; census repaired to green as above; check-test-completeness and check:pm-half-states exit 3 (locally unmeasurable by design — CI shard attestation and the PM board sweep); the three workspace-build-prerequisite gates re-run after a full turbo run build, and the whole union re-runs on the final head — quoted verdicts land in the card report

skip-changeset does not apply: this PR publishes a spec minor and a rest patch (changeset pair mirrors the merged history precedent).

Out of scope, untouched here: the door's 501 envelope, tenant-scoping questions, and the dispatcher door's own literals (#13598 records the adjacent runtime service-handle casts). #12004 is the only card addressed by this PR.

Generated by Claude Code


Generated by Claude Code

…EST PUT literal (wip)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PBjwYLS6BciTQW3c9xQiD2
…liberate non-declarations
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PBjwYLS6BciTQW3c9xQiD2
…ons the save-door diff shifted
check-system-context-census caught pure line rot: the new import line shifted
every site below it by +1 and the de-cast door block shifted the three sites
below it by +17. The gate's --fix refused (same population-sanity reason as
the history-door landing), so the eight anchors are rewritten by hand to the
lines the census and ledger already resolve to. Census now: 109 sites all
anchored, 145 anchors resolve, 27 declared non-read.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PBjwYLS6BciTQW3c9xQiD2
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 2 package(s): @objectstack/rest, @objectstack/spec, touching 9 documentable anchor(s). ⚠️2 changed file(s) yielded no anchor (packages/rest/src/rest-server.ts, packages/spec/authorable-surface/api.json), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

16 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: node scripts/docs-audit/affected-docs.mjs --json 3d0897459577835a78fc96a8f718eb3b139708a3.

2 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails.

What this run could not see
  • 2 changed file(s) yielded no anchor (packages/rest/src/rest-server.ts, packages/spec/authorable-surface/api.json) — pages documenting those are invisible to this run
  • the SDK route bridge reached 47 of 219 client-bound route-ledger rows — the other 172 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 172: 14 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 — 128 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 3d0897459577835a78fc96a8f718eb3b139708a3packageMentionDocs.

Which tree this was computed on

This run read content/docs from 88612888280db45443f56bed4a6c0786d8660a68 — the merge of head 722b069fa7f5c361b7d94861404e4bdd940e0264 into base 3d0897459577835a78fc96a8f718eb3b139708a3, 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 88612888280db45443f56bed4a6c0786d8660a68 && git checkout 88612888280db45443f56bed4a6c0786d8660a68
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 3d0897459577835a78fc96a8f718eb3b139708a3 722b069fa7f5c361b7d94861404e4bdd940e0264 && git checkout -B drift-repro 3d0897459577835a78fc96a8f718eb3b139708a3 && git merge --no-ff 722b069fa7f5c361b7d94861404e4bdd940e0264
node scripts/docs-audit/affected-docs.mjs --json 3d0897459577835a78fc96a8f718eb3b139708a3

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

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs 3d0897459577835a78fc96a8f718eb3b139708a3 → pass the list as
args.docs, on the commit named under Which tree this was computed on.

@os-warrenClaude

Copy link
Copy Markdown
CollaboratorAuthor

Released by maintainer instruction. Provenance: maintainer, live PM session chat, 2026-08-31 ~04:0xZ, verbatim 「pr 绿了为什么不合并」 — read as a personal release of the green parked contract-face PRs, per the recorded #12606 precedent (「12606 绿了」= personal release lifting the needs:contract-review park). Not a self-release: the dispatching seat acts on the maintainer's word, citing it here. Pre-release verification: all 36 check runs on head 722b069f completed success/skipped (zero red); PM checklist review of record: ACCEPT on #12004 (comment 5473171979), run at claude-fable-5; dispatch tier claude-fable-5 (not below CONTRACT_REVIEW_TIER); the one member carrying its own verdict (writeFace, four-axis converged to declare) is named in that review; no governed surface in the diff. Stripping needs:contract-review from both carriers, flipping ready, arming the queue. — session_01PBjwYLS6BciTQW3c9xQiD2


Generated by Claude Code

@os-warren
os-warren marked this pull request as ready for review August 31, 2026 04:07
@os-warren
os-warren enabled auto-merge August 31, 2026 04:07
@os-warren
os-warren added this pull request to the merge queueAug 31, 2026
Merged via the queue into main with commit 87075b1Aug 31, 2026
41 checks passed
@os-warren
os-warren deleted the claude/issue-12004-save-meta-item-request-schema branch August 31, 2026 04:31
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentationImprovements or additions to documentationsize/mteststooling

Projects

None yet

2 participants

@os-warren@claude
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

feat(spec): declare the save door's request members and de-cast the REST PUT literal (#12004) - #13599

Merged
os-warren merged 5 commits into
mainfrom
claude/issue-12004-save-meta-item-request-schema
Aug 31, 2026
Merged

feat(spec): declare the save door's request members and de-cast the REST PUT literal (#12004)#13599
os-warren merged 5 commits into
mainfrom
claude/issue-12004-save-meta-item-request-schema

Conversation

@os-warren

Copy link
Copy Markdown
Collaborator

Fixes#12004

PUT /api/v1/meta/:type/:name was the biggest remaining request-shape gap in the meta write family: saveMetaItem is a REQUIRED protocol member, but SaveMetaItemRequestSchema declared 3 of the ~11 members the REST door sends, so the call-site literal was cast as any — pure request-shape smuggling (TS2353 on every undeclared key once the cast comes off), never member-existence feature detection. This lands the #11006 maintainer-ruled pattern (2026-08-22, option B: per-member protocol-vs-transport walk, mirror the implementation's parameter type member for member) exactly as PR #12003 landed it for the audit and reset doors and PR #13521 for the history door.

Per-member verdicts (triage 2026-08-25, executed here)

MemberVerdictBasis
organizationId (optional string)DECLAREDstraight #11426/#11679-lineage; selects the ADR-0005 overlay partition and the audit-row scope; refused 403 for non-overridable types
parentVersion (optional, string or null)DECLARED, nullableimplementation declares string-or-null and, unlike the reset twin (which folds a present null back to the current hash), passes null through to the repository conflict check: null is the first-write pin, absent is unpinned last-write-wins — a real, enforced absent-vs-null distinction
actor (optional string)DECLARED#11679 lineage; recorded on the history event and audit row; the REST door's one producer is the authenticated identity, never a header
force (optional boolean)DECLAREDthe destructive-change acknowledgement (query param force=true); only object saves reach that diff
mode (optional, draft or publish)DECLARED, closed enumADR-0005 lifecycle; anything but draft (absent included) is the legacy straight-to-live default
packageId (optional, string or null)DECLARED, nullableADR-0048 binding; the absent-vs-null distinction the publish schema already documents; a named read-only base package is refused
writeFace (optional, closed enum of the three faces)DECLARED after the four-axis walk (below)server-stated per #10888 — declared because it is a real implementation parameter with three server-side producers
environmentIdNOT declaredtransport-level by the #9741 ruling; rides the rest wrapper TransportScopedMetaRequest, pinned shape-absent
sourceNOT declarednever sent by any door — its only producer is the implementation's own internal migrate call; the #11426 publish precedent leaves it out until a producer on this contract pulls it; pinned shape-absent

The writeFace walk (converged: declare)

The de-cast, and its reverse verification

The literal is now a named const typed TransportScopedMetaRequest wrapping SaveMetaItemRequest — the reset-door spelling, because this door still spreads the transport-level environmentId (long-standing wire shape, deliberately unchanged). Wire payload byte-identical: same keys, same conditional spreads, same server-stated face; the rest-server diff adds a type annotation and a comment, nothing else.

Reverse verification (predicted red, from the committed fix): a smuggledKey pasted into the literal turned the rest typecheck red with

src/rest-server.ts(5831,25): error TS2353: Object literal may only specify known properties, and 'smuggledKey' does not exist in type 'TransportScopedMetaRequest...'

and the error text prints the widened member list from the rebuilt spec dist — proving the literal compiles against the regenerated declarations, not a cache. Restore proven byte-identical: git diff HEAD empty, worktree blob hash equals the HEAD blob hash, zero grep hits for the smuggled key.

One measured behaviour pin rode along: the untouched item: z.unknown() member is key-REQUIRED at parse (absent key refused; a present explicit null parses and is then refused 400 by the implementation's own guard) — pre-existing contract behaviour, now pinned instead of silent.

Verification (all quoted verdicts from head 397d9ea; census repair at 722b069, union re-run on that final head reported on the card)

  • spec build: check-dts-emitted: @objectstack/spec - 34/34 declared declaration file(s) present. — VERDICT command-exit 0
  • spec typecheck (tsc + test-layer): check:test-typecheck: OK — @objectstack/spec's test layer compiles — VERDICT command-exit 0
  • spec targeted suites (protocol.test.ts + type-alias-convention.pin.test.ts): Test Files 2 passed (2) · Tests 181 passed (181) — the existing Iso135 isomorphism pin still holds (widening adds only optional/nullable/enum members, no defaults or transforms)
  • rest dependency graph build (turbo, 26 packages): Tasks: 25 successful, 25 total
  • rest typecheck: check:test-typecheck: OK — @objectstack/rest's test layer compiles — VERDICT command-exit 0
  • rest door suites (9 files: capability gate, compound force/mode parity, write org-scope, query multiplicity, org-scope url spelling, rest.test.ts, 4xx truncation, unknown-type refusal): 110 passed + 261 passed
  • spec generated artifacts: check:generated proved exactly one stale (content/docs/references — the new describe() rows) and --fix regenerated only it; check:authorable-surface, check:api-surface, check:export-origins, check:strictness-ledger all green (no new z.object sites, no new exports — the authorable-surface api.json picked up the seven new member rows from the rebuilt schema, as the history precedent's did)
  • system-context census: the door diff shifted eight rest-server.ts isSystem anchors (+1 import, +17 door block); --fix refused as in the history landing, anchors re-pointed by hand; check-system-context-census: OK — 109 elevation read sites in 20 packages across 45 files, all anchored; 145 anchors resolve, 27 declared non-read.
  • derived-gate union (dispatch-gates.mjs, no paths — 62 commands): first pass 56 exit-0; census repaired to green as above; check-test-completeness and check:pm-half-states exit 3 (locally unmeasurable by design — CI shard attestation and the PM board sweep); the three workspace-build-prerequisite gates re-run after a full turbo run build, and the whole union re-runs on the final head — quoted verdicts land in the card report

skip-changeset does not apply: this PR publishes a spec minor and a rest patch (changeset pair mirrors the merged history precedent).

Out of scope, untouched here: the door's 501 envelope, tenant-scoping questions, and the dispatcher door's own literals (#13598 records the adjacent runtime service-handle casts). #12004 is the only card addressed by this PR.

Generated by Claude Code


Generated by Claude Code

…EST PUT literal (wip)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PBjwYLS6BciTQW3c9xQiD2
…liberate non-declarations
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PBjwYLS6BciTQW3c9xQiD2
…ons the save-door diff shifted
check-system-context-census caught pure line rot: the new import line shifted
every site below it by +1 and the de-cast door block shifted the three sites
below it by +17. The gate's --fix refused (same population-sanity reason as
the history-door landing), so the eight anchors are rewritten by hand to the
lines the census and ledger already resolve to. Census now: 109 sites all
anchored, 145 anchors resolve, 27 declared non-read.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PBjwYLS6BciTQW3c9xQiD2
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 2 package(s): @objectstack/rest, @objectstack/spec, touching 9 documentable anchor(s). ⚠️2 changed file(s) yielded no anchor (packages/rest/src/rest-server.ts, packages/spec/authorable-surface/api.json), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

16 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: node scripts/docs-audit/affected-docs.mjs --json 3d0897459577835a78fc96a8f718eb3b139708a3.

2 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails.

What this run could not see
  • 2 changed file(s) yielded no anchor (packages/rest/src/rest-server.ts, packages/spec/authorable-surface/api.json) — pages documenting those are invisible to this run
  • the SDK route bridge reached 47 of 219 client-bound route-ledger rows — the other 172 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 172: 14 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 — 128 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 3d0897459577835a78fc96a8f718eb3b139708a3packageMentionDocs.

Which tree this was computed on

This run read content/docs from 88612888280db45443f56bed4a6c0786d8660a68 — the merge of head 722b069fa7f5c361b7d94861404e4bdd940e0264 into base 3d0897459577835a78fc96a8f718eb3b139708a3, 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 88612888280db45443f56bed4a6c0786d8660a68 && git checkout 88612888280db45443f56bed4a6c0786d8660a68
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 3d0897459577835a78fc96a8f718eb3b139708a3 722b069fa7f5c361b7d94861404e4bdd940e0264 && git checkout -B drift-repro 3d0897459577835a78fc96a8f718eb3b139708a3 && git merge --no-ff 722b069fa7f5c361b7d94861404e4bdd940e0264
node scripts/docs-audit/affected-docs.mjs --json 3d0897459577835a78fc96a8f718eb3b139708a3

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

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs 3d0897459577835a78fc96a8f718eb3b139708a3 → pass the list as
args.docs, on the commit named under Which tree this was computed on.

@os-warrenClaude

Copy link
Copy Markdown
CollaboratorAuthor

Released by maintainer instruction. Provenance: maintainer, live PM session chat, 2026-08-31 ~04:0xZ, verbatim 「pr 绿了为什么不合并」 — read as a personal release of the green parked contract-face PRs, per the recorded #12606 precedent (「12606 绿了」= personal release lifting the needs:contract-review park). Not a self-release: the dispatching seat acts on the maintainer's word, citing it here. Pre-release verification: all 36 check runs on head 722b069f completed success/skipped (zero red); PM checklist review of record: ACCEPT on #12004 (comment 5473171979), run at claude-fable-5; dispatch tier claude-fable-5 (not below CONTRACT_REVIEW_TIER); the one member carrying its own verdict (writeFace, four-axis converged to declare) is named in that review; no governed surface in the diff. Stripping needs:contract-review from both carriers, flipping ready, arming the queue. — session_01PBjwYLS6BciTQW3c9xQiD2


Generated by Claude Code

@os-warren
os-warren marked this pull request as ready for review August 31, 2026 04:07
@os-warren
os-warren enabled auto-merge August 31, 2026 04:07
@os-warren
os-warren added this pull request to the merge queueAug 31, 2026
Merged via the queue into main with commit 87075b1Aug 31, 2026
41 checks passed
@os-warren
os-warren deleted the claude/issue-12004-save-meta-item-request-schema branch August 31, 2026 04:31
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentationImprovements or additions to documentationsize/mteststooling

Projects

None yet

2 participants

@os-warren@claude
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

feat(spec): declare the save door's request members and de-cast the REST PUT literal (#12004) - #13599

Merged
os-warren merged 5 commits into
mainfrom
claude/issue-12004-save-meta-item-request-schema
Aug 31, 2026
Merged

feat(spec): declare the save door's request members and de-cast the REST PUT literal (#12004)#13599
os-warren merged 5 commits into
mainfrom
claude/issue-12004-save-meta-item-request-schema

Conversation

@os-warren

Copy link
Copy Markdown
Collaborator

Fixes#12004

PUT /api/v1/meta/:type/:name was the biggest remaining request-shape gap in the meta write family: saveMetaItem is a REQUIRED protocol member, but SaveMetaItemRequestSchema declared 3 of the ~11 members the REST door sends, so the call-site literal was cast as any — pure request-shape smuggling (TS2353 on every undeclared key once the cast comes off), never member-existence feature detection. This lands the #11006 maintainer-ruled pattern (2026-08-22, option B: per-member protocol-vs-transport walk, mirror the implementation's parameter type member for member) exactly as PR #12003 landed it for the audit and reset doors and PR #13521 for the history door.

Per-member verdicts (triage 2026-08-25, executed here)

MemberVerdictBasis
organizationId (optional string)DECLAREDstraight #11426/#11679-lineage; selects the ADR-0005 overlay partition and the audit-row scope; refused 403 for non-overridable types
parentVersion (optional, string or null)DECLARED, nullableimplementation declares string-or-null and, unlike the reset twin (which folds a present null back to the current hash), passes null through to the repository conflict check: null is the first-write pin, absent is unpinned last-write-wins — a real, enforced absent-vs-null distinction
actor (optional string)DECLARED#11679 lineage; recorded on the history event and audit row; the REST door's one producer is the authenticated identity, never a header
force (optional boolean)DECLAREDthe destructive-change acknowledgement (query param force=true); only object saves reach that diff
mode (optional, draft or publish)DECLARED, closed enumADR-0005 lifecycle; anything but draft (absent included) is the legacy straight-to-live default
packageId (optional, string or null)DECLARED, nullableADR-0048 binding; the absent-vs-null distinction the publish schema already documents; a named read-only base package is refused
writeFace (optional, closed enum of the three faces)DECLARED after the four-axis walk (below)server-stated per #10888 — declared because it is a real implementation parameter with three server-side producers
environmentIdNOT declaredtransport-level by the #9741 ruling; rides the rest wrapper TransportScopedMetaRequest, pinned shape-absent
sourceNOT declarednever sent by any door — its only producer is the implementation's own internal migrate call; the #11426 publish precedent leaves it out until a producer on this contract pulls it; pinned shape-absent

The writeFace walk (converged: declare)

The de-cast, and its reverse verification

The literal is now a named const typed TransportScopedMetaRequest wrapping SaveMetaItemRequest — the reset-door spelling, because this door still spreads the transport-level environmentId (long-standing wire shape, deliberately unchanged). Wire payload byte-identical: same keys, same conditional spreads, same server-stated face; the rest-server diff adds a type annotation and a comment, nothing else.

Reverse verification (predicted red, from the committed fix): a smuggledKey pasted into the literal turned the rest typecheck red with

src/rest-server.ts(5831,25): error TS2353: Object literal may only specify known properties, and 'smuggledKey' does not exist in type 'TransportScopedMetaRequest...'

and the error text prints the widened member list from the rebuilt spec dist — proving the literal compiles against the regenerated declarations, not a cache. Restore proven byte-identical: git diff HEAD empty, worktree blob hash equals the HEAD blob hash, zero grep hits for the smuggled key.

One measured behaviour pin rode along: the untouched item: z.unknown() member is key-REQUIRED at parse (absent key refused; a present explicit null parses and is then refused 400 by the implementation's own guard) — pre-existing contract behaviour, now pinned instead of silent.

Verification (all quoted verdicts from head 397d9ea; census repair at 722b069, union re-run on that final head reported on the card)

  • spec build: check-dts-emitted: @objectstack/spec - 34/34 declared declaration file(s) present. — VERDICT command-exit 0
  • spec typecheck (tsc + test-layer): check:test-typecheck: OK — @objectstack/spec's test layer compiles — VERDICT command-exit 0
  • spec targeted suites (protocol.test.ts + type-alias-convention.pin.test.ts): Test Files 2 passed (2) · Tests 181 passed (181) — the existing Iso135 isomorphism pin still holds (widening adds only optional/nullable/enum members, no defaults or transforms)
  • rest dependency graph build (turbo, 26 packages): Tasks: 25 successful, 25 total
  • rest typecheck: check:test-typecheck: OK — @objectstack/rest's test layer compiles — VERDICT command-exit 0
  • rest door suites (9 files: capability gate, compound force/mode parity, write org-scope, query multiplicity, org-scope url spelling, rest.test.ts, 4xx truncation, unknown-type refusal): 110 passed + 261 passed
  • spec generated artifacts: check:generated proved exactly one stale (content/docs/references — the new describe() rows) and --fix regenerated only it; check:authorable-surface, check:api-surface, check:export-origins, check:strictness-ledger all green (no new z.object sites, no new exports — the authorable-surface api.json picked up the seven new member rows from the rebuilt schema, as the history precedent's did)
  • system-context census: the door diff shifted eight rest-server.ts isSystem anchors (+1 import, +17 door block); --fix refused as in the history landing, anchors re-pointed by hand; check-system-context-census: OK — 109 elevation read sites in 20 packages across 45 files, all anchored; 145 anchors resolve, 27 declared non-read.
  • derived-gate union (dispatch-gates.mjs, no paths — 62 commands): first pass 56 exit-0; census repaired to green as above; check-test-completeness and check:pm-half-states exit 3 (locally unmeasurable by design — CI shard attestation and the PM board sweep); the three workspace-build-prerequisite gates re-run after a full turbo run build, and the whole union re-runs on the final head — quoted verdicts land in the card report

skip-changeset does not apply: this PR publishes a spec minor and a rest patch (changeset pair mirrors the merged history precedent).

Out of scope, untouched here: the door's 501 envelope, tenant-scoping questions, and the dispatcher door's own literals (#13598 records the adjacent runtime service-handle casts). #12004 is the only card addressed by this PR.

Generated by Claude Code


Generated by Claude Code

…EST PUT literal (wip)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PBjwYLS6BciTQW3c9xQiD2
…liberate non-declarations
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PBjwYLS6BciTQW3c9xQiD2
…ons the save-door diff shifted
check-system-context-census caught pure line rot: the new import line shifted
every site below it by +1 and the de-cast door block shifted the three sites
below it by +17. The gate's --fix refused (same population-sanity reason as
the history-door landing), so the eight anchors are rewritten by hand to the
lines the census and ledger already resolve to. Census now: 109 sites all
anchored, 145 anchors resolve, 27 declared non-read.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PBjwYLS6BciTQW3c9xQiD2
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 2 package(s): @objectstack/rest, @objectstack/spec, touching 9 documentable anchor(s). ⚠️2 changed file(s) yielded no anchor (packages/rest/src/rest-server.ts, packages/spec/authorable-surface/api.json), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

16 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: node scripts/docs-audit/affected-docs.mjs --json 3d0897459577835a78fc96a8f718eb3b139708a3.

2 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails.

What this run could not see
  • 2 changed file(s) yielded no anchor (packages/rest/src/rest-server.ts, packages/spec/authorable-surface/api.json) — pages documenting those are invisible to this run
  • the SDK route bridge reached 47 of 219 client-bound route-ledger rows — the other 172 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 172: 14 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 — 128 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 3d0897459577835a78fc96a8f718eb3b139708a3packageMentionDocs.

Which tree this was computed on

This run read content/docs from 88612888280db45443f56bed4a6c0786d8660a68 — the merge of head 722b069fa7f5c361b7d94861404e4bdd940e0264 into base 3d0897459577835a78fc96a8f718eb3b139708a3, 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 88612888280db45443f56bed4a6c0786d8660a68 && git checkout 88612888280db45443f56bed4a6c0786d8660a68
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 3d0897459577835a78fc96a8f718eb3b139708a3 722b069fa7f5c361b7d94861404e4bdd940e0264 && git checkout -B drift-repro 3d0897459577835a78fc96a8f718eb3b139708a3 && git merge --no-ff 722b069fa7f5c361b7d94861404e4bdd940e0264
node scripts/docs-audit/affected-docs.mjs --json 3d0897459577835a78fc96a8f718eb3b139708a3

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

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs 3d0897459577835a78fc96a8f718eb3b139708a3 → pass the list as
args.docs, on the commit named under Which tree this was computed on.

@os-warrenClaude

Copy link
Copy Markdown
CollaboratorAuthor

Released by maintainer instruction. Provenance: maintainer, live PM session chat, 2026-08-31 ~04:0xZ, verbatim 「pr 绿了为什么不合并」 — read as a personal release of the green parked contract-face PRs, per the recorded #12606 precedent (「12606 绿了」= personal release lifting the needs:contract-review park). Not a self-release: the dispatching seat acts on the maintainer's word, citing it here. Pre-release verification: all 36 check runs on head 722b069f completed success/skipped (zero red); PM checklist review of record: ACCEPT on #12004 (comment 5473171979), run at claude-fable-5; dispatch tier claude-fable-5 (not below CONTRACT_REVIEW_TIER); the one member carrying its own verdict (writeFace, four-axis converged to declare) is named in that review; no governed surface in the diff. Stripping needs:contract-review from both carriers, flipping ready, arming the queue. — session_01PBjwYLS6BciTQW3c9xQiD2


Generated by Claude Code

@os-warren
os-warren marked this pull request as ready for review August 31, 2026 04:07
@os-warren
os-warren enabled auto-merge August 31, 2026 04:07
@os-warren
os-warren added this pull request to the merge queueAug 31, 2026
Merged via the queue into main with commit 87075b1Aug 31, 2026
41 checks passed
@os-warren
os-warren deleted the claude/issue-12004-save-meta-item-request-schema branch August 31, 2026 04:31
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentationImprovements or additions to documentationsize/mteststooling

Projects

None yet

2 participants

@os-warren@claude
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

feat(spec): declare the save door's request members and de-cast the REST PUT literal (#12004) - #13599

Merged
os-warren merged 5 commits into
mainfrom
claude/issue-12004-save-meta-item-request-schema
Aug 31, 2026
Merged

feat(spec): declare the save door's request members and de-cast the REST PUT literal (#12004)#13599
os-warren merged 5 commits into
mainfrom
claude/issue-12004-save-meta-item-request-schema

Conversation

@os-warren

Copy link
Copy Markdown
Collaborator

Fixes#12004

PUT /api/v1/meta/:type/:name was the biggest remaining request-shape gap in the meta write family: saveMetaItem is a REQUIRED protocol member, but SaveMetaItemRequestSchema declared 3 of the ~11 members the REST door sends, so the call-site literal was cast as any — pure request-shape smuggling (TS2353 on every undeclared key once the cast comes off), never member-existence feature detection. This lands the #11006 maintainer-ruled pattern (2026-08-22, option B: per-member protocol-vs-transport walk, mirror the implementation's parameter type member for member) exactly as PR #12003 landed it for the audit and reset doors and PR #13521 for the history door.

Per-member verdicts (triage 2026-08-25, executed here)

MemberVerdictBasis
organizationId (optional string)DECLAREDstraight #11426/#11679-lineage; selects the ADR-0005 overlay partition and the audit-row scope; refused 403 for non-overridable types
parentVersion (optional, string or null)DECLARED, nullableimplementation declares string-or-null and, unlike the reset twin (which folds a present null back to the current hash), passes null through to the repository conflict check: null is the first-write pin, absent is unpinned last-write-wins — a real, enforced absent-vs-null distinction
actor (optional string)DECLARED#11679 lineage; recorded on the history event and audit row; the REST door's one producer is the authenticated identity, never a header
force (optional boolean)DECLAREDthe destructive-change acknowledgement (query param force=true); only object saves reach that diff
mode (optional, draft or publish)DECLARED, closed enumADR-0005 lifecycle; anything but draft (absent included) is the legacy straight-to-live default
packageId (optional, string or null)DECLARED, nullableADR-0048 binding; the absent-vs-null distinction the publish schema already documents; a named read-only base package is refused
writeFace (optional, closed enum of the three faces)DECLARED after the four-axis walk (below)server-stated per #10888 — declared because it is a real implementation parameter with three server-side producers
environmentIdNOT declaredtransport-level by the #9741 ruling; rides the rest wrapper TransportScopedMetaRequest, pinned shape-absent
sourceNOT declarednever sent by any door — its only producer is the implementation's own internal migrate call; the #11426 publish precedent leaves it out until a producer on this contract pulls it; pinned shape-absent

The writeFace walk (converged: declare)

The de-cast, and its reverse verification

The literal is now a named const typed TransportScopedMetaRequest wrapping SaveMetaItemRequest — the reset-door spelling, because this door still spreads the transport-level environmentId (long-standing wire shape, deliberately unchanged). Wire payload byte-identical: same keys, same conditional spreads, same server-stated face; the rest-server diff adds a type annotation and a comment, nothing else.

Reverse verification (predicted red, from the committed fix): a smuggledKey pasted into the literal turned the rest typecheck red with

src/rest-server.ts(5831,25): error TS2353: Object literal may only specify known properties, and 'smuggledKey' does not exist in type 'TransportScopedMetaRequest...'

and the error text prints the widened member list from the rebuilt spec dist — proving the literal compiles against the regenerated declarations, not a cache. Restore proven byte-identical: git diff HEAD empty, worktree blob hash equals the HEAD blob hash, zero grep hits for the smuggled key.

One measured behaviour pin rode along: the untouched item: z.unknown() member is key-REQUIRED at parse (absent key refused; a present explicit null parses and is then refused 400 by the implementation's own guard) — pre-existing contract behaviour, now pinned instead of silent.

Verification (all quoted verdicts from head 397d9ea; census repair at 722b069, union re-run on that final head reported on the card)

  • spec build: check-dts-emitted: @objectstack/spec - 34/34 declared declaration file(s) present. — VERDICT command-exit 0
  • spec typecheck (tsc + test-layer): check:test-typecheck: OK — @objectstack/spec's test layer compiles — VERDICT command-exit 0
  • spec targeted suites (protocol.test.ts + type-alias-convention.pin.test.ts): Test Files 2 passed (2) · Tests 181 passed (181) — the existing Iso135 isomorphism pin still holds (widening adds only optional/nullable/enum members, no defaults or transforms)
  • rest dependency graph build (turbo, 26 packages): Tasks: 25 successful, 25 total
  • rest typecheck: check:test-typecheck: OK — @objectstack/rest's test layer compiles — VERDICT command-exit 0
  • rest door suites (9 files: capability gate, compound force/mode parity, write org-scope, query multiplicity, org-scope url spelling, rest.test.ts, 4xx truncation, unknown-type refusal): 110 passed + 261 passed
  • spec generated artifacts: check:generated proved exactly one stale (content/docs/references — the new describe() rows) and --fix regenerated only it; check:authorable-surface, check:api-surface, check:export-origins, check:strictness-ledger all green (no new z.object sites, no new exports — the authorable-surface api.json picked up the seven new member rows from the rebuilt schema, as the history precedent's did)
  • system-context census: the door diff shifted eight rest-server.ts isSystem anchors (+1 import, +17 door block); --fix refused as in the history landing, anchors re-pointed by hand; check-system-context-census: OK — 109 elevation read sites in 20 packages across 45 files, all anchored; 145 anchors resolve, 27 declared non-read.
  • derived-gate union (dispatch-gates.mjs, no paths — 62 commands): first pass 56 exit-0; census repaired to green as above; check-test-completeness and check:pm-half-states exit 3 (locally unmeasurable by design — CI shard attestation and the PM board sweep); the three workspace-build-prerequisite gates re-run after a full turbo run build, and the whole union re-runs on the final head — quoted verdicts land in the card report

skip-changeset does not apply: this PR publishes a spec minor and a rest patch (changeset pair mirrors the merged history precedent).

Out of scope, untouched here: the door's 501 envelope, tenant-scoping questions, and the dispatcher door's own literals (#13598 records the adjacent runtime service-handle casts). #12004 is the only card addressed by this PR.

Generated by Claude Code


Generated by Claude Code

…EST PUT literal (wip)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PBjwYLS6BciTQW3c9xQiD2
…liberate non-declarations
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PBjwYLS6BciTQW3c9xQiD2
…ons the save-door diff shifted
check-system-context-census caught pure line rot: the new import line shifted
every site below it by +1 and the de-cast door block shifted the three sites
below it by +17. The gate's --fix refused (same population-sanity reason as
the history-door landing), so the eight anchors are rewritten by hand to the
lines the census and ledger already resolve to. Census now: 109 sites all
anchored, 145 anchors resolve, 27 declared non-read.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PBjwYLS6BciTQW3c9xQiD2
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 2 package(s): @objectstack/rest, @objectstack/spec, touching 9 documentable anchor(s). ⚠️2 changed file(s) yielded no anchor (packages/rest/src/rest-server.ts, packages/spec/authorable-surface/api.json), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

16 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: node scripts/docs-audit/affected-docs.mjs --json 3d0897459577835a78fc96a8f718eb3b139708a3.

2 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails.

What this run could not see
  • 2 changed file(s) yielded no anchor (packages/rest/src/rest-server.ts, packages/spec/authorable-surface/api.json) — pages documenting those are invisible to this run
  • the SDK route bridge reached 47 of 219 client-bound route-ledger rows — the other 172 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 172: 14 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 — 128 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 3d0897459577835a78fc96a8f718eb3b139708a3packageMentionDocs.

Which tree this was computed on

This run read content/docs from 88612888280db45443f56bed4a6c0786d8660a68 — the merge of head 722b069fa7f5c361b7d94861404e4bdd940e0264 into base 3d0897459577835a78fc96a8f718eb3b139708a3, 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 88612888280db45443f56bed4a6c0786d8660a68 && git checkout 88612888280db45443f56bed4a6c0786d8660a68
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 3d0897459577835a78fc96a8f718eb3b139708a3 722b069fa7f5c361b7d94861404e4bdd940e0264 && git checkout -B drift-repro 3d0897459577835a78fc96a8f718eb3b139708a3 && git merge --no-ff 722b069fa7f5c361b7d94861404e4bdd940e0264
node scripts/docs-audit/affected-docs.mjs --json 3d0897459577835a78fc96a8f718eb3b139708a3

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

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs 3d0897459577835a78fc96a8f718eb3b139708a3 → pass the list as
args.docs, on the commit named under Which tree this was computed on.

@os-warrenClaude

Copy link
Copy Markdown
CollaboratorAuthor

Released by maintainer instruction. Provenance: maintainer, live PM session chat, 2026-08-31 ~04:0xZ, verbatim 「pr 绿了为什么不合并」 — read as a personal release of the green parked contract-face PRs, per the recorded #12606 precedent (「12606 绿了」= personal release lifting the needs:contract-review park). Not a self-release: the dispatching seat acts on the maintainer's word, citing it here. Pre-release verification: all 36 check runs on head 722b069f completed success/skipped (zero red); PM checklist review of record: ACCEPT on #12004 (comment 5473171979), run at claude-fable-5; dispatch tier claude-fable-5 (not below CONTRACT_REVIEW_TIER); the one member carrying its own verdict (writeFace, four-axis converged to declare) is named in that review; no governed surface in the diff. Stripping needs:contract-review from both carriers, flipping ready, arming the queue. — session_01PBjwYLS6BciTQW3c9xQiD2


Generated by Claude Code

@os-warren
os-warren marked this pull request as ready for review August 31, 2026 04:07
@os-warren
os-warren enabled auto-merge August 31, 2026 04:07
@os-warren
os-warren added this pull request to the merge queueAug 31, 2026
Merged via the queue into main with commit 87075b1Aug 31, 2026
41 checks passed
@os-warren
os-warren deleted the claude/issue-12004-save-meta-item-request-schema branch August 31, 2026 04:31
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentationImprovements or additions to documentationsize/mteststooling

Projects

None yet

2 participants

@os-warren@claude
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

feat(spec): declare the save door's request members and de-cast the REST PUT literal (#12004) - #13599

Merged
os-warren merged 5 commits into
mainfrom
claude/issue-12004-save-meta-item-request-schema
Aug 31, 2026
Merged

feat(spec): declare the save door's request members and de-cast the REST PUT literal (#12004)#13599
os-warren merged 5 commits into
mainfrom
claude/issue-12004-save-meta-item-request-schema

Conversation

@os-warren

Copy link
Copy Markdown
Collaborator

Fixes#12004

PUT /api/v1/meta/:type/:name was the biggest remaining request-shape gap in the meta write family: saveMetaItem is a REQUIRED protocol member, but SaveMetaItemRequestSchema declared 3 of the ~11 members the REST door sends, so the call-site literal was cast as any — pure request-shape smuggling (TS2353 on every undeclared key once the cast comes off), never member-existence feature detection. This lands the #11006 maintainer-ruled pattern (2026-08-22, option B: per-member protocol-vs-transport walk, mirror the implementation's parameter type member for member) exactly as PR #12003 landed it for the audit and reset doors and PR #13521 for the history door.

Per-member verdicts (triage 2026-08-25, executed here)

MemberVerdictBasis
organizationId (optional string)DECLAREDstraight #11426/#11679-lineage; selects the ADR-0005 overlay partition and the audit-row scope; refused 403 for non-overridable types
parentVersion (optional, string or null)DECLARED, nullableimplementation declares string-or-null and, unlike the reset twin (which folds a present null back to the current hash), passes null through to the repository conflict check: null is the first-write pin, absent is unpinned last-write-wins — a real, enforced absent-vs-null distinction
actor (optional string)DECLARED#11679 lineage; recorded on the history event and audit row; the REST door's one producer is the authenticated identity, never a header
force (optional boolean)DECLAREDthe destructive-change acknowledgement (query param force=true); only object saves reach that diff
mode (optional, draft or publish)DECLARED, closed enumADR-0005 lifecycle; anything but draft (absent included) is the legacy straight-to-live default
packageId (optional, string or null)DECLARED, nullableADR-0048 binding; the absent-vs-null distinction the publish schema already documents; a named read-only base package is refused
writeFace (optional, closed enum of the three faces)DECLARED after the four-axis walk (below)server-stated per #10888 — declared because it is a real implementation parameter with three server-side producers
environmentIdNOT declaredtransport-level by the #9741 ruling; rides the rest wrapper TransportScopedMetaRequest, pinned shape-absent
sourceNOT declarednever sent by any door — its only producer is the implementation's own internal migrate call; the #11426 publish precedent leaves it out until a producer on this contract pulls it; pinned shape-absent

The writeFace walk (converged: declare)

The de-cast, and its reverse verification

The literal is now a named const typed TransportScopedMetaRequest wrapping SaveMetaItemRequest — the reset-door spelling, because this door still spreads the transport-level environmentId (long-standing wire shape, deliberately unchanged). Wire payload byte-identical: same keys, same conditional spreads, same server-stated face; the rest-server diff adds a type annotation and a comment, nothing else.

Reverse verification (predicted red, from the committed fix): a smuggledKey pasted into the literal turned the rest typecheck red with

src/rest-server.ts(5831,25): error TS2353: Object literal may only specify known properties, and 'smuggledKey' does not exist in type 'TransportScopedMetaRequest...'

and the error text prints the widened member list from the rebuilt spec dist — proving the literal compiles against the regenerated declarations, not a cache. Restore proven byte-identical: git diff HEAD empty, worktree blob hash equals the HEAD blob hash, zero grep hits for the smuggled key.

One measured behaviour pin rode along: the untouched item: z.unknown() member is key-REQUIRED at parse (absent key refused; a present explicit null parses and is then refused 400 by the implementation's own guard) — pre-existing contract behaviour, now pinned instead of silent.

Verification (all quoted verdicts from head 397d9ea; census repair at 722b069, union re-run on that final head reported on the card)

  • spec build: check-dts-emitted: @objectstack/spec - 34/34 declared declaration file(s) present. — VERDICT command-exit 0
  • spec typecheck (tsc + test-layer): check:test-typecheck: OK — @objectstack/spec's test layer compiles — VERDICT command-exit 0
  • spec targeted suites (protocol.test.ts + type-alias-convention.pin.test.ts): Test Files 2 passed (2) · Tests 181 passed (181) — the existing Iso135 isomorphism pin still holds (widening adds only optional/nullable/enum members, no defaults or transforms)
  • rest dependency graph build (turbo, 26 packages): Tasks: 25 successful, 25 total
  • rest typecheck: check:test-typecheck: OK — @objectstack/rest's test layer compiles — VERDICT command-exit 0
  • rest door suites (9 files: capability gate, compound force/mode parity, write org-scope, query multiplicity, org-scope url spelling, rest.test.ts, 4xx truncation, unknown-type refusal): 110 passed + 261 passed
  • spec generated artifacts: check:generated proved exactly one stale (content/docs/references — the new describe() rows) and --fix regenerated only it; check:authorable-surface, check:api-surface, check:export-origins, check:strictness-ledger all green (no new z.object sites, no new exports — the authorable-surface api.json picked up the seven new member rows from the rebuilt schema, as the history precedent's did)
  • system-context census: the door diff shifted eight rest-server.ts isSystem anchors (+1 import, +17 door block); --fix refused as in the history landing, anchors re-pointed by hand; check-system-context-census: OK — 109 elevation read sites in 20 packages across 45 files, all anchored; 145 anchors resolve, 27 declared non-read.
  • derived-gate union (dispatch-gates.mjs, no paths — 62 commands): first pass 56 exit-0; census repaired to green as above; check-test-completeness and check:pm-half-states exit 3 (locally unmeasurable by design — CI shard attestation and the PM board sweep); the three workspace-build-prerequisite gates re-run after a full turbo run build, and the whole union re-runs on the final head — quoted verdicts land in the card report

skip-changeset does not apply: this PR publishes a spec minor and a rest patch (changeset pair mirrors the merged history precedent).

Out of scope, untouched here: the door's 501 envelope, tenant-scoping questions, and the dispatcher door's own literals (#13598 records the adjacent runtime service-handle casts). #12004 is the only card addressed by this PR.

Generated by Claude Code


Generated by Claude Code

…EST PUT literal (wip)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PBjwYLS6BciTQW3c9xQiD2
…liberate non-declarations
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PBjwYLS6BciTQW3c9xQiD2
…ons the save-door diff shifted
check-system-context-census caught pure line rot: the new import line shifted
every site below it by +1 and the de-cast door block shifted the three sites
below it by +17. The gate's --fix refused (same population-sanity reason as
the history-door landing), so the eight anchors are rewritten by hand to the
lines the census and ledger already resolve to. Census now: 109 sites all
anchored, 145 anchors resolve, 27 declared non-read.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PBjwYLS6BciTQW3c9xQiD2
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 2 package(s): @objectstack/rest, @objectstack/spec, touching 9 documentable anchor(s). ⚠️2 changed file(s) yielded no anchor (packages/rest/src/rest-server.ts, packages/spec/authorable-surface/api.json), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

16 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: node scripts/docs-audit/affected-docs.mjs --json 3d0897459577835a78fc96a8f718eb3b139708a3.

2 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails.

What this run could not see
  • 2 changed file(s) yielded no anchor (packages/rest/src/rest-server.ts, packages/spec/authorable-surface/api.json) — pages documenting those are invisible to this run
  • the SDK route bridge reached 47 of 219 client-bound route-ledger rows — the other 172 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 172: 14 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 — 128 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 3d0897459577835a78fc96a8f718eb3b139708a3packageMentionDocs.

Which tree this was computed on

This run read content/docs from 88612888280db45443f56bed4a6c0786d8660a68 — the merge of head 722b069fa7f5c361b7d94861404e4bdd940e0264 into base 3d0897459577835a78fc96a8f718eb3b139708a3, 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 88612888280db45443f56bed4a6c0786d8660a68 && git checkout 88612888280db45443f56bed4a6c0786d8660a68
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 3d0897459577835a78fc96a8f718eb3b139708a3 722b069fa7f5c361b7d94861404e4bdd940e0264 && git checkout -B drift-repro 3d0897459577835a78fc96a8f718eb3b139708a3 && git merge --no-ff 722b069fa7f5c361b7d94861404e4bdd940e0264
node scripts/docs-audit/affected-docs.mjs --json 3d0897459577835a78fc96a8f718eb3b139708a3

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

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs 3d0897459577835a78fc96a8f718eb3b139708a3 → pass the list as
args.docs, on the commit named under Which tree this was computed on.

@os-warrenClaude

Copy link
Copy Markdown
CollaboratorAuthor

Released by maintainer instruction. Provenance: maintainer, live PM session chat, 2026-08-31 ~04:0xZ, verbatim 「pr 绿了为什么不合并」 — read as a personal release of the green parked contract-face PRs, per the recorded #12606 precedent (「12606 绿了」= personal release lifting the needs:contract-review park). Not a self-release: the dispatching seat acts on the maintainer's word, citing it here. Pre-release verification: all 36 check runs on head 722b069f completed success/skipped (zero red); PM checklist review of record: ACCEPT on #12004 (comment 5473171979), run at claude-fable-5; dispatch tier claude-fable-5 (not below CONTRACT_REVIEW_TIER); the one member carrying its own verdict (writeFace, four-axis converged to declare) is named in that review; no governed surface in the diff. Stripping needs:contract-review from both carriers, flipping ready, arming the queue. — session_01PBjwYLS6BciTQW3c9xQiD2


Generated by Claude Code

@os-warren
os-warren marked this pull request as ready for review August 31, 2026 04:07
@os-warren
os-warren enabled auto-merge August 31, 2026 04:07
@os-warren
os-warren added this pull request to the merge queueAug 31, 2026
Merged via the queue into main with commit 87075b1Aug 31, 2026
41 checks passed
@os-warren
os-warren deleted the claude/issue-12004-save-meta-item-request-schema branch August 31, 2026 04:31
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentationImprovements or additions to documentationsize/mteststooling

Projects

None yet

2 participants

@os-warren@claude
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

feat(spec): declare the save door's request members and de-cast the REST PUT literal (#12004) - #13599

Merged
os-warren merged 5 commits into
mainfrom
claude/issue-12004-save-meta-item-request-schema
Aug 31, 2026
Merged

feat(spec): declare the save door's request members and de-cast the REST PUT literal (#12004)#13599
os-warren merged 5 commits into
mainfrom
claude/issue-12004-save-meta-item-request-schema

Conversation

@os-warren

Copy link
Copy Markdown
Collaborator

Fixes#12004

PUT /api/v1/meta/:type/:name was the biggest remaining request-shape gap in the meta write family: saveMetaItem is a REQUIRED protocol member, but SaveMetaItemRequestSchema declared 3 of the ~11 members the REST door sends, so the call-site literal was cast as any — pure request-shape smuggling (TS2353 on every undeclared key once the cast comes off), never member-existence feature detection. This lands the #11006 maintainer-ruled pattern (2026-08-22, option B: per-member protocol-vs-transport walk, mirror the implementation's parameter type member for member) exactly as PR #12003 landed it for the audit and reset doors and PR #13521 for the history door.

Per-member verdicts (triage 2026-08-25, executed here)

MemberVerdictBasis
organizationId (optional string)DECLAREDstraight #11426/#11679-lineage; selects the ADR-0005 overlay partition and the audit-row scope; refused 403 for non-overridable types
parentVersion (optional, string or null)DECLARED, nullableimplementation declares string-or-null and, unlike the reset twin (which folds a present null back to the current hash), passes null through to the repository conflict check: null is the first-write pin, absent is unpinned last-write-wins — a real, enforced absent-vs-null distinction
actor (optional string)DECLARED#11679 lineage; recorded on the history event and audit row; the REST door's one producer is the authenticated identity, never a header
force (optional boolean)DECLAREDthe destructive-change acknowledgement (query param force=true); only object saves reach that diff
mode (optional, draft or publish)DECLARED, closed enumADR-0005 lifecycle; anything but draft (absent included) is the legacy straight-to-live default
packageId (optional, string or null)DECLARED, nullableADR-0048 binding; the absent-vs-null distinction the publish schema already documents; a named read-only base package is refused
writeFace (optional, closed enum of the three faces)DECLARED after the four-axis walk (below)server-stated per #10888 — declared because it is a real implementation parameter with three server-side producers
environmentIdNOT declaredtransport-level by the #9741 ruling; rides the rest wrapper TransportScopedMetaRequest, pinned shape-absent
sourceNOT declarednever sent by any door — its only producer is the implementation's own internal migrate call; the #11426 publish precedent leaves it out until a producer on this contract pulls it; pinned shape-absent

The writeFace walk (converged: declare)

The de-cast, and its reverse verification

The literal is now a named const typed TransportScopedMetaRequest wrapping SaveMetaItemRequest — the reset-door spelling, because this door still spreads the transport-level environmentId (long-standing wire shape, deliberately unchanged). Wire payload byte-identical: same keys, same conditional spreads, same server-stated face; the rest-server diff adds a type annotation and a comment, nothing else.

Reverse verification (predicted red, from the committed fix): a smuggledKey pasted into the literal turned the rest typecheck red with

src/rest-server.ts(5831,25): error TS2353: Object literal may only specify known properties, and 'smuggledKey' does not exist in type 'TransportScopedMetaRequest...'

and the error text prints the widened member list from the rebuilt spec dist — proving the literal compiles against the regenerated declarations, not a cache. Restore proven byte-identical: git diff HEAD empty, worktree blob hash equals the HEAD blob hash, zero grep hits for the smuggled key.

One measured behaviour pin rode along: the untouched item: z.unknown() member is key-REQUIRED at parse (absent key refused; a present explicit null parses and is then refused 400 by the implementation's own guard) — pre-existing contract behaviour, now pinned instead of silent.

Verification (all quoted verdicts from head 397d9ea; census repair at 722b069, union re-run on that final head reported on the card)

  • spec build: check-dts-emitted: @objectstack/spec - 34/34 declared declaration file(s) present. — VERDICT command-exit 0
  • spec typecheck (tsc + test-layer): check:test-typecheck: OK — @objectstack/spec's test layer compiles — VERDICT command-exit 0
  • spec targeted suites (protocol.test.ts + type-alias-convention.pin.test.ts): Test Files 2 passed (2) · Tests 181 passed (181) — the existing Iso135 isomorphism pin still holds (widening adds only optional/nullable/enum members, no defaults or transforms)
  • rest dependency graph build (turbo, 26 packages): Tasks: 25 successful, 25 total
  • rest typecheck: check:test-typecheck: OK — @objectstack/rest's test layer compiles — VERDICT command-exit 0
  • rest door suites (9 files: capability gate, compound force/mode parity, write org-scope, query multiplicity, org-scope url spelling, rest.test.ts, 4xx truncation, unknown-type refusal): 110 passed + 261 passed
  • spec generated artifacts: check:generated proved exactly one stale (content/docs/references — the new describe() rows) and --fix regenerated only it; check:authorable-surface, check:api-surface, check:export-origins, check:strictness-ledger all green (no new z.object sites, no new exports — the authorable-surface api.json picked up the seven new member rows from the rebuilt schema, as the history precedent's did)
  • system-context census: the door diff shifted eight rest-server.ts isSystem anchors (+1 import, +17 door block); --fix refused as in the history landing, anchors re-pointed by hand; check-system-context-census: OK — 109 elevation read sites in 20 packages across 45 files, all anchored; 145 anchors resolve, 27 declared non-read.
  • derived-gate union (dispatch-gates.mjs, no paths — 62 commands): first pass 56 exit-0; census repaired to green as above; check-test-completeness and check:pm-half-states exit 3 (locally unmeasurable by design — CI shard attestation and the PM board sweep); the three workspace-build-prerequisite gates re-run after a full turbo run build, and the whole union re-runs on the final head — quoted verdicts land in the card report

skip-changeset does not apply: this PR publishes a spec minor and a rest patch (changeset pair mirrors the merged history precedent).

Out of scope, untouched here: the door's 501 envelope, tenant-scoping questions, and the dispatcher door's own literals (#13598 records the adjacent runtime service-handle casts). #12004 is the only card addressed by this PR.

Generated by Claude Code


Generated by Claude Code

…EST PUT literal (wip)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PBjwYLS6BciTQW3c9xQiD2
…liberate non-declarations
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PBjwYLS6BciTQW3c9xQiD2
…ons the save-door diff shifted
check-system-context-census caught pure line rot: the new import line shifted
every site below it by +1 and the de-cast door block shifted the three sites
below it by +17. The gate's --fix refused (same population-sanity reason as
the history-door landing), so the eight anchors are rewritten by hand to the
lines the census and ledger already resolve to. Census now: 109 sites all
anchored, 145 anchors resolve, 27 declared non-read.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PBjwYLS6BciTQW3c9xQiD2
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 2 package(s): @objectstack/rest, @objectstack/spec, touching 9 documentable anchor(s). ⚠️2 changed file(s) yielded no anchor (packages/rest/src/rest-server.ts, packages/spec/authorable-surface/api.json), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

16 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: node scripts/docs-audit/affected-docs.mjs --json 3d0897459577835a78fc96a8f718eb3b139708a3.

2 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails.

What this run could not see
  • 2 changed file(s) yielded no anchor (packages/rest/src/rest-server.ts, packages/spec/authorable-surface/api.json) — pages documenting those are invisible to this run
  • the SDK route bridge reached 47 of 219 client-bound route-ledger rows — the other 172 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 172: 14 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 — 128 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 3d0897459577835a78fc96a8f718eb3b139708a3packageMentionDocs.

Which tree this was computed on

This run read content/docs from 88612888280db45443f56bed4a6c0786d8660a68 — the merge of head 722b069fa7f5c361b7d94861404e4bdd940e0264 into base 3d0897459577835a78fc96a8f718eb3b139708a3, 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 88612888280db45443f56bed4a6c0786d8660a68 && git checkout 88612888280db45443f56bed4a6c0786d8660a68
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 3d0897459577835a78fc96a8f718eb3b139708a3 722b069fa7f5c361b7d94861404e4bdd940e0264 && git checkout -B drift-repro 3d0897459577835a78fc96a8f718eb3b139708a3 && git merge --no-ff 722b069fa7f5c361b7d94861404e4bdd940e0264
node scripts/docs-audit/affected-docs.mjs --json 3d0897459577835a78fc96a8f718eb3b139708a3

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

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs 3d0897459577835a78fc96a8f718eb3b139708a3 → pass the list as
args.docs, on the commit named under Which tree this was computed on.

@os-warrenClaude

Copy link
Copy Markdown
CollaboratorAuthor

Released by maintainer instruction. Provenance: maintainer, live PM session chat, 2026-08-31 ~04:0xZ, verbatim 「pr 绿了为什么不合并」 — read as a personal release of the green parked contract-face PRs, per the recorded #12606 precedent (「12606 绿了」= personal release lifting the needs:contract-review park). Not a self-release: the dispatching seat acts on the maintainer's word, citing it here. Pre-release verification: all 36 check runs on head 722b069f completed success/skipped (zero red); PM checklist review of record: ACCEPT on #12004 (comment 5473171979), run at claude-fable-5; dispatch tier claude-fable-5 (not below CONTRACT_REVIEW_TIER); the one member carrying its own verdict (writeFace, four-axis converged to declare) is named in that review; no governed surface in the diff. Stripping needs:contract-review from both carriers, flipping ready, arming the queue. — session_01PBjwYLS6BciTQW3c9xQiD2


Generated by Claude Code

@os-warren
os-warren marked this pull request as ready for review August 31, 2026 04:07
@os-warren
os-warren enabled auto-merge August 31, 2026 04:07
@os-warren
os-warren added this pull request to the merge queueAug 31, 2026
Merged via the queue into main with commit 87075b1Aug 31, 2026
41 checks passed
@os-warren
os-warren deleted the claude/issue-12004-save-meta-item-request-schema branch August 31, 2026 04:31
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentationImprovements or additions to documentationsize/mteststooling

Projects

None yet

2 participants

@os-warren@claude