Expand description
Property Graph Engine — SQLite-backed code knowledge graph.
Stores nodes (File, Symbol, Module) and edges (imports, calls, defines,
exports) extracted by deep_queries + import_resolver. Provides
efficient traversal queries for impact analysis, architecture discovery,
and graph-driven context loading.
Re-exports§
pub use file_catalog::FileCatalogEntry;pub use node::Node;pub use node::NodeKind;pub use semantic_cache::CachedResolution;
Modules§
- file_
catalog - node
- Node types and CRUD operations for graph nodes.
- semantic_
cache - Persistent cache of semantic-backend answers, keyed by call site.
- snapshot
- Versioned, committable graph snapshots — Context-as-Code (GL#451).
Structs§
- Code
Graph - Dependency
Chain - Edge
- Graph
Query - Impact
Result - Property
Graph Meta V1 - Stored
Counts - Row counts of a persisted graph, read for status reporting only.
Enums§
Constants§
- GRAPH_
ENGINE_ VERSION - Property-graph engine generation. Bump whenever edge extraction changes
(e.g. the
type_refedges that connect C#/Java same-namespace consumers to their definers, GH #398) so an existing graph built by an older engine is transparently rebuilt on the next query instead of being served without the new edges. Graphs whosegraph.meta.jsonpredates this stamp deserialize to engine version0, so the first query after an upgrade rebuilds once.
Traits§
- Graph
Source - A graph store as a whole-graph computation reads it — a ranking, a community detection, a rule scan: the rows, and the serve-time source check that decides which of them exist for the computation (G04).
Functions§
- edge_
weight - Weight multiplier per edge kind for impact scoring.
- engine_
outdated truewhen the persisted graph was built by another engine generation thanGRAPH_ENGINE_VERSION— older, NEWER, or before the version stamp existed (missing or unreadable meta) — and must therefore be rebuilt before its edges can be trusted. A newer stamp is what an installation finds after a rollback to an earlier release: that graph holds edges this engine’s rules did not produce and cannot interpret, so it is rebuilt, not read. Callers pair this with a node-count check: an empty graph is rebuilt regardless; a non-empty graph of another generation is rebuilt by this gate.- file_
connectivity - Graph connectivity stats for a file: incoming/outgoing edge counts by kind.
- graph_
dir - Resolve the directory for graph.db and graph.meta.json.
- load_
meta - meta_
path - mirror_
index - Reliable, reusable PG build entry (#682.2): open the project’s graph store,
populate_from_project_indexfromindex, and stampgraph.meta.json. - parse_
symbol_ metadata - Inverse of
symbol_metadata: recover the sourcekindandexportedflag from a symbol node’s metadata JSON. The property-graphNodeonly models a coarseNodeKind, so the precise graph_index kind (function,struct, …) and export flag live in this metadata blob — the provider facade must read them back to surface a lossless symbol (#696 C1). Returns(None, None)for absent/malformed metadata so callers can fall back. - populate_
from_ project_ index - Mirror
indexintograph: file nodes + file catalog, symbol nodes (with line spans + kind/export metadata), and structural edges. Clears the code graph first (preserving provider cross-source edges) so the result is a faithful 1:1 representation of the index. - related_
files - Related files for a given path: direct neighbors via any structural edge, sorted by edge weight (strongest relationship first). Returns (path, weight) pairs.
- stored_
counts - What
project_root’s persisted graph holds, without serving anything from it (#2179). Status readers (doctor,index status) used to rebuild the whole index through the serving surface just to count its files — a source check per catalogued file — and to open the store throughCodeGraph::open, which migrates and creates schema. This opens the existinggraph.dbonly (never creates it), reads no schema it would change (query_only), and waits at mostSTORED_COUNTS_BUSYfor a lock another process holds:Nonewhen there is no graph, its schema is not this engine’s, or it stays busy. - write_
meta
Type Aliases§
- Served
- The serve-time source check of one request, as a traversal takes it: whether the file at a repo-relative path may be used now. One request has one such check, so the walk and the caller’s output filter agree.