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

Open
github-bot wants to merge 1 commit from github-bot/gh-1452 into main AGit
Owner

@⁠Dashhhhhhhh on GitHub · 2026-11-25 00:31 UTC · original
Dashhhhhhhh:fix/world-interior-names-case-inside → main · +31 −4 · 2 files · 1 commits · open

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

**@⁠Dashhhhhhhh** on GitHub · 2026-11-25 00:31 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1452) `Dashhhhhhhh:fix/world-interior-names-case-inside` → `main` · +31 −4 · 2 files · 1 commits · open 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)
normcase(realpath()) kept carved and CARVED apart on macOS, so --out could be written where a later scan reads carved files. The inside check now uses the shared path key.

Co-authored-by: Cursor <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:51:54 +00:00
Author
Owner

@⁠PierreEbele on GitHub · 2026-11-25 15:31 UTC · original

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

**@⁠PierreEbele** on GitHub · 2026-11-25 15:31 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1452#issuecomment-7166988611) 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
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1452/head:github-bot/gh-1452'
git switch 'github-bot/gh-1452'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1452'
git switch 'github-bot/gh-1452'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1452'
git switch 'github-bot/gh-1452'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1452'
git switch 'main'
git merge --squash 'github-bot/gh-1452'
git switch 'main'
git merge --ff-only 'github-bot/gh-1452'
git switch 'main'
git merge 'github-bot/gh-1452'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.