test(types): derive the zod-mirror-parity population instead of writing it down - #7731
Merged
Merged
Conversation
…ng it down `zod-mirror-parity.test.ts` quoted the registry population and the two differences taken from it as prose literals that no assertion read. The figures were corrected by hand four times since objectui#6141, which had written down that a prose correction "rots again the next time an entry lands"; one of those corrections was false on the day it was written, and another was a maintainer who correctly updated the ledger counts in front of them and could not see that the minuend under them had moved. Route 2 of objectui#6141, as objectui#7433's triage requires: the runtime census now carries one written-down constant, `EXPECTED_MIRROR_PAIRS`, pinned against `Object.keys(MIRRORS).length`, and derives both differences the header used to state. The ledgers are type-level `interface`s with no runtime value, so their sizes are read from this file's own AST with the TypeScript parser the census already runs for `specReferencingExports`. Each difference is derived twice -- by walking the registry and by subtracting from the pinned population -- so the two disagree exactly when a ledger names a pair `MIRRORS` does not register. The failure message names both remedies and their discriminator: whether the diff moved the registry or the constant. Every prose site that quoted the population or either difference now names the constant or the census instead of a digit; no `MIRRORS` entry, ledger entry or `EXCLUSIONS` row moves, and the ledger counts the card records as never having rotted are left alone. Empty-frontmatter changeset: `@object-ui/types` publishes nothing from `__tests__/` -- the package `tsconfig.json` excludes the directory and its build program lists zero files under it. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BAZFhALsQsGqxui8sNqM8s
…in first
When `EXPECTED_MIRROR_PAIRS` itself is the thing that moved, both cases in
the new census fail together, and the second one's hint ("a ledger entry
names a pair MIRRORS does not register") is the wrong lead. Name the
dependency: the difference subtracts from the pinned population, so it
fails as a consequence and the population case is the one to fix.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BAZFhALsQsGqxui8sNqM8s
Contributor
✅ 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
|
This was referenced Sep 5, 2026
This was referenced Sep 5, 2026
os-justin
marked this pull request as ready for review
September 5, 2026 13:17
This was referenced Sep 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #7433
Route 2 of objectui#6141, which triage (comment 5548620618) made mandatory: ⛔ a third prose correction is not a fix. The defect is the mechanism —
packages/types/src/__tests__/zod-mirror-parity.test.tsquoted the registry population and the two differences taken from it as prose literals that no assertion read — so this PR makes the number derived and leaves the digits alone.Re-derived on this branch's base, inheriting nothing
Triage boundary 2 requires re-deriving on the tree as of starting. On
b74a859, two independent instruments:MIRRORSinitializerMIRRORSmembersLedgers, from the same AST:
KnownDrift42,UnmirroredDeclared14,RuntimeOnlyDeclared7, union of the two unmirrored ledgers 15. Both differences derived twice — by subtraction and by a set walk over the registry — agreeing at 142 (no entry in either unmirrored ledger) and 115 (noKnownDriftentry).⭐ The header's digits on
b74a859are correct today. That is the card, not a refutation of it: the figure was re-measured by hand a fourth time since objectui#6141 (objectui#7655), and no assertion anywhere in the file compares the registry size to a constant. A correct hand-maintained number is still a hand-maintained number.What the pin is
One written-down constant in the runtime-census region at the bottom of the file, where the census already reads
MIRRORSat runtime:EXPECTED_MIRROR_PAIRS, asserted againstObject.keys(MIRRORS).length. It is the only count in the file a human edits.MIRRORSdoes not register, which makes this the runtime twin ofassertionUnmirroredLedgerKeysAreRegisteredand extends the same cover to the drift half.interfaces with no runtime value to count, so their sizes are read from this file's own AST with the TypeScript parser the census already runs forspecReferencingExports— the same instrument, not a second one, and a measurement rather than a list to maintain.The failure message names which side to change (triage boundary 5), printing both numbers and both remedies, with the discriminator being which of the two the diff moved — not which number looks right. The second commit adds the dependency between the two cases to that message: when the population pin is the one that moved, the difference case fails as a consequence, and its own hint would otherwise be a wrong lead.
Prose: derives, does not restate
Nine sites rewritten to name the constant or the census instead of a digit.⚠️ The dispatch's site list had moved: three sites quote the population beyond the ones it names — a
KNOWN_DRIFT is a ratchetparagraph, aReconcileAgainstLedgerdocstring, and the seeding-floor paragraph. The historical narrative that quotes superseded figures (163, 160, the 141→147 delta chain, the 158-pair seeding run) is deliberately left alone: it describes the past and cannot rot.⛔ Not touched, per the dispatch: any
MIRRORSentry, any ledger entry, anyEXCLUSIONSrow. ⛔ The withdrawn "142 vs 123 contradiction" stays withdrawn — the two subtractions have different, labelled subtrahends. The three ledger counts the card records as never having rotted keep their digits.Red-first proof
Re-run on the FINAL head
40171f5f, so the evidence matches what is pushed. Trap-guarded, absolute paths, mutation proven on disk by anchor counts before/after (⛔ never by an editor's exit code), restore proven by blob hash againstHEADand an emptygit diff HEAD.EXPECTED_MIRROR_PAIRS157 → 156MIRRORS holds 157, EXPECTED_MIRROR_PAIRS says 156→update EXPECTED_MIRROR_PAIRS from 156 to 157/put it back to 157MIRRORSentry removedMIRRORS holds 156, EXPECTED_MIRROR_PAIRS says 157→update EXPECTED_MIRROR_PAIRS from 157 to 156/put it back to 156Both restores:
restore OK — blob 5860bd3160b64446595bfa42788305cd22f39c0f matches HEAD, tree clean,git diff HEADempty.Predicted direction was RED in both legs, in opposite directions, and that is what was observed.
Changeset
check-changeset-presence.mjscounts the test file as source of a released package (it does not read the tsconfig exclude), so it demanded a declaration and got the empty-frontmatter form — the gate documents that as the explicit exemption, a pass rather than a workaround. ⛔ Noskip-changesetlabel: it is a phantom in this repo.The claim that nothing ships from
__tests__/is measured, not asserted:packages/types/tsconfig.jsonexcludes**/__tests__/**by directory, andtsc -p tsconfig.json --listFilesOnlylists 0 files under__tests__. The pin is insidetsconfig.test.json's program —tsc -p tsconfig.test.json --listFilesOnlylists the file.Gates (exit codes captured before any pipe; heavy runs through the shared verify lock)
All re-run on the final head
40171f5f:pnpm exec vitest run --maxWorkers=2 packages/types/pnpm --filter @object-ui/types type-checknode scripts/check-changeset-presence.mjsnode scripts/check-changeset-fixed.mjsnode scripts/check-changeset-no-major.mjsnode scripts/check-changeset-overwrite.mjspnpm run check:control-bytespnpm run check:spec-symbolspnpm run check:published-tsconfig-excludepnpm exec eslinton the changed fileThe three new cases were confirmed to actually execute under
--reporter=verbose, not merely to be collected.Governed-surface predicate on the final file list: 0 of 2 paths hit the register — ordinary queue landing applies.
🤖 Generated with Claude Code
https://claude.ai/code/session_01BAZFhALsQsGqxui8sNqM8s