pub struct EntryFeatures {
pub key: String,
pub size: i64,
pub hit_count: i64,
pub idle_hours: f64,
pub content_hash: Option<String>,
pub committed: bool,
pub compile_time_ms: i64,
pub reclaimable_bytes: Option<i64>,
pub recently_accessed: bool,
pub recently_imported: bool,
}Expand description
The observable state of one cache entry, as seen by an eviction policy.
Deliberately small: it is materialized for every entry in the store on each sweep, so new fields should earn their bytes.
Fields§
§key: String§size: i64§hit_count: i64§idle_hours: f64Hours since last_accessed. May be negative under clock skew; policies
are responsible for clamping (the previous SQL clamped at 0.01).
content_hash: Option<String>Content address of the entry’s artifact set, when known.
committed: bool§compile_time_ms: i64What a miss on this entry would cost to rebuild, in milliseconds
(kunobi-ninja/kache#594). 0 means unknown — either a pre-#594 entry
not yet backfilled, or a compile too fast to register. No policy ships
today that reads this; it is here so a value-aware policy can be
written and shadow-evaluated against the current one.
reclaimable_bytes: Option<i64>Physical bytes evicting this entry would actually free right now:
the sizes of blobs it holds every remaining reference to
(kunobi-ninja/kache#608). Zero for an entry whose blobs are all
shared — evicting it destroys rebuild value and reclaims nothing.
None means unknown (entry not yet backfilled into entry_blobs);
policies fall back to the logical size.
recently_accessed: boolRecent at candidate selection time. GC skips their metadata read and transaction setup; removal checks the grace again for other entries.
recently_imported: boolDelivered by the remote within crate::store::IMPORT_PIN, judged for
an automatic sweep; always false for a sweep the user asked for.
Eviction keeps it (kunobi-ninja/kache#1008).