{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://othmaneblial.github.io/pyffmpegcore/schemas/run-receipt-1.0.schema.json",
  "title": "PyFFmpegCore run receipt 1.0",
  "type": "object",
  "required": ["schema_version", "privacy", "plan", "tools", "summary", "items", "content_hashes"],
  "properties": {
    "schema_version": {"const": "1.0"},
    "privacy": {"type": "object"},
    "plan": {"type": "object"},
    "tools": {"type": "object"},
    "summary": {
      "type": "object",
      "required": ["total", "succeeded", "failed"],
      "properties": {
        "total": {"type": "integer", "minimum": 1},
        "succeeded": {"type": "integer", "minimum": 0},
        "failed": {"type": "integer", "minimum": 0}
      }
    },
    "items": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "required": ["input_probe", "output_probe", "proof", "preflight", "result"],
        "properties": {
          "input_probe": {"type": ["object", "null"]},
          "output_probe": {"type": ["object", "null"]},
          "proof": {"type": "object"},
          "preflight": {"type": "object"},
          "result": {
            "type": "object",
            "required": ["workflow", "status", "exit_category", "elapsed_seconds", "warnings"]
          }
        }
      }
    },
    "content_hashes": {
      "type": "array",
      "items": {
        "type": "object",
        "required": ["path", "algorithm", "digest"],
        "properties": {
          "path": {"type": "string"},
          "algorithm": {"const": "sha256"},
          "digest": {"type": "string", "pattern": "^[a-f0-9]{64}$"}
        }
      }
    }
  }
}
