keepcalculator

06 Numbers and Powers

Verify a Coding Agent Is Really Done

Card No. 06·41993 · Updated · Standard formula, shown below

This guide helps you confirm that a coding agent (an AI assistant or automated tool that writes code) has truly finished its task, not just stopped. You’ll learn a practical checklist to verify the work, test it, and avoid common pitfalls. Before you start, make sure you have access to the agent’s output, the original task description, and a way to run the code (like a local development environment or CI pipeline).

What You’ll Need

  • The original task description or ticket (including any acceptance criteria).
  • Access to the repository or codebase where the agent made changes.
  • A terminal or IDE to run tests and inspect the code.
  • Ability to run the project’s test suite (e.g., pytest, npm test).
  • Optionally, a code review tool (like GitHub PR review) to see the diff.

Step-by-Step

  1. Re-read the task and list acceptance criteria. Write down exactly what “done� means: what features, edge cases, and constraints were requested. If the task is vague, ask for clarification before accepting the work.
  2. Inspect the diff (changes). Look at every file the agent modified. Check for unrelated changes, deleted code, or commented-out blocks. A clean diff should only contain what’s necessary for the task.
  3. Run the full test suite. Execute the project’s tests. If any fail, the agent is not done. If there are no tests, run the code manually to verify behavior.
  4. Check for new tests. The agent should have added tests for new functionality or fixed bugs. If not, ask for them. Tests are part of “done� in most professional settings.
  5. Build and run the application. Compile or start the app (e.g., npm run build, python manage.py runserver) to ensure there are no runtime errors. Test the specific feature the agent was supposed to implement.
  6. Test edge cases manually. Try inputs that are empty, extremely large, or invalid. A truly finished agent handles these gracefully (e.g., shows an error message, not a crash).
  7. Review for code quality. Look for obvious issues: hardcoded values, missing error handling, security risks (like SQL injection), or performance problems. If you see any, send it back.
  8. Check for leftover debugging code. Search for console.log, print(), debugger, or similar. These should be removed.
  9. Verify documentation if needed. If the task required updating docs (README, API docs), confirm they are updated and accurate.
  10. Run the linter and formatter. Most projects have style rules. Run eslint, black, or equivalent. The agent should have followed them.
  11. Check for merge conflicts. If the agent worked on a branch, try merging it into the main branch (or at least check for conflicts) to ensure it integrates cleanly.
  12. Ask the agent for a summary. A good agent will tell you what it changed, how it tested, and any limitations. If the summary is vague, that’s a red flag.
  13. Do a final manual walkthrough. Use the feature exactly as a user would. If it works and meets all acceptance criteria, then—and only then—consider it done.

Common Mistakes

  • Trusting the agent’s word. Agents often say “done� when they’ve only partially completed the task. Always verify.
  • Running only the happy path. Testing only the normal case misses edge cases that will break in production.
  • Ignoring the test suite. If tests are failing, the work is not done, even if the feature seems to work manually.
  • Not checking for regressions. The agent might have broken existing functionality. Running the full test suite catches this.
  • Accepting a large diff without review. Unrelated changes can introduce bugs or security issues.
  • Skipping the build step. Code that passes tests might still fail to compile or bundle.

Tips

  • Use a checklist (like the steps above) every time. Consistency reduces mistakes.
  • If the agent provides a test report, verify it by running the tests yourself.
  • For complex tasks, break the work into smaller milestones and verify each one.
  • Use version control to revert changes if something goes wrong.
  • Consider using a second AI tool to review the agent’s code—but still do your own review.
  • Keep the acceptance criteria written down and refer to them during review.

Troubleshooting

Tests fail after agent changes. Look at the failing test output. If it’s a simple fix (like a wrong import), you can ask the agent to fix it. If it’s a design issue, you may need to revert and re-specify the task.

The agent says it’s done but the feature doesn’t work. Check if the agent actually ran the code. Sometimes it just writes code without testing. Ask it to provide a step-by-step reproduction of how it verified.

The diff is huge and messy. Ask the agent to clean up the changes, or revert and start with a more specific instruction. You can also use git diff to see exactly what changed.

No tests were added. Politely ask the agent to add tests for the new functionality. If the agent refuses, you may need to write them yourself or escalate.

Merge conflicts arise. If the agent’s branch is out of date, ask it to rebase or merge the latest main branch. Then re-run tests.

The agent ignores your feedback. If the agent repeatedly fails to address issues, consider switching to a different agent or doing the work manually.

Frequently Asked Questions

Q: Can I just trust the agent when it says it’s done?
A: No. Agents can hallucinate or miss requirements. Always verify with tests and manual review.

Q: What if there are no tests in the project?
A: Then you must manually test the feature thoroughly. Also, consider adding tests as part of the task.

Q: How long should verification take?
A: It depends on the task size. A small bug fix might take 10 minutes; a new feature could take an hour or more. Never rush.

Q: Should I check the agent’s code for security issues?
A: Yes, especially if the code handles user input or sensitive data. Look for common vulnerabilities like SQL injection or XSS.

Q: What if the agent’s code works but is poorly written?
A: That’s not “done� in a professional setting. Ask for refactoring to meet your project’s standards.

Q: Can I use a coding agent for production code?
A: Yes, but only after rigorous verification. Treat the agent’s output as a draft that needs human review.

Related

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.

More cards in this drawer

The whole Numbers and Powers drawer →