pub trait GraphStore {
// Required methods
fn get_node(&self, hash: &str) -> Option<GraphNode>;
fn get_node_by_id(&self, id: u64) -> Option<GraphNode>;
fn get_edges(
&self,
node_id: u64,
direction: EdgeDirection,
) -> Vec<GraphEdge>;
fn get_module_profile(&self, module_id: u64) -> Option<ModuleProfile>;
fn get_nodes_in_file(&self, file_path: &str) -> Vec<GraphNode>;
fn get_all_modules(&self) -> Vec<GraphNode>;
fn update_nodes(
&mut self,
changes: Vec<NodeChange>,
) -> Result<(), GraphError>;
fn update_edges(
&mut self,
changes: Vec<EdgeChange>,
) -> Result<(), GraphError>;
fn get_previous_hashes(&self, node_id: u64) -> Vec<String>;
fn find_modules_by_prefix(
&self,
prefix: &str,
exclude_file: &str,
) -> Vec<ModuleProfile>;
fn find_nodes_by_name(
&self,
name: &str,
kind: &str,
exclude_file: &str,
) -> Vec<GraphNode>;
}Expand description
FROZEN CONTRACT — GraphStore trait.
Agent A owns this interface. Agents B and C consume it. Do NOT modify this trait signature without coordination.
Required Methods§
Sourcefn get_node_by_id(&self, id: u64) -> Option<GraphNode>
fn get_node_by_id(&self, id: u64) -> Option<GraphNode>
Look up a node by its internal ID.
Sourcefn get_edges(&self, node_id: u64, direction: EdgeDirection) -> Vec<GraphEdge>
fn get_edges(&self, node_id: u64, direction: EdgeDirection) -> Vec<GraphEdge>
Get edges connected to a node in the specified direction.
Sourcefn get_module_profile(&self, module_id: u64) -> Option<ModuleProfile>
fn get_module_profile(&self, module_id: u64) -> Option<ModuleProfile>
Get the module profile for a given module node.
Sourcefn get_nodes_in_file(&self, file_path: &str) -> Vec<GraphNode>
fn get_nodes_in_file(&self, file_path: &str) -> Vec<GraphNode>
Get all nodes in a specific file.
Sourcefn get_all_modules(&self) -> Vec<GraphNode>
fn get_all_modules(&self) -> Vec<GraphNode>
Get all module-type nodes in the graph.
Sourcefn update_nodes(&mut self, changes: Vec<NodeChange>) -> Result<(), GraphError>
fn update_nodes(&mut self, changes: Vec<NodeChange>) -> Result<(), GraphError>
Apply a batch of node changes (add, update, remove).
Sourcefn update_edges(&mut self, changes: Vec<EdgeChange>) -> Result<(), GraphError>
fn update_edges(&mut self, changes: Vec<EdgeChange>) -> Result<(), GraphError>
Apply a batch of edge changes (add, remove).
Sourcefn get_previous_hashes(&self, node_id: u64) -> Vec<String>
fn get_previous_hashes(&self, node_id: u64) -> Vec<String>
Get previous hashes for rename tracking.
Sourcefn find_modules_by_prefix(
&self,
prefix: &str,
exclude_file: &str,
) -> Vec<ModuleProfile>
fn find_modules_by_prefix( &self, prefix: &str, exclude_file: &str, ) -> Vec<ModuleProfile>
Find modules whose function_name_prefixes contain the given prefix, excluding modules in the specified file. Used by W001 placement check.