Typed intent graphs for engineering work — convert prompts into validated DAGs of intents, features, tasks, tests, and edges, then store, query, and serve them from Rust, HTTP, or MCP.
//! Canonical-map field validation on edges.
usecrate::{ValidationError, ValidationResult};useagileplus_domain::intent_graph::*;/// Validate canonical_map fields on edges.
/// Checks that `direction` is not set without `link_type`.
pubfnvalidate_canonical_map(graph:&IntentGraph)-> ValidationResult{letmut errors =Vec::new();for edge in&graph.edges {ifletSome(cm)=&edge.canonical_map {if cm.link_type.is_none()&& cm.direction.is_some(){
errors.push(ValidationError::CanonicalMapError(format!("Edge {} has canonical_map.direction without link_type",
edge.id
)));}}}if errors.is_empty(){Ok(())}else{Err(errors)}}