{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://vclaw.dev/schemas/video/artifacts/cinema-queue-compatibility-receipt.schema.json",
  "title": "CinemaQueueCompatibilityReceiptArtifact",
  "type": "object",
  "required": ["schemaVersion", "receiptId", "projectSlug", "sourceFrontDoor", "sourceArtifactHash", "generatedAt", "mappings", "queueHashAtEnqueue", "providerCalls", "spendAuthorized", "contentHash"],
  "additionalProperties": false,
  "properties": {
    "schemaVersion": { "const": 1 },
    "receiptId": { "type": "string", "minLength": 1 },
    "projectSlug": { "type": "string", "minLength": 1 },
    "sourceFrontDoor": { "enum": ["batch", "pool", "chain", "mograph", "cinema"] },
    "sourceArtifactHash": { "$ref": "#/definitions/Sha256" },
    "generatedAt": { "type": "string", "format": "date-time" },
    "mappings": { "type": "array", "minItems": 1, "items": { "$ref": "#/definitions/Mapping" } },
    "queueHashAtEnqueue": { "$ref": "#/definitions/Sha256" },
    "providerCalls": { "const": 0 },
    "spendAuthorized": { "const": false },
    "contentHash": { "$ref": "#/definitions/Sha256" }
  },
  "definitions": {
    "Sha256": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
    "Mapping": {
      "type": "object",
      "required": ["externalTaskId", "queueTaskId", "executionHash", "payloadHash", "dependencies", "kind", "routeId", "enqueued"],
      "additionalProperties": false,
      "properties": {
        "externalTaskId": { "type": "string", "minLength": 1 },
        "queueTaskId": { "type": "string", "minLength": 1 },
        "executionHash": { "$ref": "#/definitions/Sha256" },
        "payloadHash": { "$ref": "#/definitions/Sha256" },
        "dependencies": { "type": "array", "items": { "type": "string", "minLength": 1 } },
        "kind": { "enum": ["image-generate", "image-repair", "video-generate", "audio-generate", "visual-qc", "identity-qc", "continuity-qc", "editorial-qc", "post-process", "assemble"] },
        "routeId": { "type": "string", "minLength": 1 },
        "enqueued": { "type": "boolean" }
      }
    }
  }
}
