-
Notifications
You must be signed in to change notification settings - Fork 45
Description
Description
The workflow schema in pkg/parser/schemas/main_workflow_schema.json has strong minLength validation (19 constraints) but weak maxLength validation (only 3 constraints). Core string fields like name, description, and tracker-id lack upper bounds, allowing unbounded strings that could cause API/database issues or performance problems.
Problem
Current State:
name: hasminLength: 1but NOmaxLengthdescription: NO length constraints at alltracker-id: hasminLength: 8and pattern validation but NOmaxLength
Impact:
- Could accept extremely long strings (50+ lines observed in production workflows)
- No protection against accidentally pasting large text blocks
- Database/API limits could be hit without validation feedback
- Validation happens at runtime instead of parse time
Evidence from Schema Consistency Check:
- Schema has 19
minLengthconstraints but only 3maxLengthconstraints - Analysis of 198 production workflows shows conservative usage, but schema should enforce limits
Suggested Changes
Add maxLength constraints to core string fields in pkg/parser/schemas/main_workflow_schema.json:
{
"name": {
"type": "string",
"minLength": 1,
"maxLength": 256 // Add this
},
"description": {
"type": "string",
"maxLength": 10000 // Add this
},
"tracker-id": {
"type": "string",
"minLength": 8,
"maxLength": 128, // Add this
"pattern": "^[a-zA-Z0-9_-]+$"
}
}Files Affected
pkg/parser/schemas/main_workflow_schema.json(schema definitions)- Potentially: Validation error messages in
pkg/workflow/*_validation.gofiles
Success Criteria
-
namefield hasmaxLength: 256constraint -
descriptionfield hasmaxLength: 10000constraint -
tracker-idfield hasmaxLength: 128constraint - Schema validation tests pass
- Existing workflows continue to validate successfully
- Error messages for violations are clear and actionable
Priority
High - Prevents potential API/database issues and improves schema robustness. Estimated effort: 1 day.
Source
Extracted from Schema Consistency Check - 2026-01-26 discussion #11976
Key finding: "Only 3 maxLength constraints across entire schema. Key fields (name, description, tracker-id) lack upper bounds, allowing unbounded strings."
AI generated by Discussion Task Miner - Code Quality Improvement Agent
- expires on Feb 17, 2026, 1:30 AM UTC