Skip to content

navmesh_cell_fit: protect scanned vehicle documents from output aliases - #2445

Merged
MoonEyes merged 1 commit into
ProjectLeonida:mainfrom
kirigayakazima:codex/navmesh-cell-fit-carve-alias
Nov 28, 2026
Merged

MoonEyes merged 1 commit into
ProjectLeonida:mainfrom
kirigayakazima:codex/navmesh-cell-fit-carve-alias

Conversation

@kirigayakazima

Copy link
Copy Markdown
Contributor

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.py
  • python -I tests/test_report_paths.py
  • Changed-path game-data scan and git diff --check passed.
  • Shared main baseline: 6,374 translator semantic tests passed across 500 files. The combined five-topic checkout passed 172 focused tests.

GPUs tested: N/A (CPU-only).

AI-assisted: Yes.

Checklist

  • Based on current main and merges cleanly with the tested base.
  • One topic.
  • No game data, keys or decryption.
  • Translator contract table: N/A.

@MSedgeMC MSedgeMC left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@zmasi

zmasi commented Nov 28, 2026

Copy link
Copy Markdown
Contributor

#2445 | head 20fbb6c (merged cleanly with main 3ca0707) | python -I tests/test_navmesh_cell_fit.py | red on main: FAILED (failures=2) (test_output_cannot_overwrite_a_common_carve_input: AssertionError: 0 != 2 on direct --common .bin input 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: yes

Audited _carve_inputs (glob.escape(carve)) and main() in tools/navmesh_cell_fit.py (same_report_path(a.out, p) check across --common .bin inputs before writing output, merging cleanly with current main 3ca0707dd). Also passed tests/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), and scripts/check_no_game_data.py on the merged tree.

@MoonEyes

Copy link
Copy Markdown
Collaborator

Red/green: classified READY by oreo-lot3 (red on main b1619e0, green on head merged with main); head 20fbb6c unchanged since 2026-11-27, before that run.
Targeted batch (PR tests, tests importing the changed modules, docs tests, translator when touched) merged on main d48a957 in GitHub Actions: no new failure.
AI-assisted (Claude Code, Claude Opus 5.5)

@MoonEyes
MoonEyes merged commit 9e5489b into ProjectLeonida:main Nov 28, 2026
6 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants