Skip to main content

Module graph_cache

Module graph_cache 

Source
Expand description

Resident graph-index cache (Phase 5 of the efficiency epic).

Materializing a ProjectIndex from the property graph (open SQLite + query files/symbols/edges) on every query that touches the graph (symbol lookups, related hints, impact) is wasteful. This keeps the materialized index resident in RAM keyed by project root, invalidated by the on-disk graph.meta.json fingerprint so a background rebuild is picked up immediately (no TTL wait). Callers that need an owned value get a cheap in-memory clone instead of a SQLite round-trip.

Functionsยง

get_cached
Returns the resident ProjectIndex for project_root, loading from disk only when absent or when the on-disk index file changed. None when no non-empty index exists on disk.
invalidate
Drops the cached graph index for a root (or all roots when None).