Repository navigation
ci: typecheck graphs that consume changed tests - #134107
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 31, 2026, 8:48 AM ET / 12:48 UTC. ClawSweeper reviewWhat this changesThe PR makes changed-test verification compile only the TypeScript test graphs that consume modified core, UI, or package test files, while retaining complete graph checks for mixed or uncertain changes. Merge readinessKeep open. The introduced change is a coherent CI-tooling optimization with conservative full-check fallbacks and no actionable correctness or security defect found; exact-head CI is still queued. Priority: P3 Review scores
Verification
How this fits togetherChanged-files verification classifies a diff into CI lanes, validates TypeScript graph boundaries, and then runs the required compiler shards. This change reuses the boundary inventory to select consuming test graphs for isolated test edits before the shard runner compiles them. flowchart LR
A[Changed files] --> B[Lane classification]
B --> C{Only core test files?}
C -- No or uncertain --> D[All test graph shards]
C -- Yes --> E[Boundary inventory]
E --> F[Consuming test graphs]
F --> G[Bounded shard runner]
D --> G
Before merge
Agent review detailsSecurityNone. PR surfaceTests +251, Other +174. Total +425 across 6 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep compiler-resolved inventory as the single source of reachability, select every consuming test graph only for unambiguous leaf-test diffs, and land after exact-head CI succeeds. Do we have a high-confidence way to reproduce the issue? Yes. The added boundary fixture establishes the relevant compiler-graph scenario and a non-root consumer failure path, although this read-only review did not execute contributor code. Is this the best way to solve the issue? Yes. Compiler-resolved reachability is the narrow maintainable selection source, and the implementation retains full compilation whenever that inventory cannot prove a safe subset. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 3ee32fb9c10d. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
What Problem This Solves
A one-test repair can spend most of its changed-files gate compiling all 16 core test graphs. This slows the edit, prove, and land cycle during release verification even when only one graph consumes the changed file.
Why This Change Was Made
Keep the existing complete compiler boundary check over all 18 production and test graphs, and reuse its resolved file inventory within the same check execution. For a pure existing test-leaf change, compile every test graph that consumes the file, including graphs that import it indirectly. Consume that inventory once; plans retain no compiler state.
Mixed production/tooling changes, removed or unknown roots, incomplete inventories, and tests consumed by production graphs retain the full test compilation. The existing runner still owns output locks and fresh child processes. Compiler inventory queries also run through the existing managed process owner, with bounded output capture and signal forwarding; cancellation returns only after the compiler tree is joined. Direct CLI groups, full CI stripes, serial defaults, resource limits, timeouts, and assertions are unchanged. No new cache, configuration, environment option, or dependency.
User Impact
Maintainers can verify isolated test repairs without recompiling unrelated graphs. This is internal verification tooling; product runtime behavior and the coverage of full release CI do not change.
Evidence
The pre-change reproduction selected all 16 graphs for one test leaf. Regression coverage executes the real changed-check plan, compiler boundary, and shard runner: a leaf selects its owner; adding an importing test selects that graph too; an incompatible exported type then produces TS2322 in the non-root consumer. All 18 boundary enumerations remain required.
The earlier native six-file gate and 219 sibling tests passed, but independent review then found that in-process synchronous inventory queries could leave compiler descendants alive after PID-targeted cancellation. That failure was reproduced before repair. Both query collectors now share one asynchronous managed command path: interrupted checks retain exit 143 after joining; ordinary compiler failures retain diagnostics; output overflow fails and joins rather than truncating the inventory.
The corrected source passed all 219 canonical tooling tests locally and on native Linux. On an actual four-CPU runner with Node 24.19, the complete six-path changed-files gate passed in 190.49 seconds, and standalone PID cancellation preserved exit 143 with both compiler and descendant stopped. The final test-only exit-listener ordering cleanup then passed its changed-test gate in 73.90 seconds and all 219 cases in 13.67 seconds on the same lease. All production hashes were unchanged; final source hashes match this PR. Native proof.
A fresh private copy with all workspace dependencies and no inherited compiler artifacts completed the same one-test gate in 250.20 seconds (4m10s), versus the retained earlier four-CPU baseline of 851.06 seconds (14m11s). Test compilation was 52.90 seconds versus 676.33 seconds, while all 18 boundary graphs were checked. This is an observed 70.6% reduction in that gate, about ten minutes; different hosts, source bases, and cache histories prevent a controlled A/B or total-release speedup claim. No memory reduction is claimed.
Managed Codex review of the final six-file diff found no actionable P0-P2 findings. Exact-head CI remains required before landing.
Product runtime delta: 0. Tooling: +174 net lines, including factoring the existing boundary/runner into their shared execution owner and replacing duplicate synchronous collectors with bounded managed capture. Tests: +251 net lines, including real cross-graph compiler and cancellation coverage. Existing full-run paths remain in the same owner rather than being duplicated. Managed review and exact-head CI are required before landing.
Named follow-up: existing documentation and a CI comment contain stale test-graph counts; this change does not alter the number of graphs or CI stripes.