39 lines
1.6 KiB
Markdown
39 lines
1.6 KiB
Markdown
---
|
|
id: analysis/template-validation
|
|
name: Implement validateTemplate and validatePreconditions
|
|
status: completed
|
|
depends_on:
|
|
- analysis/type-compat
|
|
- graph/queries
|
|
- schema/edge-attrs
|
|
scope: moderate
|
|
risk: medium
|
|
impact: component
|
|
level: implementation
|
|
---
|
|
|
|
## Description
|
|
|
|
Implement the template validation functions that check workflow templates against operation graphs, and the precondition validation that verifies all required inputs are provided by predecessors.
|
|
|
|
## Acceptance Criteria
|
|
|
|
- [ ] `validatePreconditions(graph: FlowGraph<OperationNodeAttrs, OperationEdgeAttrs>): ValidationError[]` — for each node, checks input required fields are provided by predecessor outputs; returns `ValidationError[]`
|
|
- [ ] `validateTemplate(template: UNode, operationGraph: FlowGraph<OperationNodeAttrs, OperationEdgeAttrs>): AnyValidationError[]` — validates template against operation graph
|
|
- [ ] Template validation checks: (1) all Operation names exist in registry/graph, (2) no cycles in rendered DAG, (3) type compatibility between sequential operations, (4) reachability from start, (5) no orphan nodes
|
|
- [ ] Template validation is advisory — returns warnings AND errors, never throws
|
|
- [ ] Both functions follow the "collect all errors" pattern
|
|
- [ ] Unit tests: valid template returns empty, missing operation, cycle in template, type incompatibility, unreachable nodes, orphan nodes
|
|
|
|
## References
|
|
|
|
- docs/architecture/analysis.md — validatePreconditions, validateTemplate specifications
|
|
- docs/architecture/workflow-templates.md — validation checks
|
|
|
|
## Notes
|
|
|
|
> To be filled by implementation agent
|
|
|
|
## Summary
|
|
|
|
> To be filled on completion |