ContextCompress
Semantic compression for long-running contexts
Mechanism
A memory management primitive that uses Compress to reduce the token footprint of a Context while preserving critical State. It explicitly retains active Constraints and unresolved goals.
Invariants
- Reduces the Context's token footprint by at least `min_reduction`.
- Retains every active Constraint and every unresolved goal.
- Re-evaluates which constraints are active and which goals unresolved on each pass.
Parameters
- min_reduction: type=Ratio, range=(0.0, 1.0), description=Share of the token footprint a pass must remove to count as a compression.
Failure modes
- Silent over-compression: a discarded Constraint surfaces only when a later step violates it.
- Stale activeness: a pass reuses an earlier pass's list of active constraints instead of recomputing it, so a lapsed constraint is preserved and a new one is dropped.
Where this came from
—
Builds on
- Context references
- State references
- Compress references
- Constraint references
Used by
- CapacityPressure references
- DataMinimization references
Identity
- Ref:
ContextCompress#0bf5 - Hash: sema:ContextCompress#mh:SHA-256:0bf5ce89d0ad9cac74bb69f253f06331989714d3c34bb0b385f9674439ce30b0
- Library: bootstrap 0.11.0, root a6a3d1ff0f98
- License: Not stated; check the repository