Repository navigation
test(cli): drop the tsx launcher from three 10-13 s cli files, budget seven distinct floors - #28630
Merged
Merged
Conversation
…s files create-objectstack-stack-reach, translation-contributed-nav-validate-door and i18n-extract-companion-orphan spawned bin/run-dev.js through node_modules/.bin/tsx, a launcher that is its own node process in front of the CLI. Spawn it with process.execPath instead; argv, cwd, env and timeouts are unchanged. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5mugTWnXsnz9LD9BMM
… real work authoring-rule-command-parity, hook-timeout-override-refusal and the three doctor files (ledger-read-failure, ledger-posture-independence, node-env-default) spawn or run the real producer once per single-cause fixture with no repeated triple; create-objectstack-stack-reach and i18n-extract-companion-orphan keep four distinct spawns after the process.execPath switch. Each takes a line-2 test-budget header sized from its slowest of the five scheduled CI runs x 1.25. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5mugTWnXsnz9LD9BMM
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5mugTWnXsnz9LD9BMM
Contributor
📓 Docs Drift CheckNothing in this diff resolved to a documentable surface (no symbol, route or SDK anchor derived from 0 changed package(s)), so this run has no opinion about the docs. What this run could not see
Coarse fallback — 0 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): |
Contributor
Author
|
domain:server#1 · os-project-manager · session_01R1q2xdtYgU6FKrZ7LgjPCC 席位核对 · ACCEPT ·
|
| item | reading |
|---|---|
| Shape | Draft, base main, Part of #23181. Exactly slice 31's eight packages/cli files, labels tests + skip-changeset. Clause-②: no, Metadata-protocol: none. |
| Diff check (seat) | create-objectstack-stack-reach, i18n-extract-companion-orphan and translation-contributed-nav-validate-door spawn bin/run-dev.js on process.execPath instead of the tsx launcher, argv, cwd and env unchanged; the unused TSX constants are dropped and the prose says why. Line-2 // test-budget: 20 on seven files; translation-contributed-nav takes none. No assertion changes, no shared helper touched, no timeout raised. |
| Evidence | CI green on head 8b3bf663 (35 success, 18 skipped, 0 failed; the CI and Lint & Type Check workflow runs both success). Governed check: NOT governed, 40 changed lines. The report gives 52 of 52 derived gates exit 0 on the merged head (--ran reconciled), cli unit tier 362/362 files, typecheck exit 0, and A/B N=3 of −24.8 %, −27.5 % and −16.0 % on the three switched files. |
| Landing | 「按照 pm-dispatch 规则复核过的都授权」 (Leehom, 2026-10-25T11:35Z): ready and auto-merge through the relay, once every check on this head is green or an expected skip. |
Generated by Claude Code
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.
Requested by Leehom · project thread
Part of #23181 (slice 31). The card stays open for later slices: this one takes only the eight remaining
packages/clifiles from 10 s to 13 s in slice 23's table.Clause-②: no
Metadata-protocol: none
维护者速读
packages/cli里 CI 读数 10–13 s、还没有预算头的 8 个测试文件。其中 3 个原来经node_modules/.bin/tsx包装层起 CLI 源码入口,现在直接用process.execPath起同一个bin/run-dev.js(参数、cwd、env、超时都不变),本地快 16%–28%。7 个文件在第 2 行加// test-budget: 20头;translation-contributed-nav 换入口后预计已在 10 s 以下,不加头。files[]只有 dist、README、CHANGELOG);没有删、没有放宽任何断言,用例名和数量不变;回滚即 revert。packages/cli/test/create-objectstack-stack-reach.test.ts(tsx →process.execPath+ 头);packages/cli/src/commands/doctor-ledger-read-failure.test.ts(只加头,原因写在头里)。pnpm --filter @objectstack/cli exec vitest run test/translation-contributed-nav-validate-door.test.ts test/i18n-extract-companion-orphan.test.ts→ 6/6 通过。What changes
The eight files and their slowest reading over the five scheduled
ci.ymlruns41199450735,41217827347,41237094739,41255489006,41271604267(slice 23's offender table: the default reporter's per-file module line in the Test Core shard logs). Local per-case readings from--reporter=verbose, one box, one lock hold.test/authoring-rule-command-parity.test.tsprocess.execPathos lint,os validate,os buildover the one planted-defect stack, in one case (7.6 s locally); the exit code is the contract, so it must be a real process. The nine rule cases run in process, 0.3 s togethertest/create-objectstack-stack-reach.test.tstsxlauncher, already in onebeforeAllos g object,os g flow --object,os validate; each step reads what the last one wroteprocess.execPath; header 20src/commands/doctor-ledger-read-failure.test.tsos doctorruns (3 on a module graph re-imported aftervi.resetModulesto swap the ledger reader)pnpm -v(0.25–0.48 s),tsc -v(0.08–0.20 s) andgit --version, and bundles its own config: 0.35–0.9 s per case, more on the first. One run per ledger fixture or flag; the fourteen row-builder cases are puresrc/commands/doctor-ledger-posture-independence.test.tsos doctorrunssrc/commands/doctor-node-env-default.test.tsos doctorrunsNODE_ENVvalue, project shape and flag; the twenty-one row-builder cases are puretest/i18n-extract-companion-orphan.test.tstsxlauncheros i18n extracton the apps-only stack, its--checkover a seeded legacy companion, and the full stack under--objects-onlyand--no-objects-only; each case reads the real directory its run wroteprocess.execPath; header 20test/hook-timeout-override-refusal.test.tsvitest listchildren of this package, already onprocess.execPath--hookTimeout,--teardownTimeout, no override,--testTimeout: four different config-load questions (7.4 s locally)test/translation-contributed-nav-validate-door.test.tstsxlauncheros validate --jsonon the card's fixture and on its controlprocess.execPath; no header (see below)Why the floor is distinct real work. No file repeats a (command, flags, fixture) triple. The spawning files already share their setup where they can (
create-objectstack-stack-reachin onebeforeAll), and no child only reads a file that an in-process read could replace. In the doctor files everyDoctor.runis its case's subject, with its own fixture, posture or flag. So seven files take the ruling 6181973363 letter B header: N = the slowest CI reading × 1.25, rounded up to 10 s (12.5, 12.4, 12.3, 12.2, 11.4, 11.3, 11.3 → 20), classspawns the real producer once per single-cause fixture. Each reason names the spawns or runs and the CI run its reading came from. All seven parse withreadTestBudget(scripts/measure-test-shard-timings.mjs): line 2, 20 s, that class.The one lever inside the floor. Three files spawned
bin/run-dev.jsthroughnode_modules/.bin/tsx, a launcher that is its own node process in front of the CLI. They now spawn the same entry withprocess.execPath, asauthoring-rule-command-parity, the migrate family (slice 12) and slice 25's files already do: same entry, samesrc/, samechildEnv(), argv, cwd and timeouts.create-objectstack-stack-reachandi18n-extract-companion-orphankeep their header, because the switch projects their CI reading to about 9.3–9.5 s, inside the run-to-run spread of the 10 s line.translation-contributed-nav-validate-doorprojects to about 7.6 s, so it takes no header.Not changed: no assertion, case name, case count, timeout, tier, project or helper. No source file, nothing under
test/helpers/**.Tests
A/B for the three files whose code changed. The base file (
git show ce001f97:…) copied beside head astest/zzbase-*.test.ts, one box, one lock hold, N=3, each file run alone (vitest run --maxWorkers=1 FILE), base and head interleaved. Reading: the default reporter's per-file module line. Copies deleted before the gate run.create-objectstack-stack-reachtranslation-contributed-nav-validate-doori18n-extract-companion-orphanEvery run exit 0, same test count per side (4, 2, 4). The CI projections above apply these ratios to the CI max.
Header-only files (
authoring-rule-command-parity, the three doctor files,hook-timeout-override-refusal): no A/B, per the order. Their doctor-run counts were read by instrumenting a throwaway copy of each file (deleted): 15, 20, 15.All eight on head, one run with
test/vitest-tiers-partition.test.ts: 9 files, 126/126 passed; the tier partition pin is green, so the three edited files stay inintegration.cli unit tier (
pnpm --filter @objectstack/cli exec vitest run --project unit, which holds the three doctor files andhook-timeout-override-refusal): 362/362 files, 5155/5155 tests, on the pre-merge head0877f01cand again on8b3bf663.pnpm --filter @objectstack/cli typecheck(tsc andcheck:test-typecheck) exit 0 on0877f01cand on8b3bf663, withNODE_OPTIONS=--max-old-space-size=4096.No ablation: no tested behaviour changed (test-only).
Acceptance notes
Doctor.runspawnspnpm -vandtsc -v(andgit --version), and the three files make 50 runs between them. Memoising those probes in a test would make 47 of the runs read a probe they did not take, and every case asserts the report's gauge line, which those probes feed, so it is not a test-only lever. Noted, not filed. Carrier: none.skip-changeset. Test-only.@objectstack/cli'sfiles[]isdist,README.md,CHANGELOG.md; its build emits no*.test.tsintodist/. Nofiles[]content changes.Verification
All readings on head
8b3bf663: the two commits32ad4161(theprocess.execPathswitch) and0877f01c(the seven headers), plus one merge oforigin/mainafter slices 24 (#28610), 25 (#28601) and 26 (#28599) landed, as the order asks. The merge touches none of the eight files. The A/B above was taken on32ad4161.Derived gate families:
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack→ 52 families (the same 52 before and after the merge), each run with its exit code captured before any pipe, after a fullpnpm exec turbo run build --concurrency=2(118 tasks, exit 0). All 52 exit 0 on8b3bf663.--ranreconciliation:✓ dispatch-gates --ran: 52 derived famil(ies) accounted for — 52 run, 0 NOT-MEASURED. On the pre-merge head, before the full build,check:dual-build-cjs-loadsandcheck:i18n-coverageread exit 3 (no full build),check-plugin-teardown-shape --self-testexit 3 (its pinned fixture commit absent from the shallow clone, fetched), andcheck:type-check-debtexit 3 (its closure build lost the lock queue to my own build); each read exit 0 once its prerequisite was met.node scripts/check-commit-card-trailers.mjs --range origin/main..HEADexit 0;node scripts/check-nul-bytes.mjsexit 0.Hand gates:
pnpm exec eslint --no-inline-configover the eight files exit 0, andnode --stack-size=4000 node_modules/eslint/bin/eslint.js packages/cli --no-inline-config(the repolintscript scoped to the touched package) exit 0.CI families (Test Core with the cli integration tier, lint farm, type-check lanes) are read off this PR's check-runs by the seat.
🤖 Generated with Claude Code
https://claude.ai/code/session_01FEkQ5mugTWnXsnz9LD9BMM