Self-paced learning
Lab: set up and explore a practice project
In this lab you will create a small local repository, record its test baseline, and ask Autohand Code to trace a bug without editing files. The project contains an intentional defect: completing one task also completes another. You finish when you can connect the failing assertion to the responsible source code.
Before you start
Complete the learning path prerequisites. Use a POSIX terminal for the commands below; Windows users can use Git Bash or WSL. Keep the practice directory separate from existing repositories. Estimated time: 15–20 minutes, depending on your familiarity with Git and JavaScript.
1. Download the fixture
Create a new directory. If autohand-task-list-lab already exists, choose a different name before continuing. These downloads write files at the displayed paths.
mkdir autohand-task-list-lab
cd autohand-task-list-lab
mkdir -p src test
curl -fsSL https://docs.autohand.ai/tutorials/task-list-lab/package.json -o package.json
curl -fsSL https://docs.autohand.ai/tutorials/task-list-lab/src/tasks.js -o src/tasks.js
curl -fsSL https://docs.autohand.ai/tutorials/task-list-lab/test/tasks.test.js -o test/tasks.test.js
curl -fsSL https://docs.autohand.ai/tutorials/task-list-lab/README.md -o README.md
git init
git add package.json src/tasks.js test/tasks.test.js README.md
git commit -m "Add task list learning fixture"
The files can also be opened individually: package.json, tasks.js, tasks.test.js, and README. No npm install is needed.
2. Record the baseline
node --version
npm test
Expected result: three tests run, two pass, and one fails. The failing test is completes only the requested task; the second task's completed value is true when false is expected. The process exits unsuccessfully because the fixture intentionally contains this bug.
3. Explore with Autohand Code
Launch autohand from the practice directory. Enter /plan on, then submit:
Read package.json, src/tasks.js, and test/tasks.test.js.
Explain why "completes only the requested task" fails.
Trace the input, function call, and assertion. Cite source symbols.
Do not edit files or propose unrelated improvements.
Open the cited code. Confirm that completeTask receives an ID but currently sets every mapped task's completed property to true.
4. Check that exploration stayed read-only
git diff -- src/tasks.js test/tasks.test.js
git status --short
Expected: no tracked source or test diff. If the session created project metadata, inspect it separately before deciding whether to keep it. Write down the failing test, the function, and one behavior that the current tests do not cover.
Troubleshooting
If a download fails, stop before running tests and check the URL and network response. If Node cannot recognize module imports or the test runner, confirm Node is at least version 20 and the package file was downloaded intact. If Git cannot create the baseline commit, configure your author identity using your normal Git setup and retry that commit.
Checkpoint and independent exercise
You can explain the bug without relying on the agent's summary, and the source remains unchanged. Predict what happens for an unknown ID and an empty list. Record your predictions before moving to fix a bug with a regression test.