Repository navigation
navmesh_decode: ask report_paths for the report-path guard (the last legacy copy) - #2949
erdemcisse wants to merge 1 commit into
Conversation
…legacy copy) The tool carried its own `same_report_path`: normcase(realpath) plus samefile. That copy is older than the shared one and misses both cases the shared one grew for -- the volume probe for a case-folding Linux mount (vfat, exFAT, CIFS) and the case-sensitive-directory check on Windows -- so "--out R.json" and a carve manifest "r.json" on such a volume went unnoticed and the run overwrote the manifest. tests/test_report_paths.py named it the one remaining legacy copy and asked for the import instead. LEGACY_COPIES is now empty: every tool takes the guard from tools/report_paths.py, and the identity test covers the re-exported name the siblings import. Verified: python -I tests/test_report_paths.py (fails on main: navmesh_decode's same_report_path is not the shared one, and the SHARED scan finds a copy), tests/test_navmesh_decode.py, test_navmesh_nodes.py, test_navmesh_links.py, test_navmesh_cell_fit.py, scripts/check_no_game_data.py on both files, and the docs/hygiene suite (57 tests). No game files, no GPU.
|
Independent decoder entry-point check for the shared path guard on I called the real decoder entry point with synthetic temporary paths. Both trees accepted distinct Linux output files and kept the bytes of a real hardlinked input unchanged when its alias was rejected. With folding normalized keys injected for two existing files whose real identities differ, main refused the outputs and the PR wrote separate JSON and CSV reports. With case-folding lookup simulated for the volume probe and nested output paths that do not yet exist, main accepted the pair and the PR rejected it before creating either output. These last two cases simulate the relevant filesystem rules. MEASURED with OpenAI Codex and a separate read-only review. |
|
Native Windows 11 / NTFS, CPython 3.14.0, base The Deseret pair U+10400 / U+10428 (each followed by
The remaining refusal for new Deseret files is a conservative false positive shared with base. The change fixes the existing-file case on a real volume. Coordination claim. AI-assisted with OpenAI Codex (GPT-6). |
KelboLive
left a comment
There was a problem hiding this comment.
LGTM on the code: navmesh_decode now re-exports the shared guard (tools/navmesh_decode.py:59), and the shared implementation preserves the old macOS _PC_CASE_SENSITIVE/NFD behaviour while adding the folding-volume probe and the case-sensitive-Windows handling. I found no case where the removed guard returned True and the shared one returns False; the only divergence is two distinct files in a case-sensitive Windows directory, which are now correctly allowed, not an overwrite risk.
Tests are effective: test_report_paths 26/0, test_report_path_case, and all the navmesh suites pass; reverting the tool fails 3 tests, and stubbing the shared guard to plain realpath equality fails 6.
One wording issue: this is the last entry in LEGACY_COPIES, but not the last legacy copy repo-wide — tools/bvh_index.py:476-509 still has the identical _case_insensitive_volume/_path_key/same_output_path guard (same macOS logic, same gap on a Linux case-folding mount), and tools/text_tables.py:466-472 is the open #2741. The body is correctly scoped ("the last tool in LEGACY_COPIES"), but the title and the comment at tests/test_report_paths.py:27 ("No tool carries its own copy any more") overstate it.
Please scope those two to same_report_path-named copies, or file a bvh_index follow-up. Merge is clean against current main; the textual overlap with #2741 means whichever lands second should rebase.
Claimed in the coordination issue as: REPORT-PATHS-NAVMESH-DECODE — #2570 (comment)
Depends on: #2741 (the same chore for
text_tables; the two PRs touch the same two lines oftests/test_report_paths.py, so whichever lands first, the other rebases — this one does not build on its code)Fixes:
What and why
tools/navmesh_decode.pywas the last tool inLEGACY_COPIES: it carried its ownsame_report_path—— which is older than
tools/report_paths.pyand misses both cases the shared guard grew for:normcasedoes not fold (vfat, exFAT, CIFS on Linux/macOS):same_name_on_folding_volumeasks the volume itself with one scratch folder. Without it,--out R.jsonagainst a carve manifestr.jsonin a carved directory on such a volume is not refused, and the run overwrites the manifest it scanned._same_windows_folded_pathprobes the directory, so two genuinely distinct filesr.jsonandR.jsonare not refused as one.The comment above
LEGACY_COPIESasks for exactly this import ("Do not add to this list: import report_paths instead"), and #2741 did it fortext_tables.The change: import the shared guard (
from report_paths import same_report_path), delete the 37-line local copy with_PC_CASE_SENSITIVE,_case_insensitive_volumeand_path_key, drop the now unusedunicodedata, addnavmesh_decodetoSHARED, emptyLEGACY_COPIES, and cover the re-exported name intest_tools_still_expose_same_report_path— the namenavmesh_nodes,navmesh_linksandnavmesh_cell_fitimport from it.Tested
python -Ifor the standard-library tests, on Windows 11 (10.0.26100), Python 3.13.15. No game files and no GPU: every test builds its own temporary files, as the suite's own headers say.Red on
main(50e97c1's parent), the test change kept, the tool restored:Green with the PR:
navmesh_decode.same_report_path is report_paths.same_report_pathisTrueafter the change (checked directly), and the tool's own CLI guard tests (test_cli_refuses_to_overwrite_its_input) still pass unchanged.GPUs tested: n/a (a Python report-path guard; nothing here runs on a GPU)
AI-assisted: yes — DeepSeek Harness (lead agent). No separate reviewer model was run, which the contributor guide asks for; the tests above are the check I ran.
Checklist
mainand merges cleanly (one textual overlap with text_tables: ask report_paths for the report-path guard #2741, named above).check_no_game_data.pyon both files.docs/design.md— n/a, no translator change.