Expand description
Single memory capacity manager (#995 Phase 2).
One reclaim formula and one generic, archive-backed, hysteresis reclaim used
by every store. Replaces the duplicated reclaim_target_capacity and the
per-store hard drops (history drain, procedure/pattern truncate): eviction is
now lossless everywhere because the dropped tail is archived (and restorable)
before removal.
Functionsยง
- reclaim_
preview - How many items a
reclaim_storewould archive for a store atlen, without touching the store or the archive. Powers dry-run previews (#995 Phase 6). - reclaim_
store - Generic, archive-backed, hysteresis reclaim.
- reclaim_
target - Live count to settle at after a reclaim: drop
ceil(max * headroom_pct)items so a busy store keeps real headroom instead of churning right at its cap.headroom_pct = 0.25reproduces the priormax - ceil(max/4)target byte-for-byte. - should_
reclaim - Whether a store at
lenshould reclaim now. Hysteresis: trigger only at/above the cap rather than continuously keeping N% free, so a store does not reclaim on every write once it nears capacity.