Skip to content

fix(metadata-protocol): put and delete accept the version a checksum-less sys_metadata row is served as - #21990

Merged
objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/issue-21978-served-version-compare
Oct 6, 2026
Merged

objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/issue-21978-served-version-compare

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Fixes #21978
Clause-②: no

What this changes

SysMetadataRepository (packages/metadata-protocol/src/sys-metadata-repository.ts) served a sys_metadata row that has no checksum as the hash of its stored body (rowToItem), but put and delete judged the caller's parent against the raw column (existing.checksum ?? null). So a row like that could never be written or removed through the metadata door. Every saveMetaItem / deleteMetaItem answered 409 METADATA_CONFLICT ("Expected parent hmac-sha256:… but current is null"), whether the parent was the version the door served or no If-Match was sent at all, because the door takes the parent from the same read. Publish, rollback and commit revert over such a row hit the same lock, and the post-promotion drain of a checksum-less draft was refused and silenced as a benign race.

Per triage's direction (6014717866), with nothing narrowed and no backfill:

  • One helper, servedVersion(ref, row): the stored checksum, else hashSpec(body, type). rowToItem now reads it, so every read hands out this one value.
  • One lock, lockAccepts(ref, row, parent), used by put and delete. It accepts the row's stored stamp, which is the old compare unchanged: a row with a checksum is judged exactly as before, and a null parent still matches a checksum-less row. For a checksum-less row it also accepts the served version.
  • The conflict's head (lockHead) is the served version, so a 409 on such a row names the version a read hands out (before this, null). A checksum-less row whose bytes do not parse keeps null there, so a lock refusal never becomes a parse error.
  • The lineage fields (previous_checksum, the event's parentHash) and the no-op check keep reading the raw stamp. So the first write over a checksum-less row, even with an identical body, stamps the row as usual. Nothing is rewritten at rest, and the header's "no backfill" non-goal stands, now with one line on how such a row is served.

File surface: as dispatched. The producer that wrote such rows (the datasource admin door) already stamps a checksum since PR #21977, which is on main, so the remaining work is the stored rows, and that lands in this repository class. Two test files in the same package: the pins, plus one fixture comment in protocol-publish-drafts-package-scope.test.ts that this change made false. Changeset: @objectstack/metadata-protocol patch.

Pins (protocol.served-content-hash.test.ts, the existing conflict-test double)

Through the protocol's real saveMetaItem / deleteMetaItem / publishMetaItem, on a row seeded with no checksum:

  • (a) saved and deleted with the version its read serves, in the keyed form a door hands out: the repository's own get read, keyed;
  • (a) unpinned (last-write-wins) save and delete succeed: the dogfood shape;
  • (b) a stale keyed token and the raw served hash are still refused with METADATA_CONFLICT / 409 on both doors; actualHead is the served token, the row is untouched, and retrying with that actualHead succeeds;
  • (c) a null parent still succeeds: storedParentVersion: row.checksum ?? null, the stored-row migration's in-process spelling;
  • (d) after each write the row carries hashSpec(newBody, 'view'); an identical re-save stamps it too;
  • publish over a checksum-less active row; the drain removes a checksum-less draft row;
  • repository level: a row WITH a checksum whose stamp differs from its body's hash refuses the body's hash and null (both name the stamp as head) and accepts its stamp; a checksum-less row accepts null and its served version, and refuses anything else with the served version as head.

Reverse verification (committed HEAD 5c4815a6ab)

The mutation went through scripts/ablation-replace.mjs with an EXIT/INT/TERM restore trap and absolute paths. It restored the raw compare in both put and delete (anchor hit x2 → x0, replacement x0 → x2, blob dc58518587 → 494fa3f0ee; on disk, raw-compare 0 → 2 and lockAccepts call 2 → 0).

  • Predicted beforehand: 7 of the 9 new pins red, and green for the null-parent pin and the stamped-row pin, which guard against widening and against narrowing rather than this mutation.
  • Observed: Tests 7 failed | 16 passed (23), the 7 predicted. The save door reproduced the card's text verbatim: "view/case_grid has been modified since you loaded it. Expected parent hmac-sha256:e532d121… but current is null." The drain pin read the draft row still present, and the repository pin read actualHead null.
  • Restore was proven by observation: blob after restore dc58518587 equals the HEAD blob, git diff HEAD is empty, and git status --porcelain is empty.
  • An earlier invocation was a no-op: the tool refused with exit 2 before writing, because it located the repository from the shared checkout's cwd. On-disk counts were unchanged, and it was rerun from the worktree root.

The subject is imported by relative src path (./protocol.js, ./sys-metadata-repository.js), so no dist/ sits on the ablation's resolution path.

Clause-② (measured against the built entry declarations)

packages/metadata-protocol/dist/index.d.ts was built at HEAD, and again with BASE 8a399b2b15's repository source swapped in behind a trap. The swap was restored and proven by blob equality, and HEAD was rebuilt, giving a byte-identical index.d.ts. The diff's non-comment lines are private servedVersion;, private lockHead; and private lockAccepts;, with 0 removed; everything else is doc text. index.d.cts has the identical diff. No exported type or signature moves. Behaviourally, put / delete accept for a checksum-less row the version the same repository already serves for it, which is the declared version token, not a new class of input.

Tests and gates: all on HEAD 81606021e2 (after merging origin/main twice, the second bringing PR #21979's protocol.ts change)

  • pnpm --filter @objectstack/metadata-protocol test: Test Files 218 passed | 3 skipped (221), Tests 28028 passed | 19 skipped (28047). typecheck: tsc --noEmit clean, and the test file is in the program (--listFiles count 1). Lock VERDICT command-exit 0.
  • node scripts/pm/dispatch-gates.mjs --commands (no paths) derived the 63 commands, and all ran at exit 0. check:type-check-debt ran under the verify lock ("1 ledger entr(ies) re-measured … 26 raw tsc error(s) total, none above its recorded number"). check:dual-build-cjs-loads and check:lean-entry-closure ran after a full turbo run build (72 tasks, 71 cached). Reconciliation, --ran with per-command exit codes: "63 derived, 63 run, 0 NOT-MEASURED, 0 UNRUN".
  • The artifact-roster block (55 families, outside the total): 52 at exit 0. check-closing-target-claim, check-partof-closing-keyword and check-single-claim-paths answered NOT WIRED (exit 2, no PR context); they are rerun against this PR and reported in the os-dev-report comment.
  • The four symbol-anchor sweeps (check:adr-symbol-anchors, check:scripts-symbol-anchors, check:spec-docblock-symbol-anchors, check:adr-anchors): exit 0.
  • NOT MEASURED locally, owned by CI: the five path-scheduled CI jobs (Test Core shards, Temporal Conformance, Dogfood Regression Gate, Dogfood Verify CLI, Build Core) and the workspace type-check lanes. packages/qa/dogfood/test/datasource-meta-door-reaches-admin-door.dogfood.test.ts was not run locally.

Census: writers of sys_metadata that can store a row with no checksum

Writer Where checksum Still producing such rows
SysMetadataRepository.put (insert / update) metadata-protocol/src/sys-metadata-repository.ts always hashSpec(body, type) no
SysMetadataRepository.delete same file removes the row. Its tombstone goes to sys_metadata_history with checksum: null by design n/a (history table)
datasource admin door writeDatasourceRow service-datasource/src/datasource-admin-plugin.ts hashSpec(record, 'datasource') since PR #21977; none before no. Its pre-#21977 rows are the stored population this PR makes writable
datasource admin door delete fallback same file update { state: 'inactive' }, which keeps the column no
DatabaseLoader save / create / registerRollback metadata/src/loaders/database-loader.ts contentHash stamp no
protocol orphan adoption (package_id rebind) metadata-protocol/src/protocol.ts partial update, which keeps the column no
protocol legacy delete, permission-set overlay discard protocol.ts, plugin-security/src/permission-set-overlay-discard.ts delete only no
env_id → project_id migration metadata/src/migrations/migrate-env-id-to-project-id.ts column rename DDL no
stored-row migration, flow credential move protocol.ts migrateStoredMetadata, service-automation/src/flow-credential-migration.ts through saveMetaItem → put (stamps) no. Both were refused on such rows before this PR and succeed now
generic data door, MCP data bridge, flow write nodes, hook bodies — refused: sys_metadata declares apiMethods: ['get', 'list'], plus the stored-metadata family refusals no

A tombstone reads back as a delete event with hash: null (history() / rowToEvent). getByHash never matches it, and restoreVersion refuses it with VERSION_NOT_RESTORABLE. No writer is still live after this change, so no follow-up card.

Acceptance notes

  • packages/cli/src/commands/migrate/meta.stored-flow-resolution.integration.test.ts (about :190) explains its explicit parentVersion: null by saying a raw-seeded row's derived parent "would 409". After this change it would not; the null it passes stays valid. Comment drift in another package, left as is. Owner: none.
  • The first write over a checksum-less row records previous_checksum: null / parentHash: null, the raw stamp. That is deliberate: no history row carries the served hash, so naming it would be a parent link to nothing.
  • A conflict-audit note on such a row now reads "current is (withheld)" where it read "current is null", because the head is no longer null.
  • DraftDrainFailure.draftHash is documented as "the row's checksum". It is the served version, the same value for a stamped row. This is a doc imprecision predating this PR.
  • Rollback (restoreVersion) and commit revert over a checksum-less active row take the served parent and pass the same lock. This was read in code; only publish is pinned as the representative internal caller.
  • No door read serves a version token for a stored row that has no history; the tokens come from receipts, history events and a 409's actualHead. So for a legacy row, the 409 is the first place a client sees its token. The stale-version pin covers that retry.

Generated by Claude Code

claude added 4 commits October 6, 2026 11:39
…less row is served as

SysMetadataRepository served a row with no `checksum` as the hash of its
stored body (`rowToItem`), but `put` and `delete` judged the caller's
parent against the raw column (`null`). Such a row could never be written
or removed through the metadata door: every save and delete, an unpinned
one included, answered 409 METADATA_CONFLICT.

One helper (`servedVersion`) now names the version a row is served as, and
the lock (`lockAccepts`) accepts it as the head of a checksum-less row. A
row with a `checksum` is judged exactly as before, a `null` parent still
matches a checksum-less row, and the next write stamps the row. A conflict
on such a row reports its served version. No stored row is rewritten.

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

A checksum-less `sys_metadata` row is saved, deleted and published over
through the version its read serves (with and without a pinned parent), a
stale version is still refused with 409 METADATA_CONFLICT naming the served
version, a null parent still matches it, the write stamps it, the
post-promotion drain removes such a draft, and a row with a checksum is
judged exactly as before. Adds the patch changeset.

Claude-Session: https://claude.ai/code/session_017ErfyP2Rx7XWHJA27QjyUi
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tests tooling labels Oct 6, 2026
@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 1 package(s): @objectstack/metadata-protocol, touching 6 documentable anchor(s).

1 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:

  • content/docs/concepts/metadata-lifecycle.mdx (via SysMetadataRepository (symbol, a top-level class))
What this run could not see
  • 1 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 54 of 206 client-bound route-ledger rows — the other 152 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 152: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 55 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 97 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.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 11 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 1c563af40e21248d1e0be2f13cc47626aaad893e → packageMentionDocs.

Which tree this was computed on

This run read content/docs from a482822fc821d01054463ef041a7173c013a3373 — the merge of head 81606021e2ee823cc4bc55084b68bc7562b21c91 into base 1c563af40e21248d1e0be2f13cc47626aaad893e, 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 a482822fc821d01054463ef041a7173c013a3373 && git checkout a482822fc821d01054463ef041a7173c013a3373
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 1c563af40e21248d1e0be2f13cc47626aaad893e 81606021e2ee823cc4bc55084b68bc7562b21c91 && git checkout -B drift-repro 1c563af40e21248d1e0be2f13cc47626aaad893e && git merge --no-ff 81606021e2ee823cc4bc55084b68bc7562b21c91

node scripts/docs-audit/affected-docs.mjs --json 1c563af40e21248d1e0be2f13cc47626aaad893e

⚠️ 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 1c563af40e21248d1e0be2f13cc47626aaad893e → pass the list as
args.docs, on the commit named under Which tree this was computed on.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

ACCEPT (seat review) — PR #21990 at head 81606021e2

domain:engine#1 · session_017ErfyP2Rx7XWHJA27QjyUi · read at 2026-10-06T13:27Z. The dev's report is os-dev-report on #21978.

  • The change follows triage's direction (6014717866). The seat read the helpers in sys-metadata-repository.ts:
    • One served version, servedVersion (checksum ?? hashSpec(body, type)), which rowToItem reads.
    • One lock, lockAccepts, used by put and delete. Its first arm is the base compare, byte for byte, so a stamped row is judged exactly as before. Only a checksum-less row also accepts its served version, and a null parent still matches it.
    • A conflict names the served head (lockHead), not null.
    • The lineage fields and the no-op check keep the raw stamp, so the next write stamps the row.
    • There is no backfill and no migration.
  • Other callers repaired by the same lock (H1, measured): unpinned save and delete; publish over a checksum-less active row; rollback and revert (read in code); and the post-promotion drain, which silently left a checksum-less draft pending.
  • Census (H3): no writer in the tree still stores a checksum-less sys_metadata row after PR fix(service-datasource): the admin door reads a datasource's origin from provenance, and a metadata-door write reaches it in the same boot #21977. No follow-up card is owed.
  • Pins: 9 cases in protocol.served-content-hash.test.ts, reusing its engine double.
    • Reverse verification restored the raw compare and turned exactly the 7 predicted cases red, with the base's text: "Expected parent hmac-sha256:… but current is null". It was then restored by blob equality.
  • CI on 81606021e2: 31 success, and the 3 skips are in the roster.
  • Readings against main at aa09db58c9: NOT governed (0 of 4 paths), and git merge-tree is clean.
  • Clause-②: no, at patch. Only three private members were added to the built declarations. No contract review is owed.
  • Noted, not filed (both are in the PR's Acceptance notes):
    • a packages/cli integration test's comment, which says a raw-seeded row's derived parent "would 409";
    • DraftDrainFailure.draftHash's docblock wording.

Generated by Claude Code

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review October 6, 2026 13:28
@objectstack-fleet
objectstack-fleet Bot enabled auto-merge October 6, 2026 13:28
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Oct 6, 2026
Merged via the queue into main with commit 6befe19 Oct 6, 2026
36 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-21978-served-version-compare branch October 6, 2026 14:01
akarma-synetal pushed a commit to akarma-synetal/framework that referenced this pull request Oct 7, 2026
…d decision in words instead of a tracker number (stage 27) (objectstack-ai#21997)

Part of objectstack-ai#20749
Clause-②: no

Stage 27 of this card: the next area of class (e), the test strings
shipped under `packages/spec/src`, as ruled in `5902360492` on objectstack-ai#20513.
This stage takes the second and last name-ordered `system/` group: the
16 id-bearing test files under `packages/spec/src/system/` from
`metadata-form-zod-reconciliation.test.ts` to `worker.test.ts`. Those
files carried 63 messages and 70 tracker ids. All 70 now either state
what their record decided, in words (form D), or are dropped where the
string already says it. No needle sits in this group. Text only: no
assertion, identifier, test count or code comment changes, and no file
is renamed. This finishes `system/` for this class.

## Census at the base (`aa09db58c9`)

Instruments: `census10.cjs` (md5 `9d08602ab972b4b8643c90d64d40fa41`),
`census.cjs` (md5 `6e42a45a926d375013c32d62f16a296e`), `census-wide.cjs`
(md5 `c98410a19529c439adb0afbfb00026a2`) and `dirtable.cjs` (md5
`dda605c54745b4a60cc14c9a686e4eff`), byte-identical to the copies stages
10 to 26 used. A literal counts as a test title when its folded message
is argument 0 of a `describe` / `it` / `test` call, `.each` / `.skip` /
`.only` chains included. Everything else is an "other" string.

The worktree was cut from `origin/main` at `aa09db58c9`, the claim's
base and stage 26's landing. Both instruments read **191 messages / 200
ids in 53 files**, the seat's reading and stage 26's head reading.

| directory | files | messages / ids | titles | other |
|:--|--:|--:|--:|--:|
| (files directly in `src/`) | 30 | 118 / 120 | 117 / 119 | 1 / 1 |
| `system/` (this PR: all 16) | 16 | 63 / 70 | 45 / 49 | 18 / 21 |
| `ui/` | 5 | 7 / 7 | 0 | 7 / 7 |
| `ai/` | 1 | 2 / 2 | 0 | 2 / 2 |
| `contracts/` | 1 | 1 / 1 | 0 | 1 / 1 |
| **total** | **53** | **191 / 200** | **162 / 168** | **29 / 32** |

The group reads **63 messages / 70 ids in 16 files**, the seat's figures
file for file:

| file (under `system/`) | messages / ids | titles | other |
|:--|--:|--:|--:|
| `metadata-form-zod-reconciliation.test.ts` | 21 / 24 | 4 / 4 | 17 / 20
|
| `metadata-persistence.test.ts` | 1 / 1 | 1 / 1 | 0 |
| `metrics.test.ts` | 4 / 5 | 4 / 5 | 0 |
| `notification-event-migration-retirement.test.ts` | 3 / 3 | 2 / 2 | 1
/ 1 |
| `notification.test.ts` | 1 / 1 | 1 / 1 | 0 |
| `object-storage.test.ts` | 1 / 1 | 1 / 1 | 0 |
| `operation-message.test.ts` | 3 / 3 | 3 / 3 | 0 |
| `registry-config.test.ts` | 1 / 1 | 1 / 1 | 0 |
| `settings-manifest.test.ts` | 5 / 5 | 5 / 5 | 0 |
| `stack-server.test.ts` | 2 / 2 | 2 / 2 | 0 |
| `tenant-provisioning-family-retired.test.ts` | 1 / 2 | 1 / 2 | 0 |
| `tenant.test.ts` | 3 / 5 | 3 / 5 | 0 |
| `tracing.test.ts` | 3 / 3 | 3 / 3 | 0 |
| `translation.test.ts` | 12 / 12 | 12 / 12 | 0 |
| `validation-message.test.ts` | 1 / 1 | 1 / 1 | 0 |
| `worker.test.ts` | 1 / 1 | 1 / 1 | 0 |
| **16 files** | **63 / 70** | **45 / 49** | **18 / 21** |

Five more test files sit in the same name range and carry no id
(`migration`, `search-engine`, `security-context`, `supplier-security`,
`translation-typegen`). The 18 "other" strings are declared to the
text-only tool: the 17 ledger reasons in
`metadata-form-zod-reconciliation.test.ts` (`LEDGER` rows `:256`,
`:263`, `:270`, `:283`, `:426`, `:433`, `:440`, `:447`, `:454`, `:470`,
`:477`, `:484`, `:491`, `:507`, `:514`, `:521`, and the
`TOP_LEVEL_DEFERRED.view` reason at `:880`), and one expect failure
message at `notification-event-migration-retirement.test.ts:165`.

- **Controls.** Lit: `ai/build-progress.test.ts` (2 / 2) and three files
directly in `src/` (`assembled-package-body` 4 / 4,
`compose-key-dispositions-export.pin` 5 / 5,
`compose-stacks-action-collision-shape` 3 / 3), outside the group, read
the same at the base and at the head. Dark: the 16 files read 0 at the
head while 141 of their lines still carry `#` plus digits, every one of
them a comment line. Planted in a scratch tree: an id put into the
rewritten "page component copy, keyed by component id" title reads 1 / 1
(`title:describe`), the base text put back into the `:440` ledger reason
reads 1 / 1 (`other`), and an id put into a `metrics.test.ts` comment
reads 0.
- **A wider pattern** (any `#` plus digits) reads the same as the gate
pattern in all 16 files at the base, and 0 in all 16 at the head.
- **At the head:** 128 messages / 130 ids in 37 files. The 16 files read
0 / 0, `system/` is absent, and no other file moved.

## How the area was chosen

`system/` is taken in name-ordered file groups near the ~100-id bound,
the rule stages 20 to 26 used. Stage 26 named this group at 70 ids, and
this census reads 70, so no re-cut was needed.

**Named for the next stage** (cut from the head census, 128 / 130):
- **The files directly in `src/`:** 30 files, 118 messages / 120 ids
(117 / 119 titles, 1 / 1 other, at
`stack-cross-reference-envelope.test.ts`). The largest file is
`stack-inline-action-crossref.test.ts` at 13, and no file needs
splitting. It fits one PR and one text-only proof at 120, 20% over the
~100 bound. If the seat holds to "within about 10%", the name-order cut
is two groups: `assembled-package-body.test.ts` through
`inline-grid-column-carriers.test.ts` (18 files, 61 ids) and
`root-entry-migrations-split.pin.test.ts` through `stack.test.ts` (12
files, 59 ids).
- The needles: one stage, with an at-tier review. The four colour
literals stay, as stage 21 decided.

## What each id became

- **22 literals (24 ids)** now state a decision in words.
- **1 literal (1 id)** gets its subject back in words.
- **40 literals (45 ids)** drop a number the string already explains.

Every cited record was fetched with all its comments through REST. 37
records are cited, plus one decision-batch number (below): 35 answer
200, and 2 answer 404. The two that answer 404 were read from what
landed, through the commits endpoint (this checkout is shallow):
- **objectstack-ai#10926**, from `d173125fb8` (objectstack-ai#11438): the component-translation
`submitLabel` copy key is retired, option A per the maintainer ruling of
2026-08-22;
- **objectstack-ai#12493**, from `aa5994e17a` (objectstack-ai#12626, found through its
`@objectstack/spec` CHANGELOG entry): the catalog gains two situation
keys, `record_write_denied` and `approval_recall_not_submitter`, each
its own sentence, "deliberately not `record_access_denied` restated".

**The ledger reasons in `metadata-form-zod-reconciliation.test.ts`** (17
"other" strings). Before any was rewritten, every reader of the ledger
and of the file was found:
- **The file's own assertions** read the `why` text:
`e.why.startsWith(reason)` (the class phrase that leads each ruled root
row), `toContain('5861442317')` (the ruling record id, in every ruled
root row), ``toContain(`the \`${editor.type}\` type`)`` and
`toContain(editor.surface)` (the editor names), the unspellable union
arms in backticks, and `why.length > 20`. Every rewrite keeps all of
them, so no assertion moves: only the card numbers go, and the record id
`5861442317` stays.
- **Outside the file:** `packages/spec/scripts/lib/zod-graph.ts`,
`zod-graph.test.ts`, `scripts/pm/check-widening-tells.mjs`,
`metadata-form-declared-rows.pin.test.ts`, three `*.form.ts` comments
and the CHANGELOGs name the file. None reads a `why` string: they cite
the file in prose or comments. No gate, generated artifact, docs table
or self-test reads the text. So no non-test file moves.
- **objectstack-ai#19332's ruling is record `5861442317`** (batch objectstack-ai#229 item 3, A on
all five groups). Each reason already states its class and why, so
"(ruling record 5861442317, objectstack-ai#19332)" becomes "(ruling record
5861442317)" in 15 rows.
- **`:433`** cited objectstack-ai#19330 too: "(ruling record 5861442317; per-arm view
forms, ruled: one registered form per view kind)". objectstack-ai#19330's ruling A
(`5754204415`): "`view` is reconciled PER ARM. Each view kind … gets its
own registered metadata form".
- **`:454`** cited "objectstack-ai#18164 batch objectstack-ai#209 item 1 A" after the record id
`5755653853`. objectstack-ai#18164's ruling `5755653853` is decision batch objectstack-ai#209 item
1, letter A, so `objectstack-ai#209` is a batch number, not a citation (objectstack-ai#209 itself is
an unrelated 2026 docs PR). The reason already says what was decided
("the picker placed there"; "its offer was decided as that picker in the
object designer's select-field editor"), so it now reads "(ruling record
5861442317; the picker placed there by ruling record 5755653853)".
- **`:880`** (`TOP_LEVEL_DEFERRED.view`) already says "It is reconciled
per arm, each arm against its own registered form", so "(the objectstack-ai#19330
ruling, letter A)" becomes ", as ruled".

