What the gate trusts

The real control is CODEOWNERS plus required review. (okproof now also compares the proof files with the base branch and fails the gate when a pull request weakens a criterion: okproof gate --base, on by default in the Action as criteria-guard. That catches the edit; it does not replace a person reading it.) okproof compares evidence with criteria, but it cannot stop someone with write access from editing the criteria, the workflow or the okproof settings, and it cannot make its own check required. Only repository settings can: a CODEOWNERS entry for .okproof/ (and the workflow), "Require review from Code Owners", and the okproof job as a required status check. okproof cannot enforce those, so okproof doctor checks them for you (read-only) and says what is missing. Everything below describes what the gate believes once those are in place.

okproof proves a pull request against its acceptance criteria. That only means something if the evidence cannot be written by the author of the pull request. This page says what the merge gate believes, and what it does not.

Ledgers are a cache, not evidence

okproof ingest writes .okproof/ledger-<issue>.json. A committed ledger is just a file. Anyone who can push can hand-write one that says every criterion is met, so okproof gate on its own only checks that a ledger agrees with its proof file. It prints this warning when it runs that way:

warning: ledger is not bound to a test run in this job.

Bind the gate to the job's own test run instead:

npx vitest run --reporter=junit --outputFile=junit.xml   # or any runner that writes JUnit or CTRF
npx okproof gate --results junit.xml --require-issues 142,143

gate --results <file> [--format junit|ctrf] rebuilds every ledger in memory from that results file and the proof files, and ignores .okproof/ledger-*.json completely. A forged ledger has no effect. The GitHub Action does this for you whenever the results input is set, and prints a workflow warning when it is not.

Ledgers written by okproof ingest also record results_sha256 (the hash of the results file) and proof_sha256 (the hash of the proof file text), so a reviewer can tell which run and which criteria a ledger describes.

Do not commit ledgers

Because the gate rebuilds them, committing ledgers is unnecessary and only invites forgery. Keep proof files in git and ledgers out:

# okproof: proof files (.okproof/<issue>.md) are committed; ledgers are rebuilt in CI
.okproof/ledger-*
.okproof/verify-*.json

Refutations in CI

Commit .okproof/repro/*.json (they are model-free and reviewable) and keep verify-*.json out of git. A repro in the tree is a recorded bug. The gate treats it as a problem unless the job replayed that exact file (okproof verify --replay-only --json replays.json, checked by sha256) and the bug no longer reproduces: okproof gate --replays replays.json, or --require-replays to fail when no replay results are supplied. Replays never send your --header credentials to another origin: extra headers are added to requests for the app origin only, a replayed goto to another origin is refused, and a replay with credentials needs --url.

One proof file per linked issue

A pull request that says "Closes #142" must carry .okproof/142.md. The Action passes every linked issue to okproof gate --require-issues, so renaming 142.md to another issue id, or replacing it with a file for an easier issue, fails the gate with #142 is linked by the pull request but there is no proof file. okproof gate also fails any proof file whose heading (## #142 ...) does not match its filename, and okproof sync --check fails when the file's criteria, title or heading differ from the issue.

Set the Action input require-linked: false only if your pull requests close issues okproof does not track. With sync: write a missing proof file is created from the issue instead.

Verifier findings are attributed

okproof verify runs automatic detectors (console errors, failed requests, ...) after every action. A finding refutes a criterion only if the agent's own action caused it and, for network failures, the failing URL is on the app's origin:

Pass --strict-detectors (option strictDetectors) for the old page-global behaviour.

Verifier authentication

To verify pages behind a login, give the verifier a session instead of a password:

okproof verify --url http://localhost:3000 \
  --storage-state auth.json \
  --header 'X-Test-User: qa' \
  --login ./login.mjs

Cookie and header values are never printed or written to .okproof/. Keep the storage-state file out of git.

Optional peer dependency

@anthropic-ai/sdk is an optional peer dependency, needed only by okproof verify when it calls the Claude API. It is pinned to >=1.0.0 <2.0.0 (the current major is 1.x), so a future breaking major is not picked up silently. Everything else in okproof has zero runtime dependencies.

View source on GitHub