Objective
Implement JSON Schema conditionals to enforce that command triggers cannot be used with certain event types (issues, issue_comment, pull_request, pull_request_review_comment).
Context
This addresses Issue #4 from discussion #2969. The compiler enforces this rule at runtime (pkg/workflow/compiler.go:1221), but the schema doesn't validate it. The MCP schemas already use JSON Schema conditionals correctly as a "gold standard" - this task applies that pattern to the main schema.
Approach
- Study the conditional pattern used in
pkg/parser/schemas/mcp_config_schema.json
- Add
if/then/else or not conditionals to main_workflow_schema.json
- Enforce that when
on.command is present, the conflicting events cannot be used
- Add clear error messages in schema annotations
Files to Modify
pkg/parser/schemas/main_workflow_schema.json - Add conditionals for command conflicts
Example Pattern
{
"if": {
"properties": {
"on": {"properties": {"command": {"type": "object"}}}
}
},
"then": {
"not": {
"properties": {
"on": {
"anyOf": [
{"required": ["issues"]},
{"required": ["issue_comment"]},
{"required": ["pull_request"]},
{"required": ["pull_request_review_comment"]}
]
}
}
}
}
}
Reference Files
pkg/workflow/compiler.go:1221 - Runtime enforcement logic
pkg/parser/schemas/mcp_config_schema.json - Gold standard conditional examples
Acceptance Criteria
AI generated by Plan Command for discussion #2969
Objective
Implement JSON Schema conditionals to enforce that command triggers cannot be used with certain event types (issues, issue_comment, pull_request, pull_request_review_comment).
Context
This addresses Issue #4 from discussion #2969. The compiler enforces this rule at runtime (
pkg/workflow/compiler.go:1221), but the schema doesn't validate it. The MCP schemas already use JSON Schema conditionals correctly as a "gold standard" - this task applies that pattern to the main schema.Approach
pkg/parser/schemas/mcp_config_schema.jsonif/then/elseornotconditionals tomain_workflow_schema.jsonon.commandis present, the conflicting events cannot be usedFiles to Modify
pkg/parser/schemas/main_workflow_schema.json- Add conditionals for command conflictsExample Pattern
{ "if": { "properties": { "on": {"properties": {"command": {"type": "object"}}} } }, "then": { "not": { "properties": { "on": { "anyOf": [ {"required": ["issues"]}, {"required": ["issue_comment"]}, {"required": ["pull_request"]}, {"required": ["pull_request_review_comment"]} ] } } } } }Reference Files
pkg/workflow/compiler.go:1221- Runtime enforcement logicpkg/parser/schemas/mcp_config_schema.json- Gold standard conditional examplesAcceptance Criteria
make buildandmake testsuccessfullyRelated to [Schema Consistency] 🔍 Schema Consistency Check - Required Fields & Error Documentation Gap (Nov 2, 2025) #2969