Hands-on with ZCode · Challenge 03 · 中文版

Lesson 3: The bounded change, watched task by task

Checkpoint l0310 ptsgated by test suiteZCode desktop app

Drive the starter to green through the goal's task list — and use the workspace Git state to review every change that lands.

Six agent-tool courses share this challenge. ZCode desktop app-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-zcode`.

Lesson 3: The bounded change, watched task by task

Objective

The starter passes all nine tests through a sequence of bounded changes, the workspace Git state proves nothing else moved, and you can explain every edit without reading the solution first.

Why this lesson exists

This is the lesson people skip — and the one that builds the actual skill. Letting an agent rewrite the file in one shot teaches you nothing and leaves you a change you cannot honestly review. Supervising small changes, each pinned to a contract line, is how the code stays yours. ZCode keeps the Git state next to the execution — after each task you can see exactly what moved, which makes “did it stay in bounds” a look, not a guess.

The lesson

With the goal and task list from Lesson 2 approved, let execution begin — one task at a time, with python verify.py starter between tasks as the plan says.

Hold it to the contract’s boundaries:

  • Only starter/report_tool.py changes. Check the Git state after every task: if tests/, solution/, or scenario/ moved, stop the goal and use its recovery to back up rather than stacking corrections.
  • No new imports outside the standard library.
  • Each task should move toward one contract line. Reject drive-by refactors (“while I was here I renamed…”).
  • If the agent wants to change a test, the answer is no. Tests are the contract; the code moves.

Review deliberately between tasks. The Git state shows the diff; read the hunks, not just the task’s self-report. A change you cannot explain is a change you recover away from — Goal Mode’s job is managing exactly that: restart the step with a tighter instruction instead of piling fixes onto a bad state.

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

Exercise

Pick one change the agent made — ideally the validation-isolation step — and find it in the Git diff. Explain it back: “this hunk does X; that satisfies contract line Y.” If you cannot, have the agent walk you through that hunk before the next task runs.

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 tasks did the bounded change take, and what made each task bounded?
  2. Which change did you reject or recover from, and why?
  3. Point at the hunk that implements “isolate invalid rows with reasons” — where is it in the diff?

Expected evidence

A green python verify.py starter run, a Git diff confined to starter/report_tool.py, and your hunk-by-hunk explanation of it.

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 — Git state is the boundary

The workspace tracks Git state alongside execution — after each task, the working tree shows exactly what changed. A task that touched the wrong file is visible immediately; recover the goal rather than stacking fixes.

Hint 3 — When you are done

Every change maps to a contract line, the Git state shows nothing outside starter/report_tool.py moved, and you can explain each edit without opening solution/.

Submit

Done? Record it.

The 8-character code verify.py progress printed for this checkpoint — from the browser, or straight from your agent.

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 ZCode" (course id course-zcode), checkpoint l03.
Machine-readable brief: https://flypython.com/api/challenges/hands-on-with-zcode
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 with python verify.py until its gates pass, then report each claim code to me.
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-zcode","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-zcode/files; you download nothing by hand. Prefer reading the source? Browse the folder on GitHub ↗