pub fn validate_policy(policy: &PolicyConfig) -> Result<(), Vec<String>>Expand description
Validates a policy’s node graph structure, collecting all violations.
Enforced rules:
- the policy has a
listenernode (entry) and aclientnode (exit); - every edge endpoint references an existing node;
- each input port has at most one incoming edge, except inputs of
clientanderror-handlernodes, which accept multiple; - no orphan nodes (a node with neither incoming nor outgoing edges;
being named as the policy-level
error_handlercounts as connected); error_handler, if set, references an existing node.
Returns Ok(()) when valid, otherwise Err with one message per
violation (validation does not stop at the first error).