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.
bvh_index, navmesh_index and rbf0_tree give the staging file the destination mode before os.replace. On Windows a read-only destination makes the replace fail and leaves a temp that cannot be unlinked. Restore 0600 in the failure path before unlink, and add regressions that pin the mode reset, old bytes and no leftovers.
The overwrite check only ran when the source was a single file. With a carve folder as the
source:
- out or --csv naming one of its streams replaced that stream with the report;
- --xml on the folder itself wrote the XML files among the streams, and the next run read
them as resources.
All three now stop with one argparse error (exit 2) before anything is decoded. Reports
beside the streams (.json, .csv) and an --xml sub-folder are still allowed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ttpf_mips scan wrote --json after reading every pool, without checking
the path: a pool given as --json (directly or found under a game folder)
was replaced by the report, and a directory or a missing folder ended in
a traceback before the report was printed. Now a --json that is a
directory or one of the pools is refused before the scan, the report is
printed first, its folder is created, and a write that still fails is
one "cannot write" line (exit 2).
rbf0_tree wrote out and --csv after the decode: either naming the source
file replaced it (write_json's atomic os.replace included), and out and
--csv on the same file kept only the CSV. Both are refused up front.
Same checks as navmesh_decode/bvh_index (same_report_path /
same_output_path). Synthetic pools and RBF0 blobs only, no game files.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
_rows() mapped each carve-folder file's offset to its path, so two files with
the same leading hex offset (000000000100-left.bin, -right.bin) both read the
last one. Rows now read the file they were built from.
write_json() opened the report for writing before serializing, so a tree too
deep to serialize (RecursionError) left the previous report truncated. The
JSON is written to a temporary file in the same folder and renamed in; a too
deep tree or an unwritable output is one line on stderr, exit 1.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each element now carries attrs_actual, children and content_count. The JSON summary reports the measured depth and child-count histograms, leaf/empty/text-only counts and parent-child edges. --csv writes one flat row per node with parent, slot and sibling columns. Tests cover sibling order, malformed close tags against the flat parser, tree-shape summary and CSV output. The docs replace the game-name sample trees with aggregate tree shape and a synthetic example.
Preserve a trailing NUL byte in a length-prefixed string instead of treating it as a terminator, overwrite per-resource XML files on a rerun rather than adding -0000 duplicates, and reject a source with no RBF0 start. Add tests for trailing NUL strings, non-finite floats and XML reruns.
Add a stdlib record/tree decoder for the measured RBF0 format. It joins 64 KiB continuations, parses the inline descriptor table, builds element/attribute/content/text trees, and writes JSON plus optional generic XML. Unknown descriptors, record types and malformed framing fail closed with a partial tree. Add synthetic tests and the measured grammar, samples and remaining unknowns to docs/rbf0.md; note the rig-set blob tree result in docs/animation.md.