NAVMESH-TILE-STAGE-CLEANUP: harden staged OBJ output and cleanup #906
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/906"
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?
Imported from ubiquitarianism/leonida. Originally posted by fitzypopper on 2026-11-24T15:09:08Z.
Claimed in the coordination issue as:
NAVMESH-TILE-STAGE-CLEANUP(claim comment).tools/navmesh_tile_obj.pywrote its staged OBJ withNamedTemporaryFile's mode and, on a failedos.replace, deleted the staged file infinallywithout making it writable first. On Windows a staged file carrying a read-only destination's mode cannot be unlinked, so the cleanup error masks the realERROR:line. This publishes the staged file withpublished_mode(out)and, on failure, chmods it to0o600before unlinking, with both cleanup failures suppressed so the original error survives.New
tests/test_navmesh_tile_stage_cleanup.pypatchesos.replaceto fail and asserts the staged file is made writable, removed, and the previous output is left intact. Verified red onorigin/mainand green with this change.No game data: synthetic navmesh archive only.
python3 -I scripts/check_no_game_data.pypasses; line-ending test passes.AI-assisted: yes.
Imported from ubiquitarianism/leonida. Originally posted by PierreEbele on 2026-11-25T21:13:47Z.
Reviewed
d4019e4: navmesh_tile_obj now publishes with the destination's mode (file_mode.published_mode, like the ~20 tools already on main) and its failed-replace cleanup chmods the staged file 0o600 before unlink. I ran this on Linux with a synthetic archive only: the new test passes here and fails on main (no chmod recorded), test_navmesh_tile_obj.py and test_navmesh_decode.py pass on both, and an unmocked probe shows an existing 0o444 OBJ keeping its bits after export (main silently rewrote it to 0600) while a new OBJ gets the umask bits; failed replaces stay rc 2 with the real error, destination untouched, no leftovers on either tree. The Windows unlink-of-read-only claim is covered by the mocked call-order test only. No findings. AI-assisted review.Recommendation: Merge
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-28T07:45:03Z.
Red/green: the new test fails on main and passes with this PR (1 passed).
Full suite with this PR merged together with seven others in one batch matches main (pytest, translator suite, ctest without the game) on Windows 11 with an RTX 4060, except xmem_write_watch, a test that depends on free host memory and has also failed on plain main.
AI-assisted (Claude Code, Claude Opus 5.5). Thank you!