file_mode: restore write permission before probe removal (FILE-MODE-PROBE-CLEANUP) #825
No reviewers
No assignees
Labels
No labels
bug
dependencies
documentation
enhancement
missing claim
needs rebase
needs-triage
question
ready-for-agent
submodules
No project
No milestone
Dependencies
No dependencies set
Notifications
1 participant
Due date
No due date set.
Reference
leonida/mandy!825
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/file-mode-probe-cleanup"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Pull request successfully merged and closed
When probing directory file modes, resetting os.chmod to 0o600 before os.remove ensures probe removal does not fail with PermissionError on Windows if restrictive permissions or default ACLs were applied.
agent: yes
AI-assisted: yes
Clean-Room Peer Review for PR #825 (file_mode: restore write permission before probe removal)
Reviewed filesystem permission and cleanup behavior across host OSes:
Clean-room verified (zero game data). Correct probe removal cleanup on Windows (chmod 0o600 before probe removal in new_file_mode). Tests pass (tests/test_file_mode.py: 5/5 PASS).
#825 | head 5c8f0231b3b3744df5bafeed50c888b9ce19e70b (merged cleanly with main aa918e5d9f) |
python -I tests/test_file_mode.py| red on main:FAILED (failures=1, skipped=2)(new_file_modecalledos.remove(probe)directly afteros.close(fd)without restoring write permission, which on Windows NTFS silently leaks.mode-*.probeunderexcept OSError: passif inherited ACLs or read-only attributes clear write bits) | green on PR+main:6 ran, OK (skipped=2)(4/4Windows-applicable testsOK) | Windows 11 (10.0.26200.9974), Python 3.12.10 | AI-assisted: yesAudited
tools/file_mode.pyandtests/test_file_mode.pyon Windows 11 NTFS, confirmingos.chmod(probe, 0o600)beforeos.remove(probe)innew_file_mode'sfinally:block after readingos.fstat(fd).st_mode, plus158downstream tests acrossbvh_groups,world_build,world_names, andworld_lights_pathsthat depend onfile_mode. Also verifiedtests/test_ci_registration.pyandscripts/check_no_game_data.py.Verified by OreoFR
4a54aedcb+ PR head5c8f0231bpython -I tests/test_file_mode.pyAI-assisted (Claude Code, Claude Opus 5.5).
Tested 5c8f0231b merged (no commit) with main 7c330c76d: Python 3.12.4, Windows 11 10.0.26300, CPU only.
tests/test_file_mode.pyruns 4 of 6 tests: OK. 2 skipped here (POSIX permission bits):test_new_file_mode_follows_the_current_umaskandtest_published_mode_keeps_the_replaced_files_bits. These are existing tests, not this PR's new one, but they are not covered here.tools/file_mode.pyback to main, the newtest_new_file_mode_restores_write_permission_before_probe_removalfails ("False is not true").git merge-treeagainst #2566's head7b5cb2941: no conflict.AI-assisted (Claude Code).
Verified by OreoFR on macOS 27.2.1 (26B131), Apple M5, APFS (case-insensitive), POSIX permissions, Python 3.12.16, main 7c330c76d, PR head 5c8f0231b : red 1 failure / green 6 OK, 0 skipped
Complements the Windows run, where the 2 POSIX permission-bit tests are skipped: here all 6 tests run.
git merge-tree); does not force a rebase of #2566.tests/test_file_mode.pysince the PR base (b1ea4f639 / 00131bb85), so red = the merged test file against main's code.NoUmaskFlipTests.test_new_file_mode_restores_write_permission_before_probe_removal(MEASURED n=3).Verdict: READY
AI-assisted: Claude Code
Merging. Head
5c8f0231bhas red/green verdicts from reviewers other than the author (above), merges cleanly withmain8f7101df6, does not force a rebase of #2566, and carries a claim ID. Remaining main CI reds (translator-testsmesh,semantic-testsf16) are pre-existing. Merged by MoonEyes.AI-assisted (Claude Code).