{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/eccaai-com/json-schema/eccaai-com-proof-machine-record-schema.json",
  "title": "ProofMachineRecord",
  "description": "ecca.proof.v1: the machine-readable proof record embedded in every /p/{id} page as <script type=\"application/json\" id=\"ecca-proof-data\"> and served at /p/{id}.json. Every field is the stored value: agreement is the stored adjudication record (never recomputed; null when none was stored, and then verdict is null too). The owner is never included.",
  "x-generated": "2026-11-06",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/eccaai-com-api-openapi.json#/components/schemas/ProofMachineRecord",
  "type": "object",
  "required": [
    "schema",
    "id",
    "url",
    "question",
    "answer",
    "engines",
    "agreement",
    "verdict",
    "clashes",
    "citations",
    "createdAt"
  ],
  "properties": {
    "schema": {
      "const": "ecca.proof.v1"
    },
    "id": {
      "type": "string"
    },
    "url": {
      "type": "string",
      "format": "uri"
    },
    "question": {
      "type": "string"
    },
    "answer": {
      "type": "string"
    },
    "engines": {
      "type": "array",
      "maxItems": 6,
      "items": {
        "$ref": "#/$defs/ProofEngineOutput"
      }
    },
    "agreement": {
      "type": [
        "object",
        "null"
      ],
      "description": "The stored adjudication record: method, inputs, agreeingEngineIds, dissentingEngineIds, agreementScore, canonicalAnswer, measurable.",
      "properties": {
        "method": {
          "type": "string",
          "enum": [
            "unanimous",
            "judge-merge",
            "fallback-best-agreement",
            "direct"
          ]
        },
        "inputs": {
          "type": [
            "integer",
            "null"
          ]
        },
        "agreeingEngineIds": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "dissentingEngineIds": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "agreementScore": {
          "type": [
            "number",
            "null"
          ]
        },
        "canonicalAnswer": {
          "type": [
            "string",
            "null"
          ]
        },
        "measurable": {
          "type": "boolean"
        }
      }
    },
    "verdict": {
      "type": [
        "string",
        "null"
      ],
      "description": "The one-line agreement verdict built from agreement, e.g. \"2 of 3 engines agree; Logic dissents\"."
    },
    "clashes": {
      "type": "array",
      "maxItems": 10,
      "description": "Claim against claim where two engines split, as stored.",
      "items": {
        "type": "object",
        "properties": {
          "engineA": {
            "type": "string"
          },
          "engineB": {
            "type": "string"
          },
          "claimA": {
            "type": "string"
          },
          "claimB": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "frictionScore": {
            "type": [
              "number",
              "null"
            ]
          }
        }
      }
    },
    "citations": {
      "type": "array",
      "maxItems": 10,
      "items": {
        "$ref": "#/$defs/ProofCitation"
      }
    },
    "createdAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    }
  },
  "$defs": {
    "ProofCitation": {
      "type": "object",
      "description": "A citation from the dispatch's search receipt (meta.sources), copied. https only; a non-https or over-long url is dropped, never rewritten.",
      "properties": {
        "title": {
          "type": "string",
          "maxLength": 300
        },
        "url": {
          "type": "string",
          "format": "uri",
          "pattern": "^https://",
          "maxLength": 2048
        }
      }
    },
    "ProofEngineOutput": {
      "type": "object",
      "description": "One engine's own answer as the dispatch reported it, copied: a registered engine id, its role, whether it returned, and its text (null when it did not answer; up to 8000 characters).",
      "properties": {
        "engine": {
          "type": "string",
          "enum": [
            "speed",
            "depth",
            "breadth",
            "logic",
            "context",
            "agentic"
          ]
        },
        "role": {
          "type": "string"
        },
        "ok": {
          "type": "boolean"
        },
        "text": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 8000
        }
      }
    }
  }
}