rbf0_tree: ask report_paths for the report-path guard (RBF0-TREE-SHARED-REPORT-PATH) #1214

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

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

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

Depends on: none

Fixes: none

What and why

tools/rbf0_tree.py derived report-path equality itself in same_output_path (:680, realpath + normcase +
samefile) and asked it at its four output guards: out against --csv (:702), out and --csv against
the source file (:706), out and --csv against a stream in the carve folder (:717), and --xml against
the source folder (:719). That is the one 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 (~70 tools already import it;
#1084 does the same for anim_clips).

The private copy was also missing something the shared helper has: its folding-volume probe
(same_name_on_folding_volume). On a Linux mount that ignores case (vfat, exFAT, CIFS) normcase folds
nothing and pathconf answers only on macOS, so out.json and out.JSON passed as two report paths, and
--csv could replace the JSON report or a stream in the carve folder the decode was about to read.

The duplicated logic goes (5 insertions, 13 deletions). The tool already puts its own folder on sys.path
for rbf0_index, so the import is one line; no test calls same_output_path, so the name goes with the
duplication. No behaviour change on Windows, macOS or a case-sensitive Linux filesystem.

Tested

  • tests/test_rbf0_tree.py: 37 passed, 1 skipped, 17 subtests passed.
  • python -I tools/rbf0_tree.py --help: prints its usage (the import works under -I).
  • python -m compileall -q tools/rbf0_tree.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:26 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1214) `breachato:rbf0-tree-shared-report-path` → `main` · +5 −13 · 1 files · 1 commits · open Claimed in the coordination issue as: RBF0-TREE-SHARED-REPORT-PATH (https://git.gtahub.st/github/ubiquitarianism--leonida/issues/14) Depends on: none Fixes: none ### What and why `tools/rbf0_tree.py` derived report-path equality itself in `same_output_path` (`:680`, realpath + normcase + samefile) and asked it at its four output guards: `out` against `--csv` (`:702`), `out` and `--csv` against the source file (`:706`), `out` and `--csv` against a stream in the carve folder (`:717`), and `--xml` against the source folder (`:719`). That is the one 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 (~70 tools already import it; #1084 does the same for `anim_clips`). The private copy was also missing something the shared helper has: its folding-volume probe (`same_name_on_folding_volume`). On a Linux mount that ignores case (vfat, exFAT, CIFS) `normcase` folds nothing and `pathconf` answers only on macOS, so `out.json` and `out.JSON` passed as two report paths, and `--csv` could replace the JSON report or a stream in the carve folder the decode was about to read. The duplicated logic goes (5 insertions, 13 deletions). The tool already puts its own folder on `sys.path` for `rbf0_index`, so the import is one line; no test calls `same_output_path`, so the name goes with the duplication. No behaviour change on Windows, macOS or a case-sensitive Linux filesystem. ### Tested - `tests/test_rbf0_tree.py`: **37 passed, 1 skipped**, 17 subtests passed. - `python -I tools/rbf0_tree.py --help`: prints its usage (the import works under `-I`). - `python -m compileall -q tools/rbf0_tree.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:07 +00:00
Author
Owner

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

Reviewed 7e0adef: ran tests/test_rbf0_tree.py in the sandbox on both trees (38 OK each) plus
test_report_paths.py and test_report_path_case.py (the shared helper's own suites) here; a probe of
16 path pairs and five main() guard decisions behaves identically to main on this machine, and the
intended case-folding-volume refusal is described correctly but not reproducible without such a
mount. No findings. Suggestion: add rbf0_tree to SHARED in tests/test_report_paths.py so the
no-private-copy test covers it too.
AI-assisted review.

Recommendation: Merge

**@⁠PierreEbele** on GitHub · 2026-11-25 07:10 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1214#issuecomment-7155573072) Reviewed 7e0adef: ran tests/test_rbf0_tree.py in the sandbox on both trees (38 OK each) plus test_report_paths.py and test_report_path_case.py (the shared helper's own suites) here; a probe of 16 path pairs and five main() guard decisions behaves identically to main on this machine, and the intended case-folding-volume refusal is described correctly but not reproducible without such a mount. No findings. Suggestion: add rbf0_tree to SHARED in tests/test_report_paths.py so the no-private-copy test covers it too. 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/1214/head:github-bot/gh-1214'
git switch 'github-bot/gh-1214'

Merge

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