Repository navigation
test: let Node own validation fixture cleanup - #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 September 1, 2026, 7:40 PM ET / 23:40 UTC. ClawSweeper reviewWhat this changesThe PR groups temporary validation-test fixtures under one Node test-suite root and removes that root with Node’s teardown hook. Merge readinessThe PR is a narrow, test-only cleanup with direct current-head lifecycle proof and no correctness finding. It remains open because repository policy requires explicit maintainer judgment for a member-authored pull request; the remaining current-head check should finish before merge. Priority: P3 Review scores
Verification
How this fits togetherThe repair validation tests create disposable target repositories, tool shims, and filesystem edge cases to verify ClawSweeper’s repair safeguards. Those fixtures are consumed by the test runner and should disappear once the suite completes. flowchart LR
A[Node test suite] --> B[Fixture allocator]
B --> C[Suite-owned temporary root]
C --> D[Validation fixtures]
D --> E[Repair validation checks]
E --> F[Node teardown]
F --> G[Fixture root removed]
Decision needed
Why: Repository policy reserves member-authored PRs for explicit maintainer judgment even when the code and supplied proof are sound. Before merge
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Merge the suite-owned Node teardown after the current-head check succeeds, retaining the supplied direct Do we have a high-confidence way to reproduce the issue? Not applicable: this PR repairs test-fixture lifetime rather than a user-facing issue. Is this the best way to solve the issue? Yes: native Node test teardown keeps ownership in the suite rather than adding runner-wide cleanup machinery. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 7b645130563f. 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 (10 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.
Worked on by: - @VACInc Co-authored-by: VACInc <[email protected]>
Keep changed-gate cache restoration independent of pending runtime artifacts. Preserve the fresh-output binding for archive smoke and extend the existing regression to cover warm caches across success, fallback and tampering. Co-authored-by: VACInc <[email protected]>
Merge current main and use strict validation for the build/check/smoke success fixture. Preserve the existing missing-script fallback and artifact-tampering scenarios. Co-authored-by: VACInc <[email protected]>
Keep all target-validation fixtures under one suite-owned directory and remove it with node:test after. Remove the proposed global temp reaper, heartbeat, signal lifecycle and runner overrides; raw node --test remains supported. Co-authored-by: masonxhuang <[email protected]>
Place the three detached-process test shims inside their target fixtures so the production sandbox can load them. Preserve namespace, mount and process-reaping assertions.
Integrate the reviewed cache-restoration changes. Keep the native containment shims inside their fixture checkouts and bring the new cache fixture under the existing test-owned temporary root. Co-authored-by: masonxhuang <[email protected]>
Preserve the reviewed single-root teardown and native fixture placement on current main. Co-authored-by: masonxhuang <[email protected]>
|
Merged as 311b985. The final implementation keeps temporary-fixture ownership in the validation test file and delegates cleanup to Node's native teardown. It replaces the proposed runner-wide reaper/heartbeat/signal machinery with one owned root: one file, nine net added lines, and direct Live AWS and macOS proof reproduced leaked baseline fixtures and verified cleanup after success, intentional assertion failure, and the actual FIFO preflight test. The unrelated symlink target remained unchanged. AWS run Current-head ClawSweeper review reported no correctness/security findings with sufficient proof; independent review found no actionable P1/P2 regression. GitHub CI, Windows, sparse-build, containment smoke and CodeQL passed. The merged tree matches the expected combination with current main, and the changed test file's hash matches the live-tested source. The isolated main checkout is clean; AWS lease Thanks @hxy91819 for the original contribution. This covers ordinary test completion and failure; crash/SIGKILL cleanup and historical temporary directories remain outside its ownership contract. |
What Problem This Solves
Repeated target-validation tests left their Git checkouts, tool shims and FIFO fixtures in the shared temporary directory. The test file created those directories but had no cleanup owner, including when invoked directly with
node --test.Why This Change Was Made
Allocate this test file's fixtures beneath one private temporary root and register its removal with native
node:testafter. Fixture constructors use a small local allocator; recursive removal does not inspect FIFO contents or follow directory symlinks into unrelated trees.The final implementation is confined to the owning test file. The test runner, package scripts and CI routing match main. There is no host temporary-directory scan, stale-root TTL, heartbeat, signal state machine, global TMP override or cross-suite registry. This keeps raw
node --testa supported path and lets the test harness own normal teardown.User Impact
Successful and failing target-validation runs remove their own fixtures while preserving FIFO safety coverage and unrelated files. This does not remove historical temporary directories or promise cleanup after SIGKILL, process crashes or reboots. Product-created diagnostic backups and other test files are outside this change.
OpenClaw Bay Impact
None. No production runtime, queue, publication or dashboard behavior changes.
Evidence
The final branch is
8e829d12ac840098b63dc255c6aa2655d226323f, integrated with main488b65173fa5bee156b917c57e651ec44dc41567. Its treece1ccf50567c4d1fa5f2f0e208030dc9bf431e08is identical to the independently executed candidatef4fcbff6b3b31599b3c0fe3bfb873b9bb39a6a7a; the last integration changed ancestry only. The final delta is one test file, 93 additions and 84 deletions.Live proof used a fresh AWS/Linux Crabbox lease
cbx_28deee7715ec, Node 24.18.1 and repository-pinned pnpm 11.10.0. The source bundle, tracked files and candidate tree were verified before execution. The lease had no instance profile, no hydrated operator credentials, and a task-owned empty HOME. Production namespace and Landlock support remained enabled.Run
run_25ba804a2b20exercised six rawnode --testcases. The baseline source came from6a1d212386d8b2e0f2a7d934e27160faeef09525, whose tree matches main at488b65173fa5bee156b917c57e651ec44dc41567. The success and failure lifecycle cases append one synthetic test to copies of the actual test source; the candidate FIFO-preflight case executes the actual unchanged test file.Every case completed normally without a watchdog kill, and the unrelated sentinel referenced by the fixture symlink remained byte-for-byte unchanged. The proof removed only its own synthetic baseline/candidate directories. Tracked source was unchanged by execution.
Final test source SHA-256:
8b227e2767667061e70278b50162de951b7c9c449feeaad8f7d359247e621420.Baseline test source SHA-256:
950b9f3dbf00a05fc857d8faf0b4c2ee3d0f2b3f146cc28e310705094a2a34de.Corrected full-gate run
run_23754b70a04e:pnpm run checkpassed 4,367 tests, seven skipped, zero failures, plus all 13 changed-coverage tests. All three affected Git-config tests passed separately before that full gate. The final tracked source and tree were verified unchanged after execution.An initial full-gate attempt had three unrelated Git-config test failures because the proof launcher set
GIT_CONFIG_GLOBAL=/dev/null, preventing fixtures from writing their own temporary global config. The corrected launcher removes that override and retains isolated HOME and disabled system config. No source fix was needed for those failures.The earlier six-case local macOS/Node 24.20.0 proof also passed. The Linux run above supplies the final integrated-source proof. Crash/SIGKILL/reboot cleanup and historical directory deletion are intentionally outside this contract; there is no claim of a live production deployment.
Contributor credit
Preserves the existing contribution and commit ancestry from @hxy91819 (
masonxhuang <[email protected]>). The simplification keeps owned fixture cleanup while leaving command routing with Node and the existing test runner.Standalone six-case proof harness
Save this script beside
baseline-test.ts(the baseline revision'stest/repair/target-validation.test.ts) and runnode native-proof.mjs /path/to/current/checkoutafter a frozen install and build. The script records one JSON result and captured stdout/stderr per case. It creates controlled test copies in the checkout and removes them on completion.