feat(routing): implement WorkflowSpec validator
Task 1.4 COMPLETE ✅ Comprehensive validation system for workflow specifications: - validator.go: Main validator with methods: - NewValidator(kb) - Create validator with knowledge base - ValidateWorkflowSpec(spec) - Validate one-time workflows - ValidateCronWorkflowSpec(spec) - Validate scheduled workflows - validateState(state, path) - Validate individual states - validateDuration(dur) - Validate Go duration strings - validator_cron.go: Cron expression validation: - validateCronExpression(expr) - 5-field cron validation - validateCronField(field, min, max, name) - Individual field validation - Supports: wildcards (*), ranges (0-59), steps (*/5), lists (0,15,30,45) - validator_test.go: 30 comprehensive tests - Valid/invalid workflow specs - State name validation (duplicates, missing) - State transitions (Next field references) - Catch clause validation - Task state validation (activity exists in KB) - Pass/Fail state validation - Timeout format validation - Cron workflow validation - Timezone validation - Cron expression validation - All tests PASS ✅ (39/39 total in routing package) Acceptance criteria met: ✅ Detects invalid workflow specs ✅ Validates state references and transitions ✅ Checks activities exist in knowledge base ✅ Validates timeout durations ✅ Validates cron expressions ✅ Validates timezones ✅ All validation tests pass ✅ Ready for Phase 2 (llm-router) Effort: 3 hours (estimated) Files: validator.go (281 lines) validator_cron.go (50 lines) validator_test.go (367 lines) Phase 1 COMPLETE ✅ - Task 1.1: Types ✅ - Task 1.2: Knowledge Base ✅ - Task 1.3: KB Loader ✅ - Task 1.4: Validator ✅ Total Phase 1 Effort: 10 hours (on track with 8-10 estimate)
This commit is contained in:
+1
-1
@@ -9,6 +9,6 @@ metadata:
|
||||
app.kubernetes.io/name: poimen
|
||||
app.kubernetes.io/component: orchestrator
|
||||
data:
|
||||
GIT_COMMIT: "f03184ad" # Updated automatically by CI/CD
|
||||
GIT_COMMIT: "b17def78" # Updated automatically by CI/CD
|
||||
GIT_BRANCH: "main"
|
||||
DEPLOYMENT_DATE: "2026-08-31"
|
||||
|
||||
Reference in New Issue
Block a user