Closing the Loop: Verification, Tests, and Feedback
An agent that stops as soon as the code "looks right" is still just guessing. The most valuable thing an agentic workflow can do is close the loop: actually run the change and look at what happens.
"It compiles" is not "it works"
Code that type-checks or compiles has only cleared the lowest bar. It hasn't been run, hasn't been tested against real input, and hasn't been looked at by a human. A change that passes a type checker can still be completely wrong.
What closing the loop looks like
- Run the test suite. If it fails, read the actual failure, not just "tests failed," and let that feedback drive the next fix.
- Run the app. For a backend change, hit the endpoint. For a UI change, load it in a browser and look at it, don't assume a component renders correctly just because the JSX looks plausible.
- Check logs and console output. Warnings and errors that don't crash the process are still worth reading.
- Try the edge case, not just the happy path. Empty input, a zero, a missing field, the case most likely to have been overlooked.
❌ "I've implemented the search filter." (never actually run)
✅ "I've implemented the search filter, ran the existing tests
(all pass), and manually tried searching for a term that appears
in zero results, which correctly shows an empty state."
Let failures drive the next step
The real power of an agentic loop is using a failure as input: a failing test's stack trace, a browser console error, an API's 400 response, each tells the agent (and you) exactly what's still wrong. An agent that reads and reacts to that feedback will converge on a correct solution far faster than one that just tries something once and stops.
You still verify the parts automation can't see
Automated tests and compilers won't tell you if a feature actually solves the user's problem, if the UI looks right, or if the "fix" just papers over the real bug. Skimming a diff and seeing green checkmarks is not the same as using the feature yourself.
TIP
A useful habit: before marking any agent-driven task done, ask "did I (or the agent) actually run this, or does it just look plausible?" If the honest answer is "just looks plausible," that's not done yet.