docs(cli): state the union-arm property, not the arm count - #7788
Merged
Conversation
`union-arm-diagnostics.ts` and its test quoted the size of `AnyComponentSchema` as prose integers — "108 leaf arms and 108 DISTINCT `type` literals", "stops well short of the 108", "14 entries for `AnyComponentSchema`'s 14 members" — inside a module whose header is explicit that its facts are measured on the tree. Both numbers had drifted. The card (objectui#7702) measured 105/103; this branch measures 107 arms and 13 root options. Three different arm counts inside one week, in both directions. Rather than re-measure and re-date the integers, state the property they were standing in for. What the display-cap argument actually rests on is that no literal is claimed by two arms — that is what makes "exactly one arm accepts that literal" total — and that is true independently of how many arms there are. The alignment sentence needs no count at all; the module already records that it never relies on the alignment. Twelve comment sites in two files, found by content rather than by line number. Two of them (the test file's "the other 107 arms") restate the same integer derived, and were not on the card's list; a content sweep is what turned them up. No count is pinned by a test: a pinned count would red the build every time a component lands, which is strictly worse than the stale comment. No executable line changes. Proven with the TypeScript parser: transpiling both revisions with `removeComments: true` yields byte-identical output for both files. The changeset therefore declares an empty frontmatter — nothing ships. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KbJQ1y1J12nZxYzFWhP8Q3
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 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 #7702
packages/cli/src/utils/union-arm-diagnostics.tsand its test quoted the size ofAnyComponentSchemaas prose integers, inside a module whose header is explicit thatits facts are measured on the tree. Both integers had drifted.
Remedy shape 2 — state the property, not the count
The card offered two shapes and the triage seat ruled for the second; the dispatch
adopted that ruling unchanged, and this PR implements it:
The card is its own evidence, and this branch adds a third data point. The prose said
108; the filer measured 105 at PR #7701's head and 103 at its merge-base;
this branch measures 107 on today's
origin/main. Three different values in oneweek, and the direction reversed once (116 → 105 during the card's own correction).
An integer that moved three times will move again, so it is gone rather than refreshed.
Correspondingly, no test pins the count. A pinned count would turn a stale comment
into a gate that reds every time a component lands — strictly worse than the finding.
The existing capped-list assertions stay derived (
/Nearest of the \d+ accepted types/).Live reading — recorded here, deliberately not in the source
Measured on
origin/main@6771c805athrough the vitest alias (which resolves@object-ui/types/zodtopackages/types/src/zod/index.zod.ts— source, notdist),using the card's method 3 (the module's own reader,
explainUnionIssue(...).totalArmNames)cross-checked against method 2 (error-tree derivation restricted to issues at path
exactly
['type']):explainUnionIssue(...).totalArmNames(method 3)typeliterals via error tree (method 2)[]14in the old prose)typecontractOccurrences equal distinct, so no literal is claimed by two arms — the property the
new prose states is measured true, not merely asserted. The measurement was taken with a
scratch test that was deleted before the first real edit; it is not part of this diff.
A number in a PR body is dated by its commit. A number in a comment is not.
The sites, found by content and asserted before replacement
Every site was located by content, never by line number, and each anchor's occurrence
count was asserted before its replacement (the script aborts without writing if any
count differs):
10814(alignment sentence)107(the same integer, restated derived)All twelve replacement anchors asserted 1/1. The two
107sites are the test file's"the other 107 arms come with it" and "nothing from the 107 arms that merely
disagree about
type" —108 - 1, the same measurement restated. They are the samedefect, in the same two files this dispatch claims, fixed the same mechanical way. The
card's grep was for
108, which is why they were not on its list; leaving them wouldhave left the finding half-repaired.
Comment-only — proven with the parser, not by eye
The Clause-2 void condition (any executable-line change under
packages/*/src) wasnot triggered.
^[+-]\s*(\*|//|/\*); non-comment changed lines: 0.removeComments: trueyields byte-identical output for both files, while the rawtext differs. Executable code is unchanged by construction, not by inspection.
Per the dispatch, no mutation control was attempted on "nothing mechanically reads these
numbers": a comment mutation cannot red a gate, so that arm would have measured nothing.
The proof is that all thirteen sites are comments, shown above.
Verification — all at
e83fe5064, the branch headpnpm exec vitest run packages/cli/pnpm --filter @object-ui/cli type-checkpnpm exec eslint src --format jsoninpackages/clinode scripts/check-changeset-presence.mjsnode scripts/check-changeset-no-major.mjsnode scripts/check-control-bytes.mjsnode scripts/check-shell-escape-residue.mjspnpm --filter '@object-ui/cli...' buildpnpm checkAll checks passedpackages/cliholds 16test files, and held 16 at the card's own merge-base
6e8863093as well — so this is notdrift since the card was filed. Reported rather than repeated, as the dispatch asked.
It is a fourth prose integer that does not survive measurement, on the card that exists
because prose integers do not survive measurement.
The typecheck really covered the edits:
tsc --noEmit --listFileslists both changedfiles, so this is a measurement and not a silent skip. The package script is spelled
type-check(hyphenated), and the run echoed@object-ui/cli@17.6.0 type-check, so itwas not a zero-match pass.
pnpm checkprints three pre-existing warnings aboutpackages/vscode-extensionand twofilter-builderexamples. They are untouched by this branch and cannot be reached by acomment edit; the gate exits 0.
Changeset
.changeset/7702-union-arm-count-prose.md, empty frontmatter — the first-class"declares that nothing ships" form.
packages/cli/src/is a released package's source,so
AGENTS.mdrequires the declaration even though the diff is comment-only; thepresence gate confirms the empty form is a complete answer. No version bump was invented,
and nothing is
major.Kept deliberately intact
The module header's "Measured facts this rests on (Zod 4.4.3, measured on this tree)"
statement is untouched, and nothing was removed from the card — including its three-method
cross-validation section, which the triage seat named this card's insurance against a
third re-measurement.
🤖 Generated with Claude Code
https://claude.ai/code/session_01KbJQ1y1J12nZxYzFWhP8Q3
Generated by Claude Code