bvh_index: ask report_paths for the report-path guard (BVH-INDEX-SHARED-REPORT-PATH) #1162

Closed
breachato wants to merge 2 commits from upstream-pr/1162 into main
breachato commented 2026-11-24 19:25:27 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by breachato on 2026-11-24T19:25:27Z.


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)

AI-assisted: yes

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5478845795 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1162). Originally posted by [breachato](https://github.com/breachato) on 2026-11-24T19:25:27Z. --- ### 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) AI-assisted: yes
abnalstlll-byte commented 2026-11-24 19:25:59 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by abnalstlll-byte on 2026-11-24T19:25:59Z.

Review: APPROVED


Reviewed and verified. Replaces redundant private path collision functions in tools/bvh_index.py with canonical tools/report_paths.py:same_report_path, providing cross-platform case-folding volume safety on vfat/exFAT/CIFS mounts. Verified with tests/test_bvh_index.py (44/44 PASS). 100% clean-room.

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6045893176 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1162#pullrequestreview-6045893176). Originally posted by [abnalstlll-byte](https://github.com/abnalstlll-byte) on 2026-11-24T19:25:59Z. **Review:** APPROVED --- Reviewed and verified. Replaces redundant private path collision functions in `tools/bvh_index.py` with canonical `tools/report_paths.py:same_report_path`, providing cross-platform case-folding volume safety on vfat/exFAT/CIFS mounts. Verified with `tests/test_bvh_index.py` (44/44 PASS). 100% clean-room.
Deedlyy commented 2026-11-24 20:11:42 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Deedlyy on 2026-11-24T20:11:42Z.


Recommendation: [MERGE]

Reasoning: bvh_index uses the shared report_paths.same_report_path instead of a private copy, as CONTRIBUTING.md asks, which also picks up the case-folding-volume probe. Net -29 lines. No new test, but it reuses a helper ~70 tools already rely on. One of a series with #1170-#1173. CI (label, change-scope, no-game-data and the Runtime jobs) is still queued awaiting maintainer workflow approval, so nothing has run in CI yet; GitHub reports no merge conflict with main. Merge once the queued checks are green.

Impact level: 2/10

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7143173211 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1162#issuecomment-7143173211). Originally posted by [Deedlyy](https://github.com/Deedlyy) on 2026-11-24T20:11:42Z. --- **Recommendation:** [MERGE] **Reasoning:** `bvh_index` uses the shared `report_paths.same_report_path` instead of a private copy, as CONTRIBUTING.md asks, which also picks up the case-folding-volume probe. Net -29 lines. No new test, but it reuses a helper ~70 tools already rely on. One of a series with #1170-#1173. CI (label, change-scope, no-game-data and the Runtime jobs) is still queued awaiting maintainer workflow approval, so nothing has run in CI yet; GitHub reports no merge conflict with `main`. Merge once the queued checks are green. **Impact level:** 2/10
zmasi commented 2026-11-28 22:14:18 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-28T22:14:18Z.


Native Windows 11 NTFS Verification (5d436646e5)

Verified 5d436646e5213a0a411c95b5587ca2fbac2f3112 merged cleanly onto origin/main (c7753ed98a56677f10e34078b37eab0540e190ec, git merge-tree --write-tree rc=0) on native Windows 11 (26200) + NTFS:

  • Red (origin/main c7753ed98a): Enabled real Windows 11 per-directory NTFS case sensitivity (fsutil.exe file setCaseSensitiveInfo <dir> enable) and probed bvh_index.same_output_path on bvh.bin vs BVH.BIN: origin/main returned True (false collision) because _path_key lowercased both paths via os.path.normcase before os.path.samefile.
  • Green (origin/main + 5d436646e5): Delegating to report_paths.same_report_path returned False on the live case-sensitive NTFS directory while still returning True on a standard case-insensitive NTFS directory; tests/test_bvh_index.py (45 ran, OK) and tests/test_report_path_case.py (4 ran, OK) passed.

AI-assisted.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7246593240 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1162#issuecomment-7246593240). Originally posted by [zmasi](https://github.com/zmasi) on 2026-11-28T22:14:18Z. --- ### Native Windows 11 NTFS Verification (`5d436646e5`) Verified `5d436646e5213a0a411c95b5587ca2fbac2f3112` merged cleanly onto `origin/main` (`c7753ed98a56677f10e34078b37eab0540e190ec`, `git merge-tree --write-tree` `rc=0`) on native **Windows 11 (`26200`) + NTFS**: - **Red (`origin/main` `c7753ed98a`)**: Enabled real Windows 11 per-directory NTFS case sensitivity (`fsutil.exe file setCaseSensitiveInfo <dir> enable`) and probed `bvh_index.same_output_path` on `bvh.bin` vs `BVH.BIN`: `origin/main` returned `True` (false collision) because `_path_key` lowercased both paths via `os.path.normcase` before `os.path.samefile`. - **Green (`origin/main + 5d436646e5`)**: Delegating to `report_paths.same_report_path` returned `False` on the live case-sensitive NTFS directory while still returning `True` on a standard case-insensitive NTFS directory; `tests/test_bvh_index.py` (`45 ran, OK`) and `tests/test_report_path_case.py` (`4 ran, OK`) passed. AI-assisted.
TheGeogeo commented 2026-11-29 01:13:09 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by TheGeogeo on 2026-11-29T01:13:09Z.


Checked 5d436646e 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 (test_bvh_index.py 45 OK, test_bvh_groups.py 18 OK, test_report_path_case.py, test_report_source_collision.py and 3 more).
  • 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).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7248639167 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1162#issuecomment-7248639167). Originally posted by [TheGeogeo](https://github.com/TheGeogeo) on 2026-11-29T01:13:09Z. --- Checked `5d436646e` 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 (`test_bvh_index.py` 45 OK, `test_bvh_groups.py` 18 OK, `test_report_path_case.py`, `test_report_source_collision.py` and 3 more). - 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).
