Skip to content

Integration/rbf0 report paths - #1346

Open
xel1uz wants to merge 6 commits into
ProjectLeonida:mainfrom
xel1uz:integration/rbf0-report-paths
Open

xel1uz wants to merge 6 commits into
ProjectLeonida:mainfrom
xel1uz:integration/rbf0-report-paths

Conversation

@xel1uz

@xel1uz xel1uz commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

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.

@whoalin1

Copy link
Copy Markdown
Contributor

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

  • 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

OreoFR commented Nov 28, 2026

Copy link
Copy Markdown
Collaborator

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

zmasi commented Nov 29, 2026

Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
Collaborator

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 aslan2142 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants