Sub topic 11
Check the result against the plan
This chapter assumes you have approved a plan and had the agent implement step 1 or more. You should be comfortable reading a diff and running your project's tests. The goal here is to confirm that what changed matches what you approved.
Why verification is a separate step
An agent can report "done" while the diff contains extra edits, a skipped step, or tests that never ran. The plan gives you a fixed reference. Without it, you can only ask "does this look reasonable?" With it, you can ask "is this what we agreed?"
Verification compares three things: the plan's file list, the plan's steps, and the plan's verification method.
Compare the diff with the plan
Start with the list of changed files. Run this after each step:
git status --short
git diff --statCheck the output against the plan's "Files" section. For the login rate-limit plan, you expect auth/routes.py and auth/limiter.py. You do not expect changes to requirements.txt, because the request said no new dependencies.
Then read the diff itself. Look for these problems:
- A file you did not expect to change.
- A change in a file that is unrelated to the step, such as reformatting or renamed variables.
- A step that is only partly done, such as the limiter module existing but never called.
- A new dependency, config key, or public function the plan never mentioned.
Use a checklist so you check the same things every time:
- [ ] Does the plan solve the problem I described, not a nearby one?
- [ ] Are all listed files ones I expect to change?
- [ ] Is anything changed that I did not ask for?
- [ ] Are the assumptions true for this project?
- [ ] Is there a concrete way to verify the result?
- [ ] Are the steps small enough to review one by one?The first and fourth items matter most at this stage. A diff can be clean and still solve a nearby problem, or rely on an assumption that does not hold in your project.
Run the verification the plan named
The plan's "Verification" section said to run the new tests and the existing auth tests. Run them yourself instead of relying on the agent's summary:
python -m pytest tests/test_login_limit.py tests/test_auth.py -vPassing tests show only that the behavior the tests cover works. Check that the tests cover the cases the plan listed: under the limit, at the limit, and after the window expires. A test file with one happy-path case passes easily and proves little.
Handle a deviation
When the result differs from the plan, decide which one is wrong. Sometimes the agent found a real problem, such as the client IP being behind a proxy. Then the plan needs revising. Sometimes the agent just drifted. Then the change needs reverting or fixing.
Name the deviation specifically in your reply:
The diff changes `auth/errors.py`, which is not in the plan. Revert that file
and keep the error format as it is. Then re-run the auth tests and show me the
output. Do not start step 2.A specific correction is faster than "this isn't right," and it keeps the approval gate in your hands.
Close out
After the last step, do one final pass over the whole branch:
git diff main --statCompare the full change against the full plan. Every planned file should appear. Every changed file should be explained by a step.
Exercise
The plan listed auth/routes.py and auth/limiter.py. After step 2, git diff --stat also shows requirements.txt, and all tests pass. Should you approve step 3? What do you do?
Show answer
No. requirements.txt is not in the plan, and the constraint was no new dependencies. Passing tests do not make the change acceptable. Ask the agent why it was changed, then have it revert the file or, if the dependency is truly needed, revise the plan first. Approve step 3 only after the diff matches the plan again.
Exercise
Name two things to check besides "do the tests pass" when verifying a finished step.
Show answer
Any two of: the changed files match the plan's file list; no unrequested changes appear in the diff; the step is fully done and not just partly; the tests cover the cases the plan listed; existing tests were not edited to pass; the plan's assumptions hold in the project.