A mistyped source path, or a directory passed as one, created <out>/<name> and then failed in FileInfo.Length with an unhandled FileNotFoundException and exit -532462766. Check the source after the argument checks and before Directory.CreateDirectory, print one line to stderr, and exit 2 like the other input errors.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016Nsrb3M85XUG34gwsU9emJ
An unknown first argument fell through every mode branch: it created <outdir>/<source>, printed ok=0 fail=0 skip=0 and exited 0, which make_game reads as a finished stage. Check the mode first, print one usage listing all five modes (audio and xma were missing) and exit 2.
The fixture wrote the resource page counts at 0x88/0x89, which is the
texture descriptor's width field (t+0x38 at t=0x50): width read 257 and
Parse rejected the record (layout 20480 vs allocation 4096), so no entry
reached Export and the committed test failed before any DDS write. Move
the page-count pointer to 0x40 (counts at 0x48, below the descriptor);
the same binary now recovers one texture, hits the blocked DDS write,
withholds manifest.json and exits 1. The test also asserts the DDS is
absent, not only the return code.
Review gaps closed: embedded-texture DDS writes are no longer swallowed
by catch {} (decode failures count like the textures branch, write
failures count into writeFail and fail the run); dictionary-directory
and models _tex directory creation failures return WriteFail=1; a
retryable IOException while reading a resource or decoding (CreateDds)
also counts as a write failure, so a locked source no longer publishes
a manifest with missing files; marker withdrawal goes through
WithdrawMarker, which clears a read-only attribute first and turns any
remaining delete failure into a one-line error with exit 1 instead of a
traceback.
Verified offline: Program.cs compiles 0 warnings/0 errors against the
real Core sources with a BCnEncoder stub (BCnEncoder.Net is not cached
offline, so the DLL build runs in CI); a Python mirror of Recover/
RecoverAtOffsets/TryInflate/LooksLikeDictionary/Parse/ComputeLayout
recovers the committed fixture 1/1 (system 208 B, graphics 4096 B,
pages 1/1, texture 'probe' 4x4, allocation 4096) through both scan
paths, and rejects the pre-fix bytes with the reported mismatch
(layout 20480 != allocation 4096). python -I skip path: 2 skipped, OK.
make_game writes audio/xma.done after rpf9dump xma exits 0. The xma branch
counted failed writes but fell through to the final return, which only
fails for ttpf, so a failed stream was never written on a later run.