Repository navigation
fix: preserve exact filesystem identities through recovery - #169485
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: blocked before merge. What this changesThis PR carries exact filesystem identities through reads, caches, recovery receipts, and cleanup while retaining released numeric receipt readers. Example: Delete agent victim on NTFS with a cleanup-path inode of 9007199254740993.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 2 items remain Keep this PR open: it addresses a confirmed Windows cleanup failure and preserves exact identities across recovery paths; no concrete introduced defect was found. Priority: P2 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherOpenClaw consumes fs-safe filesystem observations, retains identity receipts in application recovery state, and checks those receipts before reading, restoring, publishing, or removing files. flowchart TD
A[Filesystem observations] --> B[fs-safe exact identities]
B --> C[Reads and cache revisions]
B --> D[Recovery receipt writers]
E[Released numeric receipts] --> F[Compatibility readers]
D --> F
F --> G[Owner and replacement checks]
G --> H[Restore publish or cleanup]
Technical reviewBest possible solution: Retain exact observations and the documented legacy readers, then qualify release-upgrade compatibility and the outstanding CI failures before landing. Do we have a high-confidence way to reproduce the issue? Current main deterministically rejects cleanup identities outside the safe integer range, matching independently reported Windows release failures; this review ran no target code. Is this the best way to solve the issue? Using fs-safe's exact receipts at existing owners fixes the precision loss without adding a weaker path-based fallback or competing filesystem implementation. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against c0de07a1a492. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +192, Tests +816, Docs +3. Total +1011 across 54 files. Added test files: 2. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (22 earlier review cycles; latest 8 shown)
Reviewed October 12, 2026, 6:55 PM ET / 22:55 UTC (Revision 23). |
Dependency graph guard clearedThis PR no longer has dependency changes awaiting review. A future dependency graph change from an external contributor requires a maintainer's
|
Use fs-safe 0.26.2 path normalization while preserving private creation, pre-mutation refusal tracking, and native descriptor ownership.
Carry fs-safe exact identities through reads, cache revisions, migration claims, media staging, service backups, and deletion journals. Accept released rounded receipts in their original numeric domain, retain their legacy provenance, and upgrade verified observations on the next write while preserving permission and replacement checks. The fs-safe 0.26.2 dependency pin and original migration already landed in #169469. Keep generic Node-only identity cleanup, UI changes, deployment controllers, PR tooling, and CI inventories outside this change.
|
The old drifted stack has been replaced at The config.patch investigation and broader proof reported for the old stack do not qualify this replacement. The PR body now identifies the clean candidate and its own evidence. All 29 previously unrun Bun files pass (488 tests); the earlier 11 managed-media assertion failures reproduce with the same names and errors on the pinned main base. The Windows x64/ARM64 comparison is summarized with its inherited failures explicitly retained. Released rounded numeric receipts remain accepted as legacy and upgrade to exact encoding on their next verified write. A fresh independent review and exact-head CI are required before landing; neither is represented as complete yet. |
|
Landing is stopped at the exact-head CI attribution gate. Run 38313787621 completed with 70 successful jobs, 22 skips, and two failures: the changed-extension bundle and its aggregate CI gate. The bundle failed 27 cases in the Codex context-engine, Codex sandbox tools, memory transport, and MXC plugin suites. The CI reporter classifies it as unknown because scheduled main run 38311154418 has no matching extension job. Main exhibits the same missing-runtime-config guard failure in core tests, but that does not prove the extension failures are inherited, particularly the distinct MXC backend-retirement assertion. No inherited-failure exception or merge was submitted. Additional local probes and fresh build/typecheck reruns were stopped without claiming success. The completed 29-file Bun proof remains 488 passing tests, and the independent P0–P2 review remains clean. The clean 54-file head remains |
|
The remaining CI failures on A/B reproduction used macOS ARM64, Node 26.11.1, the same worktree and test entrypoint, with the PR's 54 changed files restored to the merge base for the baseline run.
The common error is The reviewed scope is two commits and 54 files. Independent P0–P2 review is clean; focused Node proof has 622 passes across 33 files, and the Bun failures are independently attributed to the existing |
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
What Problem This Solves
Prevents large file IDs from being rounded during guarded reads, recovery, and cleanup, and delegates private Windows long-path creation to fs-safe.
User Impact
Private directories and files retain their protected-ACL and exclusive-creation behavior while fs-safe owns Windows path handling. Exact receipts detect replacements whose file IDs collapse to the same JavaScript number. Existing numeric recovery receipts remain accepted, preserve permission bits, and upgrade after a verified exact observation on their next write.
Legacy numeric receipts retain their original precision limit: replacements with the same rounded identity cannot be distinguished until an exact receipt is recorded. This compatibility decision is deliberate; exact receipts continue to compare every bit.
Why This Change Was Made
The dependency pin, bundled plugin manifests, lockfile, expiring cooldown exemptions, and original exact-identity migration already landed in #169469. This PR preserves that work and completes the direct fs-safe consumers and compatibility readers. It removes OpenClaw's Windows namespacing adapter without changing creation-refusal tracking or native descriptor ownership.
The remaining changes carry fs-safe's exact receipts into workspace revisions, plugin artifacts, media staging, migration claims, service backups, memory-export markers, and agent deletion. There is no new CLI, configuration option, or fs-safe API.
Scope and related exclusions
The replacement branch excludes deployment controllers, PR tooling, UI components and end-to-end tests, upgrade-survivor scripts, CI inventories, and generic Node-only identity cleanup. Those changes have no dependency on the fs-safe 0.26.2 result shapes and are separate work.
The local-avatar production reader and its fixture are retained because the reader encodes
openRootFileSync.exactIdentity; this is distinct from unrelated avatar rendering repairs. The systemd mutation owner must compare its staged identity against the service reader's exact decimal receipt, with its existing ownership and mode checks preserved.The five-line audit worker registration is required by the new recovery regression: without it, the full typecheck reports TS2339 for
storageProcessTestEntrypoints.auditRecovery. The existing worker-build owner consumes that registry, so no CI wrapper or inventory change is needed.Evidence
Candidate:
bec6a6517f2a836447b90f4b6dd9f109354fe10e. Rebase baseline:36e78f215f1f058af15919da8a60c06797a759e8. The two commits apply without conflicts and retain identical patches; the diff is limited to 54 files.fs.promises.access()returnsnull, while the unchanged assertions expectundefined.pnpm tsgo:allandpnpm buildpassed on the patch-identical pre-rebase stack; the build took 1,192.47 seconds wall time, including artifact-lock wait. Fresh rebased reruns were interrupted after the CI attribution stop: typecheck exit 143 at 3,877.89 seconds, build exit 143 at 2,953.86 seconds. Those interrupted runs are not passing evidence; the typecheck completed core/UI projects, then waited for the build artifact lock, and the build stopped during package declarations. Targeted lint/format andgit diff --checkpassed.@openclaw/fs-safe/advancedsubpath on macOS ARM64: Node 26.11.1, 119.744 ms; Bun 1.4.3, 63.718 ms. Filesystem caches were uncontrolled. No new subpath or public API is added.2276c935261aadb4d6ba7f027a50bec1dd1d2384and candidate0b5953e7f2a7f9a766bb5cd6d2c394907f31d0f8, with Node 24.21.0 and Bun 1.4.3 on each native architecture. Private directory/file creation, protected ACLs, long paths, and real Worker coverage passed in every cell. Full jobs remained red on both revisions with the same failing case names and primary errors; no candidate-only failures were found.Service suites additionally skip three platform-specific cases; agent suites skip one. The baseline has no new audit-recovery file. Existing cross-platform service/agent fixture failures are unchanged; Bun snapshot cleanup reports retained SQLite handles (
EBUSY) on both heads. These are recorded failures, not a green full-suite claim. Unrelated Windows fixture and runtime repairs remain outside this PR. Exact-head PR CI run 38313787621 completed with failure: 70 successful jobs, 22 skipped jobs, and two failed jobs.checks-node-changed-extensions-bundle-1-1failed 27 cases across the four files below;openclaw/ci-gatefailed as its aggregate. Security, lint, typecheck, docs, and all nine UI E2E jobs passed. The build-artifacts job was not selected.Inherited Bun managed-media failures
retains an aged transient record while its session still has an active runretries a durably claimed file deletion after a filesystem failuredoes not reap old unindexed files while legacy metadata still existsdoes not let a valid fallback mask an unreadable exact rowretains history when a healthy configured store masks an unreadable candidatereads each session transcript once while evaluating committed recordsdoes not delete files still referenced by other sessions during session-scoped cleanupretains other selected-agent global records during scoped cleanupuses the recorded owner for unscoped session keystreats legacy unscoped global records as the configured default agentretains ownerless global records when no compatibility owner existsEach fails with
expected null to be undefinedon the pinned main base as well as the earlier candidate. These assertions were not weakened or skipped.Landing Stopped: CI Attribution Incomplete
extensions/codex/src/app-server/run-attempt.context-engine.test.tsextensions/memory-core/src/chunking-upgrade-real-transport.test.tsRuntime config is not preparedextensions/codex/src/app-server/dynamic-tool-build.sandbox.test.tsRuntime config is not preparedextensions/mxc/test/plugin.test.tsThe CI failure reporter classifies the extension job as unknown, with “No matching job on main.” Scheduled main run 38311154418 contains the same missing-runtime-config guard failure in core suites, but runs none of these extension test cases. That is not sufficient matching baseline evidence for all 27 cases, especially the separate MXC assertion. None of these failures is being relabeled as inherited or green.
Additional local extension baseline probes were interrupted without a completed result after the attribution gate stopped landing. The PR remains open at the reviewed head; no admin exception or merge was submitted. The old head remains preserved on
backup/fs-safe-0.26.2-o17. No unrelated fixture, timeout, CI inventory, or workflow changes were added to this replacement.