You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Verify on Windows That fstat and lstat Agree on File Identity in write_regular_file's Cleanup #2494
PR #2493 has write_regular_file in host-setup/agent-safety/claude/install.py remove a file it created when the write fails. It removes the file only where os.lstat(path) reports the same st_dev and st_ino as os.fstat on the descriptor it created. On Linux the two agree.
On Windows, CPython fills these fields through different calls for a descriptor and for a path. os.fstat uses the handle-based file information. os.lstat on Python 3.12 and later can take the GetFileInformationByName fast path. Nothing has checked that the two give the same st_dev width and st_ino value on NTFS, or on ReFS.
What a mismatch would do
It fails safe. The created file is never removed, and a failed write on a new file raises IncompleteWrite rather than OSError. The installer then stamps the leftover the same way it stamps any other, so nothing is deleted that should not be, and #2454's mislabel stays fixed. What would be lost is the clean "left absent as it was found" outcome on Windows.
How to settle it
Run these two tests natively on Windows, from a hub checkout that holds #2493:
Run them on the Python versions the host has, 3.12 or later included. Both pass where the identities agree. If they fail, compare identity with os.path.samestat on a os.stat(path) taken right after the create, or decide the fail-safe behavior is acceptable on Windows and document it.
Declined under GOVERNANCE.md "Trust Boundaries and Hardening Effort" (#2501, released in 2.0.867), at the maintainer's direction. A disagreement between fstat and lstat on Windows fails safe, as this issue states: the write raises IncompleteWrite loudly, nothing is deleted, and the leftover is stamped. A case whose failure is loud and non-destructive is declined, neither fixed nor filed.
Activity
Recognize the Installer's Own Partial CLAUDE.md Rather Than Backing I…
Promote develop to main: Recognize the Installer's Own Partial CLAUDE…
ptr727 commentedon Oct 8, 2026
Declined under
GOVERNANCE.md"Trust Boundaries and Hardening Effort" (#2501, released in 2.0.867), at the maintainer's direction. A disagreement betweenfstatandlstaton Windows fails safe, as this issue states: the write raisesIncompleteWriteloudly, nothing is deleted, and the leftover is stamped. A case whose failure is loud and non-destructive is declined, neither fixed nor filed.