We built a merge check that fails until every acceptance criterion is proven by a test

2026-12-02来源 dev.toEnglish

When a coding agent tells us "done", we used to open the diff and hope. The tests were green, but nothing told us whether they covered what the issue actually asked for. So we built a small tool to check that, and we'd like honest feedback on it.

It's called okproof. The idea is simple: the acceptance criteria of an issue live in the repository, a test claims a criterion by name, and the merge check stays red until every criterion has a passing test behind it.

How it works

A proof file lists what "done" means for an issue:

## #142 Member can upgrade to Pro - [ ] A member can upgrade from the settings page - [ ] The receipt email is sent after the upgrade 

A test claims a criterion with a tag in its title:

test('upgrade from settings [okproof:142.1]', async ({ page }) => { // ...real assertions here }); 

Then okproof reads your test results (Playwright, JUnit XML or CTRF) and says, per criterion, whether it is met, failed, untested, or backed by a test that asserts nothing. A criterion with no passing, asserting test blocks the merge.

npx okproof init npx okproof check 

What we think is different

  • The verdict is deterministic. No model decides if a criterion is met. A passing, asserting, tagged test does.
  • It watches for the cheap ways to fake it. It flags tests that pass without a single assertion, criteria quietly reworded or removed in the same pull request, and skipped or deleted tests.
  • It plays well with coding agents. There is an MCP server, so an agent can check its own work, and a hook that stops it from declaring victory while the gate is failing.
  • No runtime dependencies, Node 20 or newer, Apache-2.0.

There is also an optional "verifier" that attacks a running app with a model, but it only counts a bug if a replay without the model reproduces it.

What it can't do

We'd rather say this up front:

  • It can't tell whether a test is a good test. A weak test that really passes and really asserts something still counts. It narrows the gap, it doesn't close it.
  • It's young: a few weeks old, pre-1.0, so far maintained by one person, and file formats may still change between minor versions.
  • If your pull request's own code runs in the same job as the gate, that code can influence the results. For fork pull requests there's a split workflow where tests run unprivileged and the gate runs separately, and the docs say plainly what that does and doesn't protect.

Where we'd love help

We want an independent reviewer from outside the project to read the security-sensitive parts and tell us where we're fooling ourselves. We recently did a review pass and fixed a handful of real issues, including forged evidence files and some injection paths. A second pair of eyes would still beat our own.

If you try it on a throwaway repo and it's confusing, or it flags something it shouldn't, please open an issue. Those reports are the most useful thing we can get right now.

原文:https://www.a8q9.cn/en/article/we-built-a-merge-check-that-fails-until-every-acceptance-criterion-is-proven-by--b2bf17.html

相关文章