navmesh_decode: ask report_paths for the report-path guard (NAVMESH-DECODE-SHARED-REPORT-PATH) #1243

Closed
leonida/mandy
breachato wants to merge 0 commits from navmesh-decode-shared-report-path into main

Pull request closed

This pull request cannot be reopened because the branch was deleted.

breachato commented 2026-11-24 20:44:50 +00:00

Claimed in the coordination issue as: NAVMESH-DECODE-SHARED-REPORT-PATH (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7143974964)

Depends on: none

Fixes: none

What and why

tools/navmesh_decode.py carried a full private copy of tools/report_paths.py (:1049-1081): _PC_CASE_SENSITIVE,
_case_insensitive_volume (the macOS pathconf probe), _path_key (realpath + normcase + NFD casefold) and its own
same_report_path, all used by the four output guards at :1101 (--csv against --out), :1108 (the input),
:1112 (the carve folder's index.json) and :1115 (each carved entry). CONTRIBUTING.md asks a report writer to
call report_paths.same_report_path instead of deriving the answer again.

The copy was also missing the part the shared helper has and it does not: the folding-volume probe
(same_name_on_folding_volume). Its macOS probe answers only on APFS/HFS+ and normcase folds only on Windows, so
on a Linux mount that ignores case (vfat, exFAT, CIFS) --out R.json and --csv r.json passed as two report paths
and the second replaced the first.

The four private helpers and the now-unused unicodedata import go (1 insertion, 37 deletions). The module keeps
the name same_report_path because tests/test_report_path_case.py resolves navmesh_decode.same_report_path; it is
now the imported function. Different topic from NAVMESH-JOAAT-LATIN1 (joaat_cs encoding). No behaviour change on
Windows, macOS or a case-sensitive Linux filesystem.

Tested

  • tests/test_navmesh_decode.py and tests/test_report_path_case.py: 20 passed, 1 skipped, 15 subtests passed.
  • python -I tools/navmesh_decode.py --help: prints its usage (the import works under -I).
  • python -m compileall -q tools/navmesh_decode.py: clean.
  • Not tested: the folding-volume case this fixes, which needs a case-folding mount (vfat/exFAT/CIFS); this
    machine is NTFS, where normcase already folds case. tests/test_report_paths.py covers the helper's own
    folding-volume answer.
  • No game files, no GPU; nothing was built.

GPUs tested: n/a

AI-assisted: yes

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (n/a: no translator change)
Claimed in the coordination issue as: NAVMESH-DECODE-SHARED-REPORT-PATH (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7143974964) Depends on: none Fixes: none ### What and why `tools/navmesh_decode.py` carried a full private copy of `tools/report_paths.py` (`:1049-1081`): `_PC_CASE_SENSITIVE`, `_case_insensitive_volume` (the macOS `pathconf` probe), `_path_key` (realpath + normcase + NFD casefold) and its own `same_report_path`, all used by the four output guards at `:1101` (`--csv` against `--out`), `:1108` (the input), `:1112` (the carve folder's `index.json`) and `:1115` (each carved entry). CONTRIBUTING.md asks a report writer to call `report_paths.same_report_path` instead of deriving the answer again. The copy was also missing the part the shared helper has and it does not: the folding-volume probe (`same_name_on_folding_volume`). Its macOS probe answers only on APFS/HFS+ and `normcase` folds only on Windows, so on a Linux mount that ignores case (vfat, exFAT, CIFS) `--out R.json` and `--csv r.json` passed as two report paths and the second replaced the first. The four private helpers and the now-unused `unicodedata` import go (1 insertion, 37 deletions). The module keeps the name `same_report_path` because `tests/test_report_path_case.py` resolves `navmesh_decode.same_report_path`; it is now the imported function. Different topic from NAVMESH-JOAAT-LATIN1 (`joaat_cs` encoding). No behaviour change on Windows, macOS or a case-sensitive Linux filesystem. ### Tested - `tests/test_navmesh_decode.py` and `tests/test_report_path_case.py`: **20 passed, 1 skipped**, 15 subtests passed. - `python -I tools/navmesh_decode.py --help`: prints its usage (the import works under `-I`). - `python -m compileall -q tools/navmesh_decode.py`: clean. - **Not tested:** the folding-volume case this fixes, which needs a case-folding mount (vfat/exFAT/CIFS); this machine is NTFS, where `normcase` already folds case. `tests/test_report_paths.py` covers the helper's own folding-volume answer. - No game files, no GPU; nothing was built. GPUs tested: n/a AI-assisted: yes ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [x] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (n/a: no translator change)
PierreEbele commented 2026-11-25 09:25:48 +00:00

Reviewed 9ba1fa9: navmesh_decode now imports same_report_path from tools/report_paths.py instead of its own copy. Ran in the sandbox on this branch and on main: tests/test_navmesh_decode.py (17 OK), tests/test_report_paths.py (22 OK), tests/test_report_path_case.py (4 OK, 1 skipped), compileall, --help clean. A 14-case probe (hard link, symlinks, dangling symlink vs target, case and NFD-accent twins, relative and missing paths) is verdict-identical to the old guard on a case-sensitive volume; on folding volumes it now also refuses a case-twin, which is the point. No finding. Suggestion: drop navmesh_decode from LEGACY_COPIES in tests/test_report_paths.py and add it to SHARED so the import stays enforced; tests pass unchanged either way.

AI-assisted review.

Recommendation: Merge

Reviewed 9ba1fa9: navmesh_decode now imports `same_report_path` from tools/report_paths.py instead of its own copy. Ran in the sandbox on this branch and on main: tests/test_navmesh_decode.py (17 OK), tests/test_report_paths.py (22 OK), tests/test_report_path_case.py (4 OK, 1 skipped), compileall, `--help` clean. A 14-case probe (hard link, symlinks, dangling symlink vs target, case and NFD-accent twins, relative and missing paths) is verdict-identical to the old guard on a case-sensitive volume; on folding volumes it now also refuses a case-twin, which is the point. No finding. Suggestion: drop navmesh_decode from LEGACY_COPIES in tests/test_report_paths.py and add it to SHARED so the import stays enforced; tests pass unchanged either way. AI-assisted review. **Recommendation:** Merge
zmasi commented 2026-11-28 22:21:49 +00:00

#1243 | head 9ba1fa94dbb3ce1225e1deff8a89f0f572cf5ab0 (merged cleanly with main c7753ed98a) | live NTFS fsutil file setCaseSensitiveInfo <dir> enable probe + python -I tests/test_navmesh_decode.py + python -I tests/test_report_paths.py + python -I tests/test_report_path_case.py | red on main: navmesh_decode.same_report_path falsely returned True inside a case-sensitive Windows NTFS directory (both for uncreated NAV.json vs nav.json and for two distinct existing files Existing.bin vs existing.bin, because its private _path_key ran os.path.normcase before os.path.samefile) | green on PR+main: False on case-sensitive NTFS (missing and distinct existing files), True on standard case-insensitive NTFS, 17 ran, OK (test_navmesh_decode.py), 26 ran, OK (skipped=1) (test_report_paths.py), 4 ran, OK (skipped=1) (test_report_path_case.py) | Windows 11 (10.0.26200.9974), Python 3.12.10 | AI-assisted: yes

Audited 9ba1fa94db (tools/navmesh_decode.py) on Windows 11, confirming it removes the last private _case_insensitive_volume / _path_key / same_report_path copy (LEGACY_COPIES in tests/test_report_paths.py) in favor of tools/report_paths.py's shared same_report_path, which checks os.path.samefile first and probes per-directory Windows NTFS case sensitivity via _same_windows_folded_path. Also verified tests/test_ci_registration.py, tests/test_text_write_line_endings.py, and scripts/check_no_game_data.py.

#1243 | head 9ba1fa94dbb3ce1225e1deff8a89f0f572cf5ab0 (merged cleanly with main c7753ed98a) | live NTFS `fsutil file setCaseSensitiveInfo <dir> enable` probe + `python -I tests/test_navmesh_decode.py` + `python -I tests/test_report_paths.py` + `python -I tests/test_report_path_case.py` | red on main: `navmesh_decode.same_report_path` falsely returned `True` inside a case-sensitive Windows NTFS directory (both for uncreated `NAV.json` vs `nav.json` and for two distinct existing files `Existing.bin` vs `existing.bin`, because its private `_path_key` ran `os.path.normcase` before `os.path.samefile`) | green on PR+main: `False` on case-sensitive NTFS (missing and distinct existing files), `True` on standard case-insensitive NTFS, `17 ran, OK` (`test_navmesh_decode.py`), `26 ran, OK (skipped=1)` (`test_report_paths.py`), `4 ran, OK (skipped=1)` (`test_report_path_case.py`) | Windows 11 (`10.0.26200.9974`), Python 3.12.10 | AI-assisted: yes Audited `9ba1fa94db` (`tools/navmesh_decode.py`) on Windows 11, confirming it removes the last private `_case_insensitive_volume` / `_path_key` / `same_report_path` copy (`LEGACY_COPIES` in `tests/test_report_paths.py`) in favor of `tools/report_paths.py`'s shared `same_report_path`, which checks `os.path.samefile` first and probes per-directory Windows NTFS case sensitivity via `_same_windows_folded_path`. Also verified `tests/test_ci_registration.py`, `tests/test_text_write_line_endings.py`, and `scripts/check_no_game_data.py`.
TheGeogeo commented 2026-11-29 01:12:49 +00:00

Checked 9ba1fa94d merged (no commit) with main 87a39df94: Python 3.12.4, Windows 11 10.0.26300, CPU only. check_no_game_data.py is clean.

  • This PR adds no test, so there is no red/green to show.
  • No regression: the existing tests that cover the tool give the same result on main and on the merge (the 5 test_navmesh_* files, test_report_paths.py 26 OK, test_report_path_case.py, test_zero_span.py).
  • It also drops the tool's own macOS case-sensitivity code (_PC_CASE_SENSITIVE, unicodedata), which report_paths now covers.
  • The same pattern runs through #1162, #1170-#1173, #1214, #1215, #1227-#1229, #1243 and #1244. Each one replaces its tool's own copy of the same-path check with report_paths.same_report_path (tools/report_paths.py:117 on main). They share that one helper and touch one different tool each, so they do not depend on each other. Only #1228 conflicts with main.

No blocker from my side.

AI-assisted (Claude Code).

Checked `9ba1fa94d` merged (no commit) with `main` `87a39df94`: Python 3.12.4, Windows 11 10.0.26300, CPU only. `check_no_game_data.py` is clean. - This PR adds no test, so there is no red/green to show. - No regression: the existing tests that cover the tool give the same result on `main` and on the merge (the 5 `test_navmesh_*` files, `test_report_paths.py` 26 OK, `test_report_path_case.py`, `test_zero_span.py`). - It also drops the tool's own macOS case-sensitivity code (`_PC_CASE_SENSITIVE`, `unicodedata`), which `report_paths` now covers. - The same pattern runs through #1162, #1170-#1173, #1214, #1215, #1227-#1229, #1243 and #1244. Each one replaces its tool's own copy of the same-path check with `report_paths.same_report_path` (`tools/report_paths.py:117` on `main`). They share that one helper and touch one different tool each, so they do not depend on each other. Only #1228 conflicts with `main`. No blocker from my side. AI-assisted (Claude Code).
OreoFR commented 2026-11-29 03:27:48 +00:00

Verified by OreoFR on macOS 27.2.1 (26B131), Apple M5, APFS (case-insensitive), Python 3.12.16, main c8bf0e7b6, PR head 9ba1fa94d : red none / green OK

No test in the PR:

  • Merge: clean (git merge-tree).
  • Diff: drops the local copy of same_report_path (+ _path_key, _case_insensitive_volume, the unicodedata import) and imports the one from tools/report_paths. Pure refactor. No game data.
  • No red: tests/test_report_paths.py still lists navmesh_decode in LEGACY_COPIES, not in SHARED, so everything already passes on main. A local simulation of the SHARED check (imports the helper, no copy) fails on main and passes on the merge.
  • Guard checked by hand with a random .rpf (MEASURED): --out NAV.RPF for input nav.rpf, and --out x.json --csv X.JSON, are refused the same way on main and on the merge; input md5 unchanged. No behaviour change on macOS.
  • Neighbours (test_report_paths, test_tool_startup, navmesh*/ttpf*/dds/zero_span/staging tests): 102 OK, 7 skipped (rpf9dump not built, bcpack_calibration dylib absent, one Windows-only case-sensitivity test), 1 failure — test_tool_startup psin_dialogue (ModuleNotFoundError: psin_data), identical on main (MEASURED n=3), unrelated.
  • Suggestion: move navmesh_decode from LEGACY_COPIES to SHARED in tests/test_report_paths.py (its comment says to wait for this PR) — that would be the missing red test.

Verdict: NO RED (correct refactor, no test).

AI-assisted: Claude Code

Verified by OreoFR on macOS 27.2.1 (26B131), Apple M5, APFS (case-insensitive), Python 3.12.16, main c8bf0e7b6, PR head 9ba1fa94d : red none / green OK No test in the PR: - Merge: clean (`git merge-tree`). - Diff: drops the local copy of `same_report_path` (+ `_path_key`, `_case_insensitive_volume`, the `unicodedata` import) and imports the one from `tools/report_paths`. Pure refactor. No game data. - **No red**: `tests/test_report_paths.py` still lists `navmesh_decode` in `LEGACY_COPIES`, not in `SHARED`, so everything already passes on main. A local simulation of the `SHARED` check (imports the helper, no copy) fails on main and passes on the merge. - Guard checked by hand with a random `.rpf` (MEASURED): `--out NAV.RPF` for input `nav.rpf`, and `--out x.json --csv X.JSON`, are refused the same way on main and on the merge; input md5 unchanged. No behaviour change on macOS. - Neighbours (`test_report_paths`, `test_tool_startup`, navmesh*/ttpf*/dds/zero_span/staging tests): 102 OK, 7 skipped (rpf9dump not built, `bcpack_calibration` dylib absent, one Windows-only case-sensitivity test), 1 failure — `test_tool_startup` `psin_dialogue` (`ModuleNotFoundError: psin_data`), identical on main (MEASURED n=3), unrelated. - Suggestion: move `navmesh_decode` from `LEGACY_COPIES` to `SHARED` in `tests/test_report_paths.py` (its comment says to wait for this PR) — that would be the missing red test. **Verdict: NO RED** (correct refactor, no test). AI-assisted: Claude Code
MoonEyes commented 2026-11-29 17:09:04 +00:00

Tested 9ba1fa94d merged (no commit) with main 4364a4fa6: Python 3.12, Windows 11 10.0.26300, CPU only.

  • Red test: "navmesh_decode" added to SHARED and removed from LEGACY_COPIES in tests/test_report_paths.py, then python -I tests/test_report_paths.py.
  • Red on main: 2 failures, including 'from report_paths import same_report_path' not found in tools/navmesh_decode.py.
  • Green with this PR: OK (1 skipped).
  • That test edit is mine, not part of the PR. The PR should also drop navmesh_decode from LEGACY_COPIES, whose comment says this is the one tool still carrying its own copy.

AI-assisted (Claude Code).

Tested `9ba1fa94d` merged (no commit) with `main` `4364a4fa6`: Python 3.12, Windows 11 10.0.26300, CPU only. - Red test: `"navmesh_decode"` added to `SHARED` and removed from `LEGACY_COPIES` in `tests/test_report_paths.py`, then `python -I tests/test_report_paths.py`. - Red on `main`: 2 failures, including `'from report_paths import same_report_path' not found` in `tools/navmesh_decode.py`. - Green with this PR: OK (1 skipped). - That test edit is mine, not part of the PR. The PR should also drop `navmesh_decode` from `LEGACY_COPIES`, whose comment says this is the one tool still carrying its own copy. AI-assisted (Claude Code).
breachato commented 2026-11-29 18:02:29 +00:00

Added: navmesh_decode is now in SHARED in tests/test_report_paths.py in this PR (commit 92558ccf).

  • python -I tests/test_report_paths.py — OK (1 skipped), with the entry in place.
  • python -I tests/test_navmesh_decode.py — OK.
  • The red is the one you described: the same entry without this branch fails with 'from report_paths import same_report_path' not found.

Every PR in this series now touches that SHARED line, so I expect to rebase the rest as merges land; say the word if you would rather keep the list to a single follow-up.

AI-assisted.

Added: `navmesh_decode` is now in `SHARED` in `tests/test_report_paths.py` in this PR (commit `92558ccf`). - `python -I tests/test_report_paths.py` — OK (1 skipped), with the entry in place. - `python -I tests/test_navmesh_decode.py` — OK. - The red is the one you described: the same entry without this branch fails with `'from report_paths import same_report_path' not found`. Every PR in this series now touches that `SHARED` line, so I expect to rebase the rest as merges land; say the word if you would rather keep the list to a single follow-up. AI-assisted.
breachato commented 2026-11-30 19:23:34 +00:00

Rebased onto main (8f41d7d0) to clear the SHARED tuple conflict that #2637 (bink_index) opened for every sibling: the entry now sits in the tuple next to bink_index, and the branch is two commits again.

Verified on the new head:

  • python -I tests/test_report_paths.py — OK (26 tests, 1 skipped)
  • python -I tests/test_navmesh_decode.py — OK
  • git diff main — 2 files: the tool and tests/test_report_paths.py

No behaviour change beyond the shared helper.

Ready to merge: MERGEABLE / CLEAN, all five checks green. Every sibling PR touches the same SHARED line, so please merge one at a time — I'll rebase the remaining ones after each merge and keep them green.

Rebased onto `main` (`8f41d7d0`) to clear the `SHARED` tuple conflict that #2637 (`bink_index`) opened for every sibling: the entry now sits in the tuple next to `bink_index`, and the branch is two commits again. Verified on the new head: - `python -I tests/test_report_paths.py` — OK (26 tests, 1 skipped) - `python -I tests/test_navmesh_decode.py` — OK - `git diff main` — 2 files: the tool and `tests/test_report_paths.py` No behaviour change beyond the shared helper. Ready to merge: `MERGEABLE` / `CLEAN`, all five checks green. Every sibling PR touches the same `SHARED` line, so please merge one at a time — I'll rebase the remaining ones after each merge and keep them green.
aslan2142 reviewed 2026-12-01 11:49:22 +00:00
aslan2142 left a comment
No description provided.
Reviewed the diff against `main`: delegating the report-path guard in `tools/navmesh_decode.py` to `report_paths.same_report_path` is clean and clean-room verified, but this branch currently conflicts with `main` in `tests/test_report_paths.py:8-12` (`SHARED` tuple updated by `#2639` and earlier merges). Keep the `LEGACY_COPIES = set()` update in `tests/test_report_paths.py:17` when rebasing. Please rebase onto current `main` so CI runs cleanly. *(AI-assisted review.)*
aslan2142 commented 2026-12-02 05:10:31 +00:00

Thank you @breachato! Both commits from this PR (navmesh_decode) have been landed on main with full original authorship preserved in batch PR #3024 (commit 4dfd90c35), which consolidated all 15 tools/report_paths.py PRs together to avoid sequential tests/test_report_paths.py merge conflicts. Closing this PR now that it is merged!

Thank you @breachato! Both commits from this PR (`navmesh_decode`) have been landed on `main` with full original authorship preserved in batch PR #3024 (commit `4dfd90c35`), which consolidated all 15 `tools/report_paths.py` PRs together to avoid sequential `tests/test_report_paths.py` merge conflicts. Closing this PR now that it is merged!
Sign in to join this conversation.
No description provided.