Commit Graph

21 Commits

Author SHA1 Message Date
7c245a359b Merge commit 'refs/pr-all/1346' into carry/1346 2026-12-02 10:59:56 +01:00
d1d30cef24 Test case-variant output names in both RBF0 report commands
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.
2026-11-24 22:00:19 +01:00
0f67037d05 rbf0_index: restore write mode before unlink on replace failure and publish mode on Windows (RBF0-INDEX-STAGE-CLEANUP)
agent: yes
AI-assisted: yes
2026-11-24 16:51:11 +03:00
fdcf6351e1 rbf0_index: stage JSON report write via temp file and replace_retry 2026-11-23 21:49:41 +02:00
efb6595024 Merge pull request #3393 from Leo Leahy
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:07:26 -05:00
d6f1df1511 Merge pull request #3202 from Marco Luzzaro
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:07:00 -05:00
76eaa4f0ce rbf0_index: drop unreachable content_started guard on value count and update stack comment 2026-11-22 22:22:24 -03:00
070a187866 Merge commit 'aa2988cc555bad7ecd508b48a702adbb32fe7c95' into fix/rbf0-protect-carve-input
# Conflicts:
#	tools/rbf0_index.py
2026-11-23 00:21:03 +01:00
6c377077a9 Merge pull request #3393 from Leo Leahy 2026-11-22 17:01:50 -05:00
9a2317be66 rbf0_index: record attribute mismatch at content transition so truncated inputs keep it 2026-11-22 17:49:32 -03:00
939554670c rbf0_index: count attribute mismatches once per element and stop consuming attributes after content 2026-11-22 17:24:48 -03:00
5b421a4ad0 Protect RBF0 carve inputs from report overwrites 2026-11-22 20:40:21 +01:00
da37a4dbde rbf0_index: avoid offset collisions in scan_dir and stop joining on trailing status
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.
2026-11-22 17:15:44 +00:00
53061577b2 rbf0_index: reject archive range flags for directory scans 2026-11-22 04:50:02 -03:00
f2a6304080 story/anim/rbf0_index: skip the carver's index.json and .csv reports in a carve folder
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)
2026-11-22 00:33:52 -05:00
b101b57187 rbf0_index.py: a negative --strings is an error, not a slice from the end
--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>
2026-11-22 06:29:21 +01:00
092b028bcd Tools: close archive mmaps on error and reject empty rpf9_names inputs 2026-11-21 22:12:32 -03:00
86d82da20b rbf0_index.py: report a missing source, and check the output path before scanning
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>
2026-11-22 02:47:03 +03:00
fe8cd6bc72 Tools: reject out-of-range --start/--limit in RPF index tools
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).
2026-11-21 16:53:41 -06:00
241b03c9bf docs: note that all multi-chunk RBF0 resources are wide
The three narrow resources are single-stream; also drop a no-op line from the attribute test.
2026-11-21 19:10:11 +00:00
9bc8453baa docs: measured RBF0 composition in data.rpf, with rbf0_index
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.
2026-11-21 19:08:57 +00:00