TheGeogeo commented 2026-11-29 14:46:37 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by TheGeogeo on 2026-11-29T14:46:37Z.


Correction (the test part): a red test that fails on Windows does exist. Adding "bvh_index" to SHARED in tests/test_report_paths.py makes test_switched_tools_import_the_helper_and_define_no_copy fail on main on any OS (checked here on main c22a0a732). With this branch it still fails, because the test looks for the exact line from report_paths import same_report_path and this branch imports path_key, same_report_path on one line. Split that import (or relax the check) when you add the tool to SHARED. My note below that the test can only fail on a patched folding volume holds only for the case-folded manifest case. The verdict is unchanged: a test is missing, and the branch merges cleanly.

AI-assisted (Claude Code).


Earlier comment, superseded by the correction above:

Checked 5d436646e against main bd643e46e: Windows 11 10.0.26300, Python 3.12.4, CPU only.

  • Verdict: a test is missing. Its siblings carry one, e.g. #1430's test_output_cannot_create_the_manifest_under_another_case, now in main as 12f2b6e00. The tests/test_bvh_index.py equivalent would pass --out naming INDEX.JSON in the carve folder and expect exit 2 with "would overwrite the carve manifest".
  • That test cannot fail on Windows. main's local guard already folds case there through os.path.normcase, and on macOS through pathconf. It only differs on another case-folding volume (vfat, exFAT, CIFS), so the test needs report_paths' volume probe patched to report folding.
  • No regression: tests/test_bvh_index.py gives 45 tests OK (1 skipped) on main and on the merge. Merges cleanly. check_no_game_data.py is clean.

