Understand the cavemem compression contract
mainThe cavemem compression engine is a deterministic, offline system that compresses prose without invoking an LLM. It operates on a specific contract to ensure data integrity:
- Determinism:
compress(x)always produces the same output for the same input and intensity level. - Technical Token Preservation: The tokenizer identifies and protects technical tokens (code, URLs, paths, commands, version numbers, dates, numeric literals, and identifiers) from any transformations. These are preserved byte-for-byte.
- Substantive Round-tripping: While prose content is lossy (removing filler and hedging words),
expand(compress(x))is guaranteed to preserve every technical token exactly as it appeared in the original input.