rbf0_index: ask report_paths for the report-path guard (RBF0-INDEX-SHARED-REPORT-PATH) #1227

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

@⁠breachato on GitHub · 2026-11-24 20:37 UTC · original
breachato:rbf0-index-shared-report-path → main · +4 −13 · 1 files · 1 commits · open

Claimed in the coordination issue as: RBF0-INDEX-SHARED-REPORT-PATH (#14)

Depends on: none

Fixes: none

What and why

tools/rbf0_index.py derived report-path equality itself in same_output_path (:542, realpath + normcase +
samefile) and asked it at its three output guards: the source against out (:562), the carve folder's
index.json against out (:577) and each carved stream against out (:578). That is the answer
tools/report_paths.py exists to give, and CONTRIBUTING.md asks a report writer to call same_report_path(a, b)
rather than derive it again (the same one-topic refactor as #1162 and #1214-#1216).

The private copy also missed that helper's folding-volume probe, so on a Linux mount that ignores case (vfat,
exFAT, CIFS) --out R.json and --out r.json passed as two report paths and the second replaced the first,
including when the first was the archive or a stream being scanned.

The duplicated logic goes. The tool already puts its own folder on sys.path for file_mode, so the import is
one line; no test calls same_output_path, so the name goes with the duplication. The staging and permission
path claimed by RBF0-INDEX-STAGE-CLEANUP (#791) is not touched. No behaviour change on Windows, macOS or a
case-sensitive Linux filesystem.

Tested

  • tests/test_rbf0_index.py and tests/test_rbf0_index_short_continuation.py: 30 passed, 4 subtests passed.
  • python -I tools/rbf0_index.py --help: prints its usage (the import works under -I).
  • python -m compileall -q tools/rbf0_index.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:37 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1227) `breachato:rbf0-index-shared-report-path` → `main` · +4 −13 · 1 files · 1 commits · open Claimed in the coordination issue as: RBF0-INDEX-SHARED-REPORT-PATH (https://git.gtahub.st/github/ubiquitarianism--leonida/issues/14) Depends on: none Fixes: none ### What and why `tools/rbf0_index.py` derived report-path equality itself in `same_output_path` (`:542`, realpath + normcase + samefile) and asked it at its three output guards: the source against `out` (`:562`), the carve folder's `index.json` against `out` (`:577`) and each carved stream against `out` (`:578`). That is the answer `tools/report_paths.py` exists to give, and CONTRIBUTING.md asks a report writer to call `same_report_path(a, b)` rather than derive it again (the same one-topic refactor as #1162 and #1214-#1216). The private copy also missed that helper's folding-volume probe, so on a Linux mount that ignores case (vfat, exFAT, CIFS) `--out R.json` and `--out r.json` passed as two report paths and the second replaced the first, including when the first was the archive or a stream being scanned. The duplicated logic goes. The tool already puts its own folder on `sys.path` for `file_mode`, so the import is one line; no test calls `same_output_path`, so the name goes with the duplication. The staging and permission path claimed by RBF0-INDEX-STAGE-CLEANUP (#791) is not touched. No behaviour change on Windows, macOS or a case-sensitive Linux filesystem. ### Tested - `tests/test_rbf0_index.py` and `tests/test_rbf0_index_short_continuation.py`: **30 passed**, 4 subtests passed. - `python -I tools/rbf0_index.py --help`: prints its usage (the import works under `-I`). - `python -m compileall -q tools/rbf0_index.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:43:42 +00:00
Author
Owner

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

Reviewed 7d5fb85e0: cleanly replaces rbf0_index.py's private same_output_path (no other callers) with the shared report_paths.same_report_path at all three refusal sites (source, carve index.json, carved streams) and merges cleanly into main. Verified in the sandbox on both PR and origin/main: all 11 rbf0/report-path suites (128 tests, 7 pre-existing skips), test_text_write_line_endings (3), and scripts/check_no_game_data.py pass; CLI probes confirm identical refusals on Linux (source, ../ spelling, hard link, symlink, carve manifest/stream) and mocked macOS/folding-volume checks confirm rbf0_index.main() now refuses case-only aliases (SRC.RPF, INDEX.JSON, rc=2). Optional non-blocking follow-up: "rbf0_index" could be added to SHARED in tests/test_report_paths.py (though 60 of 72 same_report_path tools are not listed there).
AI-assisted review.

Recommendation: Merge

**@⁠PierreEbele** on GitHub · 2026-11-25 07:14 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1227#issuecomment-7155638575) Reviewed 7d5fb85e0: cleanly replaces `rbf0_index.py`'s private `same_output_path` (no other callers) with the shared `report_paths.same_report_path` at all three refusal sites (`source`, carve `index.json`, carved streams) and merges cleanly into `main`. Verified in the sandbox on both PR and `origin/main`: all 11 rbf0/report-path suites (128 tests, 7 pre-existing skips), `test_text_write_line_endings` (3), and `scripts/check_no_game_data.py` pass; CLI probes confirm identical refusals on Linux (`source`, `../` spelling, hard link, symlink, carve manifest/stream) and mocked macOS/folding-volume checks confirm `rbf0_index.main()` now refuses case-only aliases (`SRC.RPF`, `INDEX.JSON`, rc=2). Optional non-blocking follow-up: `"rbf0_index"` could be added to `SHARED` in `tests/test_report_paths.py` (though 60 of 72 `same_report_path` tools are not listed there). 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/1227/head:github-bot/gh-1227'
git switch 'github-bot/gh-1227'

Merge

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