Expand description
Streaming JSONL parser for .agentlog files.
Each line of an .agentlog file is one JSON object conforming to the
envelope schema from SPEC §3. This module provides a zero-copy-ish
iterator that yields one Record per line (or a typed error with the
1-based line number where the failure occurred). It does NOT enforce
trace-level invariants like “first record is metadata” or “parents
point backward” — those are enforced by callers that actually need
them (the replay engine, the differ) rather than at parse time.
Structs§
- Parser
- Streaming parser. One instance processes one
.agentlogstream.
Enums§
- Parse
Error - Errors produced by the streaming parser.
Constants§
- DEFAULT_
MAX_ LINE_ BYTES - Maximum bytes per JSONL line. Default covers real agent traces
with long tool outputs + conversational context (observed p99 is
~50 KB per record); the ceiling catches runaway inputs early
rather than OOMing deep inside
read_line. - DEFAULT_
MAX_ TOTAL_ BYTES - Maximum total bytes per trace. Hard cap to prevent a malicious
or truncated file from exhausting memory during a
parse_allcollect. At 1 GB, covers months of production traffic for most agents while still refusing obvious denial-of-service payloads.
Functions§
- parse_
all - Parse an entire
.agentlogstream into aVec<Record>.