AI code review · Self-paced workshop

7. Write the review, then review the response

Practise understanding changes, checking AI findings, and making review decisions you can defend.

Workshop index · Download all examples and lessons

Time: 30 minutes. Prerequisite: lesson 6. Outcome: concise comments and a justified decision after inspecting a follow-up revision.

Your investigation notes are for you. Review comments should help the author understand a verified problem and decide what to change.

Turn evidence into a comment

A useful comment identifies the trigger, observed behaviour, expected behaviour, and consequence. For the retry exercise:

Required: if the response is lost after the first reservation, this retry reserves the same request twice. With capacity 5 and a two-seat request, I get two accepted bookings and remaining 1. The contract requires one booking and remaining 3. Please enforce the request key at the reservation boundary and test a lost response after acceptance.

This comment describes a concrete defect and a useful test. It does not demand an unrelated architectural rewrite. Label optional suggestions separately, and omit unsupported AI claims.

The author pushes a fix

Read the follow-up exercise. The retry fix is present, but there is also a response-field rename. Run the consumer demo in your language; it intentionally fails.

Trace the failure from the returned response through JSON decoding to the existing client. In TypeScript, the producer’s local result type does not automatically update an independently deployed client reading JSON. A shared compile-time check would help only if it actually covered both versions and their runtime boundary.

Write two decisions: whether the original duplicate-reservation finding is resolved, and whether this new revision is ready to approve. These are different questions.

Check the revision, not just the comment thread

For a real PR, record the new head SHA, compare it with the previously reviewed SHA, and inspect the complete new diff. Run the relevant regression tests against the new checkout. The author saying “fixed” is useful context, not verification.

For these snapshots, record the exact before/after paths. Keep your original review note and append the evidence from the follow-up.

Constructed AI suggestion:

“The retry tests pass now. Approve the PR and update the client later; the new response name is clearer.”

Evaluate this against the compatibility contract. A naming preference does not establish permission to break existing consumers.

Hint

The contract still promises remaining. Restore that response key in this fix. A deliberate API migration would need its own compatibility plan and tests.

Checkpoint

Your review summary should state what is resolved, what remains blocking, what you tested, and what scope you did not inspect. Compare with the solution.

Save your final decision. You are ready for the capstone, where the change is unfamiliar and the AI response is not a checklist of all defects.

← 6. Follow the failure beyond the diff · 8. Review an unfamiliar change →