Skip to content

fix(test): include all runners for package directories - #160653

Merged
steipete merged 2 commits into
mainfrom
deslop/l103-package-directory-routing
Sep 28, 2026
Merged

steipete merged 2 commits into
mainfrom
deslop/l103-package-directory-routing

Conversation

@steipete

@steipete steipete commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

pnpm test packages and package-directory selections omit tests that belong to specialized runners, including fast, Gateway, and database-worker tests.

User Impact

Non-watch commands selecting a literal package directory run its regular tests through their existing owners. Watch mode, globs, explicit E2E/live selection, empty-path diagnostics, and inherited CI include limits retain their existing behavior.

Why This Change Was Made

The shared planner previously classified a directory as one runner even when its files had different owners. Discover existing *.test.ts leaves only within the requested package subtree, prune through the shared exclusions, then use the existing classification and deduplication logic. Only original explicit files own an include selection; discovered files remain narrowed by inherited includes.

This is the focused follow-up discovered during #159279. It adds no public exports, dependencies, flags, or runner policy.

Evidence

The frozen candidate tree e374c8d16fed7c3dd4edef1d5708415500c3f780 passed on Blacksmith Testbox tbx_01m3mj70p0pezbt76892sh8yz4, then was committed exactly as e711a37ed11dcffe39ad6819f81826428c02215f. Tested head 4f2a22a2eefbac5d10c22537ec282d8a62fa7fd2 is a patch-identical rebase onto fresh main 5117d94bdf94b2848a3f28b22ce1e3bc28b63e65; duplicate searches found no existing repair.

  • The new mixed-owner regression fails on the original planner with the aggregate packages/**/*.test.ts selection instead of the specialized leaves (3.17s).
  • All 12 candidate regressions passed. pnpm test test/scripts/test-projects-package-directories.test.ts --maxWorkers=1: 2.22s wall, 1.89s Vitest shard.
  • node scripts/run-vitest.mjs run packages src/infra/fs-safe-import-boundary.test.ts executed the four inherited package files plus the explicit boundary exactly once: 86 tests passed, 8.23s. pnpm test packages executed exactly the four package files: 63 passed, 4.77s. Both native JSON inventories were checked without deduplicating them.
  • pnpm build passed (403.43s); planner siblings 2,280 passed across two shards (130.08s); all import-boundary files passed across ten shards (91.42s).
  • node scripts/check-changed.mjs --base 20021ebe9b7a96539c98b8dd3a578fb46534ee05 -- scripts/test-projects.test-support.mts test/scripts/test-projects-package-directories.test.ts docs/help/testing/suites.md passed (438.25s).
  • Full proof invocation exited 0 in 19m19.995s. The lease is stopped. Independent managed review is scoped-clean through P2.

