Expand description
Strictly lossless repeat collapse for the governor’s R2 rule (governor design v1 §2 R2).
A run of at least MIN_RUN byte-identical consecutive lines becomes the
line once plus a marker line [×N identical lines], where N counts the
whole run. Nothing else changes: no timestamp stripping, no blank-line
removal, no truncation, no reordering, no \r progress folding (folding
progress rewrites drops bytes, so it is not lossless and is left out).
expand inverts collapse exactly. To keep the marker unambiguous,
collapse refuses input that already contains a marker-shaped line or the
header line; the caller then keeps the original. This is deliberately not
log_dedup::compress, which is lossy and stays as it is for ctx_shell.
Structs§
- Collapsed
- The collapse result: the rendered text and how many lines it removed.
Constants§
- HEADER_
PREFIX - First line of a collapsed text, so the model knows the marker semantics.
- MIN_RUN
- Shortest run of identical lines that is collapsed.