world_interior_names: refuse a report inside another case of the carve folder (WORLD-INTERIOR-NAMES-CASE-INSIDE) #1452

Merged
Dashhhhhhhh merged 1 commit from upstream-pr/1452 into main 2026-12-01 15:16:18 +00:00
Dashhhhhhhh commented 2026-11-25 00:31:02 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Dashhhhhhhh on 2026-11-25T00:31:02Z.


Claimed in the coordination issue as: WORLD-INTERIOR-NAMES-CASE-INSIDE

What and why

tools/world_interior_names.py _inside compared the carve folder and --out with os.path.normcase(os.path.realpath()) and commonpath. On macOS that keeps the case you typed. --out inside a folder created as carved but spelled CARVED was accepted, so the report could be written where a later scan reads carved files.

The check now uses report_paths.path_key. Pull request #717 also edits this file, for the 20-bit block number, and does not touch this check.

Tested

python -I tests/test_world_interior_names.py (28 tests) on macOS APFS. The new test refuses CARVED/r.json for a folder created as carved. No game files.

GPUs tested: n/a

AI-assisted: yes

Checklist

  • Based on current main and merges cleanly.
  • One topic.
  • No game data, keys or decryption.
  • A new translator rule is in the contract table of docs/design.md (not a translator change).

Made with Cursor

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5482765659 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1452). Originally posted by [Dashhhhhhhh](https://github.com/Dashhhhhhhh) on 2026-11-25T00:31:02Z. --- Claimed in the coordination issue as: WORLD-INTERIOR-NAMES-CASE-INSIDE ### What and why `tools/world_interior_names.py` `_inside` compared the carve folder and `--out` with `os.path.normcase(os.path.realpath())` and `commonpath`. On macOS that keeps the case you typed. `--out` inside a folder created as `carved` but spelled `CARVED` was accepted, so the report could be written where a later scan reads carved files. The check now uses `report_paths.path_key`. Pull request #717 also edits this file, for the 20-bit block number, and does not touch this check. ### Tested `python -I tests/test_world_interior_names.py` (28 tests) on macOS APFS. The new test refuses `CARVED/r.json` for a folder created as `carved`. No game files. GPUs tested: n/a AI-assisted: yes ### Checklist - [x] Based on current `main` and merges cleanly. - [x] One topic. - [x] No game data, keys or decryption. - [ ] A new translator rule is in the contract table of `docs/design.md` (not a translator change). Made with [Cursor](https://cursor.com)
PierreEbele commented 2026-11-25 15:31:58 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by PierreEbele on 2026-11-25T15:31:58Z.


Reviewed 3e5f2cc66: ran python3 -I tests/test_world_interior_names.py (28 OK; the new test skips here, this volume keeps case), plus tests/test_report_paths.py (22 OK) and tests/test_report_path_case.py (3 OK, 1 skip) for the helper now used — all on Linux arm64, no GPU or game files. Probed _inside/main() with case_insensitive_volume() patched to its macOS-default answer: main returns rc=0 and writes the report through --out CARVED/r.json, where a later scan would read it as a carved file; this head returns rc=2 ("--out would overwrite an input") and writes nothing, while prefix siblings and unrelated paths stay allowed. Behavior on a case-keeping volume is unchanged on both trees. One candidate for the coordination issue: on Linux mounts that fold case (vfat/exFAT/CIFS) the check still lets CARVED through, since case_insensitive_volume() is darwin-only — pre-existing, outside this change's macOS scope.
AI-assisted review.

Recommendation: Merge

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7166988611 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/1452#issuecomment-7166988611). Originally posted by [PierreEbele](https://github.com/PierreEbele) on 2026-11-25T15:31:58Z. --- Reviewed 3e5f2cc66: ran `python3 -I tests/test_world_interior_names.py` (28 OK; the new test skips here, this volume keeps case), plus `tests/test_report_paths.py` (22 OK) and `tests/test_report_path_case.py` (3 OK, 1 skip) for the helper now used — all on Linux arm64, no GPU or game files. Probed `_inside`/`main()` with `case_insensitive_volume()` patched to its macOS-default answer: main returns rc=0 and writes the report through `--out CARVED/r.json`, where a later scan would read it as a carved file; this head returns rc=2 ("--out would overwrite an input") and writes nothing, while prefix siblings and unrelated paths stay allowed. Behavior on a case-keeping volume is unchanged on both trees. One candidate for the coordination issue: on Linux mounts that fold case (vfat/exFAT/CIFS) the check still lets `CARVED` through, since `case_insensitive_volume()` is darwin-only — pre-existing, outside this change's macOS scope. AI-assisted review. **Recommendation:** Merge
OreoFR commented 2026-11-28 21:51:12 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-28T21:51:12Z.


Verified by OreoFR

  • Base: main 3408969a7 + PR head 3e5f2cc66
  • Test: python -I tests/test_world_interior_names.py
  • Red on main: 29 OK
  • Green with the PR: 29 OK
  • Verdict: NO RED
  • Machine: RTX 4070 Laptop 8 GB, NVIDIA 621.40, Intel Core Ultra 7 155H, Windows 11

AI-assisted (Claude Code, Claude Opus 5.5).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7246320847 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1452#issuecomment-7246320847). Originally posted by [OreoFR](https://github.com/OreoFR) on 2026-11-28T21:51:12Z. --- **Verified by OreoFR** - Base: main `3408969a7` + PR head `3e5f2cc66` - Test: `python -I tests/test_world_interior_names.py` - Red on main: 29 OK - Green with the PR: 29 OK - Verdict: NO RED - Machine: RTX 4070 Laptop 8 GB, NVIDIA 621.40, Intel Core Ultra 7 155H, Windows 11 AI-assisted (Claude Code, Claude Opus 5.5).
zmasi commented 2026-11-29 00:47:03 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by zmasi on 2026-11-29T00:47:03Z.


#1452 | head 3e5f2cc66b (merged cleanly onto origin/main e66c65b950) | Windows 11 (10.0.26200.9974, NTFS), Python 3.12.10 | AI-assisted: yes

Independent Verification (Windows 11 + NTFS)

  • Diff & safety audit: Inspected 100% of the diff across tools/world_interior_names.py and tests/test_world_interior_names.py updating _inside(folder, path) to compare report_paths.path_key(...) prefixes. python -I scripts/check_no_game_data.py tools/world_interior_names.py tests/test_world_interior_names.py passed (rc=0).
  • Native Windows 11 NTFS execution (including previously skipped case-insensitive test):
    • python -I tests/test_world_interior_names.py -> 29/29 passed (OK, 0 skipped) on a real case-insensitive NTFS volume, executing test_out_inside_another_case_of_the_carve_folder_is_refused (carved vs CARVED\r.json; skipped on case-sensitive Linux filesystems in earlier reviews).
    • Live NTFS directory junction & prefix boundary probe: Created carved and an NTFS directory junction mklink /J CarvedJunc carved, confirming _inside(carved, "...\\CARVED\\sub\\r.json") == True, _inside(carved, "...\\CarvedJunc\\r.json") == True, and sibling _inside(carved, "...\\carved2\\r.json") == False.
<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7248347492 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1452#issuecomment-7248347492). Originally posted by [zmasi](https://github.com/zmasi) on 2026-11-29T00:47:03Z. --- #1452 | head 3e5f2cc66bbb44b0f762c8beefc86e288ca00e83 (merged cleanly onto origin/main e66c65b950) | Windows 11 (10.0.26200.9974, NTFS), Python 3.12.10 | AI-assisted: yes ### Independent Verification (Windows 11 + NTFS) - **Diff & safety audit**: Inspected 100% of the diff across `tools/world_interior_names.py` and `tests/test_world_interior_names.py` updating `_inside(folder, path)` to compare `report_paths.path_key(...)` prefixes. `python -I scripts/check_no_game_data.py tools/world_interior_names.py tests/test_world_interior_names.py` passed (`rc=0`). - **Native Windows 11 NTFS execution (including previously skipped case-insensitive test)**: - `python -I tests/test_world_interior_names.py` -> **`29/29` passed (`OK`, `0` skipped)** on a real case-insensitive NTFS volume, executing `test_out_inside_another_case_of_the_carve_folder_is_refused` (`carved` vs `CARVED\r.json`; skipped on case-sensitive Linux filesystems in earlier reviews). - **Live NTFS directory junction & prefix boundary probe**: Created `carved` and an NTFS directory junction `mklink /J CarvedJunc carved`, confirming `_inside(carved, "...\\CARVED\\sub\\r.json") == True`, `_inside(carved, "...\\CarvedJunc\\r.json") == True`, and sibling `_inside(carved, "...\\carved2\\r.json") == False`.
TheGeogeo commented 2026-11-29 14:18:25 +00:00 (Migrated from github.com)

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


Ready for testing: merges cleanly with main 3535eb5c4. Not in main yet: git cherry finds 1 commit(s) not there, and 4 of the 16 lines it adds are already present. No duplicate found: its claim WORLD-INTERIOR-NAMES-CASE-INSIDE appears in no other open pull request and in no main commit.

AI-assisted (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7257200663 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1452#issuecomment-7257200663). Originally posted by [TheGeogeo](https://github.com/TheGeogeo) on 2026-11-29T14:18:25Z. --- Ready for testing: merges cleanly with `main` `3535eb5c4`. Not in `main` yet: `git cherry` finds 1 commit(s) not there, and 4 of the 16 lines it adds are already present. No duplicate found: its claim `WORLD-INTERIOR-NAMES-CASE-INSIDE` appears in no other open pull request and in no `main` commit. AI-assisted (Claude Code).
enlight3d commented 2026-11-29 15:44:22 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by enlight3d on 2026-11-29T15:44:22Z.


RUN report for #1452 (WORLD-INTERIOR-NAMES-CASE-INSIDE)

Kind: Python (tools/world_interior_names.py plus its test tests/test_world_interior_names.py).

Heads: PR head 3e5f2cc66, based on b4b7756e8; origin/main c22a0a732 (merged locally with git merge --no-edit --no-ff, clean, 2 files; main changed _array in the same file since the base, no conflict).

Commands (repo root, Python 3.13.12): python -I -B tests/test_world_interior_names.py, and the same one process per file for the other tests that import report_paths or world_interior_names: test_report_paths, test_report_path_case, test_world_index, test_first_look_paths, test_first_look_shim_report, test_gamedata_index_report_paths, test_gamedata_xml_report_paths, test_manifest, test_mask_channels, test_mod_pack_output_alias, test_psin_names, test_shader_link_check, test_tex_headers_report_paths, test_wave64_graphics_scan.

Results:

  • GREEN at PR head: test_world_interior_names.py 28 tests OK; the new test_out_inside_another_case_of_the_carve_folder_is_refused ran and passed (it is not skipped: NTFS ignores case).
  • GREEN merged into origin/main: 29 tests OK in test_world_interior_names.py; the 14 related files above all OK (test_report_path_case and test_manifest with 1 skip each). test_user_sgpr_census.py cannot run here: import pytest fails (not installed in this Python); unrelated to the PR.
  • RED, real: not reachable on Windows. With tools/world_interior_names.py reverted to the PR base (test kept), the new test still passes (28 of 28 OK). Reason: on Windows os.path.realpath returns the on-disk case and normcase lowercases, so the old _inside already refuses CARVED/r.json; the bug is the macOS path rules (case kept) and needs a macOS run.
  • RED, simulated (ad hoc script, not part of the PR, kind: behavioural): I patched os.path.normcase to keep case, os.path.realpath to abspath, os.path.commonpath to a case-sensitive version and report_paths.case_insensitive_volume to True, then ran only the new test. Old _inside: FAIL (0 != 2, the report is written inside the carve folder). PR _inside: ok. This only shows the logic difference under macOS-like rules; it is not a macOS run.

Machine: Windows 11 Pro x64, RTX 3090 24 GB, NVIDIA 621.40, Python 3.13.12 (python -I).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7258327538 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1452#issuecomment-7258327538). Originally posted by [enlight3d](https://github.com/enlight3d) on 2026-11-29T15:44:22Z. --- RUN report for #1452 (WORLD-INTERIOR-NAMES-CASE-INSIDE) Kind: Python (`tools/world_interior_names.py` plus its test `tests/test_world_interior_names.py`). Heads: PR head `3e5f2cc66`, based on `b4b7756e8`; origin/main `c22a0a732` (merged locally with `git merge --no-edit --no-ff`, clean, 2 files; main changed `_array` in the same file since the base, no conflict). Commands (repo root, Python 3.13.12): `python -I -B tests/test_world_interior_names.py`, and the same one process per file for the other tests that import `report_paths` or `world_interior_names`: test_report_paths, test_report_path_case, test_world_index, test_first_look_paths, test_first_look_shim_report, test_gamedata_index_report_paths, test_gamedata_xml_report_paths, test_manifest, test_mask_channels, test_mod_pack_output_alias, test_psin_names, test_shader_link_check, test_tex_headers_report_paths, test_wave64_graphics_scan. Results: - GREEN at PR head: `test_world_interior_names.py` 28 tests OK; the new `test_out_inside_another_case_of_the_carve_folder_is_refused` ran and passed (it is not skipped: NTFS ignores case). - GREEN merged into origin/main: 29 tests OK in `test_world_interior_names.py`; the 14 related files above all OK (test_report_path_case and test_manifest with 1 skip each). `test_user_sgpr_census.py` cannot run here: `import pytest` fails (not installed in this Python); unrelated to the PR. - RED, real: not reachable on Windows. With `tools/world_interior_names.py` reverted to the PR base (test kept), the new test still passes (28 of 28 OK). Reason: on Windows `os.path.realpath` returns the on-disk case and `normcase` lowercases, so the old `_inside` already refuses `CARVED/r.json`; the bug is the macOS path rules (case kept) and needs a macOS run. - RED, simulated (ad hoc script, not part of the PR, kind: behavioural): I patched `os.path.normcase` to keep case, `os.path.realpath` to `abspath`, `os.path.commonpath` to a case-sensitive version and `report_paths.case_insensitive_volume` to True, then ran only the new test. Old `_inside`: FAIL (`0 != 2`, the report is written inside the carve folder). PR `_inside`: ok. This only shows the logic difference under macOS-like rules; it is not a macOS run. Machine: Windows 11 Pro x64, RTX 3090 24 GB, NVIDIA 621.40, Python 3.13.12 (`python -I`).
TheGeogeo commented 2026-11-29 18:50:02 +00:00 (Migrated from github.com)

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


Tested 3e5f2cc66 merged (no commit) with main 7c330c76d: Python 3.12.4, Windows 11 10.0.26300, CPU only.

  • Green: tests/test_world_interior_names.py gives 29 tests OK (main's own: 28).
  • No red here: with tools/world_interior_names.py back to main, the 29 tests still pass. On Windows, main's os.path.normcase already folds case, and the PR's own comment says the gap was on macOS, where normcase(realpath()) keeps the typed case. Not covered here.
  • check_no_game_data.py is clean.

AI-assisted (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7260795140 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1452#issuecomment-7260795140). Originally posted by [TheGeogeo](https://github.com/TheGeogeo) on 2026-11-29T18:50:02Z. --- Tested `3e5f2cc66` merged (no commit) with `main` `7c330c76d`: Python 3.12.4, Windows 11 10.0.26300, CPU only. - Green: `tests/test_world_interior_names.py` gives 29 tests OK (`main`'s own: 28). - No red here: with `tools/world_interior_names.py` back to `main`, the 29 tests still pass. On Windows, `main`'s `os.path.normcase` already folds case, and the PR's own comment says the gap was on macOS, where `normcase(realpath())` keeps the typed case. Not covered here. - `check_no_game_data.py` is clean. AI-assisted (Claude Code).
OreoFR commented 2026-11-29 19:36:26 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-29T19:36:26Z.


Verified by OreoFR on macOS 27.2.1 (26B131), Apple M5, APFS (case-insensitive, NFD), Python 3.12.16, main dd87aa405, PR head 3e5f2cc66 : red 1 failure / green 29 OK, 0 skipped

Complements the Windows run (no red there: the gap is macOS-only).

  • Merge: clean (git merge-tree); does not force a rebase of #2566.
  • Red (main + this PR's test file): 28/29, 1 failure test_out_inside_another_case_of_the_carve_folder_is_refused (AssertionError: 0 != 2) — the red shows up on APFS (MEASURED n=3).
  • Green: 29/29, 0 skipped. Neighbour test_report_paths: OK on both (1 skipped on both).
  • Diff: _inside goes through path_key (case fold + NFD on case-insensitive volumes) and compares by prefix with os.sep; the old ValueError (different Windows drives) can no longer be raised with startswith. No game data.

Verdict: READY

AI-assisted: Claude Code

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7261413008 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1452#issuecomment-7261413008). Originally posted by [OreoFR](https://github.com/OreoFR) on 2026-11-29T19:36:26Z. --- Verified by OreoFR on macOS 27.2.1 (26B131), Apple M5, APFS (case-insensitive, NFD), Python 3.12.16, main dd87aa405, PR head 3e5f2cc66 : red 1 failure / green 29 OK, 0 skipped Complements the Windows run (no red there: the gap is macOS-only). - Merge: clean (`git merge-tree`); does not force a rebase of #2566. - **Red** (main + this PR's test file): 28/29, 1 failure `test_out_inside_another_case_of_the_carve_folder_is_refused` (`AssertionError: 0 != 2`) — the red shows up on APFS (MEASURED n=3). - **Green**: 29/29, 0 skipped. Neighbour `test_report_paths`: OK on both (1 skipped on both). - Diff: `_inside` goes through `path_key` (case fold + NFD on case-insensitive volumes) and compares by prefix with `os.sep`; the old `ValueError` (different Windows drives) can no longer be raised with `startswith`. No game data. **Verdict: READY** AI-assisted: Claude Code
aslan2142 commented 2026-12-01 11:41:58 +00:00 (Migrated from github.com)

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

Review: APPROVED


Reviewed the diff against main: tools/world_interior_names.py:367-379 cleanly switches _inside() to report_paths.path_key with a regression test in tests/test_world_interior_names.py:365-385. Clean-room verified. Approving; awaiting a green CI run before merge.

(AI-assisted review.)

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6130521449 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/1452#pullrequestreview-6130521449). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-12-01T11:41:58Z. **Review:** APPROVED --- Reviewed the diff against `main`: `tools/world_interior_names.py:367-379` cleanly switches `_inside()` to `report_paths.path_key` with a regression test in `tests/test_world_interior_names.py:365-385`. Clean-room verified. Approving; awaiting a green CI run before merge. *(AI-assisted review.)*
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!1452
No description provided.