Skip to main content

Module property_graph

Module property_graph 

Source
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;

Modules§

file_catalog
snapshot
Versioned, committable graph snapshots — Context-as-Code (GL#451).

Structs§

CodeGraph
DependencyChain
Edge
GraphQuery
ImpactResult
Node
PropertyGraphMetaV1

Enums§

EdgeKind
NodeKind

Constants§

GRAPH_ENGINE_VERSION
Property-graph engine generation. Bump whenever edge extraction changes (e.g. the type_ref edges 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 whose graph.meta.json predates this stamp deserialize to engine version 0, so the first query after an upgrade rebuilds once.

Functions§

edge_weight
Weight multiplier per edge kind for impact scoring.
engine_outdated
true when the persisted graph was built by an engine older than GRAPH_ENGINE_VERSION — or predates the version stamp entirely (missing or unreadable meta) — and must therefore be rebuilt before its edges can be trusted. Callers pair this with a node-count check: an empty graph is rebuilt regardless; a non-empty-but-outdated graph 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_index from index, and stamp graph.meta.json.
parse_symbol_metadata
Inverse of symbol_metadata: recover the source kind and exported flag from a symbol node’s metadata JSON. The property-graph Node only models a coarse NodeKind, 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 index into graph: 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.
write_meta