AI code review · Self-paced workshop

8. Review an unfamiliar change

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

Workshop index · Download all examples and lessons

Time: 50 minutes. Prerequisites: lessons 1–7, or experience tracing code and writing regression tests. Outcome: a review decision supported by independent evidence.

Open the waitlist change request. Choose Python or TypeScript. Read the contract, compare baseline and candidate, and run the smoke test. Record the snapshot paths and, when working from a committed copy, the repository SHA.

Your task

Spend the first ten minutes understanding the change without AI. Trace cancellation, availability calculation, promotion, and the returned state. Write down what must remain true about queue order and seat counts.

Then investigate using either a live assistant or the constructed response below. Ask questions with concrete inputs. You may write local tests, but keep your initial review separate from any fix.

Constructed AI response: “The implementation looks safe because the smoke test passes. One possible blocker is that cloning the state leaves nested booking objects shared with the caller, so promotion mutates the original waitlist. Consider rewriting the loop with a functional array method for readability.”

Evaluate the claims; do not assume the response lists all relevant issues. You are allowed to disagree with the model and to find no issue in parts of the code.

Deliverable

Produce a review note containing:

  1. The intended behaviour in two or three sentences.
  2. The scope and exact candidate you inspected.
  3. Any confirmed findings, with trigger, expected/actual behaviour, and consequence.
  4. Tests or traces that support each finding.
  5. Rejected AI claims and the evidence used to reject them.
  6. Your approve/request-changes decision and any remaining uncertainty.

Do not optimise for the number of comments. The useful output is a defensible decision. Do not read the solution until your review is written.

Checkpoint

Score your work using the rubric, then compare with the answer key. Run its author checks only after self-assessment:

python3 -m unittest discover -s solutions/tests -p test_waitlist.py -v
node --test solutions/tests/waitlist.test.ts

The author checks verify the teaching defects as well as the reference fixes. For your own regression tests, assert the required behaviour so they fail on the candidate and pass on the fix.

Take the workflow to your next PR

Start with intent and invariants. Read independently. Ask focused AI questions. Trace and test their claims. Write only comments you can support. Re-check the changed revision before making the final decision.

Save your review and one improvement you would make to your process next time. That is the final workshop artifact; you do not need to submit comments to a public repository.

← 7. Write the review, then review the response