Repository navigation
test(cli): budget the four slowest migrate spawn files, drop one duplicate spawn and two reader children - #28581
Merged
Conversation
…icate spawn and two reader children The four cli migrate integration files the scheduled ci.yml runs read over 10 s with no test-budget header (data-commands.absent-database 355.51 s, object-scope 135.53 s, unmapped-columns 84.84 s, plan.telemetry-sibling 62.26 s). Each is source-CLI spawns, one per distinct (command, flags, fixture) triple, so each takes the line-2 header (slowest CI reading x 1.25, rounded up to 10 s). Inside that floor: object-scope's narrowed-after-earned case copies the full-scope value-shapes run's database instead of earning the flag with a second identical spawn; unmapped-columns reads its before/after state in process with better-sqlite3 instead of two node children. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5o4JARXsyPVNGaeGa9
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. 4 test files in packages/cli/src/commands/migrate, label skip-changeset (no package's files[] ships them). Clause-②: no, Metadata-protocol: none. |
| Diff check (seat) | Line-2 // test-budget: headers on the four slowest unheaded server files in the five scheduled runs: data-commands.absent-database 450, object-scope 170, unmapped-columns 110, plan.telemetry-sibling 80, each N = slowest CI reading × 1.25 rounded up, each REASON counting the distinct spawns. object-scope copies the full-scope value-shapes --apply database instead of re-running the identical spawn; unmapped-columns reads the fixture in-process with better-sqlite3 (already a cli dependency) instead of a child node. No assertion is dropped or changed in meaning; no timeout is raised. |
| Evidence | CI green on head 12e8da5e (35 success, 18 skipped, 0 failed). Governed check: NOT governed, 52 changed lines. Mergeable state clean. The report gives 51 of 51 derived gates exit 0 after a full build, eslint and cli typecheck 0, and A/B on the two changed files (−6.1 % and −2.2 %). It also corrects slice 22's reading: 63 server files remain over 10 s, now cut into slices 24–28. |
| 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
test(cli): budget the os dev / os serve / package spawn files, drop the tsx launcher from two
#28601
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 23). The card stays open: 63 other
domain:serverfiles still read over 10 s (Acceptance notes).Clause-②: no
Metadata-protocol: none
维护者速读
packages/cli里 CI 读数最慢、且没有 budget 头的 4 个os migrate集成测试文件,各加一行第 2 行// test-budget:头(450 / 170 / 110 / 80 s);顺带去掉 object-scope 里一次与前面完全相同的 CLI spawn(改为复制那次运行的数据库),和 unmapped-columns 里两次读库用的 node 子进程(改为进程内 better-sqlite3 读)。files[]只有 dist、README、CHANGELOG);每个文件的断言一条没删、没放宽;回滚即 revert。packages/cli/src/commands/migrate/object-scope.integration.test.ts(earnedDb改为复制 full-scope 运行的库);packages/cli/src/commands/migrate/unmapped-columns.integration.test.ts(readState改为进程内读);另外两个文件只加了头。pnpm --filter @objectstack/cli exec vitest run --project integration src/commands/migrate/object-scope.integration.test.ts→ 20/20 通过。What changes
The scheduled
ci.ymlruns onmainafter slice 22 put fourpackages/climigrate integration files at the top of thedomain:serverlist, with no// test-budget:header. Readings are the default reporter's per-file module line in the Test Core shard logs (all shardssuccess) of runs41199450735,41217827347,41237094739,41255489006(its Test Core shards passed; only Test UI 5/16 failed) and41271604267:data-commands.absent-database.integration.test.tsobject-scope.integration.test.tsunmapped-columns.integration.test.tsplan.telemetry-sibling.integration.test.tsCause, per file. All four share one cause: they spawn the source CLI (
node bin/run-dev.js, already onprocess.execPathsince slice 12, already under the queue-tier oclif manifest since slice 14), and each spawn boots a migration stack against a SQLite fixture. They already boot or seed their fixture once in abeforeAll. I counted spawns against distinct (command, flags, fixture) triples:data-commands.absent-database: two seed children and 46 CLI spawns (three [finding] os migrate resume, recorded-by and value-shapes exit 1 on a project whose database does not exist yet, with an opaque "The database refused to run this query" from their own first read of a deferred table #21529 commands and eleven [finding] The rest of the read-only data-command family exits 1 on a project with no database yet: migrate account-issuer, audit-metadata-bodies, meta --stored, secret orphans and rewrap, storage orphans read tables their boot deferred #21552 doors, each--jsonand human on the absent database and--jsonon a booted control, plus four already-exit-0 doors). All 46 are distinct triples. About 7.5 s per spawn in CI.object-scope: one seed child and 18 CLI spawns, each on its own copy of the seeded database. One triple repeated: the earned-flag case ranvalue-shapes --apply --yes --jsonon a fresh seeded copy, the same as the family loop's full-scopevalue-shapesrun. Now it copies that run's database (copyFileSync(full.get('value-shapes').db, earnedDb)), so 17 spawns. The full-scope run's own database is not touched; the case still assertsverifiedBefore.verified_atis set and unchanged after the narrowed run.unmapped-columns: one seed child, ten CLI spawns (all distinct), and twonodechildren that only read the database's schema and rows before and after. Those two reads now run in process withbetter-sqlite3, the same readerobject-scopeandplan.telemetry-siblingalready use. The before/after comparison is still byte equality of the same JSON shape.plan.telemetry-sibling: two serving boots and five CLI spawns, all distinct. Header only.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. All four parse withreadTestBudget(scripts/measure-test-shard-timings.mjs). The object-scope header keeps its pre-hoist CI reading.Not changed: no assertion, case name, timeout, tier or project. No source file.
Tests
A/B (one box, one lock hold, base copied beside head as
zzbase.*, interleaved, N=3,--project integration --maxWorkers=1, default reporter file line; copies deleted before the gate run):object-scopeunmapped-columnsEvery run exit 0; object-scope 20/20 tests and unmapped-columns 10/10 tests on both sides, same names.
Header-only files, run once on head:
data-commands.absent-database51/51 (248.5 s),plan.telemetry-sibling2/2 (38.5 s).pnpm --filter @objectstack/cli typecheck(tsc +check:test-typecheck) exit 0, withNODE_OPTIONS=--max-old-space-size=4096(the default heap OOMs intsc -p tsconfig.test.json).No ablation: no tested behaviour changed (test-only).
Acceptance notes
domain:serverfile over 10 s in run41199450735. The whole shard logs (gh api …/actions/jobs/ID/logsnow returns them uncapped) show 135 server files over 10 s in the five runs. 72 are inside their own header. After this slice, 63 still count (39 inpackages/cli, 7verify, 4plugin-auth, 4plugin-security, 4runtime, 3rest, 1plugin-pinyin-search, 1service-automation). The slowest aremigrate/plan.boot-parity(60.6 s),test/dev-boot-output-order(59.4 s) andtest/verify-author-time-stage(53.6 s, over its 50). Full table and parser:pm-orders/server/evidence/23181-s23/in the project files. Carrier: test budget (domain:cli): 119 test file(s) over 10 s of wall in the hourly full battery (Part of #23151) #23181's next slices.skip-changeset. Test-only.@objectstack/cli'sfiles[]isdist,README.md,CHANGELOG.md, and its build does not emit*.integration.test.tsintodist/, so nofiles[]content changes.Verification
All readings on head
12e8da5e(the only commit).node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack→ 51 families, each run with its exit code captured before any pipe. Two first reads were container prerequisites, re-read after meeting them:check:dual-build-cjs-loadsandcheck:i18n-coverageexit 3 (no full build) →pnpm exec turbo run build --concurrency=2(118/118 tasks) → both exit 0.--ranreconciliation:✓ dispatch-gates --ran: 51 derived famil(ies) accounted for — 51 run, 0 NOT-MEASURED.pnpm exec eslint --no-inline-configover the four 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_01FEkQ5o4JARXsyPVNGaeGa9