{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://vclaw.dev/schemas/video/artifacts/soundtrack.schema.json",
  "title": "SoundtrackArtifact",
  "type": "object",
  "required": ["schemaVersion", "projectSlug", "generatedAt", "candidates"],
  "additionalProperties": false,
  "properties": {
    "schemaVersion": { "const": 1 },
    "projectSlug": { "type": "string", "minLength": 1 },
    "generatedAt": { "type": "string", "format": "date-time" },
    "candidates": {
      "type": "array",
      "items": { "$ref": "#/definitions/SoundtrackCandidate" }
    },
    "selected": {
      "type": "string",
      "minLength": 1,
      "description": "backendId of the human-selected candidate, if any."
    }
  },
  "definitions": {
    "SoundtrackCandidate": {
      "type": "object",
      "required": ["backendId", "path", "durationMs", "prompt"],
      "additionalProperties": false,
      "properties": {
        "backendId": { "type": "string", "minLength": 1 },
        "path": {
          "type": "string",
          "minLength": 1,
          "description": "Project-relative path to the generated candidate audio."
        },
        "durationMs": { "type": "number", "minimum": 0 },
        "prompt": { "type": "string" }
      }
    }
  }
}
