-
Notifications
You must be signed in to change notification settings - Fork 219
Closed as not planned
Labels
Description
Objective
Implement JSON Schema if/then constraints for conditional field requirements that are currently only enforced at compile time.
Context
Several fields have requirements that depend on other fields' values (e.g., MCP containers need network configuration in strict mode), but these aren't enforced in the schema. Users discover these requirements only through compile errors.
Conditional Requirements to Implement
-
MCP containers in strict mode require network
- If
strict: trueandtools.(tool).containeris present - Then
tools.(tool).networkmust be specified - Code:
pkg/workflow/strict_mode_validation.go
- If
-
Write permissions require safe-outputs in strict mode
- If
strict: trueandpermissionshas write scopes - Then
safe-outputsmust be configured - Code:
pkg/workflow/strict_mode_validation.go:68
- If
-
Sandbox-runtime requires feature flag
- If
sandbox-runtimeis specified - Then specific feature flag must be enabled
- Code:
pkg/workflow/compiler_parse.go
- If
-
UV packages require network access
- If
runtime.uvpackages are specified - Then network configuration must allow PyPI access
- Code:
pkg/workflow/bundler_validation.go
- If
Approach
Use JSON Schema if/then for each conditional:
{
"if": {
"properties": {
"strict": { "const": true },
"tools": {
"patternProperties": {
".*": {
"required": ["container"]
}
}
}
}
},
"then": {
"properties": {
"tools": {
"patternProperties": {
".*": {
"required": ["network"]
}
}
}
}
}
}Files to Modify
pkg/parser/schemas/frontmatter.json- Addif/thenconstraints- After changes, run
make buildto rebuild with embedded schema
Acceptance Criteria
- Schema enforces MCP container network requirement in strict mode
- Schema enforces safe-outputs with write permissions in strict mode
- Schema enforces sandbox-runtime feature flag requirement
- Schema enforces UV package network requirements
- Error messages clearly explain conditional requirements
- Existing valid configurations still pass validation
Testing
Create test workflows violating each conditional and verify schema validation catches them.
Related to #7575
AI generated by Plan Command for discussion #7569
Reactions are currently unavailable