Expand description
Pluggable cache admission and eviction policy traits (ADR 040).
The engine owns the store and every safety exemption (pins, probe-holds, deny/takedown). A policy is a pure decision function fed observations: it ranks eligible candidates or classifies an admission, and never reaches into the store.
Re-exports§
pub use lru::AlwaysAdmit;pub use lru::LruEviction;pub use tinylfu::ProbationAdmission;pub use tinylfu::TinyLfuEstimator;pub use tinylfu::TinyLfuEviction;
Modules§
- lru
- Behavior-preserving default policies: recency eviction, unconditional admit.
- sketch
- Count-min frequency sketch keyed directly on BLAKE3 hashes (ADR 040).
- tinylfu
- W-TinyLFU estimator + policies (filled in Stage B, Tasks 5-7).
Structs§
- Admission
Context - Inputs available to an admission decision.
- Eviction
Context - Everything a policy needs to plan one eviction sweep. The engine assembles
it and never interprets the policy’s semantics —
candidatesis already stripped of pins and probe-holds (a deny-listed hash stays a candidate even when pinned: deny wins over pin), andsegmentsis the generichash -> Segmentmembership the engine tracks with no meaning attached. - Eviction
Plan - The single sweep-time decision: what leaves, and what graduates to a new
segment.
LruEvictionreturnspromoteempty.
Enums§
- Admission
Decision - A policy’s admission verdict for a miss about to be served.
- Segment
- Where a freshly admitted blob is stored.
Traits§
- Admission
Policy - Decides whether a miss about to be served is worth keeping, and where.
- Eviction
Policy - Decides what the engine releases when the store is over its target.
- Frequency
Estimator - Decayed frequency estimate shared by admission and eviction.