{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Tachyon Atlas verification record",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "id",
    "problem_id",
    "protocol_version",
    "submission_id",
    "date",
    "commit",
    "evidence",
    "checker",
    "environment",
    "runtime_seconds",
    "log_url",
    "verdict",
    "reviewers"
  ],
  "properties": {
    "id": {
      "type": "string",
      "pattern": "^R-[0-9]{4,}$"
    },
    "problem_id": {
      "type": "string",
      "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$"
    },
    "protocol_version": {
      "type": "integer",
      "minimum": 1
    },
    "submission_id": {
      "type": "string"
    },
    "date": {
      "type": "string",
      "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"
    },
    "commit": {
      "type": "string",
      "pattern": "^[0-9a-f]{40}$"
    },
    "evidence": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "url",
        "sha256"
      ],
      "properties": {
        "url": {
          "type": "string",
          "format": "uri"
        },
        "sha256": {
          "type": "string",
          "pattern": "^[0-9a-f]{64}$"
        },
        "raw_url": {
          "type": "string",
          "format": "uri"
        }
      }
    },
    "checker": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "version"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "version": {
          "type": "string"
        },
        "source_url": {
          "type": "string",
          "format": "uri"
        }
      }
    },
    "environment": {
      "type": "object",
      "required": [
        "os",
        "toolchain"
      ],
      "properties": {
        "os": {
          "type": "string"
        },
        "toolchain": {
          "type": "string"
        },
        "sandbox": {
          "type": "string"
        }
      }
    },
    "runtime_seconds": {
      "type": "number",
      "minimum": 0
    },
    "log_url": {
      "type": "string",
      "format": "uri"
    },
    "verdict": {
      "enum": [
        "pass",
        "fail",
        "error",
        "inconclusive"
      ]
    },
    "reviewers": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "kind"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "kind": {
            "enum": [
              "human",
              "ai"
            ]
          },
          "scope": {
            "type": "string"
          }
        }
      }
    },
    "verified_by": {
      "enum": [
        "platform",
        "literature"
      ]
    },
    "statement_fidelity_review": {
      "type": "object",
      "required": [
        "reviewer",
        "date",
        "outcome"
      ],
      "properties": {
        "reviewer": {
          "type": "string"
        },
        "date": {
          "type": "string"
        },
        "outcome": {
          "enum": [
            "faithful",
            "weaker",
            "different"
          ]
        }
      }
    },
    "supersedes": {
      "type": "string"
    },
    "superseded_by": {
      "type": "string"
    },
    "notes": {
      "type": "string"
    },
    "contributors": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "name",
          "kind"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "kind": {
            "enum": [
              "human",
              "ai"
            ]
          },
          "ref": {
            "type": "string"
          },
          "role": {
            "type": "string"
          }
        }
      }
    },
    "result_type": {
      "type": "string"
    },
    "submission_url": {
      "type": "string",
      "format": "uri"
    },
    "revoked": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "by",
        "date",
        "reason"
      ],
      "properties": {
        "by": {
          "type": "string"
        },
        "date": {
          "type": "string"
        },
        "reason": {
          "type": "string"
        }
      }
    },
    "binding": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "kind",
        "head_sha"
      ],
      "properties": {
        "kind": {
          "enum": [
            "ci-run",
            "review"
          ]
        },
        "pr_number": {
          "type": "integer",
          "minimum": 1
        },
        "base_ref": {
          "type": "string"
        },
        "base_sha": {
          "type": "string",
          "pattern": "^[0-9a-f]{40}$"
        },
        "head_sha": {
          "type": "string",
          "pattern": "^[0-9a-f]{40}$"
        },
        "source": {
          "enum": [
            "annotation",
            "run.pull_requests"
          ]
        },
        "run_id": {
          "type": "integer"
        },
        "job_id": {
          "type": "integer"
        },
        "job_name": {
          "type": "string"
        },
        "job_url": {
          "type": "string",
          "format": "uri"
        },
        "submission_digest": {
          "type": "string",
          "pattern": "^[0-9a-f]{64}$"
        },
        "approvals": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "login",
              "digest"
            ],
            "properties": {
              "login": {
                "type": "string"
              },
              "comment_id": {
                "type": "integer"
              },
              "digest": {
                "type": "string",
                "pattern": "^[0-9a-f]{64}$"
              }
            }
          }
        }
      }
    }
  }
}
