iCode Workbench · Guide · Review
Agent diff review checklist
A checklist does not review the diff for you. It keeps the review from collapsing into “the tests pass” on a day when you are tired. Use it risk-first: scope, tests, error handling, security, performance, style, then the decision.
This checklist pairs with how to review AI-generated code. The guide explains the workflow; this page is the list you keep open.
This guide is currently available in English only.
How to use this checklist
- Review in the checkout, not in chat. Open the diff where the agent worked; the surrounding code and the tests are part of the review.
- Start with the file list. Scope and test changes are the highest-signal lines; read them before the code.
- Go risk-first. Auth, data, shared interfaces, and dependencies before formatting and docs.
- Timebox the pass. If a diff takes more than 20–30 minutes, it is probably too large to review well; split the task.
- Batch the feedback. Collect line notes and send one pass, not five small messages.
1. Scope
- Does the file list match the task, or did the agent drift?
- Are there files outside the owned paths? Why?
- Is the diff small enough to read in one sitting? If not, split the task.
- Are there unrelated formatting, rename, or dependency changes?
2. Correctness
- Does the change do what the task asked, not just something plausible?
- Are the edge cases covered: empty input, missing value, duplicate call, partial failure?
- Did the change respect the callers and the public types?
- Are there new branches that no test exercises?
3. Tests
- Did the test fail before the fix and pass after?
- Were any tests deleted, skipped, or weakened?
- Does the test assert behavior, or just that the function returns?
- Did you run the full suite on the merged result, not only the task's tests?
4. Error handling
- Is any error swallowed by a new catch or a fallback?
- Are retries bounded, with a backoff and a failure path?
- Are timeouts and cancellation handled?
- Does a failure leave the system in a recoverable state?
5. Security
- Are authorization checks still in place on every new path?
- Is user input validated at the boundary?
- Are secrets kept out of logs, errors, and the diff?
- Are new dependencies necessary, and are their licenses acceptable?
- Does the change widen a permission, a token lifetime, or a CORS policy?
6. Performance and concurrency
- Did the change add an N+1 query, an unbounded loop, or a large in-memory load?
- Are locks, queues, and shared state used correctly?
- Is the operation idempotent where it needs to be?
- Does the change hold a database lock or a transaction longer than necessary?
7. Style and docs
- Does the change follow the surrounding patterns, or introduce a new one without a reason?
- Are public APIs, configuration, and user-visible behavior documented?
- Is the changelog entry present if the project requires one?
- Are comments explaining *why*, not restating *what*?
Common false passes
A diff can satisfy the checklist mechanically and still be wrong. These are the cases to slow down for:
- The test was weakened. A deleted assertion, a skipped case, or a looser matcher makes the suite green without proving the behavior.
- The diff is small but changes a default. A one-line default change can alter every caller; read the callers, not just the line.
- The code looks idiomatic but invents an API. A plausible import or method can be hallucinated. Check that it exists.
- The happy path works; the error path is missing. A new catch that swallows the error, or a retry without a bound, is a production bug.
- The change is “harmless” but out of scope. It still needs its own task and its own review.
- The types compile; the runtime shape differs. Check the serialized shape, not just the TypeScript type.
- The unit tests pass; the integration breaks. Run the combined result after the merge.
When to stop and send it back
A review that cannot be done well is a process finding, not a personal failure. Send the task back when:
- the task statement is too vague to judge the diff;
- the diff is too large to read in one sitting;
- the tests are flaky or the suite is too slow to run;
- there is no baseline to compare against;
- the diff changes a shared contract that was never decided.
“Revise” is a valid decision. So is “reject and split the task.” The goal is reviewed, mergeable work, not a review that looks thorough. A review that stops at “looks fine” is not a review; it is a hope.
A worked example
The task: “Fix token refresh when the API returns 401.” The diff changes src/auth/refresh.ts, src/routes.ts, and tests/auth/refresh.test.ts. The suite is green.
A checklist pass finds four things the green suite does not show:
- Scope:
src/routes.tsis outside the owned paths. Finding: out-of-scope change; split it into its own task. - Tests: the test file was edited and one case is skipped. Finding: weakened test; the green run is not evidence.
- Error handling: the retry has no bound. Finding: a 401 loop if the refresh token is also expired.
- Correctness: there is no test for the expired-refresh-token case, which is the case that matters.
The decision is “revise,” with line notes for each finding. The next diff is smaller, the test is restored, and the review is faster. The checklist did not replace judgment; it kept the judgment from stopping at “green.”
Severity: what blocks a merge
- Blocker: a security hole, data loss, a weakened test, an out-of-scope change that affects behavior, or a missing failure path on a critical operation.
- Should fix: unbounded retries, missing edge-case tests, performance regressions, unclear error handling, undocumented public behavior.
- Nit: naming, formatting, comment style, a small refactor that is not required for the task.
Review the blockers first. If there is a blocker, do not spend the review on nits; send the blocker back and review the next diff. If there is no blocker, the nits can wait for a follow-up or be skipped.
Severity is about impact, not diff size. A one-line auth change can be a blocker; a 200-line rename can be a nit. If you cannot decide, ask what happens if the change ships as-is.
8. The decision
- Accept: the diff matches the task, the tests pass, and the risk areas are covered.
- Revise: the direction is right but the diff needs another pass. Send line notes with the problem, the expected change, and the evidence.
- Reject: the change is wrong, out of scope, or not worth fixing. Keep the branch and the history.
- Record the decision separately from process exit. Do not auto-merge a green task.
Printable checklist
- Scope matches the task; no unexplained files.
- Edge cases and callers covered.
- Tests fail before and pass after; no weakened tests.
- Errors are handled, retries bounded, failures recoverable.
- Auth, input, secrets, dependencies, permissions reviewed.
- No obvious performance or concurrency regression.
- Style and docs consistent.
- Decision recorded; merge order respected.
For the reasoning behind each item, read how to review AI-generated code and the review gate.