Skip to main content

Module semantic_cache

Module semantic_cache 

Source
Expand description

Persistent cache of semantic-backend answers, keyed by call site.

A row is valid only while the caller file’s content hash is unchanged and its context fingerprint still matches (see CachedResolution::context). Only definitive answers are stored; transient failures and “no result” (a cold server answers that while indexing) are retried instead.

Structs§

CachedResolution
One cached semantic answer.

Functions§

lookup_served
lookup for a caller that USES the answer (an edge it writes, a target it names): the row is returned only while every file it derives from is still served — the caller file and each target file (target_file holds several, newline-separated, for implementations). serves is the serve-time check of the opened graph (CodeGraph::serves_file: the file is present inside the project, and under protection the admitted rooted reader returns it now); it is asked per call and nothing is kept here.
store_admitted
store through storage admission (E3), for the writer of an enrichment run: admission is the ONE policy snapshot of that run. The row is persisted only if every text it keeps — caller file, backend, outcome, target file(s), target symbol — passes that snapshot verbatim. Ok(false): withheld, restricted or rewritten by admission; nothing was written and the answer is asked from the backend again like any miss.

Type Aliases§

SiteKey
Call-site key: (caller_file, 1-based line, 0-based byte column, op).