Repository navigation
navmesh_decode: guard --out/--csv with the shared report_paths.same_report_path (EGEN-NAVMESHDECODE-SHARED-PATH, DeepSeek7) - #6234
Conversation
…eport_path The private copy of the guard missed report_paths.same_name_on_folding_volume, so on a Linux mount that ignores case (vfat, exFAT, CIFS) --out R.json and --csv r.json passed as two reports and the second replaced the first. It is also the copy that lacked the macOS posixpath rule. tools/report_paths.py already holds the one answer for every tool; use it.
test_same_report_path_is_the_shared_helper fails while the tool keeps a private copy (a distinct function object). test_same_report_path_asks_the_folding_volume simulates a volume whose normcase keeps case and asserts the shared folding-volume probe is consulted: a private normcase+samefile copy answers False there.
|
Tested 27c6eb2 on Windows, CPython 3.14.7, CPU only: pass. I ran navmesh_decode.py on an empty synthetic carve folder. With --out and --csv set to two hard links to one file, the command returned 2 and preserved the original bytes. With two new names that differed only in case, it returned 2 before creating either report. With distinct JSON and CSV paths, it returned 0 and created both. The merge base 561b65a gave the same results on this Windows volume. Commands:
Both new tests fail against the merge-base helper and pass on the head. The Linux folding-volume check uses a mock. The hard-link and case-only checks above used the actual Windows filesystem. AI-assisted. |
|
Tested One test needs updating for current Synthetic inputs only. AI-assisted (Codex). |
tools/navmesh_decode.pykept its ownsame_report_pathfor the--out/--csv/ input guards. That copy is missingtools/report_paths.same_name_on_folding_volume, so on a Linux mount that ignores letter case (vfat, exFAT, CIFS)--out R.jsonand--csv r.jsonpassed as two different reports and the second one replaced the first. It also lacked the macOSposixpathrule the shared helper carries.tools/report_paths.pyis the one answer every tool is meant to use (from report_paths import same_report_path), so this drops the private copy (~35 lines) and imports it instead.No other change to the tool: same guards in
main(), same messages (--out and --csv must use different paths,--out would overwrite the input), same exit code 2.Test
python -I tests/test_navmesh_decode.py OutputPathTest, in a scratch worktree atupstream/mainwith only the new test file copied in (before), and in the branch (after):Ran 3 tests ... FAILED (failures=2)test_same_report_path_is_the_shared_helper:<function same_report_path ...> is not <function same_report_path ...>test_same_report_path_asks_the_folding_volume:AssertionError: False is not true(the privatenormcase+samefileanswer; the shared helper asks the volume and answers True)Ran 3 tests in 0.107s/OKFull module on the branch:
python -I tests/test_navmesh_decode.py->Ran 19 tests in 2.940s/OK.python -m compileall -q tools/navmesh_decode.py tests/test_navmesh_decode.py-> exit 0;python -I tools/navmesh_decode.py --helpstill prints usage.The new tests close two things: the tool must call the shared helper (a private copy is a different function object), and that helper must consult the folding-volume probe even when
os.path.normcasekeeps case.No GPU needed (no GPU test run for this change).
Notes
normcase+ probe is the smallest thing that fails before and passes after on every platform.EGEN-NAVMESHDECODE-SHARED-PATH(deepseek7). Related series: rbf0_tree: guard out/--csv/--xml with the shared report_paths.same_report_path (EGEN-RBF0-TREE-SHARED) #6176, instance_lists: use tools/report_paths.same_report_path for the --json/input guard (EGEN-INSTANCE-LISTS-SHARED-PATH) #6189, skin_streams: use tools/report_paths.same_report_path for the --json/input guard (EGEN-SKINSTREAMS-SHARED-PATH) #6137, sandbox_scene: an --out that names the --entities file is refused, not written over it (EGEN-SANDBOX-OUT-ENTITIES) #6197 (the other tools moving toreport_paths).AI-assisted.