Repository navigation
fix(ci): select every transitive importer test for agent, compaction and transport owners - #204292
Conversation
…and transport owners PR selection walked reverse imports two deep (one for 20+ importer hubs). Prompt-cache and compaction behavior tests sit 3-10 imports from these owners, so #204111 and #204180 merged without running them. Closes #204252 Co-authored-by: obviyus <[email protected]>
|
🦞👀 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. |
|
Maintainer override: the 3 red checks on cf422ec are not caused by this PR. Each one fails the same way on scheduled
This PR changes only the CI changed-test planner, one planner test, one planner fixture expectation and one docs page. It changes no product code, no Vitest config and no QA scenario. |
|
Landed in ba2046d. PR CI walked reverse imports only 2 deep (1 deep for modules with 20 or more importers). The prompt-cache and compaction tests sit 3 to 10 imports from these owners. The plan now selects every transitive importer test for them. A replay of #204111 and #204180 selects all four tests from #204252. The cost (about 12,500 tests, 131 jobs) is in the PR body. |
…jobs (#204314) ## Result A selected (PR) Node job no longer inherits the 120-minute whole-config timeout from a group it does not run. `test/scripts/ci-changed-node-test-plan.test.ts` "retains precise process ownership and independent timing keys (github)" passes again. ## Cause `createSelectedNodeTestShardBundles` projects each job of a subset compact plan onto the selected files, and copies the job's fields with `...shard`. When that subset job also held a whole-config group (no `includePatterns`), it carried `COMPACT_WHOLE_NODE_TEST_TIMEOUT_MINUTES` (120). The projection drops the unselected whole group but kept its 120-minute timeout. So an exact-file job could run with twice its canonical owner's deadline. It is latent and depends on packing. #204178 (`cded11f81d55`) added a test to `databaseWorkerCoreTestFiles`, which changed the subset packing for the GitHub profile. After that, `agentic-agents-embedded-base-3` (canonical owner timeout 60) shared a subset job with the whole `agentic-agents-embedded-run` group and got 120. A planner replay of the test's two targets shows it: at `dae98a63` (parent) the selected job has timeout 60; at `cded11f8` it has 120. The canonical owner jobs are the same at both commits. #204292 did not change this path: `main` fails the same way before and after it. ## Fix The projection keeps the whole-config timeout only when a retained group is still a whole group (`!includePatterns`). Every other timeout, such as the long-unfitted 90 minutes or a cron minimum, is copied as before. ## Evidence - Planner replay (GitHub profile, the test's two embedded targets): before, `checks-node-changed-compact-large-35` has `timeoutMinutes: 120`; after, no override (60 default). The single-file `embedded-run` job no longer gets 120 either, which matches its canonical owner, since its whole group is not selected. - `test/scripts/ci-changed-node-test-plan*.test.ts`, `ci-node-test-plan.test.ts`, `ci-workflow-planning.test.ts`: 11 files, 1,285 tests pass on the head. The named case fails on `main` (`expected 120 to be less than or equal to 60`), the same as scheduled run 45288712101 (small-18). - CI green on the head; local ClawSweeper: patch is correct, no findings. Co-authored-by: Ayaan Zaidi <[email protected]>
|
Correction to the Maintainer override above: the |
…nd a declared behavior set (#204346) ## Result PR CI for agent, compaction, prompt and transport owners goes from a full-suite plan back to a bounded one, about 13x smaller. It still selects the four tests that #204252 was about. | Replay (PR planner, hybrid, 130-row cap) | Before (#204292) | After | |---|---|---| | #204111 (31 files) | 12,562 tests / 131 jobs / 36,859 s | **967 tests / 21 jobs / 2,881 s** (max job 271 s) | | #204180 (9 files) | 12,405 / 131 / 36,673 s | **302 / 14 / 1,393 s** (max job 250 s) | Both replays select `embedded-agent-runner.prompt-cache.test.ts`, `agent-runner-required-maintenance.pending-input.test.ts`, `agent-runner-compaction-fallback.test.ts` and `session-context-accounting.gateway.integration.test.ts`. ## Change For a changed source file under `src/agents/`, `src/auto-reply/reply/agent-runner*`, `packages/agent-core/src/harness/compaction/` or `packages/ai/src/transports/`, the aggressive PR plan now selects: 1. the normal two-import walk, as for every other file; 2. every transitive importer test **in the changed file's own directory**. A file directly in a package root (for example `src/agents/compaction.ts`) skips this step, because that directory is the whole package (1,795 tests for `src/agents/`); 3. a **declared behavior set**: every `*prompt-cache*` and `*compaction*` test under `src/` and `packages/` (118 files), plus `agent-runner-required-maintenance.pending-input.test.ts` and `session-context-accounting.gateway.integration.test.ts`. A test-only edit under these owners runs itself and does not pull in the declared set. Full mode (manual and hourly) is unchanged and still walks every importer. ## Decision recorded The follow-up asked for "importers within the same package". With the package root as the scope, #204111 selects 2,424 tests / 7,519 s, which misses the target of about 1,200 tests / 3,700 s. I used the changed file's directory instead, which meets the target. Coverage given up: cross-directory transitive importers, outside the declared set, of a file under these owners. The hourly full plan still runs them. This is reversible: widening the scope is a one-line change. | Variant | #204111 | #204180 | |---|---|---| | Declared set only | 369 / 1,888 s | 135 / 1,035 s | | **Same directory + declared (this PR)** | **967 / 2,881 s** | **302 / 1,393 s** | | Same package root + declared | 2,424 / 7,519 s | 308 / 1,393 s | | #204292 (unbounded) | 12,562 / 36,859 s | 12,405 / 36,673 s | ## Evidence - `ci-changed-node-test-plan.integration.test.ts`: for 7 owners from #204111 and #204180, the plan selects the four named tests and every same-directory importer test. - `ci-changed-node-test-plan.selection.test.ts`: the fixture case again expects the two-import stop for a distant consumer in another directory (the pre-#204292 expectation). - Planner, project and workflow tests (11 files): 1,322 passed. `pnpm check:changed`: pass. ## Coverage decision and closing loop - The maintainer accepted the same-directory scope as the coverage contract for these owners. The local review asked for this decision. - **Closing loop:** when a scheduled red traces to a green PR through a cross-directory importer, the fix PR adds that importer test to the owner's declared set. The declared sets grow only from real misses. - **Measurement:** 24 h after merge, compare agent-core PR rows and wall time with the #204292 numbers above. Co-authored-by: Ayaan Zaidi <[email protected]>
…and transport owners (openclaw#204292) ## Result Pull request CI now selects every test whose runtime imports reach a changed file under `src/agents/`, `src/auto-reply/reply/agent-runner*`, `packages/agent-core/src/harness/compaction/` or `packages/ai/src/transports/`, directly or transitively. Replaying the file lists of openclaw#204111 and openclaw#204180 now selects the four tests that first failed on scheduled `main` (openclaw#204252). **Cost, read this first:** for these owners the transitive closure covers almost the whole runtime suite. A PR that touches them now runs a full-suite-sized Node plan, about 21x to 105x the previous predicted test time. Exact numbers are below. The plan stays inside the existing row cap and per-job time objective. Nothing is capped or dropped. Closes openclaw#204252. ## Why the tests were missed PR CI uses `selectionMode: "aggressive"` (`scripts/ci-build-manifest.mjs`). In `resolveBoundedChangedTestTargetPlan`, aggressive mode walks reverse imports to **depth 2**, and only to **depth 1** when the changed module has 20 or more direct importers (the hub cutoff). There are no owner-list routes for these files and no shard owner list filters them. The tests are simply too far away: | Changed owner | Import distance to the missed tests | |---|---| | `src/auto-reply/reply/agent-runner-memory.ts` | 3 (agent-runner tests) | | `src/agents/compaction.ts` | 5 (agent-runner), 7 (prompt-cache) | | `src/agents/embedded-agent-runner/run/request-boundary-compaction.ts` | 5 (agent-runner), 10 (prompt-cache) | | `src/agents/embedded-agent-runner/run/attempt-prompt-submit.ts` | 7 (prompt-cache), 9 (agent-runner) | | `packages/ai/src/transports/anthropic-messages.ts` | 6 (prompt-cache), 8 (agent-runner) | | `packages/agent-core/src/harness/compaction/summarization-completion.ts` | 6-7 | `session-context-accounting.gateway.integration.test.ts` is not reached within 10 imports of any compaction owner. It is reached only through the full closure, which runs through the Gateway into the runner. ## Fix The PR plan owner (`resolveChangedNodeTestTargets`) passes `transitiveOwners` to the bounded target walk. For a changed file that matches, the walk has no depth limit and no hub cutoff. All other paths keep the two-import walk. `docs/ci/scope-and-routing/node-test-lanes.md` describes the rule. ## Selection growth (replayed through the PR planner, hybrid backend, 130-row cap) | Replay | Before: tests / jobs / predicted test-seconds (max job) | After | |---|---|---| | openclaw#204111 (31 files) | 300 / 14 / 1,767 s (228 s) | 12,562 / 131 / 36,859 s (469 s) | | openclaw#204180 (9 files) | 22 / 5 / 351 s (140 s) | 12,405 / 131 / 36,673 s (468 s) | - The closure is nearly the whole runtime inventory. An unbounded walk from `request-boundary-compaction.ts` alone reaches 12,397 test files. - 48 of the last 200 first-parent commits on `main` (24%) touch these owners. At the replayed size, each PR push of that kind adds about 35,000 predicted test-seconds. - Shard budget: the plans stay at the compact Node row cap (130 rows plus one dist row) and below the 480-second per-job objective (max 469 s). They use the full PR row envelope that the registration budget already allows, so concurrent PRs of this kind compete for the same rows. - I tested no smaller rule that still selects the four tests. A walk depth of 10 already selects 2,401-7,129 tests (13,797-26,905 s) and still misses the Gateway integration test. ## Evidence - New test in `test/scripts/ci-changed-node-test-plan.integration.test.ts`. For 7 changed owners from openclaw#204111 and openclaw#204180, it asserts that the plan selects the four named tests and **every** test in the owner's unbounded runtime-import closure. It fails on `main` and passes on this head. - Replay script results above, on `main` and on this head. - One existing fixture expectation changed: `ci-changed-node-test-plan.selection.test.ts` used a `src/agents/example` source to pin the depth-two stop; it now expects the distant consumer. - Planner and workflow tests (13 files, 1,573 tests): all pass except `ci-changed-node-test-plan.test.ts` "retains precise process ownership (github)", which fails the same way on `main` (`expected 120 to be less than or equal to 60`). It is not caused by this change. - `pnpm check:changed`: pass. - CI on the head: green except 3 checks that fail the same way on scheduled main at the base (see the Maintainer override comment). Local ClawSweeper: patch is correct, no findings. Co-authored-by: Ayaan Zaidi <[email protected]>
…jobs (openclaw#204314) ## Result A selected (PR) Node job no longer inherits the 120-minute whole-config timeout from a group it does not run. `test/scripts/ci-changed-node-test-plan.test.ts` "retains precise process ownership and independent timing keys (github)" passes again. ## Cause `createSelectedNodeTestShardBundles` projects each job of a subset compact plan onto the selected files, and copies the job's fields with `...shard`. When that subset job also held a whole-config group (no `includePatterns`), it carried `COMPACT_WHOLE_NODE_TEST_TIMEOUT_MINUTES` (120). The projection drops the unselected whole group but kept its 120-minute timeout. So an exact-file job could run with twice its canonical owner's deadline. It is latent and depends on packing. openclaw#204178 (`7172fc1f5015`) added a test to `databaseWorkerCoreTestFiles`, which changed the subset packing for the GitHub profile. After that, `agentic-agents-embedded-base-3` (canonical owner timeout 60) shared a subset job with the whole `agentic-agents-embedded-run` group and got 120. A planner replay of the test's two targets shows it: at `447aed3e` (parent) the selected job has timeout 60; at `7172fc1f` it has 120. The canonical owner jobs are the same at both commits. openclaw#204292 did not change this path: `main` fails the same way before and after it. ## Fix The projection keeps the whole-config timeout only when a retained group is still a whole group (`!includePatterns`). Every other timeout, such as the long-unfitted 90 minutes or a cron minimum, is copied as before. ## Evidence - Planner replay (GitHub profile, the test's two embedded targets): before, `checks-node-changed-compact-large-35` has `timeoutMinutes: 120`; after, no override (60 default). The single-file `embedded-run` job no longer gets 120 either, which matches its canonical owner, since its whole group is not selected. - `test/scripts/ci-changed-node-test-plan*.test.ts`, `ci-node-test-plan.test.ts`, `ci-workflow-planning.test.ts`: 11 files, 1,285 tests pass on the head. The named case fails on `main` (`expected 120 to be less than or equal to 60`), the same as scheduled run 45288712101 (small-18). - CI green on the head; local ClawSweeper: patch is correct, no findings. Co-authored-by: Ayaan Zaidi <[email protected]>
…nd a declared behavior set (openclaw#204346) ## Result PR CI for agent, compaction, prompt and transport owners goes from a full-suite plan back to a bounded one, about 13x smaller. It still selects the four tests that openclaw#204252 was about. | Replay (PR planner, hybrid, 130-row cap) | Before (openclaw#204292) | After | |---|---|---| | openclaw#204111 (31 files) | 12,562 tests / 131 jobs / 36,859 s | **967 tests / 21 jobs / 2,881 s** (max job 271 s) | | openclaw#204180 (9 files) | 12,405 / 131 / 36,673 s | **302 / 14 / 1,393 s** (max job 250 s) | Both replays select `embedded-agent-runner.prompt-cache.test.ts`, `agent-runner-required-maintenance.pending-input.test.ts`, `agent-runner-compaction-fallback.test.ts` and `session-context-accounting.gateway.integration.test.ts`. ## Change For a changed source file under `src/agents/`, `src/auto-reply/reply/agent-runner*`, `packages/agent-core/src/harness/compaction/` or `packages/ai/src/transports/`, the aggressive PR plan now selects: 1. the normal two-import walk, as for every other file; 2. every transitive importer test **in the changed file's own directory**. A file directly in a package root (for example `src/agents/compaction.ts`) skips this step, because that directory is the whole package (1,795 tests for `src/agents/`); 3. a **declared behavior set**: every `*prompt-cache*` and `*compaction*` test under `src/` and `packages/` (118 files), plus `agent-runner-required-maintenance.pending-input.test.ts` and `session-context-accounting.gateway.integration.test.ts`. A test-only edit under these owners runs itself and does not pull in the declared set. Full mode (manual and hourly) is unchanged and still walks every importer. ## Decision recorded The follow-up asked for "importers within the same package". With the package root as the scope, openclaw#204111 selects 2,424 tests / 7,519 s, which misses the target of about 1,200 tests / 3,700 s. I used the changed file's directory instead, which meets the target. Coverage given up: cross-directory transitive importers, outside the declared set, of a file under these owners. The hourly full plan still runs them. This is reversible: widening the scope is a one-line change. | Variant | openclaw#204111 | openclaw#204180 | |---|---|---| | Declared set only | 369 / 1,888 s | 135 / 1,035 s | | **Same directory + declared (this PR)** | **967 / 2,881 s** | **302 / 1,393 s** | | Same package root + declared | 2,424 / 7,519 s | 308 / 1,393 s | | openclaw#204292 (unbounded) | 12,562 / 36,859 s | 12,405 / 36,673 s | ## Evidence - `ci-changed-node-test-plan.integration.test.ts`: for 7 owners from openclaw#204111 and openclaw#204180, the plan selects the four named tests and every same-directory importer test. - `ci-changed-node-test-plan.selection.test.ts`: the fixture case again expects the two-import stop for a distant consumer in another directory (the pre-openclaw#204292 expectation). - Planner, project and workflow tests (11 files): 1,322 passed. `pnpm check:changed`: pass. ## Coverage decision and closing loop - The maintainer accepted the same-directory scope as the coverage contract for these owners. The local review asked for this decision. - **Closing loop:** when a scheduled red traces to a green PR through a cross-directory importer, the fix PR adds that importer test to the owner's declared set. The declared sets grow only from real misses. - **Measurement:** 24 h after merge, compare agent-core PR rows and wall time with the openclaw#204292 numbers above. Co-authored-by: Ayaan Zaidi <[email protected]>
…jobs (#204314) A selected (PR) Node job no longer inherits the 120-minute whole-config timeout from a group it does not run. `test/scripts/ci-changed-node-test-plan.test.ts` "retains precise process ownership and independent timing keys (github)" passes again. `createSelectedNodeTestShardBundles` projects each job of a subset compact plan onto the selected files, and copies the job's fields with `...shard`. When that subset job also held a whole-config group (no `includePatterns`), it carried `COMPACT_WHOLE_NODE_TEST_TIMEOUT_MINUTES` (120). The projection drops the unselected whole group but kept its 120-minute timeout. So an exact-file job could run with twice its canonical owner's deadline. It is latent and depends on packing. #204178 (`cded11f81d55`) added a test to `databaseWorkerCoreTestFiles`, which changed the subset packing for the GitHub profile. After that, `agentic-agents-embedded-base-3` (canonical owner timeout 60) shared a subset job with the whole `agentic-agents-embedded-run` group and got 120. A planner replay of the test's two targets shows it: at `dae98a63` (parent) the selected job has timeout 60; at `cded11f8` it has 120. The canonical owner jobs are the same at both commits. #204292 did not change this path: `main` fails the same way before and after it. The projection keeps the whole-config timeout only when a retained group is still a whole group (`!includePatterns`). Every other timeout, such as the long-unfitted 90 minutes or a cron minimum, is copied as before. - Planner replay (GitHub profile, the test's two embedded targets): before, `checks-node-changed-compact-large-35` has `timeoutMinutes: 120`; after, no override (60 default). The single-file `embedded-run` job no longer gets 120 either, which matches its canonical owner, since its whole group is not selected. - `test/scripts/ci-changed-node-test-plan*.test.ts`, `ci-node-test-plan.test.ts`, `ci-workflow-planning.test.ts`: 11 files, 1,285 tests pass on the head. The named case fails on `main` (`expected 120 to be less than or equal to 60`), the same as scheduled run 45288712101 (small-18). - CI green on the head; local ClawSweeper: patch is correct, no findings. Co-authored-by: Ayaan Zaidi <[email protected]> (cherry picked from commit 0921f9f) Co-authored-by: RomneyDa <[email protected]>
…jobs (#204314) A selected (PR) Node job no longer inherits the 120-minute whole-config timeout from a group it does not run. `test/scripts/ci-changed-node-test-plan.test.ts` "retains precise process ownership and independent timing keys (github)" passes again. `createSelectedNodeTestShardBundles` projects each job of a subset compact plan onto the selected files, and copies the job's fields with `...shard`. When that subset job also held a whole-config group (no `includePatterns`), it carried `COMPACT_WHOLE_NODE_TEST_TIMEOUT_MINUTES` (120). The projection drops the unselected whole group but kept its 120-minute timeout. So an exact-file job could run with twice its canonical owner's deadline. It is latent and depends on packing. #204178 (`cded11f81d55`) added a test to `databaseWorkerCoreTestFiles`, which changed the subset packing for the GitHub profile. After that, `agentic-agents-embedded-base-3` (canonical owner timeout 60) shared a subset job with the whole `agentic-agents-embedded-run` group and got 120. A planner replay of the test's two targets shows it: at `dae98a63` (parent) the selected job has timeout 60; at `cded11f8` it has 120. The canonical owner jobs are the same at both commits. #204292 did not change this path: `main` fails the same way before and after it. The projection keeps the whole-config timeout only when a retained group is still a whole group (`!includePatterns`). Every other timeout, such as the long-unfitted 90 minutes or a cron minimum, is copied as before. - Planner replay (GitHub profile, the test's two embedded targets): before, `checks-node-changed-compact-large-35` has `timeoutMinutes: 120`; after, no override (60 default). The single-file `embedded-run` job no longer gets 120 either, which matches its canonical owner, since its whole group is not selected. - `test/scripts/ci-changed-node-test-plan*.test.ts`, `ci-node-test-plan.test.ts`, `ci-workflow-planning.test.ts`: 11 files, 1,285 tests pass on the head. The named case fails on `main` (`expected 120 to be less than or equal to 60`), the same as scheduled run 45288712101 (small-18). - CI green on the head; local ClawSweeper: patch is correct, no findings. Co-authored-by: Ayaan Zaidi <[email protected]> (cherry picked from commit 0921f9f) Follow-up audit: 6f93bcc volume baselines, 2c645bf UI/runtime eligibility, d7246e9 test tiers, b9ef0d7 scheduling coverage, 1e0c8f8 inventory, ad2f629 build selection, and 5754fac importer scope are independent planner changes; b5263df and b59c1b2 cover agent QA/history. Keep baseline build placement and relative timing. Release adaptation: Retained baseline pretest build mode and timing projection; only changed inherited timeout handling. Co-authored-by: RomneyDa <[email protected]>
Result
Pull request CI now selects every test whose runtime imports reach a changed file under
src/agents/,src/auto-reply/reply/agent-runner*,packages/agent-core/src/harness/compaction/orpackages/ai/src/transports/, directly or transitively. Replaying the file lists of #204111 and #204180 now selects the four tests that first failed on scheduledmain(#204252).Cost, read this first: for these owners the transitive closure covers almost the whole runtime suite. A PR that touches them now runs a full-suite-sized Node plan, about 21x to 105x the previous predicted test time. Exact numbers are below. The plan stays inside the existing row cap and per-job time objective. Nothing is capped or dropped.
Closes #204252.
Why the tests were missed
PR CI uses
selectionMode: "aggressive"(scripts/ci-build-manifest.mjs). InresolveBoundedChangedTestTargetPlan, aggressive mode walks reverse imports to depth 2, and only to depth 1 when the changed module has 20 or more direct importers (the hub cutoff). There are no owner-list routes for these files and no shard owner list filters them. The tests are simply too far away:src/auto-reply/reply/agent-runner-memory.tssrc/agents/compaction.tssrc/agents/embedded-agent-runner/run/request-boundary-compaction.tssrc/agents/embedded-agent-runner/run/attempt-prompt-submit.tspackages/ai/src/transports/anthropic-messages.tspackages/agent-core/src/harness/compaction/summarization-completion.tssession-context-accounting.gateway.integration.test.tsis not reached within 10 imports of any compaction owner. It is reached only through the full closure, which runs through the Gateway into the runner.Fix
The PR plan owner (
resolveChangedNodeTestTargets) passestransitiveOwnersto the bounded target walk. For a changed file that matches, the walk has no depth limit and no hub cutoff. All other paths keep the two-import walk.docs/ci/scope-and-routing/node-test-lanes.mddescribes the rule.Selection growth (replayed through the PR planner, hybrid backend, 130-row cap)
request-boundary-compaction.tsalone reaches 12,397 test files.main(24%) touch these owners. At the replayed size, each PR push of that kind adds about 35,000 predicted test-seconds.Evidence
test/scripts/ci-changed-node-test-plan.integration.test.ts. For 7 changed owners from feat(agents): compact from the warm prompt cache on every route #204111 and fix: compact at 80% on every route #204180, it asserts that the plan selects the four named tests and every test in the owner's unbounded runtime-import closure. It fails onmainand passes on this head.mainand on this head.ci-changed-node-test-plan.selection.test.tsused asrc/agents/examplesource to pin the depth-two stop; it now expects the distant consumer.ci-changed-node-test-plan.test.ts"retains precise process ownership (github)", which fails the same way onmain(expected 120 to be less than or equal to 60). It is not caused by this change.pnpm check:changed: pass.