cachly← All posts
AI coding agents

My AI swore all tests passed. Here's the free one-file fix that makes it prove it.

My agent told me "All tests pass." It had run 74 of our 105 test files. Another time it wrote "The email went out at 08:45." The clock said 08:37. A third time: "14 people clicked Sign in." Those were page views. Nobody had counted clicks.

None of that was lying. The agent said what it believed. The trouble is that "done" is a sentence, and a sentence costs nothing to write.

So I stopped accepting sentences. A task is done when one command exits 0. The command writes a receipt, and the agent pastes the receipt instead of the word "done". Here is the free version of that, in a single file.

What you get

proof-gate is one Node file. No dependencies, MIT, 8 tests of its own. It does two things for every task:

  1. It runs your checks (tests, build, lint, anything with an exit code).
  2. It writes a receipt: the commit, the time, every command and its exit code.

It works the same with Claude Code, Cursor, Copilot or a plain shell. It does not talk to any model. It only reads exit codes.

Step 1: put the file in your repo

git clone https://github.com/cachly-dev/proof-gate
cp proof-gate/proof-gate.mjs ./proof-gate.mjs

You need Node 18 or newer. That is the whole install.

Step 2: describe one task

Create proof-gate.json in your project root. This one guards a rate limiter:

{
  "tasks": {
    "rate-limit": {
      "checks": [
        { "name": "acceptance", "run": "node --test test/rate-limit.test.mjs" },
        { "name": "build", "run": "npm run build" }
      ],
      "controls": [
        {
          "name": "says no when the limit is off",
          "run": "node --test test/rate-limit.test.mjs",
          "env": { "RATE_LIMIT_DISABLED": "1" }
        }
      ]
    }
  }
}

The controls block is the part people skip, so one line on it. A control is the same check pointed at something that is supposed to be wrong. It must fail. If it passes, the gate goes red, because a check that cannot fail proves nothing. I cover that in a separate post. For now, copy the block and adapt it.

Step 3: run it

node proof-gate.mjs rate-limit
TASK: rate-limit
GATE: 0 (3/3)
RECEIPT: .proof-gate/receipts/rate-limit.json
NOTE: -

Four lines. Exit code 0 means green, 1 means red, 2 means refused (the setup is incomplete and nothing was judged). Refused is never green.

When something is wrong you get the first problem in NOTE:

TASK: rate-limit
GATE: 1 (2/3)
RECEIPT: .proof-gate/receipts/rate-limit.json
NOTE: control passed, so the check cannot say no: says no when the limit is off

Step 4: make the agent hand over the receipt

Add this to CLAUDE.md, AGENTS.md or your Cursor rules:

## Done means
- A task is done when `node proof-gate.mjs <task>` exits 0. Paste its four lines.
- If the gate is red, say so. Do not call the task done.

That is the change. The agent can still be wrong, but it can no longer be wrong quietly.

Why a receipt and not just the exit code

The receipt is .proof-gate/receipts/rate-limit.json. It holds the commit hash, a dirty flag, the time, and the last 20 lines of output from every command.

On 24 November my own worker agent reported "gate green". I looked at the receipt. The commit in it was the one before the agent's change. The agent had run the gate before it committed, so the green belonged to the old code. Without the commit in the receipt I would have believed it.

The same day, a feature gate of mine was green with 6 of 6 steps. The full server tests were red. One of them requires that every server route has a caller in the app, or a written reason why not. My gate had never included the full tests. I found it before the push, and now the full test run is part of the gate. A gate is only as honest as the list of things in it, and the receipt makes that list visible. If the checks you expected are not in the receipt, you see it.

Where it runs

The gate is a plain command, so it fits wherever you can run a shell command:

You can also run it after the agent says "done" and before you read a single line of the diff. If it is red, you saved yourself the reading.

What it is not

Try it tonight

Pick one task you gave an agent this week. Write its proof-gate.json entry with one check and one control. Run it. Two things can happen. It goes green and you now have a receipt. Or it goes red or refused, and you just learned something about a task you thought was finished.

The repo is here: github.com/cachly-dev/proof-gate. There is also a full version, free: the Agent Proof Kit, with task packs, a model ladder and a ledger around the gate. Leave your address at cachly.dev/forge and the download link arrives after you confirm. That is all I will say about it here.

What is the last "done" from an agent that turned out not to be?

cachly.dev

For solo developers, teams and whole companies

Explain it once. Every AI knows it.

Shared team memory between your code, your tickets and your AI. Hosted in the EU, in every tool. cachly keeps the fixes, the decisions and the traps, so the next session starts with them. Claude Code, Cursor, Copilot, Windsurf, Codex, Gemini CLI and JetBrains all read it. Free for one project, no card needed.

Servers in the EU · one command, restart your editor, done · 1 project free

Four ways to install

Claude Code
/plugin marketplace add cachly-dev/cachly-mcp
/plugin install cachly-brain@cachly

Then turn on auto-update once: /plugin → Marketplaces → cachly → Enable auto-update

Any MCP editor
npx @cachly-dev/mcp-server@latest autopilot