Class: GraphValidator
Defined in: packages/agentos/src/orchestration/compiler/Validator.ts:59
Static validator for compiled execution graphs.
Runs a suite of structural checks against a CompiledExecutionGraph:
- Cycle detection — rejects cyclic graphs when
requireAcyclicis notfalse. - Unreachable nodes — warns when one or more nodes cannot be reached from
__START__. - Edge reference integrity — errors when an edge's source/target names a non-existent node
(ignoring the sentinel values
__START__and__END__). - Entry point — errors when no edge originates from
__START__. - Exit point — errors when no edge terminates at
__END__.
Example
const result = GraphValidator.validate(graph, { requireAcyclic: true });
if (!result.valid) {
throw new Error(result.errors.join('\n'));
}
Constructors
Constructor
new GraphValidator():
GraphValidator
Returns
GraphValidator
Methods
validate()
staticvalidate(graph,options?):ValidationResult
Defined in: packages/agentos/src/orchestration/compiler/Validator.ts:69
Validates a compiled execution graph.
Parameters
graph
The CompiledExecutionGraph produced by a compiler pass.
options?
Optional validation flags.
requireAcyclic?
boolean
When true (the default) any cycle is treated as an error.
Pass false to allow cyclic graphs (e.g. iterative agent loops).
Returns
A ValidationResult describing errors and warnings found.