{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "urn:creative-vocabulary:decision:1.0",
  "title": "Creative vocabulary decision",
  "description": "An editorial decision envelope. Parameter semantics require a dimension-specific adapter; this schema does not imply an implemented renderer.",
  "type": "object",
  "additionalProperties": false,
  "required": ["id", "scope", "dimension", "term_ids", "parameters", "intent", "status", "references"],
  "properties": {
    "id": {"type": "string", "minLength": 1},
    "scope": {
      "type": "object",
      "additionalProperties": false,
      "required": ["kind", "entity_id"],
      "properties": {
        "kind": {"enum": ["work", "series", "season", "episode", "sequence", "scene", "shot", "character", "relationship", "world", "location", "sound_cue"]},
        "entity_id": {"type": "string", "minLength": 1}
      }
    },
    "dimension": {"type": "string", "minLength": 1},
    "term_ids": {
      "type": "array",
      "uniqueItems": true,
      "items": {"type": "string", "pattern": "^[a-z0-9-]+\\.[a-z0-9-]+$"}
    },
    "parameters": {"type": "object"},
    "intent": {"type": "string", "minLength": 1},
    "status": {"enum": ["candidate", "working", "established", "open"]},
    "references": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": ["reference_id", "dimensions", "influence", "adaptation_note"],
        "properties": {
          "reference_id": {"type": "string", "minLength": 1},
          "dimensions": {"type": "array", "minItems": 1, "uniqueItems": true, "items": {"type": "string", "minLength": 1}},
          "influence": {"enum": ["low", "medium", "high"]},
          "adaptation_note": {"type": "string", "minLength": 1}
        }
      }
    }
  }
}
