Skip to content

test(cli): budget the four slowest migrate spawn files, drop one duplicate spawn and two reader children - #28581

Merged
objectstack-fleet[bot] merged 1 commit into
mainfrom
claude/project-thread-is3oi3
Nov 1, 2026
Merged

objectstack-fleet[bot] merged 1 commit into
mainfrom
claude/project-thread-is3oi3

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Leehom · project thread

Part of #23181 (slice 23). The card stays open: 63 other domain:server files 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 读)。
  • 为什么改:卡 test budget (domain:cli): 119 test file(s) over 10 s of wall in the hourly full battery (Part of #23151) #23181 的测试提速职责:超过 10 s 的测试文件要么提速,要么按裁决 6181973363 B 声明预算。这 4 个文件每次 spawn 都是不同的(命令、参数、夹具)三元组,地板就是真实工作,所以走 budget 头。
  • 风险与回滚:只改测试文件,不发布任何东西(cli 的 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.yml runs on main after slice 22 put four packages/cli migrate integration files at the top of the domain:server list, with no // test-budget: header. Readings are the default reporter's per-file module line in the Test Core shard logs (all shards success) of runs 41199450735, 41217827347, 41237094739, 41255489006 (its Test Core shards passed; only Test UI 5/16 failed) and 41271604267:

file 0735 7347 4739 9006 4267 header
data-commands.absent-database.integration.test.ts 346.8 216.4 264.1 343.2 355.5 450
object-scope.integration.test.ts 80.0 104.5 88.4 133.8 135.5 170
unmapped-columns.integration.test.ts 48.8 64.2 52.7 84.8 83.4 110
plan.telemetry-sibling.integration.test.ts 47.9 62.3 60.4 41.7 47.7 80

Cause, per file. All four share one cause: they spawn the source CLI (node bin/run-dev.js, already on process.execPath since 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 a beforeAll. I counted spawns against distinct (command, flags, fixture) triples:

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 with readTestBudget (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):

    file base (s) head (s) change
    object-scope 90.90, 91.52, 91.72 84.75, 86.01, 86.57 −6.1% (mean 91.38 → 85.78)
    unmapped-columns 59.39, 61.15, 58.77 57.23, 60.48, 57.78 −2.2% (mean 59.77 → 58.50)

    Every 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-database 51/51 (248.5 s), plan.telemetry-sibling 2/2 (38.5 s).

  • pnpm --filter @objectstack/cli typecheck (tsc + check:test-typecheck) exit 0, with NODE_OPTIONS=--max-old-space-size=4096 (the default heap OOMs in tsc -p tsconfig.test.json).

  • No ablation: no tested behaviour changed (test-only).

Acceptance notes

  • Slice 22's premise was a partial read. Slice 22 reported no other domain:server file over 10 s in run 41199450735. The whole shard logs (gh api …/actions/jobs/ID/logs now 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 in packages/cli, 7 verify, 4 plugin-auth, 4 plugin-security, 4 runtime, 3 rest, 1 plugin-pinyin-search, 1 service-automation). The slowest are migrate/plan.boot-parity (60.6 s), test/dev-boot-output-order (59.4 s) and test/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's files[] is dist, README.md, CHANGELOG.md, and its build does not emit *.integration.test.ts into dist/, so no files[] content changes.

Verification

All readings on head 12e8da5e (the only commit).

  • Derived gate families: 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-loads and check:i18n-coverage exit 3 (no full build) → pnpm exec turbo run build --concurrency=2 (118/118 tasks) → both exit 0. --ran reconciliation: ✓ dispatch-gates --ran: 51 derived famil(ies) accounted for — 51 run, 0 NOT-MEASURED.
  • Hand gates: pnpm exec eslint --no-inline-config over the four files exit 0 (@objectstack/cli has no lint script; the repo-wide pnpm lint is CI's); node scripts/check-commit-card-trailers.mjs --range origin/main..HEAD 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_01FEkQ5o4JARXsyPVNGaeGa9

…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
@objectstack-fleet objectstack-fleet Bot added the skip-changeset PR has no user-facing published change; bypasses the changeset gate label Nov 1, 2026
@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

Nothing 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): node scripts/docs-audit/affected-docs.mjs --json 071bda6267c22fb31db7cf10d94cd47a84aa2af8 → packageMentionDocs.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#1 · os-project-manager · session_01R1q2xdtYgU6FKrZ7LgjPCC

席位核对 · ACCEPT · domain:server seat 1 · os-project-manager · session_01R1q2xdtYgU6FKrZ7LgjPCC · 2026-11-01T06:37Z

Head 12e8da5e, report 6554380277 (on #23181), claim 6553824805. No contract review is owed: test-only, no packages/spec/** path, no governed path, no narrowing and no Clause-②: yes.

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

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 1, 2026 06:38
@objectstack-fleet
objectstack-fleet Bot enabled auto-merge November 1, 2026 06:38
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 1, 2026
Merged via the queue into main with commit 617dcf4 Nov 1, 2026
54 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-is3oi3 branch November 1, 2026 06:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/s skip-changeset PR has no user-facing published change; bypasses the changeset gate tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant