Skip to main content

Module cache

Module cache 

Source

Modules§

warming

Structs§

CacheEntry
A cached file read: zstd-compressed content, hash, token count, and access metadata.
CacheStats
Aggregated cache statistics: hits, reads, and token savings.
CompressedOutputLru
A fixed-size, access-ordered cache of render variants for one source file.
ReuseSnapshot
Snapshot for the three non-overlapping cache-reuse measurements.
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.

Enums§

ReuseOutcome
The single terminal reuse classification for one eligible cacheable read.
VariantDelivery
#1287: delivery state of one compressed render variant. Absent = no such variant cached; UnknownConversation = stored without a resolvable conversation id (decided by conversation_allows_stub with no delivery id: served only when the caller has no conversation context either, #1909); Conversation = provably delivered to that conversation.

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
full_degradation_threshold
is_cache_entry_stale
is_cache_entry_stale_verified
Staleness with content verification: like is_cache_entry_stale, but when the mtime claims “unchanged”, additionally compares the md5 of the on-disk content against the cached hash.
record_ctx_read_outcome
Record exactly one terminal outcome for a completed ctx_read.
record_search_content_read
Record exactly one content-cache outcome for one eligible search file read.
reuse_snapshot
Return a lock-free point-in-time view of reuse counters.