Lab: The eight tools, guarded and tested
33 min read·13 Oct 2026
Module 3 · Lab · About 75 minutes · Needs: lessons 1, 2 and 3 (tool definitions andcall_tool;make_safer_toolsandmake_retry_safe_tools;make_failure_safe_tools,FlakySystemsand the guards)
What you are building
The lessons built the tools in a notebook, one layer at a time. This lab moves their final form into returns_desk/tools.py, the file Module 3 adds to the package: the simulated systems, the eight tools, the definitions the model reads, one function every call goes through, and Lesson 3's guards, stacked. Tests then pin every gap the lessons found, and a real model works Mei's cancellation, R-1004, while payments and email misbehave. Everything at BrightCart is simulated.