Skip to main content

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§

AffectedNode
A node affected by a change to the target.
AnalysisWarning
Warnings about analysis limitations
ArborGraph
The code relationship graph.
CentralityScores
Stores centrality scores after computation.
ConfidenceExplanation
Reasons explaining the confidence level
ContextNode
A node included in the context slice.
ContextSlice
Result of a context slicing operation.
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.
HeuristicsMatcher
Pattern matchers for different frameworks and languages
ImpactAnalysis
Complete impact analysis result.
ImpactResult
Result of an impact analysis query.
NodeInfo
Basic information about a node.
QueryResult
Result of a context query.
SearchIndex
An inverted index for fast substring search.
UncertainEdge
An edge that might exist at runtime but cannot be proven statically

Enums§

ConfidenceLevel
Confidence level for an analysis result
EdgeKind
The type of relationship between two code entities.
ImpactDirection
Direction of impact from the target node.
ImpactSeverity
Severity of impact based on hop distance from target.
NodeRole
Node role classification
TruncationReason
Reason for stopping context collection.
UncertainEdgeKind
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.