Crate arbor_graph

Crate arbor_graph 

Source
Expand description

Arbor Graph - Code relationship management

This crate manages the graph of code entities and their relationships. It provides fast lookups, traversals, and centrality scoring for prioritizing context in AI queries.

§Architecture

The graph uses petgraph internally with additional indexes for:

  • Name-based lookups
  • File-based grouping (for incremental updates)
  • Kind-based filtering

§Example

use arbor_graph::ArborGraph;
use arbor_core::{CodeNode, NodeKind};

let mut graph = ArborGraph::new();

// Add nodes from parsing
let node = CodeNode::new("validate", "UserService.validate", NodeKind::Method, "user.rs");
let id = graph.add_node(node);

// Query the graph
let matches = graph.find_by_name("validate");

Re-exports§

pub use store::GraphStore;
pub use store::StoreError;
pub use symbol_table::SymbolTable;

Modules§

store
symbol_table

Structs§

ArborGraph
The code relationship graph.
CentralityScores
Stores centrality scores after computation.
DependentInfo
Information about a dependent node.
Edge
An edge in the code graph with location info.
GraphBuilder
Builds an ArborGraph from parsed code nodes.
GraphEdge
A simplified edge for graph export/visualization.
ImpactResult
Result of an impact analysis query.
NodeInfo
Basic information about a node.
QueryResult
Result of a context query.

Enums§

EdgeKind
The type of relationship between two code entities.

Functions§

compute_centrality
Computes centrality scores for all nodes in the graph.

Type Aliases§

NodeId
Unique identifier for a node in the graph.