[Schema Consistency] Schema Consistency Analysis: Conditional Logic & Feature Flags (2025-11-16) #4113
Closed
Replies: 1 comment
-
|
This discussion was automatically closed because it was created by an agentic workflow more than 1 week ago. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
🔍 Schema Consistency Check - 2025-11-16
This analysis focuses on conditional logic and feature flag patterns across the schema, parser implementation, compiler validation, and documentation. The strategy examines how oneOf/anyOf patterns are validated and whether conditional requirements (like engine-specific features) are properly documented and enforced.
Summary
Inconsistencies Found: 7 findings (1 critical, 2 moderate, 4 informational)
Key Discovery: Engine-specific feature requirements are validated at compile-time but completely absent from the JSON schema, preventing IDE/editor tools from warning users during workflow authoring.
Full Analysis Report
Analysis Metadata
Categories Analyzed
✅ Schema → Parser: oneOf pattern handling, conditional validation
✅ Schema → Documentation: oneOf examples, feature descriptions
✅ Parser → Compiler: Feature interaction validation, engine requirements
✅ Schema → Workflows: Real-world usage patterns, conditional configurations
Critical Issues
1. Engine-Specific Feature Requirements Missing from Schema
Severity: 🔴 Critical
Impact: High - Users discover incompatibilities only at compile time, not during authoring
Three engine-specific features are validated in the compiler but have zero schema documentation:
a. HTTP Transport Engine Requirement
Problem: IDE validation cannot warn users that their engine choice doesn't support HTTP MCP tools.
b. max-turns Engine Requirement
Evidence from workflows:
.github/workflows/cloclo.md: usesmax-turns: 100with copilot engine ✅.github/workflows/commit-changes-analyzer.md: usesmax-turns: 100✅c. web-search Tool Engine Requirement
Recommendation: Add engine compatibility markers to schema descriptions:
{ "max-turns": { "type": "string", "pattern": "^[0-9]+$", "description": "Maximum conversation turns. ⚠️ Requires engine with max-turns support (e.g., copilot). Not supported by: codex, custom engines." }, "tools": { "properties": { "(tool-name)": { "properties": { "type": { "enum": ["stdio", "http"], "description": "MCP server transport. ⚠️ HTTP transport requires engine support (e.g., copilot). stdio is universally supported." } } } } } }Files Affected:
pkg/parser/schemas/main_workflow_schema.json- needs compatibility warningspkg/parser/schemas/mcp_config_schema.json- needs transport compatibility docsdocs/src/content/docs/reference/frontmatter.md- should document requirementsModerate Issues
2. Conditional Default Values Not Documented in Schema
Severity: 🟡 Moderate
Impact: Medium - Users rely on trial-and-error to discover resource-specific defaults
Finding: Safe-outputs
maxparameter has different defaults depending on resource type:Schema Status: ❌ Schema defines
maxas optional integer but doesn't document conditional defaultsCurrent schema:
{ "max": { "type": "integer", "description": "Maximum number to create", "minimum": 1 } }Recommended schema:
{ "max": { "type": "integer", "description": "Maximum number to create (default: 1 for issues/discussions/comments/agent-tasks, 3 for labels)", "minimum": 1, "default": 1 } }Code Reference:
pkg/workflow/safe_outputs.go(implementation is consistent, just needs schema documentation)3. Network Configuration Usage Guidance Missing
Severity: 🟡 Moderate
Impact: Medium - Users don't know when to use string vs object format
Finding: Network field supports oneOf pattern (string OR object):
Usage Statistics (from 78 workflows):
Problem: Documentation shows both formats but doesn't explain when to use which:
Recommendation: Add to
docs/src/content/docs/reference/frontmatter.md:Informational Findings (Working Correctly)
4. oneOf Patterns: Excellent Implementation ✅
Finding: 13 fields use oneOf patterns (string OR object) - all working correctly:
Evidence:
resolveSchemaWithOneOf()to provide good autocomplete (defaults to object variant)frontmatter-full.mdexplicitly shows both formats with examplesCode Reference:
pkg/parser/schema.go:638-639(oneOf resolution for autocomplete)No action needed - this is exemplary implementation.
5. Command Event Restrictions: Working as Designed ✅
Finding: Command trigger correctly restricts events to prevent conflicts
Test Coverage:
pkg/workflow/compiler_test.go:591-639Real-World Usage: Workflows correctly use event restrictions:
Schema: Correctly defines
on.command.eventsas oneOf (string OR array) with enum validationNo issues found - conditional validation working perfectly.
6. Safe-Outputs Conditional Defaults: Consistent Implementation ✅
Finding: Default
maxvalues are consistently implemented per resource typeImplementation:
pkg/workflow/safe_outputs.goTesting: Real workflows rely on these defaults:
Issue: Defaults are in code but not schema (see Moderate Issue #2)
No compiler bugs - implementation is solid, just needs schema documentation.
7. Permissions oneOf: String Format Defined but Unused ✅
Finding: Schema defines string shorthand for permissions, but no workflows use it
Schema Definition:
{ "permissions": { "oneOf": [ { "type": "string", "enum": ["read-all", "write-all", "read", "write"] }, { "type": "object", "properties": { /* granular permissions */ } } ] } }Usage Statistics (from 78 workflows):
Possible Reasons:
No action needed - valid feature that users choose not to use. Consider deprecation if never adopted.
Documentation Gaps
Schema Documentation Needed
Engine Compatibility Markers (Critical)
pkg/parser/schemas/main_workflow_schema.jsonmax-turns,tools.(name).type(HTTP transport),web-searchConditional Defaults (Moderate)
pkg/parser/schemas/main_workflow_schema.jsonsafe-outputs.(resource).maxUser Documentation Needed
Network Format Selection Guide (Moderate)
docs/src/content/docs/reference/frontmatter.mdEngine Feature Matrix (High Priority)
docs/src/content/docs/reference/engines.md(or create new page)Example Engine Matrix:
Schema Improvements Needed
1. Add Engine Compatibility Annotations
File:
pkg/parser/schemas/main_workflow_schema.jsonChanges:
{ "properties": { "engine": { "oneOf": [ { "type": "string" }, { "type": "object", "properties": { "max-turns": { "type": "string", "pattern": "^[0-9]+$", "description": "Maximum conversation turns (limits iteration depth). ⚠️ Requires engine with max-turns support. Supported by: copilot. Not supported by: codex, custom engines." } } } ] }, "tools": { "patternProperties": { "^[a-zA-Z0-9_-]+$": { "properties": { "type": { "enum": ["stdio", "http"], "description": "MCP server transport type. ⚠️ HTTP transport requires engine support (e.g., copilot). stdio is universally supported by all engines." } } } } } } }2. Document Conditional Defaults
File:
pkg/parser/schemas/main_workflow_schema.jsonChanges (for each safe-output resource):
{ "$defs": { "issue_config": { "properties": { "max": { "type": "integer", "minimum": 1, "default": 1, "description": "Maximum number of issues to create per workflow run (default: 1)" } } }, "label_config": { "properties": { "max": { "type": "integer", "minimum": 1, "default": 3, "description": "Maximum number of labels to add per workflow run (default: 3)" } } } } }Parser Updates Required
None needed - parser correctly handles all conditional patterns.
Evidence:
resolveSchemaWithOneOf()provides good autocomplete for oneOf fieldsWorkflow Violations
None found - all workflows comply with conditional requirements:
Checked:
eventsarray to restrict triggersSample Validation:
Recommendations
Immediate Actions (Critical)
Add Engine Compatibility to Schema 🔴
pkg/parser/schemas/main_workflow_schema.jsonCreate Engine Feature Matrix Documentation 🔴
docs/src/content/docs/reference/engines.md(new)Short-Term Actions (Moderate)
Document Conditional Defaults in Schema 🟡
pkg/parser/schemas/main_workflow_schema.jsonAdd Network Format Usage Guide 🟡
docs/src/content/docs/reference/frontmatter.mdLong-Term Actions (Low Priority)
Strategy Performance
Why This Strategy Succeeded:
Comparison to Previous Runs:
Next Steps
Immediate:
Follow-Up:
Validation:
References:
/tmp/gh-aw/cache-memory/strategy-selected-2025-11-16.txt/tmp/gh-aw/cache-memory/strategy-005-findings-2025-11-16.md/tmp/gh-aw/cache-memory/strategies.jsonBeta Was this translation helpful? Give feedback.
All reactions