The rebase changes two unrelated routing inventories and the canonical runtime preparation command. Current-head refresh passed on ARM Blacksmith Testbox tbx_01m3mnmzgqz0r9425pnjcaaws2: all 12 regressions (6.18s command), both public commands with the same exact 5-file/86-test and 4-file/63-test inventories (21.64s/11.26s), and 727 planner sibling cases across two shards (199.22s; upstream #160480 removed redundant planner cases). Aggregate exit 0, 8m4.583s. ARM hosting run. This lease is stopped; the initial x64 refresh lease was stopped after over 15 minutes queued without running a payload. The complete x64 build, import-boundary, and changed-check proof retains its original tree attribution. In the prior green hosted run, the 12-case new regression file took 0.387s test execution (job checks-node-compact-small-13-3, child core-tooling-8-hosted-2).

READY-TO-LAND. Prior published head 6c96ed400f6f771cb0320f94650b59204b4fc701 added only an empty CI refresh to the tested tree. That exact-head CI passed, including the compact planner job and aggregate gate. The previous merge-ref run exposed an inherited hourly-planner row-cap overflow; canonical main fix df582a4010d5d244ff100b2c8d363ebee43a0fcf restores packing without changing caps, timings, ownership, or assertions. The directory expansion was not invoked by that failing hourly constructor. No duplicate repair was included here.

Final head 8b996b97a9699ebe3e102f2f87f8a62bdd6a1bf0 rebases both commits patch-identically onto audited main c8a045a4f35e063f951130619e5e1cf4bb0de349. The changed files, routing owners/adapters, inventories, shared exclusions, and toolchain/dependency inputs are unchanged upstream. Main still lacks this repair; a fresh duplicate search found only this PR. Completed Testbox and review evidence remains valid. Final-head hosted CI is green, including the aggregate gate.

This PR must stop at READY-TO-LAND, unmerged and with auto-merge off.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation scripts Repository scripts size: S labels Sep 28, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. 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 Sep 28, 2026
@clawsweeper

clawsweeper Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 28, 2026, 5:29 PM ET / 21:29 UTC (Revision 6).

ClawSweeper review

What this changes

The branch makes package-directory test selections discover regular test files and assign each to its existing runner, with regression coverage and a testing-doc update.

Merge readiness

⛔ Blocked before merge - 2 items remain

Current main still has the package-directory test selection gap, and the branch provides a focused repair with credible command-level proof. The PR explicitly requests a READY-TO-LAND hold, so merging requires a human to release that hold.

Priority: P2
Reviewed head: 8b996b97a9699ebe3e102f2f87f8a62bdd6a1bf0
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Focused planner code, relevant regression cases, real command results, and exact-head CI support the repair; the merge hold is a workflow decision.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): The changed planner is exercised by the reported real pnpm test packages and mixed run-vitest commands on Testbox; the PR body records after-fix inventories of four files and 63 tests, and five files and 86 tests, respectively, with exact-head hosted CI green. No stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The changed planner is exercised by the reported real pnpm test packages and mixed run-vitest commands on Testbox; the PR body records after-fix inventories of four files and 63 tests, and five files and 86 tests, respectively, with exact-head hosted CI green. No stored-data contract changes.
Evidence reviewed 7 items Introduced planner change: The pinned merge-base-to-head diff adds bounded package-directory discovery before the existing per-file classification path.
Current main remains unfixed: The current-main expansion path has no package-directory leaf discovery and passes a directory onward as one target; the same planner classifies individual specialized files separately.
Regression coverage: The new tests cover mixed runner ownership, deduplication, subtree bounds, exclusions, inherited include limits, explicit E2E selection, empty targets, watch mode, and globs.
Findings None None.
Security None None.

How this fits together

OpenClaw's test command turns file and directory arguments into Vitest runner plans. Those plans determine which tests local commands and CI execute.

flowchart LR
A[Package directory argument] --> B[Test command]
B --> C[Discover regular tests]
C --> D[Apply shared exclusions]
D --> E[Choose each test runner]
E --> F[Scoped Vitest runs]
Loading

Decision needed

Question Recommendation
May this PR leave its explicit READY-TO-LAND hold and proceed to merge? Keep the hold: Leave the reviewed PR open and unmerged until its author or an authorized maintainer explicitly releases it.

Why: Green checks and a clean review cannot override the PR body's explicit instruction to remain unmerged with auto-merge off.

Before merge

  • Complete next step (P2) - Keep auto-merge off and obtain an explicit release of the READY-TO-LAND hold before merging.
  • Resolve maintainer decision - Resolve the maintainer decision shown above before merge.
Agent review details

Security

None.

PR surface

Tests +188, Docs +1. Total +189 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 2 188 0 +188
Docs 1 1 0 +1
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 189 0 +189

Review metrics

Metric Value Why it matters
Production and test growth planner +21 lines; tests +167 lines The planner growth addresses omitted runner ownership, and the added tests cover the selection boundaries.
Regression cost 12 cases; 0.387 s reported CI test execution The new test file stays below the repository's five-second per-file target.

Technical review

Best possible solution:

Keep package-directory discovery in the shared planner so each regular test reaches its existing runner once while exclusions, watch mode, and inherited include limits remain intact.

