{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://vclaw.dev/schemas/video/artifacts/cinema-creative-contract.schema.json",
  "title": "Cinema Creative Contract",
  "type": "object",
  "additionalProperties": false,
  "required": ["schemaVersion", "projectSlug", "contractId", "generatedAt", "premise", "runtimeSeconds", "genre", "tone", "audience", "format", "dialoguePosture", "boundaries", "budgetPosture", "assumptions", "contentHash"],
  "properties": {
    "schemaVersion": { "const": 1 },
    "projectSlug": { "$ref": "#/$defs/nonEmpty" },
    "contractId": { "$ref": "#/$defs/nonEmpty" },
    "generatedAt": { "type": "string", "format": "date-time" },
    "premise": { "$ref": "#/$defs/nonEmpty" },
    "runtimeSeconds": { "type": "number", "exclusiveMinimum": 0 },
    "genre": { "$ref": "#/$defs/nonEmpty" },
    "tone": { "$ref": "#/$defs/nonEmpty" },
    "audience": { "$ref": "#/$defs/nonEmpty" },
    "format": { "$ref": "#/$defs/nonEmpty" },
    "dialoguePosture": { "enum": ["none", "sparse", "dialogue-led"] },
    "boundaries": { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "$ref": "#/$defs/nonEmpty" } },
    "budgetPosture": { "enum": ["exploration", "controlled", "premium"] },
    "assumptions": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": ["field", "value", "reason"],
        "properties": {
          "field": { "$ref": "#/$defs/nonEmpty" },
          "value": { "oneOf": [{ "type": "string" }, { "type": "number" }] },
          "reason": { "$ref": "#/$defs/nonEmpty" }
        }
      }
    },
    "contentHash": { "$ref": "#/$defs/hash" }
  },
  "$defs": {
    "nonEmpty": { "type": "string", "minLength": 1 },
    "hash": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" }
  }
}
