compact-is-pure-function
IN premise
`compact()` performs no I/O, no database access, no mutations, and no side effects; it is a pure transformation from `Network` to `str`.
Summary
The compact function is safe to call anywhere without worrying about hidden effects — it just takes a network structure and returns a string. This means it can be tested trivially, cached freely, and never needs mocking or setup, which makes it a reliable building block for any operation that needs a text representation of the network.
Dependents
These beliefs depend on this one:
- compact-is-deterministic-pure-and-bounded — The compact module produces output that is simultaneously deterministic (pure function with fixed priority ordering), bounded (guaranteed to never exceed the token budget), and self-describing (includes its own token count for auditability).
Details
| Source | entries/2026/04/29/reasons_lib-compact.md |