Repository navigation
fix(windows): preflight exclusive creation leaves - #824
Conversation
Reject observed symlink leaves before portable exclusive creation while preserving collision and lock-denial provenance. Cover outside-target Root admission, standalone creators, lock records, and shared staging; document the best-effort concurrent replacement boundary.
|
🦞👀 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: needs maintainer review before merge. Reviewed October 1, 2026, 10:43 PM ET / October 2, 2026, 02:43 UTC (Revision 3). ClawSweeper reviewWhat this changesThe PR checks Windows destination symlinks before exclusive file creation, adds regression coverage, and documents the portable creation boundary. Merge readiness✅ Ready for maintainer review This PR remains necessary: current main lacks the exclusive-creation checks for standalone creators, fallback locks, and copy publication. No blocking introduced defect was found, and the related merged fixes address different paths. Priority: P2 Review scores
Verification
How this fits togetherfs-safe turns caller-selected filesystem paths into guarded creation, writing, locking, and publication operations. These checks reject existing symlink destinations before a portable open can create or write their missing targets. flowchart TD
A[Caller-selected path] --> B[Path and parent admission]
B --> C{Native creation available}
C -->|Yes| D[Native exclusive creation]
C -->|Portable fallback| E[Inspect destination leaf]
E -->|Symlink| F[Report existing destination]
E -->|Absent| G[Exclusive open and descriptor checks]
D --> H[Guarded file operation]
G --> H
Before mergeNone. Agent review detailsSecurityNone. Review metrics
Technical reviewBest possible solution: Use the shared Windows preflight throughout portable exclusive creation while retaining native paths, descriptor admission, collision semantics, and the documented concurrency limit. Do we have a high-confidence way to reproduce the issue? Yes: the reported Windows reproduction uses an unchanged dangling destination symlink with portable standalone creation, unrooted locks, or cross-volume copy publication. Main's source confirms these opens precede destination admission; this review did not execute the reproduction. Is this the best way to solve the issue? Yes: a shared preflight is a narrow correction for unchanged dangling links, and existing collision mapping and post-open identity checks remain intact. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 61cb5f1b889b. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
Windows Node exclusive opens can follow an existing dangling file symlink. Portable standalone file creation can create the missing referent before descriptor admission rejects the link, unrooted file-lock creation can write the lock record through it, and cross-volume exclusive copy publication can write the source contents before rejecting the destination. Add a shared final-leaf preflight that preserves exclusive-create collision behavior and keeps metadata-inspection failures outside the lock-open denial retry classifier.
Apply the same check to portable create-only writes and internal staging/copy creation. Staging names are random or live in fresh workspaces; these checks harden their existing creation boundary. Descriptor admission and identity-bound cleanup remain in place, and concurrent replacement between preflight and open retains the documented best-effort limitation.
Extend the writable-leaf regression with absolute and relative outside targets plus Windows UNC/device targets. Real Windows comparison before and after #823 shows those outside Root targets were already rejected by path admission without creating a referent. The confirmed outside-directory cases are standalone creators, unrooted locks, and exclusive copy publication; the changelog distinguishes them from #823's in-Root writable-leaf behavior.
Validation: real Windows AWS with Node 24.21.0 and pnpm 12.4.2 compared the parent of #823, main, and the candidate across 160 cases per revision. The fixed candidate created no dangling referent. Another Windows run checked the final production source and passed 177 focused tests (eight existing platform skips). An actual second NTFS volume reproduced the exclusive-copy case on main for absolute and relative targets; the fix kept both referents absent, and 97 focused tests passed. Local pnpm check passes with 13,410 tests. Codex autoreview is clean through P2. The exclusive-creation source is unchanged from the Windows-tested candidate. Main's separate directory-identity correction in #825 is now integrated, and 174 focused tests pass with both corrections present. Exact-head all-OS CI, coverage, and CodeQL passed on integrated head f7faca5. The earlier Windows coverage failure was resolved by the separate exact-directory-identity fix in #825; its integration is P2-clean.