Run each CLI with unused paths on the filesystem under test. A folding volume must reject the colliding names before publishing; a case-sensitive one must accept separate reports. AI-assisted.
In tools/rbf0_index.py, scan_dir() mapped rows by offset in a dict and assigned non-hex names offset=len(entries), so colliding offsets silently dropped/duplicated resources or crashed with RbfError when a colliding file was non-RBF0. Also join_resource() only stopped on complete or bad, swallowing subsequent chunks after status==trailing. Place unnamed files past max hex offset, look up row bytes by row identity, stop joining when status != truncated (matching rbf0_tree), and add synthetic regression tests.
In directory mode the three tools read every regular file, so rpf9_carve.py's index.json (and any
.csv report next to the streams) was counted as a payload, with a made-up offset (its position in
the listing). On a 1.0.2.1 copy's script.rpf carve (1,057 streams) each reported 1,058 files, and
the inflated total was off by exactly the index's size; on the data.rpf carve rbf0_index reported
28,510 streams for 28,509.
page_index.py and navmesh_decode.py already skip .json and .csv; the three tools now do the same.
story_index keeps skipping its own report as well (#712).
Tests: each tool gets a carve folder with three streams plus an index.json and a report.csv, and
must list only the three streams. All three fail on the old code (offsets 3 and 4, or 4 streams
for 2).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 7372a903afdb4b6f1a9aa7df7e60283848965dc5)
--strings was used as a slice bound, so --strings -1 dropped the last string
of every resource's sample (and -N the last N) and still exited 0. A negative
count is now an argparse-style error (exit 2) before any index is written.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A missing source file ended in a FileNotFoundError traceback from os.path.getsize.
It now exits 1 with "<source>: No such file or directory", like the existing
"empty file" message. An --out in a folder that doesn't exist, or one that is a
folder, used to fail only after the whole archive had been scanned; both are now
usage errors (exit 2) before the scan starts.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Adds the #283 argparse validators to anim_index, rbf0_index, restofworld_index and rpf9_carve: --start >= 0, --limit >= 1 (decimal or 0x hex), and --max-inflate >= 1 in restofworld_index. Bad ranges now exit 2 before any scan or output instead of silently scanning everything, less, or nothing. Synthetic CLI tests in all four test files; docs notes for each tool.
New item claimed in #156. AI-assisted (OpenCode).
1,263 RBF0 resources parse to their exact last byte under the measured record grammar: 1,243 single-stream and 20 multi-chunk, 1,260 with the FB FF 01 00 prologue and 64-bit scalars, 3 without it and 32-bit scalars. No section directory or name-hash table exists. The anim.rpf rig-set blob is the same format with a different root schema.
tools/rbf0_index.py indexes an RPF9 data area or a carved directory and writes CSV/JSON; tests/test_rbf0_index.py builds synthetic headers only. No game data is added.