Integration/rbf0 report paths #1346

Merged
leonida/mandy
xel1uz merged 6 commits from integration/rbf0-report-paths into main 2026-12-02 12:14:00 +00:00

Pull request successfully merged and closed

xel1uz commented 2026-11-24 22:06:54 +00:00

Claimed in the coordination issue as: RBF0-TREE-SHARED-REPORT-PATH and RBF0-INDEX-SHARED-REPORT-PATH (both originally claimed by @breachato).

Depends on: #1214 and #1227. This branch includes @breachato's commits from both PRs.

What and why

On a case-insensitive volume mounted in Linux, rbf0_tree could accept tree.json as the JSON output and TREE.JSON as the CSV output. Both names resolved to the same file, so the CSV replaced the JSON. rbf0_index could likewise write a report to carve/INDEX.JSON, the path reserved for its index.json manifest.

#1214 and #1227 use the shared same_report_path helper in the two CLIs. This PR adds an end-to-end test for each tool. Each test starts before the output exists. On a case-insensitive filesystem the command must exit 2 before writing. On a case-sensitive filesystem the two names are valid and the test checks the resulting output.

Tested

Tested commit: e4c409e204787ff86b2f763dc9152ce22f28efad.

  • Reproduced both bugs on the original code using WSL with a Windows-backed volume (/mnt/c). Both commands returned 0 when they should have refused the paths. On the combined branch, both returned 2 and left the output absent.
  • Ran tests/test_rbf0_tree.py, tests/test_rbf0_index.py, tests/test_report_paths.py, and tests/test_rbf0_index_short_continuation.py with python -I. On Ubuntu's native filesystem, all 92 tests passed. On native Windows, 91 passed and one was skipped.
  • Both new regression tests also passed on /mnt/c. A separate existing permission-bit test on that mount expected 0644 and observed 0777; it failed on the original code and the combined branch.

GPUs tested: n/a. These are filesystem and CLI tests using synthetic input.

AI-assisted: yes, OpenAI Codex.

Checklist

  • Based on main at 0b45fdc2. Verified a clean merge against upstream main at 4a50cafc.
  • One topic: report-path collisions in the two RBF0 tools.
  • No game data, keys or decryption. scripts/check_no_game_data.py passed on all four changed files.
  • Translator contract table: n/a. This changes two report writers and their tests.
Claimed in the coordination issue as: [RBF0-TREE-SHARED-REPORT-PATH](https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7143541315) and [RBF0-INDEX-SHARED-REPORT-PATH](https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7143809247) (both originally claimed by @breachato). Depends on: #1214 and #1227. This branch includes @breachato's commits from both PRs. ### What and why On a case-insensitive volume mounted in Linux, `rbf0_tree` could accept `tree.json` as the JSON output and `TREE.JSON` as the CSV output. Both names resolved to the same file, so the CSV replaced the JSON. `rbf0_index` could likewise write a report to `carve/INDEX.JSON`, the path reserved for its `index.json` manifest. #1214 and #1227 use the shared `same_report_path` helper in the two CLIs. This PR adds an end-to-end test for each tool. Each test starts before the output exists. On a case-insensitive filesystem the command must exit 2 before writing. On a case-sensitive filesystem the two names are valid and the test checks the resulting output. ### Tested Tested commit: `e4c409e204787ff86b2f763dc9152ce22f28efad`. - Reproduced both bugs on the original code using WSL with a Windows-backed volume (`/mnt/c`). Both commands returned 0 when they should have refused the paths. On the combined branch, both returned 2 and left the output absent. - Ran `tests/test_rbf0_tree.py`, `tests/test_rbf0_index.py`, `tests/test_report_paths.py`, and `tests/test_rbf0_index_short_continuation.py` with `python -I`. On Ubuntu's native filesystem, all 92 tests passed. On native Windows, 91 passed and one was skipped. - Both new regression tests also passed on `/mnt/c`. A separate existing permission-bit test on that mount expected `0644` and observed `0777`; it failed on the original code and the combined branch. GPUs tested: n/a. These are filesystem and CLI tests using synthetic input. AI-assisted: yes, OpenAI Codex. ### Checklist - [x] Based on `main` at `0b45fdc2`. Verified a clean merge against upstream `main` at `4a50cafc`. - [x] One topic: report-path collisions in the two RBF0 tools. - [x] No game data, keys or decryption. `scripts/check_no_game_data.py` passed on all four changed files. - Translator contract table: n/a. This changes two report writers and their tests.
whoalin1 commented 2026-11-24 23:40:35 +00:00

Verified on Windows host (AI-assisted review), commit e4c409e20.

  • python -I tests/test_rbf0_index.py: 29 tests OK (includes the new case-variant manifest-vs-report test — on NTFS the case-folding branch is real, not skipped).
  • python -I tests/test_rbf0_tree.py: 39 tests OK, 1 skip (pre-existing).
  • compileall on tools/rbf0_index.py, tools/rbf0_tree.py, tools/report_paths.py clean.
  • The change is a pure refactor: both tools drop their local same_output_path copies and call the shared tools/report_paths.same_report_path (already on main). Behaviour on Windows is covered by the new tests since NTFS folds case.

Verdict: LGTM, no issues found.

Verified on Windows host (AI-assisted review), commit e4c409e20. - `python -I tests/test_rbf0_index.py`: 29 tests OK (includes the new case-variant manifest-vs-report test — on NTFS the case-folding branch is real, not skipped). - `python -I tests/test_rbf0_tree.py`: 39 tests OK, 1 skip (pre-existing). - `compileall` on tools/rbf0_index.py, tools/rbf0_tree.py, tools/report_paths.py clean. - The change is a pure refactor: both tools drop their local `same_output_path` copies and call the shared `tools/report_paths.same_report_path` (already on main). Behaviour on Windows is covered by the new tests since NTFS folds case. Verdict: LGTM, no issues found.
OreoFR commented 2026-11-28 21:49:04 +00:00

Verified by OreoFR

  • Base: main 3408969a7 + PR head e4c409e20
  • Test: python -I tests/test_rbf0_index.py tests/test_rbf0_tree.py
  • Red on main: 31 + 39 OK (1 skipped)
  • Green with the PR: same
  • 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).

**Verified by OreoFR** - Base: main `3408969a7` + PR head `e4c409e20` - Test: `python -I tests/test_rbf0_index.py tests/test_rbf0_tree.py` - Red on main: 31 + 39 OK (1 skipped) - Green with the PR: same - 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 01:31:17 +00:00

Independent verification on Windows 11 (10.0.26200, x64, NTFS) with e4c409e204 merged onto origin/main (53b77df14f, 0 merge conflicts, 4 files changed +49/-26), tested under both Python 3.12.10 and Python 3.14.5:

  • Suite results on case-folding NTFS:
    • python -I -B tests/test_rbf0_index.py: Ran 31 tests, OK on Python 3.12.10 (1.73 s) and Python 3.14.5 (2.23 s), executing the real folds_case == True branch in test_new_report_with_a_case_variant_of_the_carve_manifest.
    • python -I -B tests/test_rbf0_tree.py: Ran 39 tests, OK (skipped=1) on Python 3.12.10 (1.77 s) and Python 3.14.5 (2.34 s), executing the real case-folding branch in test_new_json_and_csv_paths_that_differ_only_in_case.
  • Context on NO RED on native Windows: on os.name == "nt", origin/main's local same_output_path() already folded case via os.path.normcase(os.path.realpath(...)); replacing both copies with report_paths.same_report_path() deduplicates the helper and extends pre-creation case-collision detection to POSIX hosts mounting case-insensitive filesystems (where os.path.normcase is a no-op).
  • Hygiene: git diff --check, python -I -m compileall -q, and python -I scripts/check_no_game_data.py across all 4 touched files exited 0.

AI-assisted.

Independent verification on Windows 11 (`10.0.26200`, x64, NTFS) with `e4c409e204` merged onto `origin/main` (`53b77df14f`, `0` merge conflicts, `4` files changed `+49/-26`), tested under both `Python 3.12.10` and `Python 3.14.5`: - **Suite results on case-folding NTFS**: - `python -I -B tests/test_rbf0_index.py`: `Ran 31 tests`, `OK` on `Python 3.12.10` (`1.73 s`) and `Python 3.14.5` (`2.23 s`), executing the real `folds_case == True` branch in `test_new_report_with_a_case_variant_of_the_carve_manifest`. - `python -I -B tests/test_rbf0_tree.py`: `Ran 39 tests`, `OK (skipped=1)` on `Python 3.12.10` (`1.77 s`) and `Python 3.14.5` (`2.34 s`), executing the real case-folding branch in `test_new_json_and_csv_paths_that_differ_only_in_case`. - **Context on `NO RED` on native Windows**: on `os.name == "nt"`, `origin/main`'s local `same_output_path()` already folded case via `os.path.normcase(os.path.realpath(...))`; replacing both copies with `report_paths.same_report_path()` deduplicates the helper and extends pre-creation case-collision detection to POSIX hosts mounting case-insensitive filesystems (where `os.path.normcase` is a no-op). - **Hygiene**: `git diff --check`, `python -I -m compileall -q`, and `python -I scripts/check_no_game_data.py` across all 4 touched files exited `0`. AI-assisted.
MoonEyes commented 2026-11-29 17:09:10 +00:00

Tested e4c409e20 merged (no commit) with main 4364a4fa6: Python 3.12, Windows 11 10.0.26300, CPU only.

  • tests/test_rbf0_index.py (31 OK) and tests/test_rbf0_tree.py (39 OK, 1 skipped) pass with this PR, and also with tools/rbf0_index.py and tools/rbf0_tree.py back to main. No red: which case fails without the fix?

AI-assisted (Claude Code).

Tested `e4c409e20` merged (no commit) with `main` `4364a4fa6`: Python 3.12, Windows 11 10.0.26300, CPU only. - `tests/test_rbf0_index.py` (31 OK) and `tests/test_rbf0_tree.py` (39 OK, 1 skipped) pass with this PR, and also with `tools/rbf0_index.py` and `tools/rbf0_tree.py` back to `main`. No red: which case fails without the fix? AI-assisted (Claude Code).
aslan2142 reviewed 2026-12-01 11:35:54 +00:00
aslan2142 left a comment
No description provided.
This PR is stacked on unmerged base PRs `#1214` and `#1227` (both still open and conflicting with `main`) and has no CI run yet. Please wait for `#1214` and `#1227` to land, then rebase so this PR carries only the integration tests in `tests/test_rbf0_index.py` and `tests/test_rbf0_tree.py` with a green CI run. *(AI-assisted review.)*
MoonEyes commented 2026-12-02 11:09:41 +00:00

For information: this pull request is carried in #3106, which merges your head e4c409e20 (your commits are kept) into current main and keeps only your two case-variant tests, as aslan2142's review asked: main already has newer report-path guards in both tools, so your tool changes are not taken. If you rebase this one yourself, say so and #3106 can be closed.

AI-assisted (Claude Code).

For information: this pull request is carried in #3106, which merges your head `e4c409e20` (your commits are kept) into current `main` and keeps only your two case-variant tests, as aslan2142's review asked: `main` already has newer report-path guards in both tools, so your tool changes are not taken. If you rebase this one yourself, say so and #3106 can be closed. AI-assisted (Claude Code).
Sign in to join this conversation.
No description provided.