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

Closed
github-bot wants to merge 1 commit from gh-pr/828/head into gh-pr/828/base
Owner

@⁠trigger337 on GitHub · 2026-11-24 14:18 UTC · original
trigger337:fix/bvh-rehydrate-stage-cleanup → main · +22 −0 · 2 files · 1 commits · closed without merging

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

**@⁠trigger337** on GitHub · 2026-11-24 14:18 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/828) `trigger337:fix/bvh-rehydrate-stage-cleanup` → `main` · +22 −0 · 2 files · 1 commits · closed without merging 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
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:23:24 +00:00
github-bot closed this pull request 2026-11-26 09:23:24 +00:00
Author
Owner

@⁠abnalstlll-byte on GitHub · 2026-11-24 14:29 UTC · original · approved these changes

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).

**@⁠abnalstlll-byte** on GitHub · 2026-11-24 14:29 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/828#pullrequestreview-6041062705) · **approved these changes** 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).
Author
Owner

@⁠aslan2142 on GitHub · 2026-11-24 19:50 UTC · original

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).

**@⁠aslan2142** on GitHub · 2026-11-24 19:50 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/828#issuecomment-7142669386) 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).

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.