Repository navigation
test(config): parallelize the complete state startup corpus - #153532
Conversation
Keep all 34 release/config pairs and both startup passes. Share the matrix and file inventory, retain fresh historical state per cell, and reuse lifecycle-owned SQLite inspection workers and Gateway plugin metadata. Route every partition through CI coverage receipts and runtime prerequisites.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 20, 2026, 7:52 AM ET / 11:52 UTC (Revision 7). ClawSweeper reviewWhat this changesSplits historical startup checks across eight test files and updates CI coverage accounting, runtime preparation, fallback execution, and documentation. Merge readiness✅ Ready for maintainer review Keep open as useful, protected maintainer work. Current main still serializes the state corpus in one file; the reviewed patch preserves coverage, and no blocking correctness or security finding remains. Priority: P3 Review scores
Verification
How this fits togetherThe startup corpus checks historical configuration and databases through Doctor and Gateway startup. CI schedules these checks and uses complete-coverage receipts to avoid running the same corpus twice. flowchart TD
A[Historical state and config fixtures] --> B[Shared case inventory]
B --> C[Eight state test partitions]
C --> D[Doctor and Gateway startup]
D --> E[State preservation assertions]
F[CI coverage receipt] --> G{All corpus files covered?}
G -->|Yes| C
G -->|No| H[Prepared four-worker fallback]
H --> C
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests +81, Docs +6, Config +9, Other -2. Total +94 across 21 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Use one shared corpus inventory to distribute unchanged historical upgrade checks through existing workers while preserving conservative fallback coverage. Do we have a high-confidence way to reproduce the issue? Not applicable to a product defect: this is a CI performance improvement, supported by the serial current-main source and reported before/after runner measurements. Is this the best way to solve the issue? Yes. File-level partitioning fits the existing executor, preserves historical assertions, and shares the inventory across coverage accounting and runtime preparation. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 7a1090af25b4. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (6 earlier review cycles)
|
Declare the JavaScript inventory for production type checking and include it in the maintained wrapper closure. The complete matrix and benchmarked runtime remain unchanged.
Precise selection intentionally retains pre-relocation capacity. Build the comparison template without placement observations, restore real timing reads, and retain all routing, preparation, timing, and coverage assertions.
|
Merged via squash.
|
…#153532) * test(config): parallelize the complete state startup corpus Keep all 34 release/config pairs and both startup passes. Share the matrix and file inventory, retain fresh historical state per cell, and reuse lifecycle-owned SQLite inspection workers and Gateway plugin metadata. Route every partition through CI coverage receipts and runtime prerequisites. * fix(ci): register startup corpus inventory for extracted tools Declare the JavaScript inventory for production type checking and include it in the maintained wrapper closure. The complete matrix and benchmarked runtime remain unchanged. * test(ci): compare precise owners before runtime relocation Precise selection intentionally retains pre-relocation capacity. Build the comparison template without placement observations, restore real timing reads, and retain all routing, preparation, timing, and coverage assertions.
What Problem This Solves
The prior-release state corpus keeps a CI worker busy for roughly six minutes because all 34 release/config pairs live in one file. Related: #153435.
User Impact
This reduces CI runtime without changing product behavior or removing historical upgrade coverage. The complete two-release × 17-config matrix still executes both Doctor/Gateway startup passes, including real session, credential, cron, preference, model-catalog, schema-version, and SQLite-integrity checks.
Why This Change Was Made
Eight small test files now register disjoint rows from one shared matrix. The executor can schedule them independently. One file inventory also drives build prerequisites and complete-corpus receipts, so partial plans cannot suppress the fallback proof. The fallback uses four workers; frozen revisions predating the split keep their existing execution path.
Each cell still starts with an untouched copy of its released databases. A cell owns one existing SQLite read-only worker scope across its operations: it reuses processes/imports while each inspection reacquires source admission and reads fresh bytes. Static model preparation consumes the metadata already returned by Gateway startup, following the production handoff. No timers, budgets, assertions, migration steps, or fixture rows were removed or relaxed.
Profiling found fixture preparation costs only 1.6 ms. Doctor plus startup admission takes 92.7% of a representative 17.652-second cold case; the first pass performs a real agent database upgrade from schema 19 to 21. Pre-migrating the fixture would weaken that proof. The profile's composite migration spans do not separately identify SQL-write, worker-startup, and plugin-contract costs.
Evidence
Landing validation: Refreshed from main through REST at 2026-09-20 11:08 UTC. Head
9a15bce42bbda51feb2c892fd0e9af7a58f65776passed CI run 35506996781, including the aggregate gate and security review. The refreshed patch is unchanged. A source audit reconfirmed all 34 distinct cells, 68 startup passes, all 11 original assertion statements, and complete-file coverage guards. Earlier run failures below are historical.Measured earlier CI run 35498795746 passed all 35 corpus tests on two CPUs / two workers. The complete corpus group fell from 372.92 → 258.79 s, an observed 114.13 s (30.6%) reduction. Its companion tests are identical; the single state file becomes all eight partitions. The largest state file is now 74.489 s, compared with 359.774 s before. The final corpus owner is
checks-node-compact-small-1, job 106046812779. Earlier candidate CI measured the group at 291.62 s. Job packing changed, so whole-job durations are not controlled comparisons.Historical CI failure, cleared by the refreshed run above: four
src/agents/harness/selection.test.tsheartbeat/cron/detached/aborted rows fail withAgent worker lease differs from its captured native owner; the aggregate gate reflects that failure. Advancing-main #147463, commitb7d37fd7885, moves heartbeat outcomes into the native agent worker. It is included in CI's basebedaf6c517f010e31b1bbd11b22c04e81c087fbdand absent from this PR head. Those paths are unchanged here, and the failed job does not execute the corpus. The exact lease mismatch remains for that owner to investigate; no out-of-lane repair or unchanged CI retry was requested. All planner/wrapper corrections in this PR passed final CI.That first CI cycle also caught two integration omissions: missing declarations for the shared JavaScript inventory and its absence from the extracted maintainer-wrapper manifest. The follow-up adds both. The production type graph and both originally failing wrapper-closure tests now pass locally. Corpus code, cells, and assertions are unchanged.
The next CI cycle exposed an older comparison that depended on whole-plan packing: precise plans intentionally preserve their original template, but the test compared against the full plan after runtime relocation.
a171c4d88cederives only the expected template before relocation, restores real timing reads before invoking the actual selector, and retains every assertion. All seven precise-owner/runtime-placement cases pass, along with types, lint, and fresh independent reviews.The full corpus passed on Blacksmith Testbox (Node 24.19.0, four available CPUs, 15.4 GiB RAM): 35 tests, zero skipped, all 68 startup passes, at both worker counts. Testbox workflow; lease
tbx_01m2ypp7tyw3t4nh8bmdxw5a7awas stopped after downloading results.timeEight workers reduced command wall by 36.66 s (17.6%) on this four-CPU host while consuming more CPU. This is an oversubscribed-host measurement, not a claim of eight-CPU scaling. RSS is the reported process maximum, not the sum of concurrently live workers.
The original single file cost 293.123 summed test seconds on main run 35468218069 and 359.774 s in the supplied PR run. The following comparison uses that PR's original case times allocated to each new partition; the candidate columns are observed Testbox and native-CI summed case times. Different hosts and cold-case distribution limit direct per-case comparisons.
part-2part-3part-4part-5part-6part-7part-8A representative cold cell took 17.652 → 17.469 s. That is effectively flat; baseline phase tracing also adds a comparison caveat, so no isolated per-startup speedup is claimed. Its whole command was 68.23 → 60.43 s and Vitest 32.90 → 28.14 s, partly preparation/transform differences. The reliable improvement is removing file-level serialization while reusing existing lifecycle-owned resources.
Local Mac attempts used the required 240-second cap and import-duration diagnostics. The original full-file baseline exhausted the cap in cold runtime preparation before any case ran. Subsequent profiling attempts were also dominated by compiler/import work. The first post-split attempt exposed the wrapper's rebuild-on-dirty-support-input behavior and was interrupted; its descendants were explicitly stopped. All eight clean committed-revision per-file attempts also reached the 240-second cap after entering startup, without completed partition proof; no incomplete run is counted as a pass or measured speedup.
Validation: 203 focused planner, complete-coverage, runtime-prerequisite, documentation-targeting and workflow cases passed; workflow validation passed.
check-changedpassed global guards, formatting, all core-test/script/root type graphs, and all three dead-export scans. Its broad core lint was stopped after 650 s; the requested targeted type-aware oxlint substitute passed all changed code and an intentionally failing floating-promise canary proved type-aware diagnostics were active.oxfmt --checkandgit diff --checkpassed. Independent pre-commit and committed-branch reviews through P2 are both scoped-clean. The committed revision passedpnpm build qaRuntime. The correction ine7103a8a750passed scopedcheck-changed(reusing the unchanged dead-export scan), the production core type graph, and both previously failing wrapper-closure tests. Its fresh local and committed-branch reviews are also scoped-clean through P2. The final test-oracle correction also passed scopedcheck-changedand fresh local/branch reviews through P2. That earlier CI run passed the corpus and all corrected planner/wrapper checks; the advancing-main heartbeat failure was subsequently cleared by the landing refresh above. No unchanged CI rerun was requested.Coverage removed: none. No
src/cli/**changes, production migration changes, timeout changes, baseline exceptions, new public contracts, or storage-policy changes.