okproof

v0.4.0
io.github.okproof/okproof Checked 3 hours ago Published 21 hours ago

Proves agent-written pull requests against their acceptance criteria with passing tests.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

okproof_criteria

List the acceptance criteria in the repo's proof files (.okproof/<issue>.md) with the exact tag to put in a test title so the test claims that criterion, e.g. "upgrade works [okproof:142.1]". Call this first to learn what you must prove.

ParameterTypeDescription
dirstringFolder holding proof files, relative to the working directory. Default ".okproof".
issuestringOnly list this issue (matches /^[\w-]+$/), e.g. "142". Default: every proof file.

okproof_status

The definition of done. Call this BEFORE telling the user a task is finished. Reports, per issue, which acceptance criteria are proven (met), failed or untested, based on the ledger the test run wrote. The first line is the verdict ("Done" or "Not done"); a "Next steps" list names every unmet criterion and its tag. Untested counts as not done, and so does "unproven" (the tagged tests passed but asserted nothing). Each row shows its evidence level against the level it requires, e.g. [E2/E3 ▰▰▱]; "insufficient" means the tests pass but the criterion needs stronger evidence, and a "Raise th…

ParameterTypeDescription
dirstringFolder holding proof files and ledgers, relative to the working directory. Default ".okproof".
formatstringjunit or ctrf. Default: guessed from the results file.
issuestringOnly report this issue (matches /^[\w-]+$/). Default: every proof file.
resultsstringA JUnit XML or CTRF JSON file from this working directory. When given, the ledgers are rebuilt in memory from it (as okproof gate --results does in CI) and committed ledgers are ignored.

okproof_ingest_junit

Turn a JUnit XML test report (from Playwright, Jest, Vitest, pytest, ...) into okproof ledgers by matching test names that contain [okproof:<issue>.<n>] tags. Run your tests with a JUnit reporter first, then call this, then call okproof_status. Never posts to GitHub. The file must be inside the working directory.

ParameterTypeDescription
file *stringPath to the JUnit XML file, relative to the working directory.
dirstringFolder holding proof files; ledgers are written here. Default ".okproof".

okproof_add_criterion

Append one acceptance criterion ("- [ ] text") to .okproof/<issue>.md, creating the file if needed (then "title" is required). Returns the new criterion id and the tag to put in test titles. Agents may only ADD criteria: there is deliberately no tool to remove or edit them, so these tools cannot weaken a proof. (An agent that can edit files could still change .okproof/ by hand; keep it under CODEOWNERS.) If a criterion is wrong, tell the user.

ParameterTypeDescription
issue *stringIssue id, matches /^[\w-]+$/, e.g. "142".
text *stringThe criterion, one line, phrased as observable behaviour a test can check.
dirstringFolder holding proof files, relative to the working directory. Default ".okproof".
titlestringIssue title for the "## #<issue> <title>" heading. Required only when the proof file does not exist yet.

okproof_lint

Static check for weak and unrelated tests: finds tests tagged [okproof:<id>] whose body has no assertion or only trivial ones (expect(true).toBe(true)), tests whose body never mentions any key word of the criterion they claim (reported as "possibly unrelated", advisory), tags that name a criterion no proof file lists, and criteria no tagged test claims. A tag is a claim; an assertion is evidence. Heuristic, never runs your tests. Paths must stay inside the working directory.

ParameterTypeDescription
dirstringProject root to scan, relative to the working directory. Default ".". Proof files are read from <dir>/.okproof.
strictRelevancebooleanTreat "possibly unrelated" findings as failures. Default false (advisory).
testsstringLimit the scan to this directory, file or simple glob (relative to dir), e.g. "tests/ui" or "tests/**/*.spec.ts".

okproof_suggest

For each criterion no tagged test claims, lists existing untagged tests whose names share key words with it (advisory only: it never edits a test, and a similar name is not proof). Read a candidate before tagging it [okproof:<id>]. English-only keyword matching. Paths must stay inside the working directory.

ParameterTypeDescription
dirstringProof folder, relative to the working directory. Default ".okproof".
maxnumberCandidates per criterion, 1 to 20. Default 3.
testsstringLimit the scan to this directory, file or simple glob of test sources.

okproof_verify_findings

Check review findings (machine or human) against the code with no model: confirmed (the quoted code is still there and the repro still fails), fixed, false-positive-suspect (the quoted code never existed), outside-scope (not in the PR diff) or unverified. Call it on a review before acting on the review, to separate real findings from invented ones.

ParameterTypeDescription
findings *Either a path (inside the working directory) to a findings file (JSON or markdown, see docs/review-findings.md), or the findings themselves as an array of {id, title, claim, file?, line?, quote?, seve…
allow_commandsbooleanAsk to run repro commands found in the findings. Default false: a findings file is untrusted. Honoured only when the MCP server was started with `okproof mcp --allow-commands`; otherwise those finding…
basestringPull request base ref. Findings about files outside `git diff base...HEAD` are outside-scope.
blocking_severitystringlow, medium, high or critical. A confirmed finding at or above this blocks. Default high.