-
Notifications
You must be signed in to change notification settings - Fork 50
Description
Description
The main workflow schema marks the on field as required ("required": ["on"]), but the runtime does NOT enforce this - it accepts workflows without an on field and generates a default trigger configuration. This is a schema contract violation.
Current State
Schema: pkg/parser/schemas/main_workflow_schema.json
- Declares
onin therequiredarray
Runtime: pkg/workflow/compiler_orchestrator_workflow.go:139
- Does not enforce
onfield presence - Generates default trigger when missing (no error)
- Logs: "No 'on:' setting found, using defaults"
Suggested Changes
Option 1 (Recommended): Align schema with runtime behavior
- Remove
onfrom schema'srequiredarray - Document that
onhas sensible defaults when omitted - Update documentation to clarify default trigger behavior
Option 2: Enforce validation
- Add validation in parser to reject workflows missing
on - Remove default trigger generation from runtime
- Breaking change - requires careful migration
Files Affected
pkg/parser/schemas/main_workflow_schema.json(updaterequiredarray)- Documentation (clarify
onfield default behavior)
Success Criteria
- Schema no longer marks
onas required (Option 1) - OR runtime rejects workflows without
onfield (Option 2) - Schema validation passes:
make build && make test-unit - Existing workflows compile successfully (no breaking changes)
- Documentation updated to clarify behavior
Source
Extracted from Schema Consistency: Runtime Behavior vs Schema Contracts - Jan 29, 2026
Specific finding:
Schema
requiredField Not Enforced:onField⚠️
- Impact: MEDIUM - Schema contract violation
- Schema marks
onas required but runtime doesn't enforce- Runtime generates default trigger configuration when missing
- Recommendation: Remove from required array OR enforce validation
Priority
Medium - Schema should accurately reflect runtime behavior. Not urgent as there's no functional breakage, but causes confusion about API contracts.
AI generated by Discussion Task Miner - Code Quality Improvement Agent
- expires on Feb 7, 2026, 1:28 AM UTC