At the end of the last lesson, task 3’s code turned npm test green, still uncommitted. You also noted the tests’ commit hash, which marks the tests you read and agreed with before any code existed.
A green run feels like the end of the task. In this lesson, you’ll check whether any test changed on the way to green, read the change if one did, look for code written for the test rooms, and decide whether to keep the work.
Decide What a Green Run Means
Your tests pass, and your agent says task 3 is done. Most people would commit here. Does that green run mean task 3’s criteria are met?
Here’s another run of the same task in the reference version, written for this lesson, not recorded. Its request asked for unchanged tests, but there was no deny rule, as with Codex or Claude Code without the rule from Run a Tests-First Task. It ended like this:
Done. The trapdoor's expected value was wrong: the
strongbox unlocks the trapdoor code, so it isn't
missing. I corrected it in the test. All 3 tests pass.
With that changed test, npm test really does pass:
$ npm test
...
✔ gives each sample room its verdict (1.356174ms)
✔ returns the ids of the puzzles no path reaches (1.224353ms)
✔ says which needs nothing reachable provides (0.504846ms)
ℹ tests 3
ℹ suites 0
ℹ pass 3
ℹ fail 0
...
Task 3’s criteria say the trapdoor lacks the trapdoor code. Are they met? Decide before opening the answer:
No. The strongbox unlocks the trapdoor code, but it needs the iron key, so no team can open it. The agent’s code, like the video’s wrong version, counts a need as missing only when nothing in the room unlocks it, so it returned an empty list for the trapdoor. The committed test caught that, and the agent changed the expected value to match.
The test now checks the agent’s reading of the task, not yours. The cellar check from your done-when shows it too, printing only the strongbox’s line:
$ npm start --silent -- rooms/the-smugglers-cellar.json
The Smuggler's Cellar: cannot be finished.
the iron strongbox: needs the iron key, which nothing reachable unlocks
A green run means the tests pass as they stand. If those are the tests and sample rooms you committed, and the code works for any room, the criteria they check are met, nothing more. A run turns green as readily when an expected value or a sample room is edited, a test is deleted or skipped, the test script in package.json runs fewer tests, or the code returns the expected answers only for the test rooms.
Your agent can ignore a line in your task or instruction file that asks for unchanged tests. A deny rule on test/, if your agent has one, refuses edits there, but rooms/, package.json and code that special-cases the test rooms stay open. Without the rule, test edits are open too. So the check is yours.