Skip to main content

Module graph

Module graph 

Source

Structs§

DefinitionText
Source-text capture for a node — signature, body slice, preceding doc-comment, and byte range into the original file. Filled during pass 1 from the tree-sitter node’s byte range; cheap (no extra parsing).
Edge
A directed relationship between two nodes.
GraphDiff
Incremental change set produced by the indexer after each commit. Applying a GraphDiff to the store brings the persisted graph up to date.
LldLabels
LLD annotations added during pass-2 analysis. All fields are optional because pass 2 runs asynchronously — nodes are queryable before annotations arrive.
Node
A single named entity in the knowledge graph.
NodeId
Stable, globally unique node identifier. UUID v4 assigned at parse time.
NodeMetadata
Per-node metadata collected during pass-1 (structural) indexing.
Span

Functions§

find_import_cycles
Find import cycles via Tarjan’s SCC over EdgeKind::Imports edges. Returns one Vec<String> (node IDs) per cycle; cycles of size 1 (self-loops) are excluded.
in_degree_by_calls
Count inbound Calls edges per destination node id. Shared by gitcortex-mcp (centrality/clustering/tour) and gitcortex-viz so both surfaces always use the same algorithm and cannot drift.