Repository navigation
test(fs): route Bun race spies through node fs - #151302
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. |
d6bbca1 to
296fdf4
Compare
|
Codex review: needs maintainer review before merge. Reviewed September 17, 2026, 9:49 PM ET / September 18, 2026, 01:49 UTC. ClawSweeper reviewWhat this changesThe PR temporarily selects fs-safe’s portable filesystem path during Bun race and path-probe tests, then restores the previous native mode. Merge readiness✅ Ready for maintainer review Keep open: this is a focused test repair absent from the pinned main and latest release. No introduced correctness or security defect was found. Priority: P3 Review scores
Verification
How this fits togetherOpenClaw’s filesystem tests inject symlink changes and count path lookups to check containment and coordinator efficiency. Bun’s native compatibility path bypasses their Node filesystem spies, so the test setup must select an observable path. flowchart TD
A[Filesystem regression tests] --> B{Running under Bun?}
B -->|Yes| C[Temporarily select portable filesystem]
B -->|No| D[Keep existing filesystem mode]
C --> E[Inject races and count path probes]
D --> E
E --> F[Check safety and efficiency assertions]
F --> G[Restore spies and previous mode]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests +20. Total +20 across 2 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep the runtime workaround intact while adapting the existing test helpers to exercise their intended filesystem boundaries under Bun. Do we have a high-confidence way to reproduce the issue? Yes, from source: Bun POSIX with fs-safe’s native addon bypasses the node:fs spies used by these regressions. The reviewer did not execute the tests. Is this the best way to solve the issue? Yes. The existing public mode switch restores spy observability within bounded test scopes without weakening assertions or changing production code. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 0bf3566b6d54. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
…151339) Restore filesystem import-boundary, workflow-routing, and full-suite inventory guards after the changes in #151302, #151282, and #151001. Route native filesystem configuration through the existing facade, register the recovery and Codex attempt tests in their existing owners, and select those guards when their inventory inputs change. Includes the reviewed routing repair from #151340 with its original human authorship preserved. Finalize the existing Gateway serial admission and two-worker ceiling before runtime placement reads recipient policy. This preserves compact worker limits when inventory changes without changing timing measurements, original compaction assertions, configuration, dependencies, or user-facing runtime behavior. Validation: exact-head CI run 35306657804 completed green; the native watcher exited 0 with no pending checks. Retained focused proof passed 1,591 tests across six files, with both new placement regressions failing before the repair and all four placement cases passing after it. Committed-branch review found no actionable defects. The pre-existing diagnostics test-support lint issue from #151161 remains an explicitly nonblocking follow-up.
…penclaw#151339) Restore filesystem import-boundary, workflow-routing, and full-suite inventory guards after the changes in openclaw#151302, openclaw#151282, and openclaw#151001. Route native filesystem configuration through the existing facade, register the recovery and Codex attempt tests in their existing owners, and select those guards when their inventory inputs change. Includes the reviewed routing repair from openclaw#151340 with its original human authorship preserved. Finalize the existing Gateway serial admission and two-worker ceiling before runtime placement reads recipient policy. This preserves compact worker limits when inventory changes without changing timing measurements, original compaction assertions, configuration, dependencies, or user-facing runtime behavior. Validation: exact-head CI run 35306657804 completed green; the native watcher exited 0 with no pending checks. Retained focused proof passed 1,591 tests across six files, with both new placement regressions failing before the repair and all four placement cases passing after it. Committed-branch review found no actionable defects. The pre-existing diagnostics test-support lint issue from openclaw#151161 remains an explicitly nonblocking follow-up.
Problem
Direct Bun runs could not execute five filesystem race and path-probe regressions because
@openclaw/fs-saferoutes Bun realpath through its N-API compatibility path. The tests inject races and count probes throughnode:fsspies, so the intended injection never occurred under Bun even though the production adapter behaved normally.Solution
Select fs-safe's documented portable
node:fspath only while Bun-specific test spies are active, then restore the previously configured native mode infinally. The shared symlink-race helper now owns that adaptation for filesystem and archive safety tests, and the coordinator probe-count test uses the same bounded setup. Production runtime behavior is unchanged.Validation
node scripts/check-changed.mjs