{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://example.invalid/techviz/vizspec-1.1.schema.json", "title": "TechViz Grounded Visualization Specification", "type": "object", "required": [ "version", "id", "title", "question", "type", "direction", "summary", "alt", "long_description", "source_context", "nodes", "edges" ], "additionalProperties": false, "properties": { "version": { "enum": ["1.0", "1.1"] }, "id": { "type": "string", "pattern": "^[A-Za-z][A-Za-z0-9_.-]*$" }, "title": { "type": "string", "minLength": 1 }, "question": { "type": "string", "minLength": 1 }, "type": { "enum": [ "context", "architecture", "container", "component", "deployment", "data-flow", "sequence", "flow", "state", "network", "erd", "dependency", "concept" ] }, "direction": { "enum": ["LR", "RL", "TB", "BT"] }, "audience": { "type": "array", "items": {"type": "string"} }, "summary": { "type": "string", "minLength": 1 }, "alt": { "type": "string", "minLength": 1 }, "long_description": { "type": "string", "minLength": 1 }, "source_context": { "type": "object", "required": ["document", "document_sha256", "anchor"], "additionalProperties": true, "properties": { "document": {"type": "string"}, "document_sha256": { "type": "string", "pattern": "^[a-f0-9]{64}$" }, "anchor": { "type": "object", "required": ["kind", "value", "line"], "additionalProperties": true, "properties": { "kind": {"enum": ["marker", "heading", "line"]}, "value": {}, "line": {"type": "integer", "minimum": 1} } } } }, "composition": { "$ref": "#/$defs/composition" }, "groups": { "type": "array", "items": {"$ref": "#/$defs/group"} }, "nodes": { "type": "array", "minItems": 1, "items": {"$ref": "#/$defs/node"} }, "edges": { "type": "array", "items": {"$ref": "#/$defs/edge"} }, "legend": { "type": "array", "items": { "type": "object", "required": ["symbol", "meaning"], "additionalProperties": false, "properties": { "symbol": {"type": "string"}, "meaning": {"type": "string"} } } }, "metadata": { "type": "object" } }, "allOf": [ { "if": { "properties": {"version": {"const": "1.1"}}, "required": ["version"] }, "then": { "required": ["composition"] } } ], "$defs": { "composition": { "type": "object", "required": ["profile", "diagram_only", "reference_ids", "rationale"], "additionalProperties": false, "properties": { "profile": { "enum": [ "component-flow", "orchestrator-workers", "query-fanout", "timeline", "reconciliation-loop", "resource-controller", "two-zone-pipeline", "sequence", "ports-adapters", "comparison" ] }, "diagram_only": {"const": true}, "reference_ids": { "type": "array", "minItems": 1, "uniqueItems": true, "items": {"type": "string"} }, "rationale": { "type": "string", "minLength": 1 }, "focus_node": { "type": "string" } } }, "evidenceArray": { "type": "array", "items": { "type": "object", "required": ["start_line", "end_line"], "additionalProperties": false, "properties": { "start_line": {"type": "integer", "minimum": 1}, "end_line": {"type": "integer", "minimum": 1}, "quote": {"type": "string"} } } }, "group": { "type": "object", "required": ["id", "label", "evidence", "assumption"], "additionalProperties": false, "properties": { "id": { "type": "string", "pattern": "^[A-Za-z][A-Za-z0-9_.-]*$" }, "label": {"type": "string", "minLength": 1}, "kind": {"type": "string"}, "role": {"type": "string"}, "parent": {"type": "string"}, "description": {"type": "string"}, "evidence": {"$ref": "#/$defs/evidenceArray"}, "assumption": {"type": "boolean"} }, "allOf": [ { "if": { "properties": {"assumption": {"const": true}}, "required": ["assumption"] }, "then": { "properties": {"evidence": {"maxItems": 0}} } } ] }, "node": { "type": "object", "required": ["id", "label", "kind", "evidence", "assumption"], "additionalProperties": false, "properties": { "id": { "type": "string", "pattern": "^[A-Za-z][A-Za-z0-9_.-]*$" }, "label": {"type": "string", "minLength": 1}, "kind": {"type": "string"}, "group": {"type": "string"}, "description": {"type": "string"}, "evidence": {"$ref": "#/$defs/evidenceArray"}, "assumption": {"type": "boolean"}, "icon": {"type": "string"}, "link": {"type": "string"}, "role": {"type": "string"}, "shape": {"type": "string"}, "details": { "type": "array", "maxItems": 8, "items": {"type": "string"} }, "position": {"type": "integer", "minimum": 1}, "emphasis": { "enum": ["primary", "normal", "muted", "warning"] } }, "allOf": [ { "if": { "properties": {"assumption": {"const": true}}, "required": ["assumption"] }, "then": { "properties": {"evidence": {"maxItems": 0}} } } ] }, "edge": { "type": "object", "required": ["id", "from", "to", "label", "kind", "evidence", "assumption"], "additionalProperties": false, "properties": { "id": { "type": "string", "pattern": "^[A-Za-z][A-Za-z0-9_.-]*$" }, "from": {"type": "string"}, "to": {"type": "string"}, "label": {"type": "string"}, "kind": {"type": "string"}, "order": {"type": "integer", "minimum": 1}, "style": {"enum": ["solid", "dashed", "dotted"]}, "emphasis": { "enum": ["primary", "normal", "muted", "warning"] }, "evidence": {"$ref": "#/$defs/evidenceArray"}, "assumption": {"type": "boolean"} }, "allOf": [ { "if": { "properties": {"assumption": {"const": true}}, "required": ["assumption"] }, "then": { "properties": {"evidence": {"maxItems": 0}} } } ] } } }