Skip to main content

arbor_graph/
lib.rs

1//! Arbor Graph - Code relationship management
2//!
3//! This crate manages the graph of code entities and their relationships.
4//! It provides fast lookups, traversals, and centrality scoring for
5//! prioritizing context in AI queries.
6//!
7//! # Architecture
8//!
9//! The graph uses petgraph internally with additional indexes for:
10//! - Name-based lookups
11//! - File-based grouping (for incremental updates)
12//! - Kind-based filtering
13//!
14//! # Example
15//!
16//! ```no_run
17//! use arbor_graph::ArborGraph;
18//! use arbor_core::{CodeNode, NodeKind};
19//!
20//! let mut graph = ArborGraph::new();
21//!
22//! // Add nodes from parsing
23//! let node = CodeNode::new("validate", "UserService.validate", NodeKind::Method, "user.rs");
24//! let id = graph.add_node(node);
25//!
26//! // Query the graph
27//! let matches = graph.find_by_name("validate");
28//! ```
29
30mod builder;
31mod confidence;
32mod diff;
33mod edge;
34mod graph;
35mod heuristics;
36mod impact;
37mod query;
38mod ranking;
39mod search_index;
40mod slice;
41
42pub mod store;
43pub mod symbol_table;
44
45pub use search_index::SearchIndex;
46
47pub use builder::GraphBuilder;
48pub use confidence::{ConfidenceExplanation, ConfidenceLevel, NodeRole};
49pub use diff::{
50    changed_node_ids, compute_blast_radius, node_matches_changed_file, BlastRadiusSummary,
51};
52pub use edge::{Edge, EdgeKind, GraphEdge};
53pub use graph::{ArborGraph, NodeId};
54pub use heuristics::{
55    detect_analysis_limitations, AnalysisWarning, HeuristicsMatcher, UncertainEdge,
56    UncertainEdgeKind,
57};
58pub use impact::{AffectedNode, ImpactAnalysis, ImpactDirection, ImpactSeverity};
59pub use query::{DependentInfo, ImpactResult, NodeInfo, QueryResult};
60pub use ranking::{compute_centrality, compute_centrality_warm, CentralityScores};
61pub use slice::{ContextNode, ContextSlice, TruncationReason};
62pub use store::{GraphStore, StoreError};
63pub use symbol_table::SymbolTable;