Repository navigation
fix(test): keep extension batches inside requested directories - #162009
Conversation
Preserve canonical plugin roots as directory filters and intersect plain directory test globs with their owning scope. Prevent policy batches from selecting sibling policy filenames or nested policy directories while retaining watch discovery, explicit files, exclusions, and complex owner patterns. Add real runner-to-selector regression cases, proven failing before the fix, and keep existing aggregation and scoped-config assertions aligned.
|
🦞👀 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: blocked before merge. Reviewed September 30, 2026, 2:38 PM ET / 18:38 UTC (Revision 3). ClawSweeper reviewWhat this changesThe branch bounds bundled-plugin test batches to requested directories and updates runner and selector tests for directory, watch, and explicit-file selection. Merge readiness⛔ Blocked before merge - 2 items remain Current main still has the reported selection bug, and the latest commit appears to resolve the prior explicit-file finding. I found no further discrete patch defect. The live PR API reports a contributor association, and the supplied after-fix evidence does not yet show a real extension batch run. Priority: P2 Review scores
Verification
How this fits togetherThe extension batch runner turns requested plugin names into Vitest configuration groups and file targets. Vitest then selects tests, while runtime preparation decides which code to build before they run. flowchart LR
A[Requested plugins] --> B[Extension batch planner]
B --> C[Configuration groups]
C --> D[Directory and file targets]
D --> E[Vitest selection]
E --> F[Runtime preparation]
F --> G[Executed tests]
Before merge
Agent review detailsSecurityNone. PR surfaceTests +57, Other +10. Total +67 across 4 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep directory selection in the existing runner and selector owners, with a real batch demonstrating that requested plugin directories are respected while explicit-file admission remains stable. Do we have a high-confidence way to reproduce the issue? Yes. Current-main source emits a bare plugin-name target, and the PR reports a pre-fix policy batch that planned 17 files but executed 38; this read-only review did not run the command. Is this the best way to solve the issue? Yes. The patch changes the existing runner and pattern owners, and its latest commit addresses the prior explicit-file regression. Real after-fix Vitest selection remains unobserved. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 112df95f5ee6. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
…law#162009) * fix(test): keep extension batches inside requested directories Preserve canonical plugin roots as directory filters and intersect plain directory test globs with their owning scope. Prevent policy batches from selecting sibling policy filenames or nested policy directories while retaining watch discovery, explicit files, exclusions, and complex owner patterns. Add real runner-to-selector regression cases, proven failing before the fix, and keep existing aggregation and scoped-config assertions aligned. * fix(test): preserve explicit extension file filters
What Problem This Solves
pnpm test:extensions:batch policyplanned 17 policy files but ran 38 files because the runner emitted barepolicy, which Vitest treats as a substring filter. Adding a slash alone still admits sibling paths containing a nestedpolicy/directory.User Impact
Default bundled-plugin discovery stays inside the requested plugin directories. Explicit test files, exclusions, database-worker aggregation, watch discovery, and include-file precedence remain intact. Product behavior and plugin contracts are unchanged.
Why This Change Was Made
Preserve canonical plugin roots as directory filters, then narrow plain directory test globs only when their existing owner proves containment. The owner keeps its
.test.tssuffix; complex globs retain their existing behavior. This fixes selection at the existing runner and pattern owners without replacing directory discovery with a static file inventory.Evidence
Corrected head
7d53e88634361a53f2861bcc46dc3c88d46b6e4fcompleted run 36759052890 with one inherited failed job,checks-node-compact-small-1-3(childcore-tooling-2-hosted-3), plus the aggregate CI gate. The three failures are intest/scripts/plugin-sdk-surface-report.test.ts: registered command joins, pinned public budgets, and callable-growth rejection. Source reports 4,595 exports / 2,699 callable exports, versus budgets 4,594 / 2,698.The same three cases and counts fail on unrelated current PR #162038 at head
10eedda18c8acc5ceb8045233a93cdd7dca8c9db, run 36758377865, job 110034839635. Our failing CI checkout is merge tree7a10bc32a87142b955ae9bb52dfce8ed12cb8de8, incorporating main112df95f5ee65a0b17622735e2b616d2910dc79b. That main contains6830c82ea080767b8953edce13a3e543eed419da, which addswithUserPathBaseDirectory; the existinginfra-runtimewildcard exports it. This PR changes no SDK graph, report, budget, or inputs to those counts. The coordinator owns the inherited budget repair. All affected suites and security checks passed; landing uses the expressly authorized inherited-failure exception pinned to the corrected head, without describing hosted CI as green.Initial head
0e59de3670ba5f69af6b149788e218daf3cdef5afailed the existing “ordinary QA file” build-admission case in run 36750231892, job 110007133350. The implicit directory operand widened an explicit file selection and caused an unwanted build. Commit7d53e88634361a53f2861bcc46dc3c88d46b6e4fpreserves the prior implicit operand when the canonical CLI parser finds explicit file filters. No assertion was weakened or retried to hide this failure.Correction proof:
node scripts/run-vitest.mjs test/scripts/test-extension.test.ts test/scripts/test-projects-build-admission.test.ts --maxWorkers=1passed 280 tests / 2 files. The formerly failing admission case passed in 9 ms; all default-directory regressions still pass. This overloaded-host run took 1,525.10 seconds wall, including CLI subprocess coverage, worker compilation, and cleanup.All three new runner-to-selector regression cases failed on the original implementation. They also exposed the incomplete slash-only fix; the final repair passes single-plugin, multi-plugin, and watch cases, rejecting sibling filenames, nested sibling directories, similar plugin names, and files outside the owner's suffix.
Selection-owner coverage before the explicit-filter correction:
node scripts/run-vitest.mjs test/scripts/test-extension.test.ts test/vitest-scoped-config.test.ts test/vitest/vitest.pattern-file.test.ts test/vitest-unit-fast-config.test.ts --maxWorkers=1: 171 passed / 4 files. The shared run took 437.04 seconds wall on the overloaded Mac, including cold worker compilation. Existing watch, include-file intersection, explicit-file, exclusion, extglob, and unit-fast routing coverage passed.Test cost: the three new cases took 37 / 19 / 4 ms on the corrected source. The full runner file took 64.463 seconds of Vitest test time; scoped-config took 30.259 seconds. These files already cover native process/lifecycle and whole-inventory contracts; the additions introduce no processes, timers, polling, retries, or worker configuration.
check-changedpassed all selected guards, script/test-root typechecks, formatting, and lint before the one-file correction. The correction is additionally checked with script lint/typechecking and both cycle checks. Its optional whole-tree dead-export scan was omitted via the documentedOPENCLAW_CHECK_CHANGED_SKIP_DEADCODE=1switch for host load.Both
scripts/check-madge-import-cycles.tsandscripts/check-import-cycles.tspassed with 0 cycles before push.Independent final review: no actionable P0–P2 findings.
The lane's Blacksmith lease had expired and the sanitized AWS coordinator returned HTTP 401 without allocating a lease. This follow-up used the authorized sequential
nice -n 15local fallback. Hosted CI on the published head remains the merge gate.