Review the Working Tree First

Task 3’s code is green and still uncommitted. In the last lessons, you checked that no test changed on the way to green and that no code names the test rooms. That showed the tests passed for the right reason, but not what else your agent changed while it worked.

In this lesson, you’ll review task 3 before you commit it, starting from the task as you wrote it and the working tree, not from your agent’s summary. You’ll get a short checklist you can reuse after every task.

Find Everything the Task Changed

Your agent’s summary is text its model generated. It’s a claim about the work, so start from the task instead. Open docs/tasks.md and the request you sent in Run a Tests-First Task, and write down the files task 3 should touch. In the reference version, that’s two: src/check-room.js for missingNeeds(), and check-room.js for the printed lines.

Then run git status, which lists the files that differ from your last commit, including new files Git has never stored. In the reference version, it shows this:

Language: Shell
$ git status
On branch master
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
    modified:   check-room.js
    modified:   src/check-room.js

no changes added to commit (use "git add" and/or "git commit -a")

The two modified files match the two on your list, and there’s no Untracked files section. Yours may also list your agent’s settings folder there. Any other file is one your task didn’t name, and it goes on your list of things to check.

git status doesn’t list every file, though. A new folder shows as one entry, such as src/helpers/, so look inside it. Files your .gitignore names, such as node_modules/, don’t show at all. The session’s commands, below, tell you whether to look there.

If your agent committed anyway, its changes don’t show in git status either. To list every tracked file changed since the tests’ commit, run git diff --stat e9fde4c with your own hash, as in Check What Made the Run Green.

Plain git diff shows only unstaged edits to tracked files, so it leaves out new files and anything your agent staged or committed.

An agent’s task can leave changes in three places: edits to tracked files, new files, and the effects of the commands it ran, such as a global install or a file written outside the project. No Git output shows the third, so the session’s commands tell you where to look, and then you check that place itself.

Locked learning resources

Join us and get access to thousands of tutorials and a community of expert JavaScript developers.

Unlock This Lesson

Already a member? Sign-In

Locked learning resources

The full lesson is for members only. Join us and get access to thousands of tutorials and a community of expert JavaScript developers.

Unlock This Lesson

Already a member? Sign-In

Become a Member to join the conversation.