Skip to content

Use unique temporary files for atomic saves - #17

Merged
Code0x58 merged 1 commit into
masterfrom
codex/secure-file-replacement
Oct 18, 2026
Merged

Code0x58 merged 1 commit into
masterfrom
codex/secure-file-replacement

Conversation

@Code0x58

@Code0x58 Code0x58 commented Oct 18, 2026 •

Copy link
Copy Markdown
Owner

Saving now creates an exclusive temporary file beside the destination, then atomically replaces it and removes the temporary file on failure. Existing backup files and symlinks are untouched, overlapping saves use independent files, and pathlib paths work through save as well as load.

Validation: 29 tests pass, including backup/symlink safety, interleaved saves, failed-replacement cleanup, and pathlib paths.

Stack position 4 of 9. Depends on #16; this PR targets codex/persist-deletions so its diff contains only this fix. Addresses review finding 5.

Stack overview: #14. Next: #18.

@codecov

codecov Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.63%. Comparing base (1d4ff24) to head (bd84f30).
⚠️ Report is 6 commits behind head on master.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #17      +/-   ##
==========================================
+ Coverage   95.89%   98.63%   +2.74%     
==========================================
  Files           1        1              
  Lines         146      147       +1     
==========================================
+ Hits          140      145       +5     
+ Misses          6        2       -4     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

@Code0x58
Code0x58 force-pushed the codex/secure-file-replacement branch from c346c21 to dc70ca3 Compare October 18, 2026 15:13
@Code0x58
Code0x58 added this pull request to stack #23 October 18, 2026 15:39
@Code0x58
Code0x58 force-pushed the codex/secure-file-replacement branch 2 times, most recently from 586a2f3 to 1a0f432 Compare October 18, 2026 15:43
Base automatically changed from codex/persist-deletions to master October 18, 2026 15:44
@Code0x58
Code0x58 force-pushed the codex/secure-file-replacement branch from 1a0f432 to bd84f30 Compare October 18, 2026 15:44
@Code0x58
Code0x58 merged commit 61bc9ed into master Oct 18, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant