Skip to main content

Module cache

Module cache 

Source

Structs§

CacheEntry
A cached file read: zstd-compressed content, hash, token count, and access metadata.
CacheStats
Aggregated cache statistics: hits, reads, and token savings.
SessionCache
In-memory file cache with segmented LRU eviction (probationary vs protected), file references, and cross-file dedup.
SharedBlock
A block shared across multiple files, identified by its canonical source.
StoreResult
Result of a cache store operation, indicating whether it was a hit or new entry.

Functions§

eviction_scores_rrf
Compute Reciprocal Rank Fusion eviction scores for a batch of cache entries. Each signal (recency, frequency, size) produces an independent ranking. The final score is the sum of 1/(k + rank) across all signals. Higher score = more valuable = keep longer.
file_mtime
is_cache_entry_stale