Expand description
The part of a captured run worth reading when it failed.
amont-agent quiet keeps the whole output in a log file and prints only
this: the failure blocks of the run, then the runner’s own summary. The
heuristic never decides pass or fail (the child’s exit code does); it only
chooses which lines to show.
Hand-written over lowercased lines with word-boundary checks, on purpose:
no regex dependency (docs/plans/2026-10-11-test-output-keeps-its-status.md,
Decisions). The same function exists in amont, which shares no crate with
this one; the golden fixtures in tests/fixtures/excerpt/ are what keep the
two copies saying the same thing.
§Memory
The run’s output can be gigabytes, so the accumulator is fed in chunks and
holds at most 64 KB whatever it is fed: the line being assembled (1 KB), a
ring of the last 40 lines held to 60 KB - bound, and the excerpt itself
(finished blocks plus the block in progress) held to bound.
Structs§
Constants§
- DEFAULT_
BOUND - The excerpt total when
--max-bytesis not given. - MAX_
BOUND - The largest
--max-bytesaccepted.
Functions§
- clean
- Strip ANSI escape sequences and keep what a terminal would show after a carriage return (progress bars rewrite their line).