{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/cueframe-ai/json-schema/cueframe-ai-compare-frames-response-schema.json",
  "title": "CompareFramesResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/cueframe-ai-evidence-api-openapi.yml#/components/schemas/CompareFramesResponse",
  "type": "object",
  "properties": {
    "reference": {
      "type": "object",
      "properties": {
        "frame": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "width": {
          "type": "integer",
          "exclusiveMinimum": 0,
          "maximum": 9007199254740991
        },
        "height": {
          "type": "integer",
          "exclusiveMinimum": 0,
          "maximum": 9007199254740991
        },
        "artifactSha256": {
          "type": "string",
          "pattern": "^sha256:[0-9a-f]{64}$"
        },
        "byteLength": {
          "type": "integer",
          "exclusiveMinimum": 0,
          "maximum": 16777216
        },
        "normalization": {
          "type": "object",
          "properties": {
            "pixelFormat": {
              "type": "string",
              "const": "rgb24"
            },
            "sampleAspectRatio": {
              "type": "string",
              "const": "1:1"
            },
            "colorConversion": {
              "type": "string",
              "const": "ffmpeg_source_metadata"
            },
            "rotation": {
              "type": "string",
              "const": "ffmpeg_autorotate"
            },
            "sourceColorSpace": {
              "type": [
                "string",
                "null"
              ]
            },
            "sourceColorTransfer": {
              "type": [
                "string",
                "null"
              ]
            },
            "sourceColorPrimaries": {
              "type": [
                "string",
                "null"
              ]
            }
          },
          "required": [
            "pixelFormat",
            "sampleAspectRatio",
            "colorConversion",
            "rotation",
            "sourceColorSpace",
            "sourceColorTransfer",
            "sourceColorPrimaries"
          ],
          "additionalProperties": false
        },
        "mediaItemId": {
          "type": "string"
        },
        "sourceIdentity": {
          "type": "string",
          "pattern": "^sha256:[0-9a-f]{64}$"
        },
        "representationIdentity": {
          "type": "string",
          "pattern": "^sha256:[0-9a-f]{64}$"
        },
        "representationRevision": {
          "type": "string"
        },
        "frameCount": {
          "type": "integer",
          "exclusiveMinimum": 0,
          "maximum": 9007199254740991
        },
        "fpsNum": {
          "type": "integer",
          "exclusiveMinimum": 0,
          "maximum": 9007199254740991
        },
        "fpsDen": {
          "type": "integer",
          "exclusiveMinimum": 0,
          "maximum": 9007199254740991
        },
        "actualTimeSec": {
          "type": "number",
          "minimum": 0
        },
        "coordinateSystem": {
          "type": "string",
          "const": "certified_representation"
        }
      },
      "required": [
        "frame",
        "width",
        "height",
        "artifactSha256",
        "byteLength",
        "normalization",
        "mediaItemId",
        "sourceIdentity",
        "representationIdentity",
        "representationRevision",
        "frameCount",
        "fpsNum",
        "fpsDen",
        "actualTimeSec",
        "coordinateSystem"
      ],
      "additionalProperties": false
    },
    "candidate": {
      "type": "object",
      "properties": {
        "compositionFrame": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "renderFrame": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "introFrames": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "fps": {
          "type": "number",
          "exclusiveMinimum": 0
        },
        "actualTimeSec": {
          "type": "number",
          "minimum": 0
        },
        "artifactSha256": {
          "type": "string",
          "pattern": "^sha256:[0-9a-f]{64}$"
        },
        "jobId": {
          "type": "string"
        },
        "artifactId": {
          "type": "string"
        },
        "requestedTimeSec": {
          "type": "number",
          "minimum": 0
        },
        "previewed": {
          "type": "object",
          "properties": {
            "source": {
              "type": "string",
              "enum": [
                "inline",
                "scratch",
                "persisted"
              ]
            },
            "compositionId": {
              "type": "string"
            },
            "etag": {
              "type": "string"
            }
          },
          "required": [
            "source"
          ],
          "additionalProperties": false
        }
      },
      "required": [
        "compositionFrame",
        "renderFrame",
        "introFrames",
        "fps",
        "actualTimeSec",
        "artifactSha256",
        "jobId",
        "artifactId",
        "requestedTimeSec",
        "previewed"
      ],
      "additionalProperties": false
    },
    "comparison": {
      "type": "object",
      "properties": {
        "sourceWidth": {
          "type": "integer",
          "exclusiveMinimum": 0,
          "maximum": 9007199254740991
        },
        "sourceHeight": {
          "type": "integer",
          "exclusiveMinimum": 0,
          "maximum": 9007199254740991
        },
        "width": {
          "type": "integer",
          "exclusiveMinimum": 0,
          "maximum": 9007199254740991
        },
        "height": {
          "type": "integer",
          "exclusiveMinimum": 0,
          "maximum": 9007199254740991
        },
        "referenceSha256": {
          "type": "string",
          "pattern": "^sha256:[0-9a-f]{64}$"
        },
        "candidateSha256": {
          "type": "string",
          "pattern": "^sha256:[0-9a-f]{64}$"
        },
        "crop": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "x": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "y": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "width": {
                  "type": "integer",
                  "exclusiveMinimum": 0,
                  "maximum": 9007199254740991
                },
                "height": {
                  "type": "integer",
                  "exclusiveMinimum": 0,
                  "maximum": 9007199254740991
                }
              },
              "required": [
                "x",
                "y",
                "width",
                "height"
              ],
              "additionalProperties": false
            },
            {
              "type": "null"
            }
          ]
        },
        "alignment": {
          "type": "string",
          "const": "none"
        },
        "normalization": {
          "type": "object",
          "properties": {
            "pixelFormat": {
              "type": "string",
              "const": "rgb24"
            },
            "alpha": {
              "type": "string",
              "const": "opaque_only"
            },
            "colorConversion": {
              "type": "string",
              "const": "none_rgb_samples"
            }
          },
          "required": [
            "pixelFormat",
            "alpha",
            "colorConversion"
          ],
          "additionalProperties": false
        },
        "images": {
          "minItems": 1,
          "maxItems": 3,
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "view": {
                "type": "string",
                "enum": [
                  "side_by_side",
                  "overlay",
                  "difference"
                ]
              },
              "width": {
                "type": "integer",
                "exclusiveMinimum": 0,
                "maximum": 9007199254740991
              },
              "height": {
                "type": "integer",
                "exclusiveMinimum": 0,
                "maximum": 9007199254740991
              },
              "artifactSha256": {
                "type": "string",
                "pattern": "^sha256:[0-9a-f]{64}$"
              },
              "pngBase64": {
                "type": "string",
                "minLength": 1,
                "maxLength": 8388608
              },
              "byteLength": {
                "type": "integer",
                "exclusiveMinimum": 0,
                "maximum": 6291456
              }
            },
            "required": [
              "view",
              "width",
              "height",
              "artifactSha256",
              "pngBase64",
              "byteLength"
            ],
            "additionalProperties": false
          }
        }
      },
      "required": [
        "sourceWidth",
        "sourceHeight",
        "width",
        "height",
        "referenceSha256",
        "candidateSha256",
        "crop",
        "alignment",
        "normalization",
        "images"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "reference",
    "candidate",
    "comparison"
  ],
  "additionalProperties": false
}