docs(metadata-protocol): boot reconciliation is ADR-0094 D4, not D3, at two comment sites - #16153
docs(metadata-protocol): boot reconciliation is ADR-0094 D4, not D3, at two comment sites#16153claude[bot] wants to merge 1 commit into
Conversation
…at two comment sites Two comments in `packages/metadata-protocol` cite `ADR-0094 D3` for boot reconciliation. In ADR-0094 that is D4 (`### D4 — Boot reconciliation and the migration/backfill path`); D3 is a different decision — `### D3 — Data-door writes are redirected into metadata (write-through)`. Prime Directive #13's mechanism is that a code comment naming an ADR section sends the next author to the decision they are standing on. A wrong section sends them to the write-through redirect table when they were looking for the `kernel:ready` convergence pass — a plausible-looking wrong answer, which is worse than no citation at all. Comment text only; no behaviour, no assertion, no test semantics. The edit is byte-length neutral, so no line number moves. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ARYe3yQTQCUFm5qPYNgKaJ
📓 Docs Drift CheckThis PR changes 1 package(s): 2 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
What this run could not see
Coarse fallback — 9 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 2d88dea85c16e4398dcdc6cc30c911cde434238e && git checkout 2d88dea85c16e4398dcdc6cc30c911cde434238e
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin f7ffbd65eaac1919e85dcb597c996d1177b54dbb 2c904e9c4c169dde68e9c2a00da66538569713b1 && git checkout -B drift-repro f7ffbd65eaac1919e85dcb597c996d1177b54dbb && git merge --no-ff 2c904e9c4c169dde68e9c2a00da66538569713b1
node scripts/docs-audit/affected-docs.mjs --json f7ffbd65eaac1919e85dcb597c996d1177b54dbb
|
Docs Drift Check — the two named pages, and the blind spot that was actually worth searchingThe two hand-written rows: no action, and why that is a measurement rather than a shrugBoth rows exist because this diff sits inside the
The input-side blind spot the check names itself — searched by handThe row that would be invisible to this check on every run is prose that restates the boot-reconciliation rule while citing the wrong ADR section, because it shares no identifier with the emitter. That is precisely this card's shape, so the census was extended past Every
The three Coverage the other way — every ⇒ Nothing found outside the two authorised sites. Nothing to file, and nothing in Firing positive controls, because a zero result without one is not a reading:
Tree noteThe bot read Anchor family, re-run on the merged tree
Generated by Claude Code |
Fixes #15247
Two comments in
packages/metadata-protocolciteADR-0094 D3for boot reconciliation. Read from the record itself, that mechanism is D4:### D3 — Data-door writes are redirected into metadata (write-through)(ADR-0094:133) — an engine middleware registered byplugin-securitythat translates every non-system data-door write intosaveMetaItem/deleteMetaItem.### D4 — Boot reconciliation and the migration/backfill path(ADR-0094:185) — "Atkernel:ready, after the ADR-0086 D5 package seeding,plugin-securityruns a convergence pass": overlays to records, the one-time backfill, drift healing.Prime Directive #13's mechanism is that a comment naming an ADR section sends the next author to the decision they are standing on. These two sent them to the write-through redirect table when they were looking for the
kernel:readyconvergence pass — a plausible-looking wrong answer, which is worse than no citation.The diff
Two characters, comment text only. No behaviour, no assertion, no test semantics.
Triage measured the second site at
protocol.ts:20062on1bc3c092a; on this PR's base932acc3dfthe same sentence sits at:20024. Re-located by text, not by line number.The census — the real job of this PR
git grep -n "ADR-0094 D3\|ADR-0094 D4" -- packages/— 20 hits, every one classified, so that "I changed exactly the two that were wrong" is checkable rather than asserted.Genuine D3 — data-door write-through. 4 hits. CORRECT, left alone.
plugin-security/src/permission-set-projection.ts:861// Data-door write-through (ADR-0094 D3)plugin-security/src/permission-set-projection.ts:959sys_permission_setinto the metadata store"plugin-security/src/permission-set-projection.ts:1140createPermissionSetWriteThrough(declared at:975) — the enclosing function IS the D3 middlewareplugin-security/src/permission-set-projection.test.ts:566Genuine D4 — boot reconciliation / backfill / drift healing. 14 hits. CORRECT, left alone.
plugin-security/src/permission-set-projection.ts:300(ADR-0094 D4 boot backfill),:1299(bannerBoot reconciliation + one-time backfill),:1438(backfill into metadata FAILED (ADR-0094 D4)),:1465(drift re-projection),:1481(failed-backfill summary),:1497(projection reconciled (ADR-0094 D4)) ·permission-set-drift.ts:22(D4 step 1) ·permission-set-overlay-discard.ts:18(step 2/3) ·security-plugin.ts:3562([ADR-0094 D4] Converge record ↔ metadata) ·permission-set-projection.test.ts:253,:913,:1111·plugin-security/CHANGELOG.md:5864,:9491(historic, generated).The two outliers — boot reconciliation spelled D3. 2 hits. THE ONLY THING THIS PR CHANGES.
metadata-protocol/src/protocol.ts:20024·metadata-protocol/src/protocol.recovery-doors-mutation-projector.test.ts:204 + 14 + 2 = 20. Post-edit the same census returns 4 D3 + 16 D4 = 20 — same total, so no citation was added or dropped, exactly two were re-pointed.
The census population, proved with a firing control
The boilerplate's pathspec trap is real and it fires on this very query:
packages/*/src/**/*.tsgit grepapplies no:(glob)magic, so this silently excludes everythingpackages/**/*.tsCHANGELOG.mdrows-- packages/(used here)Positive control inside the chosen set, at both directory depths the population spans: 2 files matched at
packages/<pkg>/src/and 6 atpackages/plugins/<pkg>/src/.Repo-wide, outside
packages/, the same pattern hits onlydocs/adr/0086-…:379,docs/adr/0131-…:260anddocs/adr/0131-…:301— all three cite D3 for the write-through redirect and are correct. They are a governed surface and are not touched.Clause ②: no
Measured by ablation on
@objectstack/metadata-protocol, not assumed.files: ["dist", …], so the published surface is all 24 files underdist/. Built at head, swappedprotocol.tsback toorigin/main, rebuilt, diffed all 24, restored.boot reconciliation (ADR-0094 D4)count 1 to 0, D3 count 0 to 1, blob426728d2ato89436302d— byte-identical toorigin/main's blob.dist/:ablation-dist-preflight --absent 'ADR-0094 D4'exit 0, "marker absent from all 24 built files".dist/index.js.mapanddist/index.cjs.map.index.d.ts,index.d.cts,index.jsandindex.cjsare all byte-identical.registry to the target version— occurs in exactlyindex.js.mapandindex.cjs.mapand in none of the other 22 files, the same distribution as the changed text. Sourcemaps embedsourcesContentverbatim; they are not a contract face.git status --porcelainempty, blob back to426728d2a,git diff HEADempty, and the rebuiltdist/byte-identical to the pre-ablation snapshot across all 24 files.ablation-dist-preflightwith the marker expected present exits 1 and says the marker is found "ONLY in 2 sourcemap files and in no executable output". That is the tool stating, without being asked, that this text never reaches running code.Line-number neutrality, proved rather than assumed
A comment-only diff is not a no-op for any gate that cites a line number, so:
protocol.ts1235907 bytes before and after; the test file 24258 before and after.protocol.ts21625 to 21625; the test file 511 to 511.cat -nof base against head, exactly one line differs per file, at the same line number (20024and20). Every other line is byte-identical at its own number, so no anchor can have moved.protocol.tsfrom elsewhere in the tree (:106,:1580,:2938,:6764,:8082, and the nine rows inscripts/check-durability-degradation-log-level.mjs). None names:20024, and none names:20in the test file.Gates run locally, at this PR's final commit
2c904e9c4Derived with
node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack(102 families; CI runs the farm). The anchor/census family was run in full and not narrowed on the grounds that the diff is only comments:check-system-context-census.mjs+--self-test·check:doc-anchors·check:adr-anchors·check:adr-symbol-anchors·check:scripts-symbol-anchors·check-keyed-text-bounds.mjs+--self-test·check:nul-bytes·check:doc-authoring·check:cross-package-test-inputs·check:durability-log-level·check:single-claim-paths·check-comment-mask-adoption.mjs·check-comment-mask-corpus.mjs— 15 runs, allREAL_EXIT=0(redirect-then-read, never through a pipe).Population proof rather than a bare exit code:
check:cross-package-test-inputsnamesmetadata-protocolin its output;check-system-context-censussweepsmetadata-protocol(it anchorsmetadata-protocol/src/seed-loader.ts:2032) and carries 0 anchors intoprotocol.ts.Package verification:
pnpm --filter @objectstack/metadata-protocol typecheckexit 0, andtsc --noEmit --listFilesconfirms both edited files are in the swept set (this package's tsconfig includessrc/**/*with no test exclusion, so the green is about them).vitest run src/protocol.recovery-doors-mutation-projector.test.ts— 10 passed, exit 0.Changeset:
skip-changeset, no changeset fileAGENTS.md: that label "is for a diff that publishes nothing from any released package." The ablation above measured this case — no declaration, no runtime output, no behaviour changes; the only published bytes that move are sourcemap
sourcesContent. Merged precedent of the same shape: #16103 (comment-only indriver-memory/src/memory-matcher.ts) and #15985 (comment-only in aservice-cluster-redistest header), both merged carryingskip-changesetand no changeset.In-flight check on
protocol.tsRun before claiming, against current
origin/main=932acc3df. Two open PRs also touch this file: #16117 (+34 -4) and #16123 (+8 -3), both with hunks in the@@ -7290region — about 13,000 lines above:20024, no overlap, and this diff is length-neutral so it moves nothing for either. #16125 is an open issue against a different sentence at:14967; it is deliberately not addressed here and remains open.Generated by Claude Code