Repository navigation
test(scripts,types): judge the spawned-build env by REMOVAL, and correct three comments that outran their measurement (objectui#8712) - #9014
Merged
Conversation
…ect three comments that outran their measurement (objectui#8712)
The objectui#8598 ratchet over builds a test spawns asked whether the token
`VITEST` occurs in the resolved `env:` expression. Removal is the property it
exists to hold, and presence is the wrong question in both directions at once.
Re-measured on `2596b1b85`, one file, one command, varying only the environment
`packages/cli/src/__tests__/cli-bin.test.ts` hands its two build spawns:
env: { ...process.env, VITEST: 'true' } exit 0, 2 passed -- a tree
that SETS the variable passes the gate that exists to remove it
const { VITEST: _v, ...BUILD_ENV } = process.env
exit 1 at both spawns -- a
correct scrub, written idiomatically, is refused
The env expression is now read as an AST and classified by what it DOES to the
key: `delete env.VITEST` on a copy and a `{ VITEST: _v, ...rest }` pattern are
both accepted, an object literal that assigns `VITEST` is refused by name, and
anything else is `inherits`. Name resolution stays as narrow as it was -- the
declaration of the name the spawn passes, plus the names spread into it -- so a
comment about the variable still resolves nothing. Both mutations above were
re-run against the new predicate and both flipped; every mutation was restored
to its HEAD blob and proved by hash.
Three comments are corrected to what was measured, which is the rest of the same
card. Two of them said a flipped `emptyOutDir` on the `./zod` bundle config
"deletes the published package" and that "the build still exits 0". Measured on
the same tip with `vite build --emptyOutDir`: `dist/` goes 128 files to 89, the
whole loss inside `dist/zod/` (40 to 1) because `outDir` is a SUBDIRECTORY, and
the build script's third step then reds with `missing 39 of 128 files tsc
emits`. The gate is sound and unchanged; only the sentences about it move. The
third is a built-artifact case named for a single-schema-entry measurement it
cannot make: a vitest import evaluates the whole barrel, so against an ablated
`tsc` barrel of 30 separate modules that case PASSED while the file went red
through the structural case beside it. It is renamed to the accept-set control
it is.
Fixes #8712
Claude-Session: https://claude.ai/code/session_01FhBNJcLRZLe8M87VcUgpKr
Co-authored-by: Claude <noreply@anthropic.com>
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
|
baozhoutao
marked this pull request as ready for review
September 10, 2026 18:01
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Sep 10, 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 #8712
Every item on that card was carried as a premise, not a fact — the card's own fence, adopted verbatim by triage. ⭐ Each was re-measured on
origin/main=2596b1b85before anything was touched. All three actionable items reproduce; ④ and ⑤ are recorded-only by the card's own words and ⛔ nothing was changed for them.① The ratchet had a vacuous green and a false positive — both reproduced, both closed
The gate over builds a test spawns judged the resolved
env:expression by whether the tokenVITESToccurs in it. Removal is the property it exists to hold, and presence is the wrong question in both directions at once.Re-measured on the tip above — one file mutated, one command, the gate's own exit code:
{ ...process.env, VITEST: 'true' }— a tree that SETS the variable2 passedthis environment SETS \VITEST``const { VITEST: _v, ...BUILD_ENV } = process.env— a correct, idiomatic scrub2 passed{ /* VITEST must not reach a build this test spawns. */ ...process.env }— the token in a comment only2 passedhands the child \VITEST` unchanged`⭐ The third row is not on the card. It is the shape the file's own header already names as the thing to refuse — a call site somebody explained instead of fixing — and it was measured to pass. It was taken against the old gate restored from
2596b1b85in the same tree, so both halves of that row are real runs, not inference.What changed: the env expression is read as an AST and classified by what it does to the key —
delete env.VITESTon a copy and a{ VITEST: _v, ...rest }rest pattern are both accepted, an object literal that assignsVITESTis refused by name, everything else isinherits. ⛔ Nothing was widened to make a case pass: every shape that passed before and is genuinely a scrub still passes, and two shapes that used to pass no longer do.Name resolution stays exactly as narrow as it was — the declaration of the name the spawn passes, plus names spread into it, never the whole file — so a comment about the variable resolves to nothing. The population walk, the floor and
NAMED_MEMBERare untouched.HEADblob, and confirmedgit diff HEADnamed no files. The two mutated blobs are byte-identical between the before and after runs (580275ce…for the setter,9254390…for the rest pattern), so the two columns above differ only in the predicate.② Both
emptyOutDircomments stated a measured falsehood — the claim reproduced, the quoted string did notMeasured on the same tip,
vite build --emptyOutDirin the types package:outDiris a subdirectory, so a flip emptiesdist/zod/— the./zodtypings and every per-category zod module — and leaves the other 89 files standing. And it is not silent:vite builditself exits 0, but the build script's third step reds. ⭐ The gate is sound and unchanged; only the two sentences about it move, now stating the measured effect and attributing it to the commit it was measured on. The stale "124 files" in the same sentence went with them.③ A case name outran what it measures
Against an ablated
tscbarrel of 30 separate relative specifiers, the built-artifact pin reds —Tests 1 failed | 4 passed, the failure being the structural case — while the case named for a single-schema entry passed. A vitest import evaluates the whole barrel, as that file's own header says, so no case in it can measure a single-schema entry. It is renamed to the accept-set control it actually is, and the reason is recorded beside it. The bundle was restored and the restore proved by hash (44404e1d…).④ / ⑤ — ⛔ no change
Recorded-only by the card's own words. Neither asks for one and neither got one.
The gate objectui#8997 landed 40 minutes before this card was dispatched has the same textual shape, and ⭐ its narrower hole is reachable: a spawn whose env declaration merely names
childVitestEnv()in a comment is accepted, while the identical file without that comment is refused. Measured with a probe plus its control, both runs restored. ⛔ Not touched here — that card is closed, its gate is not this card's surface, and a floor protects four pinned files' assertion counts. Filed bare with the measurement as #9013.Verification
pnpm exec vitest run scripts/__tests__/spawned-build-vitest-env-8598.test.ts—2 passedspawned-vitest-child-env-8616.test.ts+ the config pin —3 files, 12 passedOBJECTUI_DIST_PINS=1 … --project dist—5 passedtype-check:scriptsexit 0 — and--listFilesconfirms the changed gate is in that program;@object-ui/typestype-checkexit 0 (all three of its projects)eslint --format jsonon all four changed files: 4 files linted, 0 errors, 0 warningscheck-changeset-presence✅ (one changeset, empty frontmatter — nothing published changes) ·check-control-bytes✅ ·check-new-cross-file-line-citations0 new ·check-governed-queue-guard --test→ NOT GOVERNED⛔ Left in draft: not flipped ready, not enqueued, no auto-merge. The PM seat lands it.
🤖 Generated with Claude Code
https://claude.ai/code/session_01FhBNJcLRZLe8M87VcUgpKr
Generated by Claude Code