{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://hermes.ai/sdd-mvcp-contract.schema.json", "title": "SDD MVCP Contract", "type": "object", "required": ["meta", "model_contract", "view_contract", "controller_contract", "process_contract", "acceptance_matrix"], "properties": { "meta": { "type": "object", "required": ["project", "version", "effective_date"], "properties": { "project": {"type": "string"}, "version": {"type": "string"}, "effective_date": {"type": "string"}, "owner": {"type": "string"} } }, "model_contract": { "type": "array", "minItems": 1, "items": {"$ref": "#/definitions/modelEntity"} }, "view_contract": { "type": "array", "items": {"$ref": "#/definitions/viewScreen"} }, "controller_contract": { "type": "array", "minItems": 1, "items": {"$ref": "#/definitions/controllerOp"} }, "process_contract": { "type": "array", "items": {"$ref": "#/definitions/processFlow"} }, "acceptance_matrix": { "type": "array", "items": { "type": "object", "required": ["requirement_id", "coverage", "acceptance_cases"], "properties": { "requirement_id": {"type": "string"}, "coverage": { "type": "object", "required": ["model", "view", "controller", "process"], "properties": { "model": {"type": "array", "items": {"type": "string"}}, "view": {"type": "array", "items": {"type": "string"}}, "controller": {"type": "array", "items": {"type": "string"}}, "process": {"type": "array", "items": {"type": "string"}} } }, "acceptance_cases": { "type": "array", "items": { "type": "object", "required": ["type", "description", "expected"], "properties": { "type": {"enum": ["happy", "boundary", "failure", "security", "performance"]}, "description": {"type": "string"}, "expected": {"type": "string"} } } } } } } }, "definitions": { "modelEntity": { "type": "object", "required": ["entity", "fields", "owner"], "properties": { "entity": {"type": "string"}, "owner": {"type": "string"}, "purpose": {"type": "string"}, "fields": { "type": "array", "items": { "type": "object", "required": ["name", "type", "nullable", "constraints"], "properties": { "name": {"type": "string"}, "type": {"type": "string"}, "nullable": {"type": "boolean"}, "constraints": {"type": "array", "items": {"type": "string"}}, "index": {"type": "string", "enum": ["idx", "unique", "none"]}, "default": {"type": ["string", "number", "boolean", "null"]} } } } } }, "viewScreen": { "type": "object", "required": ["view_id", "route", "events", "fields"], "properties": { "view_id": {"type": "string"}, "route": {"type": "string"}, "fields": { "type": "array", "items": { "type": "object", "required": ["name", "visible_when", "validation"], "properties": { "name": {"type": "string"}, "visible_when": {"type": "string"}, "validation": {"type": "array", "items": {"type": "string"}}, "required": {"type": "boolean"} } } }, "events": { "type": "array", "items": { "type": "object", "required": ["event", "target_controller_id", "payload"], "properties": { "event": {"type": "string"}, "target_controller_id": {"type": "string"}, "payload": {"type": "object", "additionalProperties": true} } } } } }, "controllerOp": { "type": "object", "required": ["operation_id", "method", "path", "input", "output", "errors"], "properties": { "operation_id": {"type": "string"}, "method": {"enum": ["GET", "POST", "PUT", "PATCH", "DELETE"]}, "path": {"type": "string"}, "auth": {"type": "string"}, "input": {"type": "object", "additionalProperties": true}, "output": {"type": "object", "additionalProperties": true}, "idempotent": {"type": "boolean"}, "errors": { "type": "array", "items": { "type": "object", "required": ["code", "retryable", "description"], "properties": { "code": {"type": "string"}, "retryable": {"type": "boolean"}, "description": {"type": "string"} } } } } }, "processFlow": { "type": "object", "required": ["flow_id", "start_state", "end_state", "transitions"], "properties": { "flow_id": {"type": "string"}, "start_state": {"type": "string"}, "end_state": {"type": "string"}, "transitions": { "type": "array", "items": { "type": "object", "required": ["from", "to", "trigger", "action", "error_state"], "properties": { "from": {"type": "string"}, "to": {"type": "string"}, "trigger": {"type": "string"}, "action": {"type": "string"}, "guard": {"type": "string"}, "error_state": {"type": "string"}, "retry_max": {"type": "integer", "minimum": 0} } } } } } } }