{ "$schema": "http://json-schema.org/draft-07/schema#", "$id": "discovery-state-schema", "title": "Discovery State Schema", "description": "Schema for issue discovery session state machine", "type": "object", "required": ["discovery_id", "target_pattern", "metadata", "phase"], "properties": { "discovery_id": { "type": "string", "description": "Unique discovery session ID", "pattern": "^DSC-\\d{8}-\\d{6}$", "examples": ["DSC-20250128-143022"] }, "target_pattern": { "type": "string", "description": "File/directory pattern being analyzed", "examples": ["src/auth/**", "src/payment/**,src/api/**"] }, "metadata": { "type": "object", "required": ["created_at", "resolved_files", "perspectives"], "properties": { "created_at": { "type": "string", "format": "date-time", "description": "ISO 8601 timestamp of discovery creation" }, "resolved_files": { "type": "array", "items": { "type": "string" }, "description": "List of resolved file paths from pattern" }, "perspectives": { "type": "array", "items": { "type": "string", "enum": ["bug", "ux", "test", "quality", "security", "performance", "maintainability", "best-practices"] }, "description": "Selected discovery perspectives" }, "external_research_enabled": { "type": "boolean", "default": false, "description": "Whether Exa research is enabled" } } }, "phase": { "type": "string", "enum": ["initialization", "parallel", "external", "aggregation", "complete"], "description": "Current execution phase" }, "perspectives_completed": { "type": "array", "items": { "type": "string" }, "description": "List of completed perspective analyses" }, "total_findings": { "type": "integer", "minimum": 0, "description": "Total number of findings across all perspectives" }, "priority_distribution": { "type": "object", "properties": { "critical": { "type": "integer", "minimum": 0 }, "high": { "type": "integer", "minimum": 0 }, "medium": { "type": "integer", "minimum": 0 }, "low": { "type": "integer", "minimum": 0 } }, "description": "Count of findings by priority level" }, "issues_generated": { "type": "integer", "minimum": 0, "description": "Number of issues generated from discoveries" }, "completed_at": { "type": "string", "format": "date-time", "description": "ISO 8601 timestamp of discovery completion" } }, "examples": [ { "discovery_id": "DSC-20250128-143022", "target_pattern": "src/auth/**", "metadata": { "created_at": "2025-01-28T14:30:22Z", "resolved_files": ["src/auth/service.ts", "src/auth/validator.ts"], "perspectives": ["bug", "ux", "test", "quality", "security"], "external_research_enabled": true }, "phase": "complete", "perspectives_completed": ["bug", "ux", "test", "quality", "security"], "total_findings": 45, "priority_distribution": { "critical": 2, "high": 8, "medium": 20, "low": 15 }, "issues_generated": 10, "completed_at": "2025-01-28T14:45:00Z" } ] }