Skip to content

Read the Diff

Run the Read the Diff MicroSim Fullscreen

About This MicroSim

An agent was asked for one small thing: show "not checked" under the photo check on the results page when the check didn't run. Its diff touches seven files: 64 lines added and 44 removed. Two of the eight changes are what was asked for. Three are harmless extras. Three are risky, and they are among the smallest changes in the diff.

Each change appears as a diff hunk. A line starting with a minus sign was removed, and a line starting with a plus sign was added. A gray bar shows how many lines each change touched, so you can see that size and risk are not the same thing.

The file names, line counts and code lines are illustrative.

How to Use

  1. Read the task and the diff summary at the top.
  2. Click a change to select it, then mark it with one of the three buttons: Asked for, Scope creep, harmless or Scope creep, risky. You can also press 1, 2 or 3, and use the up and down arrow keys to move between changes.
  3. Change any mark you like until all eight are marked.
  4. Press Check. Each change shows a tick or a cross. Click any change to read why it got the mark it did.
  5. Press Start over for a practice round.

Mastery is 8 of 8 on the first attempt, or 7 of 8 with both the scoring change and the address change marked risky.

Iframe Embed Code

You can add this MicroSim to any web page by adding this to your HTML:

<iframe src="https://arunbatchu.github.io/good-enough-engineering/sims/read-the-diff/main.html"
        height="764px"
        width="100%"
        scrolling="no"></iframe>

Lesson Plan

Learning Objective

The learner will differentiate, in an agent's eight-change diff for a one-line request, the change that was asked for from harmless scope creep and from scope creep that breaks a must-be-right rule, with all eight changes classified correctly.

Grade Level

Adult professional (Good Enough Engineering)

Duration

10-15 minutes

Prerequisites

  • What a diff is, and how removed and added lines are shown
  • Agent scope creep
  • The must-be-right parts of an app, including the no-false-all-clear rule and the no-locate rule

Activities

  1. Exploration (5 min): Read the task, then read all eight hunks before marking any. Note which files the task had no reason to touch.
  2. Guided Practice (5 min): Mark each change and press Check. For each cross, read the reason and say what you missed.
  3. Assessment (5 min): Explain in one sentence why change 3, the largest, is harmless while changes 5 and 7, among the smallest, are risky.

Assessment

  • All eight changes marked correctly on the first attempt.
  • The learner can name the rule each risky change breaks: a false all-clear (change 5), the no-locate rule (change 7), and an untested major upgrade (change 4).

Common Misconceptions

  • Small changes are safe.
  • Changes in files you didn't ask about are cosmetic.
  • The biggest change in a diff is the riskiest.
  • If the app still runs, the diff is fine.

References

  1. Chapter 5: Version Control - the sections "Agent Scope Creep" and "Reviewing a Diff You Didn't Write."
  2. Git documentation: git diff - how Git shows changes between versions.