A requirement should say how to check itself
The previous post ended with a condition: rewriting a requirement only works if the file says how to check it. This post is about that sentence.
An agent that finishes a task reports that it is done. It is not lying; it believes it. The trouble is that “done” is its own judgement, and when you let the author grade the work, the grade is always good. People have the same problem, which is why engineering invented acceptance tests, code review and the separate QA team. Agents just made it cheap to produce work faster than anyone can review it.
We looked at three ways to decide what “done” means:
- Keep a separate catalogue of test cases, maintained next to the requirements, or
- Let a reviewer, human or model, read the result and decide, or
- Write the check into the requirement itself, so the requirement and its proof are one file.
We chose the third. Every requirement carries its acceptance criteria, and a requirement without a criterion does not go to work. A criterion is one of three kinds. A command the machine runs, with an exit code: no opinion involved. A judgement by a second model, with the evidence it must read named in advance; never the model that wrote the code. Or a picture: a reference screenshot, because a screen that is only checked by its markup can pass with no styling at all. We learned that one the hard way, when a tester that could not see closed its checks as “unable to verify” and bare pages were accepted for a while.
This is an old idea too. Bertrand Meyer called it design by contract: a routine states what it promises, and the promise is checked, not assumed. Behaviour-driven development put the check into the specification language. We only moved it to where the agent cannot avoid it.
The arrangement has a useful side effect. The pipeline runs the criteria, not the agent, so a failed criterion holds the requirement outside “confirmed” no matter what the report says. And because the criterion lives in the file, it is rewritten together with the requirement, which is what keeps the previous post’s rule honest: the file says what the system does now, and how to prove it.
The price is the usual one. Writing a checkable criterion takes longer than writing a wish, and some things are hard to check by command. For those we accept a judgement with named evidence, and we keep a list of what still needs a human eye, for anyone who wants the detailed log. The next post will be about where all the work comes from in the first place.