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§
Structs§
- Affected
Node - A node affected by a change to the target.
- Analysis
Warning - Warnings about analysis limitations
- Arbor
Graph - The code relationship graph.
- Centrality
Scores - Stores centrality scores after computation.
- Confidence
Explanation - Reasons explaining the confidence level
- Context
Node - A node included in the context slice.
- Context
Slice - Result of a context slicing operation.
- Dependent
Info - Information about a dependent node.
- Edge
- An edge in the code graph with location info.
- Graph
Builder - Builds an ArborGraph from parsed code nodes.
- Graph
Edge - A simplified edge for graph export/visualization.
- Heuristics
Matcher - Pattern matchers for different frameworks and languages
- Impact
Analysis - Complete impact analysis result.
- Impact
Result - Result of an impact analysis query.
- Node
Info - Basic information about a node.
- Query
Result - Result of a context query.
- Search
Index - An inverted index for fast substring search.
- Uncertain
Edge - An edge that might exist at runtime but cannot be proven statically
Enums§
- Confidence
Level - Confidence level for an analysis result
- Edge
Kind - The type of relationship between two code entities.
- Impact
Direction - Direction of impact from the target node.
- Impact
Severity - Severity of impact based on hop distance from target.
- Node
Role - Node role classification
- Truncation
Reason - Reason for stopping context collection.
- Uncertain
Edge Kind - Types of uncertain edges
Functions§
- compute_
centrality - Computes centrality scores for all nodes in the graph.
- detect_
analysis_ limitations - Check for common patterns that limit static analysis accuracy
Type Aliases§
- NodeId
- Unique identifier for a node in the graph.