{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "triangle.schema.json", "title": "Triangle Definition", "description": "3-NPC relationship triangle — self-contained forks, no cross-triangle cascade in v0.1 (D-024, D-047).", "type": "object", "required": ["canonical_id", "display_name", "members"], "additionalProperties": false, "properties": { "canonical_id": { "type": "string", "pattern": "^[a-z][a-z0-9-]*$", "description": "Triangle slug" }, "display_name": { "type": "string", "minLength": 1 }, "description": { "type": "string" }, "members": { "type": "array", "items": { "$ref": "#/$defs/member" }, "minItems": 3, "maxItems": 3, "description": "Exactly 3 NPC members" }, "forks": { "type": "array", "items": { "$ref": "#/$defs/fork" }, "description": "Possible fork points in this triangle" }, "resolution_states": { "type": "array", "items": { "$ref": "#/$defs/resolution" }, "description": "Terminal states this triangle can reach" } }, "$defs": { "member": { "type": "object", "required": ["npc", "role"], "additionalProperties": false, "properties": { "npc": { "type": "string", "pattern": "^npc:[a-z][a-z0-9-]*$", "description": "NPC short-form canonical ID" }, "role": { "type": "string", "description": "This NPC's role within the triangle" } } }, "fork": { "type": "object", "required": ["id", "condition"], "additionalProperties": false, "properties": { "id": { "type": "string", "pattern": "^[a-z][a-z0-9_-]*$" }, "condition": { "type": "string", "description": "What triggers this fork" }, "outcomes": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string" }, "description": { "type": "string" }, "effects": { "type": "array", "items": { "type": "string" } } } } } } }, "resolution": { "type": "object", "required": ["id", "description"], "additionalProperties": false, "properties": { "id": { "type": "string", "pattern": "^[a-z][a-z0-9_-]*$" }, "description": { "type": "string" } } } } }