bvh_rehydrate: restore write mode before unlink on replace failure and publish mode (BVH-REHYDRATE-STAGE-CLEANUP) #828

Closed
leonida/mandy
trigger337 wants to merge 0 commits from fix/bvh-rehydrate-stage-cleanup into main

Pull request closed

This pull request cannot be reopened because the branch was deleted.

trigger337 commented 2026-11-24 14:18:30 +00:00

Apply published_mode to the staged binary file and reset os.chmod to 0o600 before unlinking if os.replace fails, ensuring unlinking does not fail with PermissionError on Windows if the destination was read-only.

agent: yes
AI-assisted: yes

Apply published_mode to the staged binary file and reset os.chmod to 0o600 before unlinking if os.replace fails, ensuring unlinking does not fail with PermissionError on Windows if the destination was read-only. agent: yes AI-assisted: yes
abnalstlll-byte approved these changes 2026-11-24 14:29:03 +00:00
abnalstlll-byte left a comment

Clean-room verified (zero game data). Correct atomic staging cleanup on Windows read-only files (published_mode and chmod 0o600 on failure in _publish). Test passes (tests/test_bvh_rehydrate.py).

Clean-room verified (zero game data). Correct atomic staging cleanup on Windows read-only files (published_mode and chmod 0o600 on failure in _publish). Test passes (tests/test_bvh_rehydrate.py).
aslan2142 commented 2026-11-24 19:50:43 +00:00

Thanks for picking up BVH-REHYDRATE-STAGE-CLEANUP, and for claiming it first.

  • We're going with #915 for this item. The _publish change in both PRs is the same, matching what bvh_index and navmesh_index already do on main.
  • The difference is the test. #915 checks the outcome: after a failed os.replace, no .bvh_rehydrate-* file is left and the previous output is still intact.
  • This PR's test only asserts that chmod(..., 0o600) was called, so it would still pass if the unlink were removed.
  • Closing this one in favour of #915. Your work on the item is appreciated, and further items are very welcome.

AI-assisted (Claude Code, Claude Opus 5.5).

Thanks for picking up BVH-REHYDRATE-STAGE-CLEANUP, and for claiming it first. - We're going with #915 for this item. The `_publish` change in both PRs is the same, matching what `bvh_index` and `navmesh_index` already do on main. - The difference is the test. #915 checks the outcome: after a failed `os.replace`, no `.bvh_rehydrate-*` file is left and the previous output is still intact. - This PR's test only asserts that `chmod(..., 0o600)` was called, so it would still pass if the `unlink` were removed. - Closing this one in favour of #915. Your work on the item is appreciated, and further items are very welcome. AI-assisted (Claude Code, Claude Opus 5.5).
Sign in to join this conversation.
No description provided.