Every build ships the gate that checks its output.
Gates are not uniform. Some sit at the root of their build and some in
its tests/ folder, and the names vary because each is named
for what it checks rather than for being a gate. One takes an argument.
docs/gates.md lists every one with its exact path and both commands: run directly, and run as a hook. Use it rather than guessing at a filename.
Run directly and a gate exits 0 when it passes and 1 when it fails, which is the Unix convention and what you want at a command line.
python tools/as_hook.py python <the gate>
That is the other way. A hook only blocks a tool call on exit 2. Exit 1 is treated as a non-blocking error and the action proceeds, so a gate wired in directly reports its failure and stops nothing. The wrapper translates the code, which lets one script be correct in both places. Chapter 20 covers this, including the two ways a hook can end up silently absent.
| Chapter | Build | Folder |
|---|---|---|
| 0 | 00-reading-code | builds/00-reading-code |
| 2 | 02-what-an-agent-does | builds/02-what-an-agent-does |
| 4 | 04-first-session | builds/04-first-session |
| 6 | 06-prompting-like-a-reviewer | builds/06-prompting-like-a-reviewer |
| 7 | 07-verification-gates | builds/07-verification-gates |
| 8 | 08-git-and-environments | builds/08-git-and-environments |
| 9 | 09-literature-triage | builds/09-literature-triage |
| 10 | 10-statistics-assumption-checks | builds/10-statistics-assumption-checks |
| 11 | 11-survival-and-dose-response | builds/11-survival-and-dose-response |
| 12 | 12-publication-figures | builds/12-publication-figures |
| 13 | 13-sequence-and-omics | builds/13-sequence-and-omics |
| 14 | 14-docking-prep | builds/14-docking-prep |
| 15 | 15-image-and-plate-reader | builds/15-image-and-plate-reader |
| 16 | 16-lab-data-management | builds/16-lab-data-management |
| 17 | 17-manuscript-assembly | builds/17-manuscript-assembly |
| 18 | 18-deposition | builds/18-deposition |
| 19 | 19-grant-and-thesis-drafting | builds/19-grant-and-thesis-drafting |
| 21 | 21-error-hunt | builds/21-error-hunt |
A gate you have never seen fail is not a gate. Break something on purpose and confirm it fails, for the reason you expected.