Lab: One traced refund agent, with every guard
Module 8 · Lab · About 80 minutes · Needs: lessons 1 to 4 of this module, and the Module 6 lab (or the cells in Step 1)
What you are building
It is Friday 24 July 2026, the end of week 8. This week each lesson wrote its own loop: run_agent with open_ticket in Lesson 1, a guarded run_agent with Budget in Lesson 2, run_loop in Lesson 3 and run_loop with a who label in Lesson 4. The repository gets one. supportdesk/agent.py holds the loop with all eight stop reasons, and it reaches the billing system only through Module 6's guarded_execute. supportdesk/approvals.py makes a refund request idempotent and puts a named person in front of every payout. supportdesk/trace.py writes one line per step, supportdesk/trajectory.py grades the path a run took, and supportdesk/mcp_server.py serves the read-only lookups over MCP. Two runs call the hosted model; everything else uses stand-ins.