77 lines
2.7 KiB
JSON
77 lines
2.7 KiB
JSON
{
|
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
"title": "Recipe Validation Rules Output Schema",
|
|
"description": "Schema for validation rule discovery output",
|
|
"type": "object",
|
|
"required": ["version", "extracted_at", "validation_rules"],
|
|
"properties": {
|
|
"version": {
|
|
"type": "string",
|
|
"description": "The goose version these rules apply to"
|
|
},
|
|
"extracted_at": {
|
|
"type": "string",
|
|
"format": "date-time",
|
|
"description": "ISO timestamp when rules were extracted"
|
|
},
|
|
"validation_rules": {
|
|
"type": "array",
|
|
"description": "List of validation rules",
|
|
"items": {
|
|
"type": "object",
|
|
"required": ["rule_id", "category", "description", "affected_fields", "error_message"],
|
|
"properties": {
|
|
"rule_id": {
|
|
"type": "string",
|
|
"description": "Unique identifier for the rule (e.g., 'prompt_or_instructions_required')"
|
|
},
|
|
"category": {
|
|
"type": "string",
|
|
"description": "Category of validation (e.g., 'required_fields', 'parameters', 'structure')",
|
|
"enum": ["required_fields", "parameters", "structure", "schema", "cross_field"]
|
|
},
|
|
"description": {
|
|
"type": "string",
|
|
"description": "Human-readable description of the validation rule"
|
|
},
|
|
"affected_fields": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
},
|
|
"description": "List of Recipe fields this rule validates (e.g., ['instructions', 'prompt'])"
|
|
},
|
|
"requirement_type": {
|
|
"type": "string",
|
|
"description": "Type of requirement (e.g., 'at_least_one', 'conditional', 'required', 'optional')"
|
|
},
|
|
"condition": {
|
|
"type": "string",
|
|
"description": "Condition when rule applies (e.g., 'When requirement=optional')"
|
|
},
|
|
"error_message": {
|
|
"type": "string",
|
|
"description": "Exact error message users see when validation fails"
|
|
},
|
|
"validation_function": {
|
|
"type": "string",
|
|
"description": "Name of the validation function in code (e.g., 'validate_optional_parameters')"
|
|
},
|
|
"introduced_in": {
|
|
"type": "string",
|
|
"description": "Version when rule was introduced (default: 'unknown' for V1)"
|
|
},
|
|
"last_modified": {
|
|
"type": "string",
|
|
"description": "Version when rule was last modified"
|
|
},
|
|
"code_snippet": {
|
|
"type": "string",
|
|
"description": "Relevant code snippet showing validation logic"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|