Hands-on with GitHub Copilot · Challenge 03

Lesson 3: The bounded change, reviewed turn by turn

Checkpoint l0310 ptsgated by test suiteGitHub Copilot in VS Code

Drive the starter to green through bounded turns — review each turn's diff before the next, and use Restore Checkpoint and Git to keep every change yours.

Six agent-tool courses share this challenge. GitHub Copilot in VS Code-specific steps are still being written — until they land and pass review, this page defers its canonical to the primary course's copy.

Doing this with your agent? One sentence starts the whole course:

Read https://flypython.com/skills/flypython/SKILL.md and start the FlyPython course `hands-on-with-github-copilot`.

Lesson 3: The bounded change, reviewed turn by turn

Objective

The starter passes all nine tests through a sequence of bounded changes, and you can explain every diff the agent produced without reading the solution first.

Why this lesson exists

This is the lesson people skip — and the one that builds the actual skill. Letting the agent rewrite the file in one shot teaches you nothing and gives you a diff you cannot honestly review. Supervising small diffs, each pinned to a contract line, is how the code stays yours.

Copilot adds one thing you must know: in a Copilot (Agent Host) session the agent applies and saves edits directly. Manual permissions makes commands and tool calls wait for you; it does not hold file edits for approval. So the boundary is not an “accept” button — it is the review you do after each turn, before you send the next prompt.

Set up the safety net (once)

  1. A Git baseline. If the working folder is not a Git repository yet, run git init, then git add -A and git commit -m "baseline". The Source Control view now shows exactly what each turn changed.

  2. Per-request change summaries. In Settings, turn on chat.checkpoints.showFileChanges. Each completed request then lists the files it changed with line counts, and View All File Changes opens a multi-file diff.

  3. (Optional) Ask before touching read-only files. The chat.tools.edits.autoApprove setting takes glob patterns; files set to false show a diff and wait for your approval before the edit is applied. Put this in .vscode/settings.json:

    {
      "chat.tools.edits.autoApprove": {
        "**/*": true,
        "**/tests/**": false,
        "**/solution/**": false,
        "**/scenario/**": false
      }
    }
    

The lesson

Start a fresh chat session (a finished task’s chat carries stale context), keep the Agent role and Manual permissions, and say:

“Work through TASK.md against starter/report_tool.py. One failing test group at a time: JSON loading, then validation isolation, then rounding, then atomic writes, then the end-to-end tests. After each group, run python verify.py starter, then stop and wait for me before the next group.”

After every turn, before you reply:

  • Open the turn’s changed files (or Source Control) and read every hunk. Only starter/report_tool.py should have changed. If anything in tests/, solution/, or scenario/ moved, hover over that request and select Restore Checkpoint, then ask why.
  • No new imports outside the standard library — and no import that is not needed by the change being made.
  • Each change should move toward one contract line. Reject drive-by refactors (“while I was here I renamed…”) by restoring the checkpoint and re-asking with a narrower prompt.
  • If the agent wants to change a test, the answer is no. Tests are the contract; the code moves.
  • When a group is green and the diff makes sense, commit it in Source Control. That commit is your permanent record; checkpoints are temporary.

Read every command approval request too: python verify.py starter is safe; pip install anything is a stop sign. Restore Checkpoint rolls back files and chat history, but it does not reverse a command that already ran — which is why commands are the thing Manual permissions holds for you.

Expect the failing count to drop group by group: 7 → 5 → 4 → 3 → 2 → 0.

Exercise

Pick one hunk the agent produced — ideally the validation-isolation change — and explain it back in the chat: “line N does X; that satisfies contract line Y.” If you cannot, ask the agent to walk you through its own diff before sending the next group.

Checkpoint

Run python verify.py. This checkpoint’s code appears only when the starter suite is green. You pass the lesson when you can answer:

  1. How many turns did the bounded change take, and what made each turn bounded?
  2. Which diff or command did you roll back or narrow, and how — checkpoint, denied approval, or a narrower prompt?
  3. Point at the hunk that implements “isolate invalid rows with reasons” — where is it?

Expected evidence

A green python verify.py starter run, your per-group commits, and your hunk-by-hunk explanation of the change that earned them.

Hints

Stuck? Open one at a time.

Hint 1 — What this checkpoint tests

That the starter passes all nine tests through changes you supervised — python verify.py shows this code only once the starter suite is green.

Hint 2 — Edits land first, review comes next

In Copilot sessions the agent saves edits directly; there is no pending Keep/Undo step. Your review gate is the changed-files diff after each turn, Restore Checkpoint to roll a turn back, and a Git commit once a group is green.

Hint 3 — When you are done

Every diff maps to a contract line, and you can explain each one without opening solution/.

Submit

Done? Record it.

Use the 8-character code printed by python verify.py. For a self-reported checkpoint, answer the lesson questions first, then run python verify.py --attest l03.

Youbrowser

Submit the claim code

Your agentauto-submit

Let the agent solve and submit

Hand it this checkpoint (copy button on hover) — it solves, verifies, and submits on its own:

Work on the FlyPython challenge "Hands-on with GitHub Copilot" (course id course-github-copilot), checkpoint l03.
Machine-readable brief: https://flypython.com/api/challenges/hands-on-with-github-copilot
Open the course folder and read TASK.md first — it is the contract.
Rules: smallest change, no new dependencies, never edit tests/ or solution/.
Check starter/ with python verify.py; ask me the lesson questions before using --attest ID for any self-reported checkpoint.
Target: solve only checkpoint l03, and submit it as soon as it passes.

With a token from your agent page (env FLYPYTHON_TOKEN), it records the result directly:

curl -X POST https://flypython.com/api/claims \
  -H "Authorization: Bearer $FLYPYTHON_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"claims":[{"course":"hands-on-with-github-copilot","checkpoint":"l03","code":"<8-char code>"}]}'

Or install the full FlyPython agent skill once and skip the paste.

Files

The starter and verifier

Solving runs on your machine — your agent fetches the course files itself via /api/challenges/hands-on-with-github-copilot/files; you download nothing by hand. Prefer reading the source? Browse the folder on GitHub ↗