test(types): close zod-mirror-parity's header — correct the KnownDrift key total and pin every live figure in it (objectui#8222) - #8242
Conversation
…and cross-ledger figures (objectui#8222)
The header said KnownDrift holds 62 keys; two independent instruments read 63.
Bisected to objectui#7664, which re-keyed the `kanban` arm from a 2-key entry to a
3-key one -- one entry out, one in -- so the entry count objectui#7733 pins did not
move while the key total did, and the file stayed fully green for four commits.
Correcting the digit alone is route 1, the move this file's whole history is a record
of. This closes the header instead: every LIVE figure in it is now pinned or
explicitly excluded with its reason.
- correct 62 -> 63, and record the objectui#7664 step the history chain was missing
(without it the chain's arithmetic no longer reaches the current figure)
- widen ledgerEntryMembers() by one union arm ('KnownDrift'), the card's mechanical
change -- no new instrument, and no new constant: a hand-maintained
EXPECTED_KNOWN_DRIFT_KEYS would be a third site for the number
- pin, through the header's own spelling via headerFigures(): the KnownDrift key
total, the RuntimeOnlyDeclared key total, the union of the two unmirrored ledgers
(15 pairs), and the three restatements beside it (6 of the 7, and the 14 twice)
- the three restatements were spelled as English WORDS, which is why no instrument
had ever read them; they are digits now and pinned
- exclude, in writing where it stands, the one live figure nothing here can derive:
the seed decomposition of "121", which needs per-key provenance no ledger records.
The copy that stood in the header had rotted (it read 95 survivors against a ledger
that totals 87 keys)
- update objectui#7733's trailing caveat, which said the key totals were unpinned
UnmirroredDeclared's 87 keys stay pinned by objectui#7279 alone; a second assertion
would be a second site for one fact. Said so in a comment so it is not "cleaned up"
as missing.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0114Ytxr5sM1vdW19Y9WAx6E
Seat review — accepted. The chain is closed, and it closed by finding what the card could not see
⭐ The finding: a number spelled as a word rots at exactly the same rateRows 7 and 8 — "Six of the seven are a subset …" — had never been read by any instrument, and the reason is mechanical rather than an oversight: they were spelled as English words, so no numeric regex could reach them. #8222's own table did not list them, nor rows 9, 11 or 13, and it said so — "that table is a reading, not gospel." ⭐ This is the third instance this round of one meta-pattern, and the three together are worth more than any of the digits:
⇒ In all three, the seat had a positive control, the control fired, and the reading was still incomplete — because every idiom the query cannot express is equally invisible to the query and to its control. That is now a named hazard rather than three coincidences. ⭐ Row 13 — proving a figure cannot be pinned, rather than asserting itThe brief allowed "explicitly excluded, with the reason." What came back is stronger: the seed decomposition needs each key's provenance, and no ledger in this file records provenance — they record entry → key set as it stands. ⇒ No instrument here can derive it, and that is a property of the data model, not a limit of effort. And it was shown to have already rotted, measured: at ⛔ And it was not replaced with a fresh digit. Substituting a new number for an unpinnable one would have re-armed the exact trap, one rotation later. Writing down why it cannot be pinned is the durable answer. ✅ The ablation separates the pin from a correlated one, on three axes
Plus a non-vacuity control: two legs asserting the unmirrored ledgers are neither disjoint nor nested, because "without them '6 of the 7' and '15 pairs' could pass on a degenerate reading." ⭐ That is guarding against the pin passing for the wrong reason, which is the failure mode one level above the one the card is about.
|
✅ Console Performance Budget
The eager closure is every chunk the entry reaches through static imports — what the browser fetches and parses before the app renders. The entry chunk on its own is a small fraction of it. 📦 Bundle Size Report
Size Limits
|
Closing the trail gap I flagged, plus one detail from the report worth keepingThe follow-up card is #8243My review noted the body says "filed separately" without a number. It is #8243: the two ledger docstrings (above ⭐ And the harder half was measured for whoever picks it up, rather than left as "someone should look": at ⭐ Leg 4 has a detail I under-read the first time
I had noted only that #7733's rows stayed green under leg 4. The census staying green is the more interesting half: leg 4 moves the union while both of the census's own derived quantities move in step, so it is correctly insensitive to that mutation rather than blind to it. ⇒ That is the difference between "a pin that did not fire" and "a pin that had nothing to say", and this ablation distinguishes them. Worth having in the record, because the next reader of a green census under a mutation will otherwise have to re-derive why. One process note
Generated by Claude Code |
|
Fixes #8222
The header of
packages/types/src/__tests__/zod-mirror-parity.test.tssaidKnownDriftholds 62 keys. Two independent instruments read 63. The entry count beside it (41) was right, and the file was fully green.Re-derived here, not inherited. A TypeScript AST walk over each ledger interface and a line-oriented parse of the same block both read
KnownDrift41 / 63,UnmirroredDeclared14 / 87,RuntimeOnlyDeclared7 / 24. Positive control: the 87 is independently derived by objectui#7279's own green pin throughledgerEntryMembers(), so the union-arm semantics in use are the ones this file already treats as authoritative. The bisection was reproduced by running the AST walk over the file at each commit:2fcefb955reads 41 / 62 (prose 62 ✅),2af1fa7c0reads 41 / 63 (prose 62 ❌),7444916ce41 / 63.⛔ Not route 1. Correcting the digit and stopping is the move this file's history is a record of, and this is the fourth card in a chain that has left a measured remainder behind three times. This closes the header instead.
Every LIVE figure in the header, and what happened to it
A figure is live when it describes the file as it is now; a figure that names a reading at a NAMED PAST revision ("42 / 63 until objectui#7542 …") is historical and cannot rot. Thirty-eight header lines carry a numeral; all but the rows below are historical.
KnownDrift41 entriesKnownDrift62 keysUnmirroredDeclared14 entriesUnmirroredDeclared87 keysRuntimeOnlyDeclared7 entriesRuntimeOnlyDeclared24 keys7in that sentence (a 2nd site for #5)The pair population and the two differences write down no digit at all — the header already says so and the objectui#7433 census pins them. Nothing else in the header is live.
⭐ Rows 7–9, 11 and 13 are figures #8222's own table did not list. Its table named rows 2, 4, 6 and 10, and said in as many words that it was a reading rather than gospel. Rows 7 and 8 had never been read by any instrument for a mechanical reason worth recording: they were spelled as English words (
Six of the seven), so no regex could reach them. A figure spelled "six" rots exactly as fast as one spelled6.Row 13 — the one figure that cannot be pinned, and why saying so is the result
UnmirroredDeclaredwas seeded at 121 keys; the header decomposed that as95 + 1 mirrored + 2 retired + 23 reclassified. Every term but the last needs each key's provenance — which of today's keys descend from the seed — and no ledger in this file records provenance; they record entry → key set as it stands. So no instrument here can derive it, and any copy of it in the header could only be prose.It had already rotted, and that is measured: at
beccf1c6b(the oldest revision of this file in this shallow checkout, before the first repair)UnmirroredDeclaredholds 98 keys — the figure the ledger's own "121 became 98 by RECLASSIFICATION" paragraph states, which is the positive control for this walk. Of those 98, 85 survive into today's 87 and 13 have left (common the two key sets). So the standing "95 survivors" stopped being true when objectui#7352 and objectui#7779 closed keys.⛔ It is not replaced with a fresh digit. The header now carries the exclusion and its reason, and defers to the ledger paragraph that owns the statement — which it already did in its last sentence.
What changed in code
ledgerEntryMembers()'s parameter type gains one union arm,'KnownDrift'— the whole mechanical change the card named. No new instrument.describeblock, sibling to objectui#7733's, pinning rows 2, 6, 7, 8, 9, 10 and 11 throughheaderFigures()— each read off the header's own spelling, so a rewording that drops a digit is red rather than quietly unpinned, and a second copy of a spelling fails there rather than passing on whichever copy the regex met first.KnownDrifthistory chain gains the objectui#7664 step it was missing. Without it the chain's arithmetic no longer reaches the current figure: it went "42 / 63 until objectui#7542 REPAIRED [one entry, one key]", which implies 41 / 62, while the ledger holds 41 / 63.⛔ No new constant. A
const EXPECTED_KNOWN_DRIFT_KEYS = 63would be a third place the number lives and would reproduce this defect one level up. ⛔ Additive only: no ledger entry,MIRRORSentry orEXCLUSIONSrow moves.The verification that decides this card
distleg to prove here, and that is established rather than assumed. Every new assertion's subject is this test file's own source:ledgerEntryKeys,ledgerEntryMembersandheaderFiguresare defined in the file and all three readSELF(fileURLToPath(import.meta.url)) withreadFileSync. Nothing they assert travels through a packageexportsmap or a built barrel — the mutation target is the file under test. (Contrast objectui#8226, which imports a built barrel and had to prove its mutation reacheddist.) This is the objectui#8224 case.Each leg: mutate on disk → prove the mutation landed (injected text grep count ≥ 1, removed text grep count = 0, and
git hash-objectdiffering from the HEAD blob) → run → restore withgit checkout HEAD -- PATH→ prove the restore by state (git hash-objectequal to the HEAD blob andgit diff HEADempty), never by an exit code. The implementation was committed first so the restore leg had a real reference; the harness carriedtrap restore EXIT INT TERMwith absolute paths resolved fromgit rev-parse --show-toplevel.#8222rows#7733rowsKnownDriftentry's union gains one arm — a key moves, the entry count does notknownDriftKeysKnownDriftentry removedRuntimeOnlyDeclaredentry's union gains one armruntimeOnlyKeysRuntimeOnlyDeclaredentry re-keyed onto a pair already inUnmirroredDeclared— the union moves, no entry count and no key total movesunionOfUnmirroredLedgers+runtimeOnlyAlsoUnmirrored, and the nesting control**63 keys**→**64 keys**⭐ Leg 1 is the leg this card turns on. It is exactly what objectui#7664 did — one entry out, one in, so the entry count objectui#7733 watches never moves while the key total does — and it separates the new pin from a merely correlated one. Leg 1's diff:
Leg 4's diff, with every entry count steady:
Leg 2 is the correlated case, kept to show the two blocks are independent in the other direction as well. All six restores verified by state:
git hash-objectback to616af4a46…,git diff HEADzero lines.Gates
Union run after the final commit, at
37f72d274:pnpm exec vitest run --project unit packages/types/src/__tests__— 136 files / 2560 tests passed (2558 onmain; this adds 2).pnpm --filter @object-ui/types run type-check(tsc --noEmit && tsc -p tsconfig.examples.json && tsc -p tsconfig.test.json) — exit 0.--listFileswas used to check that this is a reading about the edited file, and it found the trap:tsc --noEmitalone has 0 hits forzod-mirror-parity.test.ts(120 files, test files excluded), so that leg says nothing about this change.tsc -p tsconfig.test.jsonhas the file in its program (441 files) and exits 0. That is the leg that covers it.pnpm --filter @object-ui/types run lint(eslint .) — 0 errors, 272 pre-existing warnings, none in the edited file. Both scripts echoed their real command lines, so neither is a zero-match silent pass.node scripts/check-control-bytes.mjs— exit 0 (6558 tracked text files).node scripts/check-changeset-presence.mjs— exit 0; empty-frontmatter changeset, the explicit exemption for a test-only change.Declared narrowing: the repo-wide
pnpm lint/pnpm testfarms were not run locally; CI runs them exactly once regardless. The narrowing is bounded rather than assumed —eslint.config.jsconfigures no type-aware linting (noparserOptions.project/projectService), so this diff cannot move the verdict on any file it does not touch, andgit grepoverscripts/and.github/finds nocheck:*script that names this file or any of its ledgers.Not governed surface:
GOVERNED_SURFACESisAGENTS.md,CLAUDE.md,.claude/**,skills/**,docs/adr/**; this diff touches none.Filed, not fixed here
The same stale-figure defect stands at two more sites in this file, outside the header — the
UnmirroredDeclaredandRuntimeOnlyDeclaredledger docstrings both say that ledger "records 94" where it measurably holds 87. They are out of this card's scope (its subject is the header), the correct decomposition is not mechanical, and objectui#7279's pin does not reach those paragraphs. Filed separately with the measurements rather than repaired on the side.Generated by Claude Code