Do we have a high-confidence way to reproduce the issue?

Yes, current-main source shows the package directory being routed as one target while individual files have specialized runner owners. The PR reports a pre-fix regression failure, but this read-only review did not execute it.

Is this the best way to solve the issue?

Yes, expanding only literal non-watch package directories in the existing planner is a narrow repair that reuses established runner classification and include filtering.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against a46cde88785d.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: Package-directory commands can silently omit specialized tests, but the effect is limited to test selection.
  • merge-risk: 🚨 automation: The diff changes shared test-runner planning, where a classification mistake could change local or CI coverage despite passing checks.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The changed planner is exercised by the reported real pnpm test packages and mixed run-vitest commands on Testbox; the PR body records after-fix inventories of four files and 63 tests, and five files and 86 tests, respectively, with exact-head hosted CI green. No stored-data contract changes.
  • proof: sufficient: Contributor real behavior proof is sufficient. The changed planner is exercised by the reported real pnpm test packages and mixed run-vitest commands on Testbox; the PR body records after-fix inventories of four files and 63 tests, and five files and 86 tests, respectively, with exact-head hosted CI green. No stored-data contract changes.

Evidence

What I checked:

  • Introduced planner change: The pinned merge-base-to-head diff adds bounded package-directory discovery before the existing per-file classification path. (scripts/test-projects.test-support.mts:1504, 8b996b97a969)
  • Current main remains unfixed: The current-main expansion path has no package-directory leaf discovery and passes a directory onward as one target; the same planner classifies individual specialized files separately. (scripts/test-projects.test-support.mts:1503, a46cde88785d)
  • Regression coverage: The new tests cover mixed runner ownership, deduplication, subtree bounds, exclusions, inherited include limits, explicit E2E selection, empty targets, watch mode, and globs. (test/scripts/test-projects-package-directories.test.ts:28, 8b996b97a969)
  • Real command evidence: The captured PR body reports after-fix pnpm test packages selecting four files with 63 passing tests and a mixed run-vitest command selecting five files with 86 passing tests; it also reports a failing pre-fix regression. These are contributor-reported Testbox observations, not a reviewer-side execution. (8b996b97a969)
  • Final-head CI: The linked pull-request workflow completed successfully for the exact reviewed head. An earlier linked ARM hosting workflow concluded cancelled, so its overall conclusion is not counted as a pass. (8b996b97a969)
  • Area history: Recent main-branch history shows Peter Steinberger repeatedly changing the test planner and Vincent Koc contributing nearby CI planning work; this supports routing, not attribution of the defect. (scripts/test-projects.test-support.mts, abb37032e7f7)

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Vincent Koc: 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.

History

Review history (5 earlier review cycles)
  • reviewed 2026-09-28T18:48:27.167Z sha 4f2a22a :: blocked before merge. :: none
  • reviewed 2026-09-28T19:30:37.997Z sha 4f2a22a :: blocked before merge. :: none
  • reviewed 2026-09-28T20:24:20.361Z sha 6c96ed400f6f771cb0320f94650b59204b4fc701 :: blocked before merge. :: none
  • reviewed 2026-09-28T20:44:21.310Z sha 6c96ed400f6f771cb0320f94650b59204b4fc701 :: blocked before merge. :: none
  • reviewed 2026-09-28T21:19:26.973Z sha 8b996b9 :: blocked before merge. :: none

@steipete
steipete marked this pull request as ready for review September 28, 2026 19:21
@clawsweeper

clawsweeper Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@steipete
steipete force-pushed the deslop/l103-package-directory-routing branch from 6c96ed4 to 8b996b9 Compare September 28, 2026 21:05
@steipete
steipete merged commit 8857192 into main Sep 28, 2026
165 checks passed
@steipete
steipete deleted the deslop/l103-package-directory-routing branch September 28, 2026 21:36
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 29, 2026
* fix(test): run package directory tests in their owning projects

* ci: refresh package directory checks after planner repair
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. P2 Normal backlog priority with limited blast radius. 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: S 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