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 edge;
33mod graph;
34mod heuristics;
35mod impact;
36mod query;
37mod ranking;
38mod search_index;
39mod slice;
40
41pub mod store;
42pub mod symbol_table;
43
44pub use search_index::SearchIndex;
45
46pub use builder::GraphBuilder;
47pub use confidence::{ConfidenceExplanation, ConfidenceLevel, NodeRole};
48pub use edge::{Edge, EdgeKind, GraphEdge};
49pub use graph::{ArborGraph, NodeId};
50pub use heuristics::{
51 detect_analysis_limitations, AnalysisWarning, HeuristicsMatcher, UncertainEdge,
52 UncertainEdgeKind,
53};
54pub use impact::{AffectedNode, ImpactAnalysis, ImpactDirection, ImpactSeverity};
55pub use query::{DependentInfo, ImpactResult, NodeInfo, QueryResult};
56pub use ranking::{compute_centrality, CentralityScores};
57pub use slice::{ContextNode, ContextSlice, TruncationReason};
58pub use store::{GraphStore, StoreError};
59pub use symbol_table::SymbolTable;