Repository navigation
fix(write): add renameIdentity option for FUSE mounts with unstable inode numbers - #33
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed July 1, 2026, 12:38 AM ET / 04:38 UTC. Summary Reproducibility: yes. for the PR defects: source inspection shows the opt-in still reaches the default Python helper path, while every new behavioral test forces Python mode off. I did not run a live rclone mount in this checkout. Review metrics: 3 noteworthy metrics.
Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Keep strict dev/ino identity as the default, then land an explicit compatibility mode only after it works consistently across helper-enabled and helper-off paths, preserves fail-closed lock semantics unless maintainers approve otherwise, and has matching docs plus redacted live proof. Do we have a high-confidence way to reproduce the issue? Yes for the PR defects: source inspection shows the opt-in still reaches the default Python helper path, while every new behavioral test forces Python mode off. I did not run a live rclone mount in this checkout. Is this the best way to solve the issue? No: the compatibility direction may be viable, but this patch is not the narrowest safe implementation until it handles the helper path, preserves the existing error contract, resolves stale-lock security semantics, and aligns the docs. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: not found in the target repository. Codex review notes: model internal, reasoning high; reviewed against 3d34569bba9c. Label changesLabel justifications:
Evidence reviewedSecurity concerns:
What I checked:
Likely related people:
What the crustacean ranks mean
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. How this review workflow works
|
…node numbers
On filesystems like rclone FUSE mounts, rename(2) causes every subsequent
path-based lookup on the destination to return a freshly-minted inode number,
making the post-rename (dev,ino) identity check always fail even with a single
process and zero concurrency. This manifests as a deterministic
FsSafeError("path-mismatch") on every overwrite-mode write through
writeFileInRoot/runPinnedWriteFallback.
Adds renameIdentity: "verify-content-with-lock" to RootDefaults and
RootWriteOptions. When set, the write acquires an exclusive sidecar lock for
the target path, performs the write under that lock, and verifies by comparing
the SHA-256 of the written bytes against the bytes re-read from the target
(using an fd-based stat for the returned identity to stay consistent across all
subsequent lookups). Stale locks from crashed holders are detected via
PID-liveness check and removed automatically. Default behavior is unchanged.
Closes openclaw#32
2dbd7de to
46e6cc2
Compare
|
@clawsweeper re-review The branch now deliberately routes the opt-in around the Python helper, fails closed on stale locks, preserves |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
Landed via rebase on Proof:
Caveat: |
|
Thanks for the improvements since we opened this. Three things came up in review that you may want to address or dismiss before merging. Stream input with In if (params.input.kind !== "buffer") {
throw new FsSafeError("path-mismatch", "fallback target changed during write");
}The stream was consumed writing to the temp file, so there's nothing to hash. But the write succeeded, and the lock means no cooperating writer could have interleaved. Throwing
Dead type RenameIdentityMismatchPolicy = "throw" | "verify-content";
Happy to send a patch for any of these, but didn't want to push more commits without checking first. |
Summary
renameIdentity: "verify-content-with-lock"compatibility writes for rclone-style FUSE mounts whose destination inode changes across rename.(dev, ino)verification as the unchanged default.Closes #32.
Security contract
This is an explicit weaker opt-in for trusted/cooperating writers. It does not prove that the destination still names the temp-file object, retain the Python helper's fd-relative parent pinning, or stop a same-UID writer that ignores the advisory lock.
The compatibility lock is a per-target, SHA-256-keyed sidecar stored in the already-canonical root. That avoids creating a lock through a missing or raced target parent. Stale locks fail closed and are never reclaimed from host-local PID evidence. The stricter Python helper is deliberately bypassed only in this mode because it requires rename to preserve inode identity.
Implementation
RenameIdentityPolicythrough the root API.already-exists,mkdir: false, stale-lock, and post-write identity behavior.0.4.1 - Unreleasedchangelog entry thanking @jlautman.Validation
pnpm check: 38 test files passed; 423 tests passed, 3 skipped.pnpm audit --prod --json: 0 vulnerabilities.mkdircontract and lock-parent boundary findings.run_b2ca73c0818e, leasecbx_dfc891eea183.55:13142417776620928161to55:13160412383924634112.path-mismatch.compatible-content.Exact validated head:
46e6cc26cba0f4f2b6e1ea5217cb35a6d34e1bd9.