{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://vclaw.dev/schemas/video/artifacts/scene-selection.schema.json",
  "title": "SceneSelectionArtifact",
  "type": "object",
  "required": ["schemaVersion", "scenes"],
  "additionalProperties": false,
  "properties": {
    "schemaVersion": { "const": 1 },
    "scenes": {
      "type": "array",
      "items": { "$ref": "#/definitions/SceneSelectionEntry" }
    }
  },
  "definitions": {
    "SceneSelectionEntry": {
      "type": "object",
      "required": [
        "sceneIndex",
        "selectedCandidateId",
        "rejectedCandidateIds",
        "pendingCandidateIds",
        "rerollRequested",
        "chainFromPrev"
      ],
      "additionalProperties": false,
      "properties": {
        "sceneIndex": { "type": "integer", "minimum": 0 },
        "selectedCandidateId": {
          "oneOf": [
            { "type": "string", "minLength": 1 },
            { "type": "null" }
          ]
        },
        "rejectedCandidateIds": {
          "type": "array",
          "items": { "type": "string", "minLength": 1 }
        },
        "pendingCandidateIds": {
          "type": "array",
          "items": { "type": "string", "minLength": 1 }
        },
        "rerollRequested": { "type": "boolean" },
        "chainFromPrev": { "type": "boolean" },
        "chainFromSceneIndex": { "type": "integer", "minimum": 0 },
        "notes": { "type": "string" }
      }
    }
  }
}
