navmesh_cell_fit: protect scanned vehicle documents from output aliases #2445
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2445"
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 kirigayakazima on 2026-11-27T10:17:06Z.
Claimed in the coordination issue as: NAVMESH-CELL-FIT-CARVE-ALIAS
Depends on: #952 (textual conflict in argument handling if both branches land; this change builds directly on main).
What and why
The archive was protected from output collisions, but scanned vehicle documents under --common could still be overwritten. Refuse output aliases of those files before reading the carve. A readable synthetic archive reproduced exit 0 with the vehicle document replaced via its hard link. The fixed CLI returns 2 and preserves its bytes. The regression also covers a direct path.
Tested
Windows, Python 3.14.7, synthetic fixtures.
python -I tests/test_navmesh_cell_fit.pypython -I tests/test_report_paths.pygit diff --checkpassed.GPUs tested: N/A (CPU-only).
AI-assisted: Yes.
Checklist
Imported from ubiquitarianism/leonida. Originally posted by MSedgeMC on 2026-11-27T15:09:20Z.
Review: COMMENTED
Verified on the PR branch: python3 -m unittest tests.test_navmesh_cell_fit -v -> 5 tests OK, including the new output-alias protection case. Not approving yet: the branch is 606 commits behind current main and shares the test file with PR #2446, so both need rebasing before a combined diff can be reviewed.
Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-28T09:46:37Z.
#2445 | head
20fbb6cf50(merged cleanly with main3ca0707dd) |python -I tests/test_navmesh_cell_fit.py| red on main:FAILED (failures=2)(test_output_cannot_overwrite_a_common_carve_input:AssertionError: 0 != 2on direct--common.bininput and hardlink alias) | green on PR+main:5 tests OK(-k test_output_cannot_overwrite_a_common_carve_input:1 test OK) | Windows 11, Python 3.12.10 | AI-assisted: yesAudited
_carve_inputs(glob.escape(carve)) andmain()intools/navmesh_cell_fit.py(same_report_path(a.out, p)check across--common.bininputs before writing output, merging cleanly with currentmain3ca0707dd). Also passedtests/test_report_paths.py(24 OK, skipped=1),tests/test_text_write_line_endings.py(3 OK),tests/test_runner_calls_all_tests.py(3 OK), andscripts/check_no_game_data.pyon the merged tree.Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-28T15:13:32Z.
Red/green: classified READY by oreo-lot3 (red on main
b1619e0a3, green on head merged with main); head20fbb6cf50unchanged since 2026-11-27, before that run.Targeted batch (PR tests, tests importing the changed modules, docs tests, translator when touched) merged on main
d48a957bbin GitHub Actions: no new failure.AI-assisted (Claude Code, Claude Opus 5.5)