Repository navigation
fix: keep affected tests for common importer names - #147754
Conversation
|
🦞👀 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 13, 2026, 11:22 PM ET / September 14, 2026, 03:22 UTC (Revision 3). ClawSweeper reviewWhat this changesRemoves an importer-count cutoff so focused test runs retain affected tests for common filenames, with regression coverage for cached selection and direct tooling imports. Merge readiness✅ Ready for maintainer review This remains a useful, focused fix: current main still drops import candidates above the cutoff. No blocking correctness or security findings remain, and the supplied measurements support the repair. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw’s test planner turns changed source paths into focused Vitest targets. Its reverse-import scanner connects those paths to consuming tests before the test runner selects its execution lanes. flowchart LR
A[Changed source paths] --> B[Test planner]
C[Tracked source inventory] --> D[Import scanner]
B --> D
D --> E[Resolved importer edges]
E --> F[Source traversal or direct tooling selection]
F --> G[Focused Vitest targets]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests +7. Total +7 across 2 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep complete resolved importer facts in the existing planner while preserving helper rules, direct-only tooling selection, and explicit full-graph fallback. Do we have a high-confidence way to reproduce the issue? Yes: current-main source proves that a narrow importer plus more than 800 basename matches can suppress other consumers. The PR supplies matching before/after observations; this review did not execute tests. Is this the best way to solve the issue? Yes: removing the cutoff uses facts already acquired by the existing owner and fixes both source and tooling selection without introducing another routing mechanism. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against c2f7bfbc2401. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
|
Fixed: focused test selection retains affected source and tooling tests for common importer names. |
Preserve complete affected-test selection for common source names while retaining existing helper and tooling routing. Refs openclaw#147665.
What Problem This Solves
Fixes focused test selection dropping existing owners when a new importer is added for a source file with a common name. In #147665, a valid root test importing
matrix/api.jscaused selection for Matrix'schannel.tsto omitchannel.threading.test.ts. Broad matches can also leave tooling selection with a literal-reference test while dropping its direct-import test.User Impact
Developers running focused source-file or changed-test commands get existing owner tests alongside newer consumers. Direct tooling selection also retains its imported tests when the same source name appears widely across the checkout.
Why This Change Was Made
The reverse-import scanner already reads candidate files and caches their resolved import edges before applying its 800-candidate limit. That limit now discards acquired facts: a narrow hit can make an incomplete importer list look complete, while tooling has no full-graph recovery for discarded direct imports.
Remove the obsolete limit and consume the existing facts. Keep helper-specific selection, direct-only tooling, traversal stopping at tests, tracked-file and filesystem inventories, live-test exclusions, and explicit full-graph and scan-failure behavior with their existing owners. Planning still reads source text without executing plugin runtimes. This change adds no dependencies, configuration, persistence, or Matrix runtime code.
Evidence
dbb422c85a5, a tracked fixture containing the Matrix API import reproduces the original omitted-threading-test failure. The extended fixtures fail in three cases against the original implementation, with the no-narrow-import control passing; the candidate passes all six focused cases.0e044ec0f041, all 1,105 tests pass with the Matrix importer present:node scripts/run-vitest.mjs test/scripts/test-projects.test.ts test/scripts/test-projects-routing.test.ts test/scripts/ci-changed-node-test-plan.test.ts test/scripts/pr-crabbox-gate-plan.test.ts test/scripts/run-vitest.test.ts --reporter=dot.node scripts/check-changed.mjs -- scripts/test-projects.test-support.mts test/scripts/test-projects.test.ts, including scripts/root-test type checks, semantic lint, and static guards. The local publication preflight took 29 seconds; independent review is clean through P2.Paired Linux measurements used one retained runner, three fresh Node processes per scenario, five repeated queries in each process, and both
resolveChangedTestTargetPlanandbuildVitestRunPlans. Times below are median cold changed-target planning; the Matrix scenarios include the same tracked API-import fixture.Cached Matrix queries measured 2.81 → 4.59 ms for the complete result. Every additional helper target has a verified relative-import path to that helper, and no previous helper consumer was removed. The complete Matrix reference is included because the original partial result's speed alone is not a valid comparison.
The same 1,105 routing tests also pass on the prospective merge with main
c863c432c0ec(result tree97cd85ec00a2). Changed mode selects seven Matrix targets including the parity check; explicit source mode selects the six consumer tests. Both include threading.CI passed on the exact head. ClawSweeper rated that head Platinum with no findings.