labs/ch09: Planning and Cost
Following the chapter's Lab steps:
- Budgets first: read
budgets.md, writebudget_steps_max/budget_cost_maxintocases/cases-50(for cases without them,run.pyoverlays the suggested defaults); write down the deviation red lines: unplanned write operations, unplannedget_customer. - Flip the switch:
python labs/ch09/run.py --repeat 5runs the full set withplanner+write_toolson; the interval discipline gets no exemption for a new switch. Traces and verdicts land inlabs/ch09/out/. - Align:
python labs/ch09/align.py labs/ch09/out/traces.jsonlprints each trace's subgoal mapping, orphan-step count, and the deviation top-3. - Report: fill
templates/ch09/cost-latency-report-template.mdwith the distribution numbers run.py prints; for the comparison configuration runpython labs/ch09/run.py --repeat 5 --no-planner(the planner on/off cost-quality points). - Decide: answer the Decision section's three questions and write the budget revisions back into the cases.
No model API? run.py needs a real model (set MODEL_BASE_URL / MODEL_NAME).
align.py is fully offline and runs on any trace JSONL; python labs/ch09/align.py --demo
uses MODEL_FAKE to reproduce the canonical 11-step refund detour (including the
unplanned get_customer) and aligns it on the spot, zero API.
Files in this lab
Full directory: repo/labs/ch09/