Review what comes back like a senior
Lesson 4 of 5 — read generated code adversarially, where models actually fail.
The failure classes models reliably produce, and how to review for intent and edges instead of style.
Prerequisites
Lesson 3 — you have tasks whose output you now need to judge.
Reviewing AI code
Reading generated code adversarially for the failures models reliably make — wrong assumptions, missing edges, plausible-but-wrong APIs.
Want the full picture? Open the reference →
The rubric — the classes models reliably miss
Run this on every diff
const user = await db.users.find(id);return user.profile.name; // TypeError when user or profile is nullconst user = await db.users.find(id);if (!user) return null; // the case it skippedreturn user.profile?.name ?? 'Anonymous';Quiz
A generated function is clean, well-named, and passes the test the model wrote. What is left to do?
Take a diff a model gave you recently and run all seven rubric items on it. Find at least one thing you would change.
Concepts covered · 1
More like this
Add todos with JavaScript
Wire the form so typing and pressing Add creates a real item. You will hold the todos in an array and render the list from it — the pattern every UI framework formalises later.
Complete & delete
Click a row to toggle it done; click the × to delete it. You will do it with a single listener on the list — event delegation — instead of one per row.
Orchestrate agents without the codebase rotting
Putting it together: context, guardrails, and a verification loop that lets you run coding agents across a real codebase without it drifting into an incoherent pile. This is the senior loop at full speed.
Liked this one?
Pass it on
Discussion
Be the first to ask
Your questions stay private with the team. We can pin answers to share with everyone.
Sign in to ask a question privately on this tutorial.
Sign inNo pinned answers yet for this tutorial.