{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://vclaw.dev/schemas/video/artifacts/reframe-qc.schema.json",
  "title": "ReframeQcReceipt",
  "description": "Content-addressed composition and media-QC receipt emitted beside a social reframe output.",
  "type": "object",
  "required": ["schemaVersion", "generatedAt", "sourcePath", "outputPath", "sourceSha256", "outputSha256", "planSha256", "ok", "planQc", "mediaQc"],
  "additionalProperties": false,
  "properties": {
    "schemaVersion": { "const": 1 },
    "generatedAt": { "type": "string", "format": "date-time" },
    "sourcePath": { "type": "string", "minLength": 1 },
    "outputPath": { "type": "string", "minLength": 1 },
    "sourceSha256": { "$ref": "#/definitions/hash" },
    "outputSha256": { "$ref": "#/definitions/hash" },
    "planSha256": { "$ref": "#/definitions/hash" },
    "ok": { "type": "boolean" },
    "planQc": {
      "type": "object",
      "required": ["ok", "findings"],
      "additionalProperties": false,
      "properties": {
        "ok": { "type": "boolean" },
        "findings": {
          "type": "array",
          "items": {
            "type": "object",
            "required": ["code", "severity", "shotIndex", "message"],
            "additionalProperties": false,
            "properties": {
              "code": { "enum": ["subject-off-center", "subject-clipped", "subject-anchor-missing"] },
              "severity": { "enum": ["error", "warning"] },
              "shotIndex": { "type": "integer", "minimum": 0 },
              "message": { "type": "string", "minLength": 1 },
              "observed": { "type": "number" },
              "limit": { "type": "number" }
            }
          }
        }
      }
    },
    "mediaQc": { "type": "object", "additionalProperties": true }
  },
  "definitions": {
    "hash": { "type": "string", "pattern": "^[a-f0-9]{64}$" }
  }
}
