world_lights_paths: restore write mode before unlink on replace failure and publish mode (WORLD-LIGHTS-STAGE-CLEANUP) #838
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!838
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/world-lights-stage-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
Apply published_mode to staged .partial file and reset os.chmod to 0o600 before os.remove on replace failure or write error, ensuring temporary file cleanup does not fail with PermissionError on Windows.
agent: yes
AI-assisted: yes
Audited and verified. Applies published_mode(lights_out) to the staged output file prior to replacement and restores write permission
#838 | head 09bbad3cca6479f6f82d258d445825535bc1af47 (merged cleanly with main aa918e5d9f) |
python -I tests/test_world_lights_paths.py+ live Windows NTFSstat.S_IREADread-only destination cleanup check | red on main:FAILED (failures=1)(summarizeneither appliedpublished_mode(lights_out)beforeos.replace(staged, lights_out)nor restored0o600write mode beforeos.remove(staged)on write or replace failure) | green on PR+main:33 ran, OK(33/33unit testsOK, plus cleanPermissionErrorwith0secondary unlink exceptions and0staged leftovers on Windows NTFS when replacing a read-onlylights.jsonl) | Windows 11 (10.0.26200.9974), Python 3.12.10 | AI-assisted: yesAudited
tools/world_lights_paths.pyandtests/test_world_lights_paths.pyon Windows 11 NTFS, confirmingpublished_mode(lights_out)mode preservation beforeos.replaceandos.chmod(staged, 0o600)beforeos.remove(staged)on both write and replace failure paths. Also verifiedtests/test_ci_registration.py,tests/test_text_write_line_endings.py, andscripts/check_no_game_data.py.Verified by OreoFR on macOS 27.2.1 (26B131), Apple M5, APFS (case-insensitive), Python 3.12.16, main 53b77df14 : red 1 failure (
ScanTest.test_stage_cleanup_restores_write_mode_on_replace_failure) / green 33 OK.python -I tests/test_world_lights_paths.pyfrom the repository root.AssertionError: False is not true, the write mode is not restored when the replace fails.git merge --no-ffof this PR, no conflict): 33 run, OK, 0 skips.Red = main + only the test files from this PR (
git checkout pr-838 -- tests/test_world_lights_paths.py); green = main + the merged PR. When green runs more tests than red, it is because the merge keeps tests main added since the PR branched.AI-assisted: Claude Code (Claude Opus 5.5).
Thanks for this PR. It has a red/green verification by OreoFR on macOS (READY): https://github.com/ProjectLeonida/mandy/pull/838#issuecomment-7248840525
The only thing missing for a merge is your claim in the coordination issue #2570 (see CONTRIBUTING.md). Once it is there, a maintainer can pick it up.
AI-assisted: Claude Code
Merging. Head
09bbad3cchas red/green verdicts from reviewers other than the author (above), merges cleanly withmain16801256a, 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).