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.
What 'done' means for a change
card 5 of 6
What the diff says that the report didn't
The agent marked the lockout test as skipped ("flaky") and never said so. That is why "all tests pass": nothing checking the lockout ran. So there is no evidence (criterion 2), and the skip is hidden (criterion 6).
Second, if `limiter.hit` raises, say because the limiter's store is down, `except Exception: pass` silently lets every login through (criterion 6).
**Later cost:** while the store is down, password guessing is unlimited and the logs show nothing.
Done would mean three things:
- the lockout test runs, and fails if the limiter call is removed
- store failures are handled the codebase's usual way
- the report says both
// Python
--- a/auth/views.py
+++ b/auth/views.py
@@ -14,1 +14,6 @@ def login(request):
+ try:
+ if not limiter.hit(client_ip(request)):
+ return rate_limited_response()
+ except Exception:
+ pass
user = authenticate(request)
--- a/tests/test_login.py
+++ b/tests/test_login.py
@@ -20,1 +20,2 @@
+@pytest.mark.skip(reason="flaky")
def test_login_locks_after_5_tries():
Terms on this card
- diff
- The set of line changes between two versions of the code: removed lines start with '-', added lines with '+'.
- flaky
- Said of a test that sometimes passes and sometimes fails without any code change. Often used as an excuse to skip a test that is actually failing.
- store
- The shared storage (a database or cache server) where a rate limiter keeps its request counts. If it is unreachable, the limiter call fails.
- `except Exception: pass`
- Python code that catches almost any error and does nothing, so the failure vanishes without a trace.
- lockout
- Blocking further login attempts for an account or address after too many tries.
Lesson goal: State the criteria for a finished change: it does what was asked, there is evidence it works, it breaks nothing else, it fits the codebase's conventions, it is small enough to review and it hides nothing. Contrast this with 'the agent stopped and said it's done'. ·
the whole lesson