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 edge;
32mod graph;
33mod query;
34mod ranking;
35
36pub use builder::GraphBuilder;
37pub use edge::{Edge, EdgeKind, GraphEdge};
38pub use graph::ArborGraph;
39pub use query::{DependentInfo, ImpactResult, NodeInfo, QueryResult};
40pub use ranking::{compute_centrality, CentralityScores};