# Evidence or it didn't happen

Table of Contents

The previous posts covered checking an agent’s work from the outside using nightly personas and fresh reviewers. Before either of those run, the agent that wrote the code has to prove it works.

When an agent says a task is done, it usually means the code compiles and its own tests pass. Neither proves the feature actually works.

Done is a contract

Every task ends with the same four checks, and the agent’s final message must show proof for each:

  • Verified where it shows up. Checked where a real user would notice it, not just in a unit test.
  • Reviewed. Passed the two-reviewer check.
  • Small commits. Each commit is an isolated change that builds and passes on its own.
  • Records updated. New terms added to the glossary, questionable choices logged, and remaining work noted in the issue.

Verification carries the most weight and requires hard evidence: a command and its output, a screenshot, or a value read back from the database. “It compiles”, “tests should pass”, or another agent’s summary do not count.

Check the thing the user sees

Unit tests only prove the isolated code they cover. To prove a change works, the agent verifies the real output:

The changeWhere it’s checkedThe evidence
A screenThe actual screen, signed in as a seeded userBefore-and-after screenshots in both app languages
An emailThe local test mailboxThe received email, its language, and its links
An assistant toolA direct tool callIts output and the resulting database state
Stored dataA post-action queryThe actual value read back
A background jobTriggering the jobThe resulting state and log output
Pure logicIts unit testThe test output

Two rules keep this honest:

  1. No shortcuts. The agent must set up the check using real user flows, never test-only endpoints or direct database writes. Shortcuts only prove the shortcut works.
  2. Suspect the setup first. When a check fails, look for a wrong port, a stale browser tab, or a lagging background job before rewriting code. Ruling out environment issues first prevents bad fixes.

Inconclusive is not a pass

Sometimes a check can’t run because the stack won’t start, a job won’t trigger locally, or the seed lacks specific data.

In that case, the agent must report inconclusive and leave the task open, rather than rounding up to a pass. For example, when fixing stuck uploads with a new nightly cleanup job, the agent verified the UI in both languages but marked the background job inconclusive since it couldn’t trigger it locally. That honest gap is far more useful than a false green checkmark.

The evidence ends up in the pull request

Screenshots and videos don’t belong in the main code branch. A script pushes them to an unmerged asset branch and outputs Markdown links for the pull request’s “Verification” section.

Every PR shows exactly what was tested. A recent feature letting owners view sent emails included:

  • Test runs per project, with email tests executed three times in a row.
  • Paging verification on the running stack, confirming a page of 100 and pages of 7 returned the exact same 51 rows in order.
  • Screenshots of the disabled feature flag, the sent email list, and an opened email in both languages.
  • A video recording of opening an email.

Similarly, a database connection pool tweak included load-testing metrics: under eight concurrent users, 95th-percentile home page load times dropped from 273–282 ms to 180–198 ms. It also explicitly noted what wasn’t measured, like production traffic. Documenting untested areas is evidence too.

Bugs get a red test first

For bug fixes, the sequence is strict. The agent must prove the bug exists before touching application code:

  1. Reproduce it. Run a fast, repeatable command or test that fails due to the bug.
  2. Guess and rule out. List three to five possible causes, testing the cheapest one first and ruling others out with real output rather than guesses.
  3. Commit the failing test alone. This leaves a clear history showing the test failing prior to the fix.
  4. Fix the root cause. Patch it where all callers pass through, not just at the reported symptom.
  5. Show red, then green. Quote both the failing and passing test outputs in the final message.

Committing the failing test on its own is cheap and makes the fix verifiable months later.

Where to start

  1. Define “done” in writing. Give the agent a four-point checklist it must prove in its final message.
  2. Ban weak evidence. Reject “it compiles”, “tests should pass”, and second-hand summaries.
  3. Allow “inconclusive” as an answer. Let the agent admit when it couldn’t verify something so it stops faking passes.
  4. Put evidence in the pull request. Keep screenshots and metrics in the PR rather than a disappearing chat log.

Start with the written definition of done. Four clear rules change how an agent works more than adding hundreds of extra tests.

Grab the work and verify skills, bug playbook, and evidence script from shipping-with-an-agent/evidence, copy them into your repo, and customise your checks.

Next: Your agent needs a map, not a manual

Shipping with an agent Series

Comments