restofworld_model_join: ask report_paths for the report-path guard (RESTOFWORLD-MODEL-JOIN-SHARED-REPORT-PATH) #1244

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

@⁠breachato on GitHub · 2026-11-24 20:44 UTC · original
breachato:restofworld-model-join-shared-report-path → main · +7 −9 · 1 files · 1 commits · open

Claimed in the coordination issue as: RESTOFWORLD-MODEL-JOIN-SHARED-REPORT-PATH (#14)

Depends on: none

Fixes: none

What and why

tools/restofworld_model_join.py derived the report-path answer itself inside _aliases_input (:1236-1257):
realpath + normcase compared by hand twice (the source, then the carve folder's index.json) and
os.path.samefile twice, to refuse an --out that would overwrite the archive, the folder manifest or a carved
stream. CONTRIBUTING.md asks a report writer to call report_paths.same_report_path instead of deriving it again,
and the private copy missed that helper's folding-volume probe: on a Linux mount that ignores case (vfat, exFAT,
CIFS) --out INDEX.json beside an existing index.json was not refused and replaced the manifest.

The equalities now go through same_report_path; the last branch of _aliases_input is untouched because it is a
containment rule, not an equality (an output inside the carve folder with a .bin/.bk2 name), and
tests/test_carve_short_system_pages.py asserts it. The tool had no tools/ entry on sys.path, so one is added
for the import, as tex_headers does. Different topic from OLD-7750 (#886, page-map slots and index.json load).
No behaviour change on Windows, macOS or a case-sensitive Linux filesystem.

Tested

  • tests/test_restofworld_model_join.py, tests/test_carve_short_system_pages.py and
    tests/test_report_path_case.py: 23 passed, 1 skipped, 44 subtests passed.
  • python -I tools/restofworld_model_join.py --help: prints its usage (the import works under -I).
  • python -m compileall -q tools/restofworld_model_join.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)
**@⁠breachato** on GitHub · 2026-11-24 20:44 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1244) `breachato:restofworld-model-join-shared-report-path` → `main` · +7 −9 · 1 files · 1 commits · open Claimed in the coordination issue as: RESTOFWORLD-MODEL-JOIN-SHARED-REPORT-PATH (https://git.gtahub.st/github/ubiquitarianism--leonida/issues/14) Depends on: none Fixes: none ### What and why `tools/restofworld_model_join.py` derived the report-path answer itself inside `_aliases_input` (`:1236-1257`): realpath + normcase compared by hand twice (the source, then the carve folder's `index.json`) and `os.path.samefile` twice, to refuse an `--out` that would overwrite the archive, the folder manifest or a carved stream. CONTRIBUTING.md asks a report writer to call `report_paths.same_report_path` instead of deriving it again, and the private copy missed that helper's folding-volume probe: on a Linux mount that ignores case (vfat, exFAT, CIFS) `--out INDEX.json` beside an existing `index.json` was not refused and replaced the manifest. The equalities now go through `same_report_path`; the last branch of `_aliases_input` is untouched because it is a containment rule, not an equality (an output inside the carve folder with a `.bin`/`.bk2` name), and `tests/test_carve_short_system_pages.py` asserts it. The tool had no `tools/` entry on `sys.path`, so one is added for the import, as `tex_headers` does. Different topic from OLD-7750 (#886, page-map slots and `index.json` load). No behaviour change on Windows, macOS or a case-sensitive Linux filesystem. ### Tested - `tests/test_restofworld_model_join.py`, `tests/test_carve_short_system_pages.py` and `tests/test_report_path_case.py`: **23 passed, 1 skipped**, 44 subtests passed. - `python -I tools/restofworld_model_join.py --help`: prints its usage (the import works under `-I`). - `python -m compileall -q tools/restofworld_model_join.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)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:44:17 +00:00
Author
Owner

@⁠PierreEbele on GitHub · 2026-11-25 14:35 UTC · original

Reviewed 9638d91: restofworld_model_join's overwrite guard now calls same_report_path from tools/report_paths.py instead of its own normcase/realpath/samefile code. Ran on this branch and on main: tests/test_restofworld_model_join.py (9 OK), tests/test_carve_short_system_pages.py (11 OK, including the direct _aliases_input assertions), tests/test_report_paths.py (22 OK), tests/test_report_path_case.py (4 OK, 1 skipped), --help clean. A 16-case probe (index.json via hard link, symlink, dangling symlink; case twins of index.json and .bk2 names; carved *.bin siblings; subfolders; .. spellings; archive sources) gives identical verdicts on main and here; on folding volumes it additionally refuses a case-twin of index.json, as intended. No finding. Suggestion: add restofworld_model_join to SHARED in tests/test_report_paths.py so the import stays pinned; nothing fails as-is. AI-assisted review.

Recommendation: Merge

**@⁠PierreEbele** on GitHub · 2026-11-25 14:35 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1244#issuecomment-7165500912) Reviewed 9638d91: restofworld_model_join's overwrite guard now calls `same_report_path` from tools/report_paths.py instead of its own normcase/realpath/samefile code. Ran on this branch and on main: tests/test_restofworld_model_join.py (9 OK), tests/test_carve_short_system_pages.py (11 OK, including the direct `_aliases_input` assertions), tests/test_report_paths.py (22 OK), tests/test_report_path_case.py (4 OK, 1 skipped), `--help` clean. A 16-case probe (index.json via hard link, symlink, dangling symlink; case twins of index.json and .bk2 names; carved *.bin siblings; subfolders; `..` spellings; archive sources) gives identical verdicts on main and here; on folding volumes it additionally refuses a case-twin of index.json, as intended. No finding. Suggestion: add restofworld_model_join to SHARED in tests/test_report_paths.py so the import stays pinned; nothing fails as-is. 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/1244/head:github-bot/gh-1244'
git switch 'github-bot/gh-1244'

Merge

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