The tool counts documents it could not parse and prints the count, then returned
0 whatever happened. A corpus with some truncated tails is normal (a tail-cut
carve) and must stay 0, but a run where *no* document parsed looks exactly like
an empty corpus: "0 documents read, 0 roots, 1 not well-formed" with a success
status, which a caller cannot act on.
Report that one case on stderr and return 1, mirroring content_definitions.py,
which returns 1 when an input fails. A partial corpus is unchanged.
🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
Track active type-handler elements by identity instead of suppressing type and extra-attribute counts whenever use_type_handler=False is passed directly, and cover multi-chunk streaming child cleanup in tests.
- Keep Reader.read() aligned with Reader.convert() on root type handlers, type="NULL", attribute conventions, and stats["object"], and detach cleared top-level elements from root via del root[:].
- Match vector elements by float x/y/z/w attributes so vectors with extra attributes retain their tuple value via "$value", while non-vector x/y/z/w attributes are preserved as @x/@y/@z/@w instead of failing _float() or being dropped.
- Avoid double-counting types[t] and stats["extra attributes"] when a registered type handler falls back to reader.convert(el, use_type_handler=False).
Converts RAGE parser XML into plain values by its conventions (value,
x/y/z/w, content arrays, polymorphic type and NULL, ref, Item lists and
keyed maps, extra attributes), with register_root / register_type for
typed handlers. Each top-level field is converted and dropped as it ends.
On the 1.0.2.1 carve of common.rpf: 259 of 267 documents, 111 roots, 317
type classes, 0 conversion errors (counts only). Synthetic tests.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>