Work effectively with AI coding agents. Understand them as language models running in a tool loop with limited context, which is why they guess, game the visible signal and report confidently. Recognise the shortcut and correctness tells in their code across Python, TypeScript/JavaScript, Rust, Java and Go, and know the damage each one does later. Verify changes instead of trusting them, review diffs fast for quality and security, judge when work is truly finished, and choose, design and steer tasks so agents can finish them well.
Verify an agent change instead of trusting it
card 4 of 6
Running the plan on the coupon fix
builds on: Mocks that test nothing, Tests that restate the implementation, See it fail: red before green and break-it checks, Pin behavior before a refactor, Let the toolchain check first
You keep the agent's test, remove just the 3-line guard and rerun: green. That is the tell. The test never reached the bug, so it proves nothing about the fix. You ask for a test that applies the coupon twice. Old code: red, total 81. With the fix: green, 90. Flip the guard's condition: red again. Last, run the full suite, mypy and CI, and check that the diff added no `# type: ignore` comments or config changes.
Terms on this card
- tell
- An observable sign in a diff, transcript or summary that suggests a shortcut or an error.
- guard
- A check at the start of a code path that stops or skips the work when a condition holds, e.g. 'coupon already used'.
- mypy
- A static type checker for Python that reports type errors without running the code.
- # type: ignore
- A Python comment that tells the type checker to skip errors on that line. Adding one silences a check instead of fixing the problem.
- CI
- Continuous integration: a server that automatically builds the code and runs its tests and checks on every push or pull request.
Lesson goal: For a given change, build a short verification plan: reproduce the problem, see the tests fail and then pass, judge whether the tests could catch a real bug, pin behaviour before refactors and run the toolchain checks. Explain what evidence each step gives you. ·
the whole lesson