test: isolate and clean temporary test roots - #1099
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Codex review: needs maintainer review before merge. Reviewed August 30, 2026, 5:02 AM ET / 09:02 UTC. ClawSweeper reviewWhat this changesThe PR isolates named Node test runs in a per-run temporary root, removes that root after completion or signals, reaps stale roots, and converts validation-test fixtures to automatic cleanup. Merge readinessKeep open for maintainer handling: this MEMBER-authored PR remains a coherent, unmerged test-lifecycle change, but GitHub reports a dirty merge state. Current main still has the pre-isolation test runner, so the central change is not already implemented there; rebase and refresh the exact-head proof before landing. Priority: P3 Review scores
Verification
How this fits togetherClawSweeper’s Node test runner starts unit and repair tests that validate automation and repair-lane behavior. Named commands enter the runner, which launches child test processes that create temporary filesystem fixtures and feeds their result back to CI or local validation. flowchart LR
A[Named test command] --> B[Test runner]
B --> C[Per-run temporary root]
C --> D[Node test process]
D --> E[Temporary fixtures]
D --> F[Exit or termination signal]
F --> G[Cleanup and stale-root reaper]
G --> H[Clean temporary area]
Decision needed
Why: The patch is coherent, but the dirty merge state prevents this review from determining the behavior of the resolved merge, and repository policy reserves maintainer-authored work for explicit judgment. Before merge
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Rebase the focused test-lifecycle change onto current main, preserve the per-run cleanup contract, and refresh the documented lifecycle proof against the resolved head before merge. Do we have a high-confidence way to reproduce the issue? Yes, source and the submitted lifecycle fixtures define a focused reproduction path for temporary-root cleanup, but no new execution was performed in this read-only review and the current merge result is unavailable. Is this the best way to solve the issue? Unclear until rebase: isolating the shared runner and using per-test cleanup is a maintainable direction, but the dirty merge must be resolved before the exact landing behavior can be confirmed. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against fa535d54a032. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (9 earlier review cycles; latest 8 shown)
|
4b99634 to
1aa53a6
Compare
|
Local black-box validation completed against commit Environment:
Evidence:
No pre-existing historical temporary directories were deleted during this validation. The PR CI |
…ck finalization (#1109) Three repair lanes rolled up PR status checks independently, and the finalizer's copy had a live bug: it processed every check entry instead of deduplicating to the newest run per check identity, so an older failed run of a re-run check remained a blocker after the newer run succeeded. The finalizer's classifications feed the published repair queue via repair-publish-results, making stale failures veto finalization. All three lanes now share src/repair/status-check-rollup.ts (latest-run selection, ignored-name parsing, casing and timestamp precedence implemented once); lane policy stays in the callers. Proof (docs/proof/status-check-rollup): a red-then-green regression test, and a real-payload production-boundary trace -- the identical real 26-entry check payload from PR #1099 classified by both implementations: pre-change code reports two stale CANCELLED blockers, this head reports zero, and the real report-only finalizer confirms needs_checks=0. Verified in a Docker-backed Crabbox local-container with committed provenance. Automation-risk disposition: the newest run of a check identity is its current state (the rule the router and post-flight lanes already applied); blast radius is finalizer classifications in the published repair queue; rollback is a revert restoring per-entry processing.
Summary
Repeated test runs can leave fixture directories behind in the shared system temporary directory. Some fixtures intentionally contain non-regular files such as FIFOs, which can also cause content-inspecting host cleanup tools to block indefinitely.
This change keeps the FIFO safety coverage while tightening the test lifecycle:
The tracker follows the established OpenClaw auto-cleanup temp-directory pattern, adapted locally so ClawSweeper does not depend on another repository's test helpers.
Review follow-up
Validated at head
a602f2ba67.target-validationis now a canonicalrun-node-tests.mjstarget. Validation fixtures created through the supported narrow-test command inherit the run root, so a SIGKILL, crash, or reboot leaves aclawsweeper-test-run-*root that the existing heartbeat/TTL reaper recognizes. The rawnode --test ... target-validation.test.tscommand is no longer used as the recommended evidence path.test/codex-process.test.tstwice; the named target remains the single source of file selection.Local black-box validation
Linux, Node
v24.15.0. Corepack resolved the repository pin to pnpm11.10.0.Runner and lifecycle behavior
Result: 10 passed, 0 failed. This covers named-target selection plus successful FIFO cleanup, assertion-failure cleanup, stale-root TTL cleanup, and SIGTERM cleanup through the real CLI runner.
Incident-equivalent FIFO fixture through the canonical target
Result: 1 passed, 0 failed; FIFO behavior completed in 19.75 ms. Matching counts were unchanged:
Repeated full target validation through the canonical target
Executed twice:
Results:
clawsweeper-test-run-*:0 -> 0 -> 0clawsweeper-validation-*:0 -> 0 -> 0Repository checks
corepack pnpm run check: static checks, formatting, builds, lint, and changed coverage passed; the final full-coverage run failed only in threetest/review-blob-hydration.test.tspartial-clone hydration cases, which returnedhydrated: false/blobs: 0in this environment. The same failures reproduce when that file is run directly outside the new runner; this PR does not modify that test or hydration code. The current-head hostedpnpm checkpassed: https://github.com/openclaw/clawsweeper/actions/runs/31464912192/job/93695706262.origin/mainafter commit: clean; TruffleHog cleanScope boundary
This change affects only test fixture and test-runner lifecycle. It does not change OpenClaw Bay state, queues, sweep workflows, publication behavior, or dashboard contracts. It does not downgrade pnpm and does not delete host-level pnpm, npm, or Docker caches.