Skip to main content

code_ranker_plugin_api/
graph.rs

1//! [`Graph`] — what a plugin's `analyze` returns: pure **structure**, nodes +
2//! edges, and nothing computed.
3//!
4//! Derived data is produced centrally afterwards and lives outside this type:
5//! - per-node metrics and cycle membership are written into nodes' `attrs` by id
6//!   during enrichment (in the metrics/graph layer, not in this contract);
7//! - graph-level cycles and averages are computed by the orchestrator and stored
8//!   in the snapshot, not here.
9
10use crate::edge::Edge;
11use crate::node::Node;
12use serde::{Deserialize, Serialize};
13
14#[derive(Debug, Clone, Default, Serialize, Deserialize)]
15pub struct Graph {
16    pub nodes: Vec<Node>,
17    pub edges: Vec<Edge>,
18}