In this video, you watched an example session of task 1 for the escape-room builder, written for the video rather than recorded. In task 1, the agent returns the ids of the puzzles no path reaches, and its done-when ends in a new test on both sample rooms with npm test passing. Then you watched the same task in a session with no check to run. Your own sessions will differ, but their shape should be the same.
Key points:
- The agent added a test with the task’s two examples: an empty list for The Lighthouse Keeper’s Study, and the strongbox and the trapdoor for The Smuggler’s Cellar.
- Its first version looked for needs that no puzzle in the room unlocks. That caught the iron strongbox, which needs the iron key. The code read well, and nothing in it looked wrong.
- The agent ran the check. One test passed and one failed, and the failure showed what the test expected and what the function returned: the trapdoor was missing. The trapdoor needs a code from inside the strongbox, and the strongbox unlocks that code, so the first version never reported the trapdoor. But nothing opens the strongbox, so the trapdoor can’t be reached.
- The agent read that failure and edited the function. The new version walks the room the way the brief defines finishing it: start with nothing, solve every puzzle whose needs are found, and collect what each one unlocks. The puzzles left over are the unreachable ones. It ran the check again, both tests passed, and only then did it report that it was done.
- The agent changed the code, ran the check, read the failure, fixed the code, and ran the check again. That cycle is a feedback loop, and a check the agent can run lets it go round until the check passes.
- In this example it went round once, because one fix caught the puzzle stuck behind the strongbox. On a bigger task it can go round many times. The check’s output tells the agent what to fix. It can also go round without getting closer, or stop with the check still failing. Then you step in and tell it what you know, or sharpen the task.
- In the second session, the done-when named no command and the agent had no permission to run one. It wrote the same test and the same first version, and its model predicted what the code would do. Its report repeated the examples from the task.
- Some reports say the tests weren’t run, and some don’t. This one didn’t, and it read word for word like the first session’s. But run the test on that code, and one test fails with the trapdoor missing. Nothing in the session showed the agent that failure.
With a check it can run, an agent can see what fails and work on it until the check passes. Without one, it can only predict, and its report can sound the same either way. Telling the two apart from a report comes later, in Read Done Reports as Claims.
Here’s the new test the example session added to test/check-room.test.js. The code below is a small example made for the video, and your agent’s code will differ: