{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://benchlist.ai/schemas/run.schema.json",
  "title": "BenchmarkRun",
  "type": "object",
  "required": ["id", "serviceId", "benchmarkId", "score", "runs", "submittedAt", "publisher", "verification"],
  "properties": {
    "id": { "type": "string" },
    "serviceId": { "type": "string" },
    "benchmarkId": { "type": "string" },
    "model": { "type": "string", "description": "Specific model variant, e.g. claude-opus-4-7" },
    "config": { "type": "object", "description": "Arbitrary config: temperature, top_p, system prompt hash, etc." },
    "score": { "type": "number" },
    "runs": { "type": "integer", "minimum": 1 },
    "stdev": { "type": "number" },
    "median": { "type": "number" },
    "breakdown": { "type": "object", "description": "Subcategory scores if applicable" },
    "runnerVersion": { "type": "string" },
    "runnerRepo": { "type": "string" },
    "runnerCommit": { "type": "string", "pattern": "^[a-f0-9]{7,40}$" },
    "datasetHash": { "type": "string", "pattern": "^(sha256:)?[a-f0-9]{64}$" },
    "methodologyHash": { "type": "string", "pattern": "^(sha256:)?[a-f0-9]{64}$" },
    "transcriptMerkleRoot": { "type": "string", "pattern": "^(sha256:)?[a-f0-9]{64}$" },
    "transcriptUri": { "type": "string", "description": "Optional IPFS/S3 pointer to full transcripts" },
    "sampleCount": { "type": "integer" },
    "startedAt": { "type": "string", "format": "date-time" },
    "finishedAt": { "type": "string", "format": "date-time" },
    "durationSeconds": { "type": "number" },
    "cost": { "type": "object", "properties": { "usd": { "type": "number" }, "currency": { "type": "string" } } },
    "attestor": { "type": "string", "description": "Attestor id from attestors.json" },
    "attestorSignature": { "type": "string", "description": "Hex signature over canonical run digest" },
    "publisher": { "type": "string" },
    "verification": {
      "type": "object",
      "required": ["mode", "status"],
      "properties": {
        "mode": { "type": "string", "enum": ["aligned", "signed-attestation", "self-reported", "community-replay"] },
        "status": { "type": "string", "enum": ["verified", "pending", "failed", "unverified", "disputed"] },
        "alignedBatchId": { "type": "string", "description": "Aligned Layer batch identifier" },
        "alignedTaskHash": { "type": "string", "pattern": "^0x[a-f0-9]{64}$" },
        "alignedProofSystem": { "type": "string", "enum": ["groth16_bn254", "sp1", "risc0", "halo2_kzg", "halo2_ipa", "plonk"] },
        "alignedProofUri": { "type": "string" },
        "alignedVerifierContract": { "type": "string", "pattern": "^0x[a-fA-F0-9]{40}$" },
        "onchainBlock": { "type": "integer" },
        "onchainTx": { "type": "string", "pattern": "^0x[a-f0-9]{64}$" },
        "explorerUrl": { "type": "string", "format": "uri" },
        "verifiedAt": { "type": "string", "format": "date-time" },
        "failureReason": { "type": "string" }
      }
    },
    "replay": {
      "type": "object",
      "properties": {
        "command": { "type": "string" },
        "dockerImage": { "type": "string" },
        "envRequired": { "type": "array", "items": { "type": "string" } },
        "expectedDuration": { "type": "string" }
      }
    },
    "notes": { "type": "string" },
    "flags": { "type": "array", "items": { "type": "string", "enum": ["contaminated", "outdated", "superseded", "sponsored", "community"] } }
  },
  "additionalProperties": false
}
