[Schema Consistency] 🔍 Schema Consistency Analysis - Critical Validation Gap Found (Nov 4) #3103
Closed
Replies: 2 comments 1 reply
-
|
/plan |
Beta Was this translation helpful? Give feedback.
1 reply
-
|
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 - November 4, 2025
Overview
This automated consistency check identified a critical schema validation gap using a new analysis strategy focused on parser runtime behavior versus schema contract promises. The analysis reveals that all three schemas accept arbitrary field names, creating a silent failure mode where typos pass validation without warning.
Critical Discovery: Missing
"additionalProperties": falsein all schemas allows ANY field to pass validation, including typos likepermisions,engnie, andtoolz.Key Findings Summary
🚨 Critical Security Issue
Schema Accepts ANY Field Name
Affected Files:
pkg/parser/schemas/main_workflow_schema.jsonpkg/parser/schemas/included_file_schema.jsonpkg/parser/schemas/mcp_config_schema.jsonProblem: None of the schemas set
"additionalProperties": falseat the root level. Per JSON Schema spec, this defaults totrue, accepting any field name.Real-World Impact:
All three typos pass schema validation but are silently ignored at runtime, causing:
Recommendation: Add
"additionalProperties": falseto all three schemas immediately.Parser Behavior Inconsistencies
Issue 1: Ignored Fields Bypass Validation
Location:
pkg/parser/schema.go:31-54Two fields (
description,applyTo) are filtered out BEFORE schema validation viafilterIgnoredFields(). These fields:Issue 2: Empty String Validation Missing
No
minLengthconstraints on critical string fields:name: ""passes ✅engine: ""passes ✅command: ""passes ✅Unknown if runtime accepts empty strings or what happens.
Issue 3: Type Coercion Undocumented
Go's
yaml.Unmarshalperforms automatic type coercion BEFORE schema validation:yes/no/true/false→ Gobool123→ GointValidation order:
Unmarshal → Filter ignored → Schema validate → Custom validateType errors from unmarshaling bypass schema validation entirely.
✅ Positive Findings
Excellent Error Message Quality
Location:
pkg/parser/schema.go:248-393The error handling is exceptional:
Example:
This UX excellence mitigates (but doesn't solve) the typo blindness issue.
Performance Optimization
Compiled schemas cached with
sync.Oncefor fast validation after first compile.Documentation Gaps
descriptionandapplyTowork but not in schemaRecommendations
🔴 HIGH PRIORITY (Security/Correctness)
Add
"additionalProperties": falseto all three schemasAdd
minLength: 1to required string fieldsname,engine, critical stringsDocument ignored fields in schema
descriptionandapplyTowith clear explanations🟡 MEDIUM PRIORITY (User Experience)
Create validation behavior documentation
Add schema validation test suite
Enhance typo detection
🟢 LOW PRIORITY (Maintenance)
not/if/then)examplesfield)Strategy Performance
Strategy: Strategy-013 - Parser Runtime Behavior vs Schema Contract Analysis
Type: NEW (first use)
Findings: 9 issues across 4 categories
Effectiveness: VERY HIGH
Reuse Recommendation: YES - use every 5-7 runs
Unique Value: Previous strategies focused on field presence/absence. This strategy revealed how validation works, finding a critical foundation issue that affects all fields across all schemas.
Strategy Steps:
additionalPropertiessetting in schemasminLength)Next Steps
Immediate Actions Needed
additionalProperties: falseagainst all production workflows"additionalProperties": falseto all three schemasminLength: 1to required stringsFollow-up Tasks
not/if/then)Analysis Metadata
Cache Strategy Selection: Day 308 → Use new approach (30% probability)
This report was automatically generated by the schema consistency checker. The analysis rotates through 13 proven strategies (70% of time) and tries new approaches (30% of time) to discover different classes of inconsistencies.
Beta Was this translation helpful? Give feedback.
All reactions