Repository navigation
test(cli): budget the os dev / os serve / package spawn files, drop the tsx launcher from two - #28601
Merged
Merged
Conversation
…the tsx launcher where it only adds a process Six packages/cli test files read over 10 s in the scheduled ci.yml runs. Each one's boots or spawns are the subject it pins, so each takes a line-2 test-budget header (slowest CI reading x 1.25, rounded up to 10 s). package-restart-acceptance and package-owned-command-readers also spawn bin/run-dev.js with process.execPath instead of the tsx binary: same entry, same src/, one node process per spawn instead of two (about -34% each, measured on one box, N=3). Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
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 25's six packages/cli/test files, labels tests + skip-changeset. Clause-②: no, Metadata-protocol: none. |
| Diff check (seat) | Line-2 // test-budget: headers on all six (80/50/40/40/30/30), each naming its distinct boots and the slowest CI reading × 1.25. package-owned-command-readers and package-restart-acceptance spawn bin/run-dev.js on process.execPath instead of the tsx binary, with argv, cwd, stdio and childEnv unchanged; the now-unused TSX import is dropped and the shared helper is not touched. No assertion changes; no timeout is raised. |
| Evidence | CI green on head 9a33975d (35 success, 18 skipped, 0 failed). Mergeable state clean. Governed check: NOT governed, 17 changed lines. The report gives 48 of 48 derived gates exit 0, --ran 0 NOT-MEASURED, typecheck and scoped eslint exit 0, and A/B N=3 of about −34 % on each switched file. |
| 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 was referenced Nov 1, 2026
Merged
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 25, the
os dev/os serve/ package family). The card stays open for the other slices.Clause-②: no
Metadata-protocol: none
维护者速读
packages/cli/test里 6 个os dev/os serve/ 包相关的集成测试文件,各加一行第 2 行// test-budget:头(80 / 50 / 40 / 40 / 30 / 30 s);其中 2 个文件(package-restart-acceptance、package-owned-command-readers)把 spawn 方式从node_modules/.bin/tsx bin/run-dev.js改成process.execPath bin/run-dev.js,同一个入口、同一份src/,每次 spawn 少起一个 node 进程,本机 A/B 各快约 34%。files[]只有 dist、README、CHANGELOG);断言一条没删、没放宽,超时、层、项目都没动;回滚即 revert。packages/cli/test/package-restart-acceptance.integration.test.ts(spawn 改为process.execPath);packages/cli/test/package-owned-command-readers.test.ts(同上);其余 4 个文件只加了头。pnpm --filter @objectstack/cli exec vitest run --project integration test/package-owned-command-readers.test.ts→ 8/8 通过。What changes
Slice 23's offender table (
pm-orders/server/evidence/23181-s23/offenders-after-s23.mdin the project files) reads these six files over 10 s with no// test-budget:header. Readings are the default reporter's per-file module line in the Test Core shard logs of the five scheduledci.ymlruns41199450735,41217827347,41237094739,41255489006,41271604267:dev-boot-output-order.integration.test.tspackage-restart-acceptance.integration.test.tspackage-owned-command-readers.test.tsdev-organization-ownership-stale-column.integration.test.tsdev-standalone-self-heal.integration.test.tsserve-runtime-state-project-key.test.tsCause, per file. Every file already runs its boots or spawns once, in a
beforeAll(or, for the runtime-state file, in the cases that read them). I counted them against distinct (command, flags, fixture) triples:dev-boot-output-orderos dev(supervisor +servechild) under a real ptypackage-restart-acceptanceos serve --devon one database filetsx/dist/cli.mjs) starts a second node process for the same entryprocess.execPath+ header 50package-owned-command-readersdiff --json,migrate meta --jsonover the two-package config and its one-package control)process.execPath+ header 40dev-organization-ownership-stale-columnos devon one database file (the second runs the upgrade ceremony)dev-standalone-self-healos dev, restart over the staged index, productionos serve)serve-runtime-state-project-keysrc/commands/serve.tsthrough tsx, about 4 s of module load apiece; the file's own import ofserve.tsis about 16 s locally. Distinct pids and a clean exit per child are the subjectThe tsx launcher.
node_modules/.bin/tsx Xrunstsx/dist/cli.mjsin one node process, which then spawns a second node process forX(checked: undertsx -e,process.ppidis anode …/tsx/dist/cli.mjsprocess).bin/run-dev.jsruns straight underprocess.execPath, as slice 12 already does for other spawn files (serve-no-auth-secret-refusal,dev-standalone-self-heal,union-fold-command-parity): the same entry, the samesrc/, the sameNODE_ENVthatrun-dev.jspins. Measured without the test manifest,node bin/run-dev.js diff --helptook 5.1 to 5.2 s against 8.9 to 10.2 s through the tsx binary.I tried the same move on
serve-runtime-state-project-key(node --import tsx/dist/loader.mjs CHILD) and reverted it: about 4.0 to 4.3 s per child either way, because the cost there is loadingserve.ts, not the launcher. Making the child lighter would mean moving the state writer out ofserve.ts, a source change outside this slice.Headers (ruling 6181973363 letter B, class
spawns the real producer once per single-cause fixture): N = the slowest of the five CI readings × 1.25, rounded up to 10 s. The two files whose spawn changed keep their pre-change CI reading; a shard-timings refresh resizes them. All six parse withreadTestBudget(scripts/measure-test-shard-timings.mjs): 80, 50, 40, 40, 30, 30, each at line 2.Not changed: no assertion, case name, timeout, tier or project. No test helper (
test/helpers/**is untouched). No source file.Tests
A/B (one box, one lock hold, base copied beside head as
zzbase-*, interleaved, N=3,--project integration --maxWorkers=1, the test manifest global setup on as in CI's queue tier; vitest'stestsfigure, and the wholeDurationin brackets; copies deleted before the gate run):package-restart-acceptancepackage-owned-command-readersEvery run exit 0; restart-acceptance 5/5 and owned-command-readers 8/8 on both sides, same names.
Header-only files, run once on head in the same lock hold:
dev-boot-output-order3/3 (tests 46.02 s),dev-organization-ownership-stale-column5/5 (21.79 s),dev-standalone-self-heal4/4 (17.17 s),serve-runtime-state-project-key12/12 (17.86 s, import 16.53 s).No ablation: no tested behaviour changed (test-only).
pnpm --filter @objectstack/cli typecheck(tsc +check:test-typecheck) exit 0 on9a33975d, withNODE_OPTIONS=--max-old-space-size=4096.Acceptance notes
skip-changeset. Test-only.@objectstack/cli'sfiles[]isdist,README.md,CHANGELOG.md, and its build does not emittest/**intodist/, so nofiles[]content changes.serve-runtime-state-project-keyandpackage-owned-command-readerssit invitest-tiers.ts'sintegrationtier already (they spawn); nothing moved.Verification
All readings on head
9a33975d(my commiteb79e981plus one merge oforigin/mainafter slice 23, #28581, landed; that merge touches none of these six files).node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack→ 48 families, each run with its exit code captured before any pipe, all exit 0. On the first round (before the merge) two were container prerequisites, re-read after meeting them:check-plugin-teardown-shape --self-testexit 3 (shallow clone) →git fetch --depth=1of its pinned fixture commit → exit 0;check:dual-build-cjs-loadsexit 3 (no full build) →pnpm exec turbo run build --concurrency=2(118/118) → exit 0. The whole set then re-ran on9a33975d.--ranreconciliation:✓ dispatch-gates --ran: 48 derived famil(ies) accounted for — 48 run, 0 NOT-MEASURED (a DERIVED zero — all 48 recorded an exit code and none of them is 3). List with codes:pm-orders/server/evidence/23181-s25/gates-ran-9a33975d.txtin the project files.pnpm exec eslint --no-inline-configover the six files exit 0 (@objectstack/clihas nolintscript; the repo-widepnpm lintis CI's);node scripts/check-commit-card-trailers.mjs --range origin/main..HEADexit 0.🤖 Generated with Claude Code
https://claude.ai/code/session_01FEkQ5peeAMkJqa2CHQj7ia