The proof-first checks
okproof's rule is that an auditor should try to disprove "done", and that silence is not proof. These checks add the ways a green run can still be wrong: it was incomplete, it tested a different build, it fixed one example of a bug but not the bug, it never tried two people at once, or the brief says something the criteria do not.
Everything here is deterministic. None of it calls a model.
Partial runs
A results file can look fine and still be a fragment: the runner was killed, a shard was lost, a suite was skipped. Without a signal, every criterion the missing tests covered just looks untested.
okproof marks a run incomplete when any of these holds:
- the report has fewer testcases than a baseline (
--baseline <n|results file>, Action inputbaseline, envOKPROOF_BASELINE); - the report marks itself aborted, truncated, interrupted or partial (JUnit suite attribute or
<property>; CTRFextra); - the report's own summary disagrees with its contents (JUnit
tests=against the number of<testcase>; CTRFresults.summary.testsagainst the length ofresults.tests); - the JUnit XML ends inside an open
<testsuite>.
In an incomplete run, criteria with no evidence get the verdict partial (not untested) and the gate says "the test run looks incomplete". A testcase left open at the end of a truncated file is not trusted either: a tagged test that was cut off becomes partial, never met. partial never passes.
Limits: the summary check is !=, so a report that repeats testcases (reruns) may be called incomplete; this only affects criteria that had no evidence anyway. Without a baseline, a run that is complete but small is not detected.
Wrong build
A green run proves nothing about a pull request if it came from another commit. Give okproof the commit it should have seen:
okproof gate --results results.xml --expect-commit <sha>[,<sha>] [--expect-url https://app.example.com]
or set OKPROOF_EXPECT_COMMIT / OKPROOF_EXPECT_URL. The Action sets the commit by default to the job commit and the pull request head (input expect-commit; off disables it; expect-url adds the origin).
Where okproof reads the identity the results carry, strongest first:
- The results file: JUnit
<property name="okproof.commit" value="...">andokproof.url; CTRFextra.commit(orresults.environment.commit) andextra.url. - The environment where okproof ran:
GITHUB_SHA. This says where okproof ran, not what the tests ran against, so it is labelledenv. To make the check mean something, have your test run write the commit into the report.
If an expectation is given and the recorded commit differs or is missing, every criterion becomes wrong-build and the gate fails with "tested a different build". A short sha matches by prefix (7 digits or more). With --expect-url, a recorded URL on another origin fails; a missing URL is ignored. A verify-<issue>.json recorded against another non-local origin fails the gate too.
It is only active when an expectation is given, so nothing changes for existing setups. The Action always gives one.
Ledgers record the check: build: { ok, recorded: { commit, url, source }, expected, reason }, and incomplete: [reasons]. See schemas/ledger-run.schema.json.
The Decision header
The ledger markdown and the PR comment start with a header:
**Decision: NOT DONE.** 2 met · 1 partial
Blocked because the test run looks incomplete (...), so 1 criterion has no evidence.
Still needs a live check after deploy: 7.1 (E2, unit-level).
- Counts per verdict, including
partialandwrong-build. - One blocking reason, in this order: wrong build, a failed criterion, an incomplete run, insufficient evidence, tests that assert nothing, no test.
- "Still needs a live check after deploy": criteria that are
metwith evidence below E3. E1 and E2 mean passing tagged tests only;okproof verifynever drove the running app for them. They are labelledunit-levelwhen no claiming test points at a trace, screenshot or video, andtest-onlyotherwise. This is a heuristic on the evidence strings the runner reports, not a measurement of what the test touched.
Root-cause variants
When okproof verify confirms a failure (a probe, or the model), it varies the failing recorded actions to test the defect class:
| Variant | What changes |
|---|---|
whitespace-padded, whitespace-only, empty | the typed values |
very-long (10,000 characters), unicode-rtl (right-to-left, emoji), special-characters | the typed values (the original text is kept inside, so the same assertion applies) |
max-number, min-number | numeric input only |
repeat-x2, repeat-x3 | the last click or key press is performed again |
after-reload, after-back-forward | a reload, or back then forward, before the assertion |
width-375 | a 375px viewport |
offline-online | the network is cut and restored |
Each variant runs in a fresh browser context (one Chrome) with the failing assertion reused. fails means the same defect appeared again; passes; not-comparable when the variant changes what the assertion looks for (empty input against "the typed text is still there"); error when a step could not run. Results are saved in the repro file as variants: [{name, result, note?}] (schemas/repro.schema.json), and the CLI prints "class breadth: 3 of 9 comparable variants also fail (...)".
A fix is narrow when the exact example passes but variants still fail. okproof verify --replay-only --variants re-runs the variants for saved repros and prints NARROW FIX: ...; it exits 1 in that case.
Flags: --no-variants turns it off for verify (on by default in the CLI, off for library callers). Limits: the variants are a fixed list, not a search; a variant can only be judged by the assertion that failed, so text assertions skip the replacing variants.
Sequence checks
Probes that need more than one screen or one person. They have their own registry and keywords (not the seven probes), run only when a criterion's words match, and report only what a replay in fresh browsers confirms. --no-sequences turns them off (on by default in the CLI, off for library callers).
| Check | Runs when the criterion mentions | What it does |
|---|---|---|
n-records | second record, multiple, several, each record, overwrite, more than one, ... | Creates three records through the same form in one session. After each, every earlier record that was visible must still be there; after a fresh load all must be. Catches "the second record overwrote the first" through stale form state. |
two-actors | concurrent, two users, another user, session, isolated, private, leak, ... | Two independent browser contexts (separate cookies and storage). A adds a record; B loads the page and must not find A's value in B's form fields; B adds a record; A reloads and must still have its own record. With an isolation word in the criterion (isolated, another user, private, leak, session), B must not see A's records at all. Without one, a shared list is legitimate and is not flagged. |
in-app-navigation | navigate, navigation, menu, link, click through, ... | For up to three links: loads the page fresh by URL, then reaches it by clicking from the start page, and flags a blank page, a different heading or a page exception. |
Actions of a two-actor repro carry an actor tag (A or B); okproof verify --replay-only replays those with one context per actor.
Limits: the form is found like the persistence probe finds it (the first text fields and a submit button), and records are judged by what the page shows. An app that does not list records after saving them cannot be judged and the check reports "not applicable".
Review findings and the brief
See review-findings.md for okproof verify-findings.
okproof brief-check <brief.md> [dir] [--strict] [--json] compares a product brief with the proof files:
- rules are sentences with
must,never,always,shall,cannotormay not(outside code fences), with their heading as context; - an uncovered rule has no criterion sharing enough of its keywords (a warning, an error with
--strict); - a contradiction is a criterion about the same thing as a rule that disagrees: opposite polarity ("never charged twice" against "is charged twice"), or a different number for the same unit ("5 attempts" against "3 attempts"). Exit code 1;
- an ungrounded criterion matches no sentence of the brief (a warning).
Limits, stated plainly: it is keyword overlap on English text. It does not understand synonyms, negation scope, scope of a rule, or arithmetic ("1 hour" against "60 minutes" is a mismatch for the word "hour" only if both say hours). A contradiction is a pointer to read two lines, and an uncovered rule may only mean the criterion uses other words. The Action input brief runs it.