A stream that starts inside a --limit window but ends past it was counted in carver_streams with
all its stored bytes, so stored + zero_padding + unread could exceed the span (up to 122% on a
2 MiB window of navmeshes.rpf). navmesh_index.py (#766) does not count such a stream; its bytes
inside the window are left to the tail. navmesh_decode now does the same and reports those
streams under past_window / past_window_stored instead of dropping them. Decoding is unchanged: a
resource that starts inside the window is still read to its end.
Real data (counts only), four 2 MiB windows of navmeshes.rpf: byte classes now add up to exactly
the span (main: 121.97%, 119.01%, 100.23%, 103.64%), and streams, stored, inflated, zero_padding
and unread equal navmesh_index.py's on every window.
Tests: the window-limit test now expects 1 carved stream + 1 past_window (main: 2); a new test
ends the window inside a stream and checks nothing is carved and the classes sum to the span.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`--out <the archive>` (and `--csv <the archive>`) opened the input for
writing after the scan and replaced it with the JSON summary, exit 0, no
warning. Refuse the combination up front, as the --out/--csv collision
already is, so the archive is never touched.
The scan finished, then a report path in a folder that did not exist ended
the run in a FileNotFoundError traceback and threw away the summary. Create
the parent folder at write time, as navmesh_index.py already does.
_psin_state() walked the section list and reported a resource complete when
the walk ended exactly at the end of the data. A PSIN header with no section
at all ends there too, so it was counted complete with 0 sections. At least
one section is now required.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>