# Verification record format

Every check that a maintainer logs on a submission gets one public record: `records/<id>.json`, listed on the
[Verification log](../records.html) with every outcome (`pass`, `fail`, `error`, `inconclusive`) and a filter. Not every CI
run is logged: a check enters the log when a maintainer labels the submission. Records are never deleted; a wrong one is
marked superseded (`supersedes`/`superseded_by`) or revoked (`revoked`) and the reason is logged. A later pass supersedes an
earlier failure record of the same submission.
They are written by the records bot (`.github/workflows/records.yml`, `tools/bot/records.py`):
* `status:check_passed` writes `verdict: pass`, only when a completed successful `verify` run bound to the exact pull request,
  head commit and job (and the base commit it used) and the evidence hash back it;
* `status:check_failed` writes `fail` (the job failed), `error` (cancelled, timed out, workflow broke, PR changes more than
  the submission file) or `inconclusive` (no run, or no job for this problem); `log_url` is the run;
see `MAINTAINERS.md`.

**Legacy records.** R-0001 and R-0002 were written before run binding: they have no `binding` object, their `checker.version`
was read from `main` at record time, and their `evidence` has no `raw_url`. They stay valid. The site marks them legacy,
counts them as verified passes, and never awards open-problem points for them. The API (`api/records.json`) adds a derived
`evidence.raw_url` and a `legacy` flag to every record; stored files are not rewritten.

Machine-readable schema: [`record.schema.json`](record.schema.json) (JSON Schema, draft 2020-12).

| Field | Type | Meaning |
|---|---|---|
| `id` | string | Unique, e.g. `R-0001`. |
| `problem_id` | string | The problem's `id`. |
| `protocol_version` | integer | The problem's `protocol_version` when the check ran. |
| `submission_id` | string | The submission this checks (`submissions[].id`). |
| `date` | `YYYY-MM-DD` | Day the check finished. |
| `commit` | string | Git commit SHA of the repository state that was checked (40 hex chars). |
| `evidence` | object | `{url, sha256, raw_url?}`: where the evidence artifact lives (GitHub page) and its SHA-256 (64 hex chars); `raw_url` is the raw-file link at the same commit (raw.githubusercontent.com), useful when the GitHub page is unavailable. The hash is of the exact bytes checked. |
| `checker` | object | `{id, version, source_url}`: frozen checker or `lean` / reviewer procedure, with its pinned version. For new records `version` and the permalink `source_url` come from the trusted BASE commit the run used (`binding.base_sha`), not from `main` at record time. `version: unbound` means no run could be bound (failure records only). |
| `binding` | object | Optional (absent on legacy records). What the record is tied to. `kind: ci-run`: `{pr_number, base_ref, base_sha, head_sha, source: annotation\|run.pull_requests, run_id, job_id, job_name, job_url}`; `base_sha` is omitted on a failure record whose run did not prove it. `kind: review`: `{head_sha, submission_digest, approvals: [{login, comment_id, digest}]}`, where each approval is bound to the digest (SHA-256 over the issue body, the evidence SHA-256 and the commit) that was current when the maintainer approved. |
| `environment` | object | `{os, toolchain, sandbox}`: for example OS image, Lean and Mathlib versions or Python version, and the sandbox limits (network off, memory, CPU). |
| `runtime_seconds` | number | Wall-clock time of the check. |
| `log_url` | string | Public URL of the full log (for example a CI run). |
| `verdict` | string | `pass`, `fail`, `error` or `inconclusive`. Only `pass` can lead to credit. |
| `reviewers` | array | `{name, kind: human\|ai, scope}` for each reviewer; empty for pure machine checks. An AI reviewer is always `kind: ai` and is displayed as an AI check, never as peer review. |
| `verified_by` | string | Optional. `platform` or `literature`; set only on a passing record. |
| `statement_fidelity_review` | object | Optional. `{reviewer, date, outcome}`: required before a problem is marked resolved. |
| `contributors` | array | Optional. `{name, kind: human\|ai, ref, role}`, copied from the submission; used for warm-up credit and to confirm the attribution of open-problem points (the credited person must appear here). |
| `result_type`, `submission_url` | string | Optional. Copied from the submission. |
| `supersedes`, `superseded_by` | string | Optional record ids. |
| `revoked` | object | Optional. `{by, date, reason}`: a maintainer revoked the record with `/revoke reason`. The record stays in the log; its points are removed. |
| `notes` | string | Optional. What was and was not checked; for a failure record, why the verdict was chosen. |

Example (illustrative values only):

```json
{
  "id": "R-0001",
  "problem_id": "example-problem",
  "protocol_version": 1,
  "submission_id": "S-0001",
  "date": "2026-12-01",
  "commit": "0123456789abcdef0123456789abcdef01234567",
  "evidence": {"url": "https://example.org/evidence.tar.gz", "sha256": "0000000000000000000000000000000000000000000000000000000000000000"},
  "checker": {"id": "certified/example-sum-of-squares", "version": "1.0.0", "source_url": "https://example.org/check.py"},
  "environment": {"os": "ubuntu-24.04", "toolchain": "python 3.12", "sandbox": "network off, 512 MB, 60 s"},
  "runtime_seconds": 1.8,
  "log_url": "https://example.org/run/1",
  "verdict": "pass",
  "reviewers": []
}
```