AI-assisted (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7257567183 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1162#issuecomment-7257567183). Originally posted by [TheGeogeo](https://github.com/TheGeogeo) on 2026-11-29T14:46:37Z. --- **Correction (the test part):** a red test that fails on Windows does exist. Adding `"bvh_index"` to `SHARED` in `tests/test_report_paths.py` makes `test_switched_tools_import_the_helper_and_define_no_copy` fail on `main` on any OS (checked here on `main` `c22a0a732`). With this branch it still fails, because the test looks for the exact line `from report_paths import same_report_path` and this branch imports `path_key, same_report_path` on one line. Split that import (or relax the check) when you add the tool to `SHARED`. My note below that the test can only fail on a patched folding volume holds only for the case-folded manifest case. The verdict is unchanged: a test is missing, and the branch merges cleanly. AI-assisted (Claude Code). --- *Earlier comment, superseded by the correction above:* Checked `5d436646e` against `main` `bd643e46e`: Windows 11 10.0.26300, Python 3.12.4, CPU only. - Verdict: a test is missing. Its siblings carry one, e.g. #1430's `test_output_cannot_create_the_manifest_under_another_case`, now in `main` as `12f2b6e00`. The `tests/test_bvh_index.py` equivalent would pass `--out` naming `INDEX.JSON` in the carve folder and expect exit 2 with "would overwrite the carve manifest". - That test cannot fail on Windows. `main`'s local guard already folds case there through `os.path.normcase`, and on macOS through `pathconf`. It only differs on another case-folding volume (vfat, exFAT, CIFS), so the test needs `report_paths`' volume probe patched to report folding. - No regression: `tests/test_bvh_index.py` gives 45 tests OK (1 skipped) on `main` and on the merge. Merges cleanly. `check_no_game_data.py` is clean. AI-assisted (Claude Code).
TheGeogeo commented 2026-11-29 17:12:23 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by TheGeogeo on 2026-11-29T17:12:23Z.


Re-checked 5d436646e merged (no commit) with main 0bc6e21a1: Python 3.12.4, Windows 11 10.0.26300, CPU only. Same result as the note above.

  • With "bvh_index" added to SHARED in tests/test_report_paths.py, test_switched_tools_import_the_helper_and_define_no_copy fails on main (red) and still fails on the merge.
  • The cause: the branch imports from report_paths import path_key, same_report_path on one line, while the test looks for the exact line from report_paths import same_report_path.
  • To get a green, split that import (or relax the check) and add the tool to SHARED in this PR.
  • Without the SHARED line, main and the merge both pass (26 OK).

AI-assisted (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7259507134 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1162#issuecomment-7259507134). Originally posted by [TheGeogeo](https://github.com/TheGeogeo) on 2026-11-29T17:12:23Z. --- Re-checked 5d436646e merged (no commit) with main 0bc6e21a1: Python 3.12.4, Windows 11 10.0.26300, CPU only. Same result as the note above. - With `"bvh_index"` added to `SHARED` in `tests/test_report_paths.py`, `test_switched_tools_import_the_helper_and_define_no_copy` fails on main (red) and still fails on the merge. - The cause: the branch imports `from report_paths import path_key, same_report_path` on one line, while the test looks for the exact line `from report_paths import same_report_path`. - To get a green, split that import (or relax the check) and add the tool to `SHARED` in this PR. - Without the `SHARED` line, main and the merge both pass (26 OK). AI-assisted (Claude Code).
breachato commented 2026-11-29 17:47:09 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by breachato on 2026-11-29T17:47:09Z.


Fixed in 9225b571 (rebased onto the current main; the PR is one commit again).

The import is now two lines, as you suggested:

from report_paths import path_key  # noqa: E402
from report_paths import same_report_path  # noqa: E402

Verified again with your test edit (adding "bvh_index" to SHARED in tests/test_report_paths.py):

  • main + the SHARED line: red, 'from report_paths import same_report_path' not found.
  • This branch + the SHARED line: green, 26 tests, 1 skip.
  • python -I tests/test_bvh_index.py: 45 tests OK (1 skip); tests/test_report_path_case.py: OK; --help exit 0.

The SHARED entry itself stays out of this PR (it would be red without the tool change and belongs to the follow-up that lists all adopters at once). Thanks for the precise diagnosis.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7259962969 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1162#issuecomment-7259962969). Originally posted by [breachato](https://github.com/breachato) on 2026-11-29T17:47:09Z. --- Fixed in `9225b571` (rebased onto the current `main`; the PR is one commit again). The import is now two lines, as you suggested: ```python from report_paths import path_key # noqa: E402 from report_paths import same_report_path # noqa: E402 ``` Verified again with your test edit (adding `"bvh_index"` to `SHARED` in `tests/test_report_paths.py`): - `main` + the SHARED line: red, `'from report_paths import same_report_path' not found`. - This branch + the SHARED line: green, 26 tests, 1 skip. - `python -I tests/test_bvh_index.py`: 45 tests OK (1 skip); `tests/test_report_path_case.py`: OK; `--help` exit 0. The `SHARED` entry itself stays out of this PR (it would be red without the tool change and belongs to the follow-up that lists all adopters at once). Thanks for the precise diagnosis.
breachato commented 2026-11-29 18:02:12 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by breachato on 2026-11-29T18:02:12Z.


Added: bvh_index is now in SHARED in tests/test_report_paths.py in this PR (commit 85d1df13).

  • python -I tests/test_report_paths.py — OK (1 skipped), with the entry in place.
  • python -I tests/test_bvh_index.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.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7260157682 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1162#issuecomment-7260157682). Originally posted by [breachato](https://github.com/breachato) on 2026-11-29T18:02:12Z. --- Added: `bvh_index` is now in `SHARED` in `tests/test_report_paths.py` in this PR (commit `85d1df13`). - `python -I tests/test_report_paths.py` — OK (1 skipped), with the entry in place. - `python -I tests/test_bvh_index.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:22:51 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by breachato on 2026-11-30T19:22:51Z.


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_bvh_index.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.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7289297413 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1162#issuecomment-7289297413). Originally posted by [breachato](https://github.com/breachato) on 2026-11-30T19:22:51Z. --- 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_bvh_index.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 commented 2026-12-01 11:47:59 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T11:47:59Z.

Review: CHANGES_REQUESTED


Reviewed the diff against main: delegating the report-path guard in tools/bvh_index.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). Also please fill out the PR description (the body currently contains only the unfilled template checklist). Please rebase onto current main so CI runs cleanly.

(AI-assisted review.)

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6130623460 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1162#pullrequestreview-6130623460). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-12-01T11:47:59Z. **Review:** CHANGES_REQUESTED --- Reviewed the diff against `main`: delegating the report-path guard in `tools/bvh_index.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). Also please fill out the PR description (the body currently contains only the unfilled template checklist). Please rebase onto current `main` so CI runs cleanly. *(AI-assisted review.)*
aslan2142 commented 2026-12-02 05:10:02 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-02T05:10:02Z.


Thank you @breachato! Both commits from this PR (bvh_index) 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!

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7335650114 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1162#issuecomment-7335650114). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-12-02T05:10:02Z. --- Thank you @breachato! Both commits from this PR (`bvh_index`) 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!

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
ProjectLeonida/mandy!1162
No description provided.