{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://vclaw.dev/schemas/video/artifacts/cinema-provider-projection-bundle.schema.json",
  "title": "CinemaProviderProjectionBundleArtifact",
  "type": "object",
  "required": ["schemaVersion", "bundleId", "quoteId", "projectSlug", "routeId", "capabilitySnapshotId", "capabilitySnapshotHash", "createdAt", "projections", "contentHash"],
  "additionalProperties": false,
  "properties": {
    "schemaVersion": { "const": 1 },
    "bundleId": { "type": "string", "minLength": 1 },
    "quoteId": { "type": "string", "minLength": 1 },
    "projectSlug": { "type": "string", "minLength": 1 },
    "routeId": { "type": "string", "minLength": 1 },
    "capabilitySnapshotId": { "type": "string", "minLength": 1 },
    "capabilitySnapshotHash": { "$ref": "#/definitions/Sha256" },
    "createdAt": { "type": "string", "format": "date-time" },
    "projections": {
      "type": "array",
      "minItems": 1,
      "items": { "$ref": "#/definitions/Projection" }
    },
    "contentHash": { "$ref": "#/definitions/Sha256" }
  },
  "definitions": {
    "Sha256": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
    "Projection": {
      "type": "object",
      "required": ["taskId", "taskKind", "routeId", "transportId", "accountClass", "capabilitySnapshotId", "capabilitySnapshotHash", "payloadHash", "sourceHashes", "providerArguments", "providerArgumentsHash", "fallbackPolicy"],
      "additionalProperties": false,
      "properties": {
        "taskId": { "type": "string", "minLength": 1 },
        "taskKind": { "enum": ["image-generate", "image-repair", "video-generate", "audio-generate", "visual-qc", "identity-qc", "continuity-qc", "editorial-qc", "post-process", "assemble"] },
        "routeId": { "enum": ["gobananas-images", "openai-images", "higgsfield-images", "higgsfield-unlimited", "higgsfield-cli", "seedance-xskill"] },
        "transportId": { "type": "string", "minLength": 1 },
        "accountClass": { "enum": ["subscription-unlimited", "provider-credits", "api-credits", "free", "local"] },
        "capabilitySnapshotId": { "type": "string", "minLength": 1 },
        "capabilitySnapshotHash": { "$ref": "#/definitions/Sha256" },
        "payloadHash": { "$ref": "#/definitions/Sha256" },
        "sourceHashes": { "type": "array", "items": { "$ref": "#/definitions/Sha256" } },
        "providerArguments": { "type": "object" },
        "providerArgumentsHash": { "$ref": "#/definitions/Sha256" },
        "fallbackPolicy": { "const": "forbidden" }
      }
    }
  }
}