**"ruled" appears in two rewritten strings**, both on objectstack-ai#19330's ruling A
(`5754204415`): `:433` and `:880` above.

**The same-id titles stage 26 listed:**
- the five `(objectstack-ai#15679)` titles (`metrics:500`, `object-storage:864`,
`registry-config:215`, `tracing:524`, `worker:561`) now say "carry their
unit in the key name" / "carries its unit in the key name". objectstack-ai#15679 is
objectstack-ai#14478's ruling B (`5548763981`) for `system/`: the fifteen duration
keys carry their unit in the key name. That is stage 25's objectstack-ai#15677 reading
and stage 26's form;
- `translation.test.ts`'s six: `objectstack-ai#16772` and `objectstack-ai#6080` state their
decisions (below); `objectstack-ai#10926`, `objectstack-ai#21257`, `objectstack-ai#11287` and `objectstack-ai#4667` drop,
because each title already says it (retired, retired, the keys the
resolver acts on, retired).

**Stated in words** (22 literals):

| record | literal (under `system/`) | now reads | the decision |
|:--|:--|:--|:--|
| objectstack-ai#19332, objectstack-ai#19330 | `metadata-form-zod-reconciliation.test.ts:433` |
"(ruling record 5861442317; per-arm view forms, ruled: one registered
form per view kind)" | Above. |
| objectstack-ai#3786 | `metadata-form-zod-reconciliation.test.ts:886` | "metadata
form ↔ Zod reconciliation — a hand-written form held to its schema by a
gate" | The template for the hand-copied-list pattern: derive from the
one source, and where it cannot be derived, a coverage assertion is the
gate. |
| objectstack-ai#15679 (objectstack-ai#14478 ruling B) | `metrics.test.ts:500`,
`object-storage.test.ts:864`, `registry-config.test.ts:215`,
`tracing.test.ts:524`, `worker.test.ts:561` | "… carry their unit in the
key name" / "… carries its unit in the key name" | Above. |
| objectstack-ai#15939, objectstack-ai#14478 | `metrics.test.ts:584` | "metrics JSDoc-only durations
carry their unit in the describe and the key name" | objectstack-ai#15939's ruling
(`5564447683`, option 2): a key whose JSDoc names a unit its describe
does not is a divergence, refused; the unit moves into the describe,
where objectstack-ai#14478's rule puts it in the key name. Ruling A (`5635659224`)
remediates per file. |
| objectstack-ai#17785 | `tracing.test.ts:565` | "the OTel exporter and performance
durations carry their unit in the describe and the key name" | The
tracing file's remediation under objectstack-ai#15939's ruling A: the four keys
renamed with their unit, and the unit published in the describe. |
| objectstack-ai#16194 | `notification-event-migration-retirement.test.ts:165` (expect
message) | "… — its runner was retired, with no operator door and no
boot-time invoker" | The ruling (`5582372148`, batch objectstack-ai#88): retire; no
operator door and no platform invoker. |
| objectstack-ai#7414 | `operation-message.test.ts:101` | "operation message catalog —
permission_denied, the 403 refusal as localized user copy" | The 403
refusal renders through the operation message catalog in the caller's
locale, naming no object, operation or position. |
| objectstack-ai#7451 | `operation-message.test.ts:193` | "operation message catalog —
the row-level user copy, a sentence per situation" | The row-level
denials get their own keys (`record_access_denied`,
`record_change_not_allowed`), not the grant denial restated. |
| objectstack-ai#12493 (404) | `operation-message.test.ts:306` | "… sharing write
denial and approvals recall, two keys of their own" | What landed in
`aa5994e17a`, above. |
| objectstack-ai#5933 | `settings-manifest.test.ts:230` | "Specifier.valueDomain — a
declared standard domain is the boundary, `options` a UI list" | When
`valueDomain` is declared, the standard domain is the enforcement
boundary and `options` degrades to a UI convenience list. |
| objectstack-ai#5131 | `settings-manifest.test.ts:246` | "is optional — an undeclared
specifier keeps exhaustive-options semantics, enforced at save" | A
`select` value outside its `options` is refused at save. objectstack-ai#5933 keeps
that for an undeclared specifier. |
| objectstack-ai#7327 | `settings-manifest.test.ts:306` | "`visible` — the settings
visibility grammar, narrowed to what the save-time evaluator runs" |
Direction (b): narrow the declared type to the grammar the save-time
evaluator implements, not CEL. |
| objectstack-ai#15811 | `settings-manifest.test.ts:338` | "REFUSES an `ast`-only
envelope — an evaluated slot requires a non-blank `source`" | Ruling A
(`5644350409`, batch objectstack-ai#122 item 2): every engine-evaluated expression
slot requires a non-blank `source`. |
| objectstack-ai#4938 | `stack-server.test.ts:61` | "server: carries only keys with a
consumer — the retired HttpServerConfig keys stay out" | The maintainer
ruling A (`5173147201`): the unreachable `HttpServerConfigSchema` and
its seven dead keys are retired. |
| objectstack-ai#16772 | `translation.test.ts:840` | "dashboard global-filter copy,
addressable from a bundle by filter name" | Finding B:
`dashboards.NAME.globalFilters.KEY` becomes a bundle group, keyed by the
filter name. |
| objectstack-ai#6080 | `translation.test.ts:901` | "page component copy, keyed by
component id" | Page component copy gets a bundle address by component
id. |
| objectstack-ai#7646 | `translation.test.ts:1082` | "screen-flow copy — a `flows`
bundle group, runner chrome kept out" | The recorded ruling
(`5253154523`): a `flows` surface for flow, screen and field copy;
runner chrome stays in the console's own catalog. |
| objectstack-ai#3957 | `validation-message.test.ts:90` | "renderValidationMessage —
English output is unchanged, the field label in place of the API name" |
Messages name the field by its label, through the message catalog. The
describe pins the English output as before, label for API name. |

**Subject back in words** (1 literal): `translation.test.ts:713` "should
reject the retired shape …" now names it, "the retired object-first `o.`
shape". objectstack-ai#3778 retired that shape for the `translation` type.

**Dropped where already stated** (40 literals, 45 ids). A number goes
only where the string already says its decision. Examples: the 15 ledger
reasons above; `:880`'s "(the objectstack-ai#19330 ruling, letter A)"; the tails
`(objectstack-ai#5280)`, `(objectstack-ai#14327)`, `(objectstack-ai#19332)`, `(objectstack-ai#18124)` x2, `(objectstack-ai#5933)`, `(objectstack-ai#4001)`
x3, `(objectstack-ai#14478, objectstack-ai#14519)`, `(objectstack-ai#14519)`, `(objectstack-ai#15939, objectstack-ai#14478)` on "→
schemaCacheTtlSeconds", `(objectstack-ai#10926)`, `(objectstack-ai#21257)`, `(objectstack-ai#11287)`, `(objectstack-ai#15178)`,
`(objectstack-ai#19620)`, `(objectstack-ai#4667)`; and the prefixes `objectstack-ai#18118` x2 (before "the retired
CEL arm"), `[objectstack-ai#16194]` x2, `[objectstack-ai#4616]` and `[objectstack-ai#4739 / objectstack-ai#16325]`. The one 404
number among them (objectstack-ai#10926) goes only where the title already states what
landed.

**No file is renamed.**

## Readers

- **Needles:** none. The 17 ledger reasons are data the file's own
assertions read for their class phrase, record id and editor names, all
kept (above); none reads an id. The one declared expect message is a
failure message (the second argument of `expect`), not an expected
value. `notification-event-migration-retirement.test.ts` reads the
`NOTIFICATION_EVENT_MIGRATION_ID` docblock for a claim matrix's absence
and for `RETIRED` / `os migrate` / `boot-time invoker` /
`files-to-references`, none of them an id. No title or message in the
group is matched against a source docblock or another file's text.
- **Test-name filters:** none. No tracked script, workflow or package
config passes `-t` / `--testNamePattern` to vitest; the one vitest `-t`
hit is a README example under `packages/qa/dogfood` filtering its own
fixture.
- **Snapshots:** none. No `__snapshots__` directory is tracked under
`packages/spec`, and none of the 16 files calls a snapshot matcher.
- **Projects:** all 16 files run in `local`; none is in
`packages/spec/vitest.repo-tests.json`. The base-versus-head run below
takes both projects anyway.
- **By substring:** every old literal, its id-bearing fragment and a
window around each id (193 needles) was searched with `git grep` at the
base, across the tracked tree outside its own file. No gate, doc,
filter, snapshot, QA checklist entry or `scripts/check-*.mjs` self-test
reads one. The 26 hits are 16 published CHANGELOG lines, which quote
"form ↔ Zod reconciliation (objectstack-ai#3786)" and "strict from birth (objectstack-ai#4001)" as
release text, and 10 sibling hits among the five `(objectstack-ai#15679)` titles of
this group, all rewritten here.
- **One code comment quotes a title:** `tracing.test.ts:560` says "a
describe headed `Span.duration carries its unit`". The new title keeps
that prefix.

## Text-only proof

Stage 10's scratch tool (`textonly10.cjs`, md5
`d5e4801dbb4329ab1984da91e92fc47c`) compares base and head file by file
on three legs:
1. **Skeleton:** the full AST, with string pieces masked. It must be
identical.
2. **Comments:** every comment, byte-equal.
3. **Strings:** each changed string leaf must sit in a test-call title
position or on a declared line, must carry a tracker id before, and must
carry no `#` plus digits after. This stage declares the 18 lines named
above.

- **Result:** 16 of 16 files SAME on all three legs, with the per-file
counts predicted in writing before any edit (2026-10-06T13:25:38Z).
- **Totals:** 63 changed string leaves in 63 literals: 45 titles and 18
declared. The diff's `+` and `-` lines are exactly the 63 planned lines
as multisets, and every file keeps its line count.
- **Controls (14 of 14 as predicted on the first run, on scratch copies,
each anchor hit once):** identifier rename DIFF; numeric literal DIFF;
comment edit COMMENT DIFF; a non-title string given an id VIOLATION; a
rewritten title given a new id VIOLATION; a title that was id-free at
base edited VIOLATION; one title reverted to base SAME; an `it.each` row
given an id VIOLATION; an undeclared expect message changed VIOLATION; a
title re-split into a `+` chain DIFF; a declared ledger reason reverted
to base SAME; the declared deferral reason given a new id VIOLATION; the
declared expect message given a new id VIOLATION; a template-literal
title given a new id VIOLATION.
- **Templates and tables:** no `.each` title, no `$name` / `%s`
placeholder and no table row changes.

**Test counts:** the 16 files were run at the base, before the edit, and
at the head, in the same worktree, with `--project local --project
repo`. Both sides read 747 tests in 16 files, all passed, with the same
count and status sequence per file in 16 of 16. 302 full test names
change, and each changed name equals the base name with the planned
replacements applied: 0 mismatches. One full name repeats on each side,
the same one: an `it.each` pair under "translation unknown-key
strictness" that already printed alike at the base. No head name carries
`#` plus digits (302 base names did). No source escape sits in a planned
anchor, so the comparison tool met none.

## Changeset: `skip-changeset`

Measured, not assumed:
- `npm pack --dry-run` of `@objectstack/spec` lists 2068 files. 0 of the
16 touched files are in it, and no `*.test.ts` at all (`files[]` ships
`src/**/*.zod.ts`, not tests). The controls
`src/system/translation.zod.ts`, `src/system/metrics.zod.ts` and
`dist/index.mjs` are in it.
- In the built `dist/`, two new phrases and an old one each read in 0
files. The control `Unrecognized key` reads in 42.

So this PR publishes nothing, and no changeset is added.

## Verification (at `320cf687c7`)

- `pnpm turbo run build` over all packages: 71 / 71, through the shared
verify lock (turbo exit 0, recorded to a file).
- `@objectstack/spec`:
  - `vitest run --project local`: 619 files, 18485 passed, 1 todo.
- `typecheck`: exit 0, including `check:test-typecheck` (52 files / 246
errors / 135 pinned signatures held). Its program holds all 16 group
files, counted by path with `tsc --listFilesOnly -p tsconfig.test.json`.
- `check:generated`: all 15 generated artifacts up to date, against the
`dist/` the build above wrote.
- **Gates:** `dispatch-gates --commands` derived 79 families, the same
79 as stage 26. All 79 exit 0. `--ran` reconciles: 79 derived, 79 run, 0
NOT-MEASURED, 0 UNRUN, every family with its exit code recorded. The
five roster families marked as sharing a directory with this diff
(`check:meta-url-spelling`, `check:spec-changes`,
`check:authz-resolver`, `check:error-code-casing`,
`check:filter-alias-parity`) each exit 0.
- **ESLint, a proven narrowing:** `--no-inline-config` over the 16 files
reads 0 errors and 0 warnings. The population comes from ESLint's own
config: 16 configured, 0 ignored. No file sets `parserOptions.project`
or `projectService`, so no untouched file's verdict can move.
- `check-governed-merges --test`: NOT governed, 126 changed lines (+63 /
-63).
- A control-byte scan over the 16 changed files finds none.

## `main` since the base

Re-fetched just before this PR opened, `origin/main` was one commit past
the base (`6befe19c6e`, objectstack-ai#21990). It touches 4 files in
`packages/metadata-protocol` and `.changeset/`, none of the 16 and none
under `packages/spec/src/system/`, so `main` was not merged. `git
merge-tree` onto `6befe19c6e` is clean, and none of the 4 open PRs
touches any of the 16 files.

## Acceptance notes

- **Same-id test titles in other packages** stay: 37 lines in 14
packages (`plugin-security` 9, `lint` 5, `cli` 4, `objectql` 4,
`service-settings` 4, `core` 2, `spec/scripts` 2, and one each in
`metadata-protocol`, `metadata`, `plugin-approvals`, `qa/dogfood`,
`sdui-parser`, `service-automation` and `service-i18n`), each package's
share under the objectstack-ai#20513 lane children. Examples:
`plugin-security/src/permission-denied-user-copy.test.ts`'s four `objectstack-ai#7414
—` describes and
`metadata/src/migrations/notification-event-migration-retirement.test.ts:54`'s
`[objectstack-ai#16194]` twin. No same-id title is left in this card's own census.
- **Kept record ids in the ledger reasons:** `5861442317` (held by the
file's own `toContain('5861442317')` assertion) and `5755653853` are
GitHub comment ids of ruling records, outside the gate's
three-to-five-digit pattern, not tracker numbers.
- **Code comments with live ids** remain in these files, among them the
`fieldGroups` / `inlineColumns` / root-coordinate ledger banners in
`metadata-form-zod-reconciliation.test.ts` (six comment lines still say
"5861442317, objectstack-ai#19332"), the `// objectstack-ai#7646 —` banner in `translation.test.ts`
and the `objectstack-ai#17785, ruling A on objectstack-ai#15939` block in `tracing.test.ts`. Code
comments are not this card's share.

---

_Generated by [Claude
Code](https://claude.ai/code/session_01T9u38rswFp5Rw8DswRUReJ)_

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tests tooling

Projects

None yet

2 participants