NAVMESH-TILE-STAGE-CLEANUP: harden staged OBJ output and cleanup #906
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!906
Loading…
Reference in a new issue
No description provided.
Delete branch "navmesh-tile-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
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.
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
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!