Expand description
Five-stage progressive compaction (DESIGN.md §9), borrowed from Claude Code.
DefaultCompactor is purely structural — it doesn’t call a model. Stage 3
(Microcompact) and Stage 5 (AutoCompact) would normally invoke a cheap LLM;
here we collapse content into terse summaries so the framework can run
offline. Wire a ModelBackedCompactor later if you want semantic summaries.
Structs§
- Default
Compactor - Heuristic compactor — operates on the structure of the context only.
- Model
Backed Compactor - Compactor that calls an LLM for the inferential stages and falls back to
DefaultCompactor’s structural strategies for the computational ones.
Constants§
- CALIBRATION_
KEY Context::metadatakey under which the loop stores a calibration factor — the ratio of the model’s real reportedinput_tokensto this compactor’s char-based estimate on the previous turn.budget()multiplies its raw estimate by it, so the trigger auto-aligns to the actual model + language (a fixedtokens_per_charbadly under-counts CJK, over-counts nothing).