Skip to content

ci: typecheck graphs that consume changed tests - #134107

Merged
steipete merged 1 commit into
mainfrom
codex/changed-test-typegraphs
Aug 31, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/changed-test-typegraphs

Conversation

@steipete

Copy link
Copy Markdown
Contributor

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.

@clawsweeper

clawsweeper Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 31, 2026
@clawsweeper

clawsweeper Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 31, 2026, 8:48 AM ET / 12:48 UTC.

ClawSweeper review

What this changes

The 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 readiness

⚠️ Ready for maintainer review - 2 items remain

Keep 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
Reviewed head: ec18d7021384abd5e190656b61239082d3d9dfc8

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The patch has focused boundary-level coverage and supplied native behavior proof, with exact-head CI remaining as the normal landing gate.
Proof confidence 🐚 platinum hermit (4/6) ✨ media proof bonus Sufficient (linked_artifact): The changed production owner is the changed-files TypeScript graph selector; the PR body links a native runner trace covering its after-fix graph-selection and managed-cancellation behavior, including observed recovery and exit status.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (linked_artifact): The changed production owner is the changed-files TypeScript graph selector; the PR body links a native runner trace covering its after-fix graph-selection and managed-cancellation behavior, including observed recovery and exit status.
Evidence reviewed 6 items Current-main baseline: The fetched main revision invokes every core graph boundary listing synchronously; the PR replaces that unchanged complete boundary scope with a reusable per-run inventory.
Conservative graph selection: Selection accepts only pure .test.ts/.tsx changes, verifies the complete unique graph inventory and root ownership, and falls back to all shards if a changed test is missing, ambiguous, or included by a production graph.
Boundary owner and caller: The changed-files runner creates one check object only for the marked boundary/typecheck commands; its boundary pass collects graph files through the existing managed-process owner before the runner selects shards.
Findings None None.
Security None None.

How this fits together

Changed-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
Loading

Before merge

  • Resolve merge risk (P1) - Exact-head CI is still queued, so the source review and supplied native proof do not replace the required landing gate.
  • Complete next step (P2) - No repair lane is needed: no discrete introduced defect was found, and the remaining action is normal exact-head CI completion.
Agent review details

Security

None.

PR surface

Tests +251, Other +174. Total +425 across 6 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 2 257 6 +251
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 4 344 170 +174
Total 6 601 176 +425

Review metrics

Metric Value Why it matters
Production versus test delta tooling +174 net; tests +251 net The tooling growth consolidates boundary enumeration and targeted shard execution; the added tests exercise cross-graph type failures and process-tree cancellation.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    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.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best 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.

Labels

Label changes:

  • add P3: This changes internal CI verification speed and process handling, with no product-runtime behavior change.
  • add proof: sufficient: Contributor real behavior proof is sufficient. The changed production owner is the changed-files TypeScript graph selector; the PR body links a native runner trace covering its after-fix graph-selection and managed-cancellation behavior, including observed recovery and exit status.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (linked_artifact): The changed production owner is the changed-files TypeScript graph selector; the PR body links a native runner trace covering its after-fix graph-selection and managed-cancellation behavior, including observed recovery and exit status.

Label justifications:

  • P3: This changes internal CI verification speed and process handling, with no product-runtime behavior change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (linked_artifact): The changed production owner is the changed-files TypeScript graph selector; the PR body links a native runner trace covering its after-fix graph-selection and managed-cancellation behavior, including observed recovery and exit status.
  • proof: sufficient: Contributor real behavior proof is sufficient. The changed production owner is the changed-files TypeScript graph selector; the PR body links a native runner trace covering its after-fix graph-selection and managed-cancellation behavior, including observed recovery and exit status.

Evidence

What I checked:

  • Current-main baseline: The fetched main revision invokes every core graph boundary listing synchronously; the PR replaces that unchanged complete boundary scope with a reusable per-run inventory. (scripts/check-tsgo-core-boundary.mts:131, 3ee32fb9c10d)
  • Conservative graph selection: Selection accepts only pure .test.ts/.tsx changes, verifies the complete unique graph inventory and root ownership, and falls back to all shards if a changed test is missing, ambiguous, or included by a production graph. (scripts/lib/tsgo-core-test-shards.mts:157, ec18d7021384)
  • Boundary owner and caller: The changed-files runner creates one check object only for the marked boundary/typecheck commands; its boundary pass collects graph files through the existing managed-process owner before the runner selects shards. (scripts/check-changed.mts:1023, ec18d7021384)
  • Boundary-level regression coverage: The added fixture compiles a real non-root importing graph, observes TS2322 after an incompatible exported type, and verifies cancellation preserves exit 143 only after compiler descendants have stopped. (test/scripts/tsgo-core-test-shards.test.ts:161, ec18d7021384)
  • Introduced-scope provenance: The sole branch commit introduces the six reviewed script/test files; the verified test merge has the supplied main parent followed by this exact head. (scripts/check-changed.mts:688, ec18d7021384)
  • Provided native proof: The complete PR body links a native four-CPU GitHub Actions run and reports after-fix changed-gate, cross-graph, and cancellation results. The link could not be reopened here because GitHub DNS was unavailable; that reviewer limitation does not negate the supplied proof. (ec18d7021384)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: L maintainer Maintainer-authored PR labels Aug 31, 2026
@steipete
steipete merged commit 145d9ff into main Aug 31, 2026
183 checks passed
@steipete
steipete deleted the codex/changed-test-typegraphs branch August 31, 2026 13:43
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: L status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant