Lab: Budgets, compaction and notes for the shift
37 min read·13 Oct 2026
Module 7 · Lab · About 70 minutes · Needs: the Module 3 lab'stools.py, and lessons 1 and 2 (token budgets per section;compact_line,Notes,fresh,subagentandreuse)
What you are building
This lab moves the module's code into the returns-desk/ repository as one new file, returns_desk/context.py, that imports Module 3's tools.py and never replaces it. It holds a budget per section, compaction that keeps every id, a notes file behind two tools, fresh contexts, a read-only sub-agent, and a shift runner whose build hook decides what each call sees. Five tests pin it. One fact is traced throughout: R-1001's $129.00 refund on order 5521, waiting for Marta. Everything at BrightCart is simulated.