compact-never-exceeds-budget

IN premise

`compact()` guarantees the returned string's estimated token count (chars/4) does not exceed the `budget` parameter, enforced by pre-checking every line addition against remaining space.

Summary

The compaction function enforces a hard ceiling on output size by checking each line against the remaining token budget before including it, so callers can trust that the result will never blow past the limit they specified. This matters because downstream consumers can safely allocate context windows knowing the compacted output will fit within the requested bounds.

Dependents

These beliefs depend on this one:

Details

Sourceentries/2026/04/29/reasons_lib-compact.md