Skip to content
Start free

Next month's report, end to end

Run the whole project the way a monthly scheduler would, read the check matrix, add a case nobody planned for, and list what you still check on a real machine.

12 min · on a computer

Free course. Your Maestro, an AI, .

Every piece of the monthly sales pipeline now lives in one project: contract.py checks incoming files, report.py writes outputs safely, and scenarios.py runs the sequence from start to finish. Instead of touching your working folder, scenarios.py copies data/ into a temporary folder with tempfile.mkdtemp(), runs each monthly file the way a scheduler would, and prints a matrix comparing expected and observed results. Because this is a sandbox check, nothing is scheduled and nothing is sent: an alert is just a line in reports/alerts.log.

Each row of the matrix tests one guarantee in the sandbox:

  • Case A (September): Runs data/sales_2026-09.csv (8 rows) and checks the total of 3,000 (North 1,200, South 800, East 650, West 350).
  • Case B (October): Runs data/sales_2026-10.csv (8 rows) and checks the new valid month's total of 2,800.
  • Case C (November): Runs data/sales_2026-11.csv (6 rows with 5 contract breaches: duplicate order_id S-1101, negative amount -80, blank region, October date 2026-10-31, and text amount "1,200"), confirming report.run returns rejected and leaves reports/history.csv and reports/latest.json unchanged.
  • Reruns: Runs October twice more and confirms upsert keeps 4 rows for October in reports/history.csv and 1 row in reports/runs.csv.
  • Interruption and recovery: Simulates a stop before publishing (crash_before_publish=True), confirms reports/latest.json still holds October's 2,800 total, and verifies that rerunning clears any .tmp file.

Try it

Your task is to test an nobody planned for (Case D): a December file, data/sales_2026-12.csv, with one order whose header spells the third column Region with a capital R.

Before you create the file or run the , read contract.py and report.py and write down your prediction for Case D: what will report.run("2026-12", base) return, why, and will reports/history.csv or reports/latest.json change? Your Maestro waits for your prediction and review list before coaching, and any hints count as assisted work. Tell your Maestro your prediction before you run the new row.

Then run the matrix below, add data/sales_2026-12.csv and its check row in scenarios.py, and run uv run scenarios.py again.

Your turn

Run the matrix and read every row. Then add data/sales_2026-12.csv whose header spells the region column Region (capital R), with one order, predict the outcome, and add a row for it in scenarios.py where the comment says so. You're done when the matrix has your row and every row passes.

What you still check on a real machine

A passing matrix in scenarios.py proves how contract.py and report.py behave on test files in a scratch folder. It does not prove that a real monthly schedule will work on your machine. Before writing your review below, go through the project one file at a time and ask, for each thing the sandbox simulated or took for granted (when and as whom the run starts, where the files live, what happens to an alert line, who acts on a rejected file), what you would have to look at on the real machine to know it holds.

Once you have written your review list below, you can ask your Maestro to compare your checklist against the project files.

Check yourself: Write a pre-release review with three parts: (1) your prediction and observed outcome for Case D (data/sales_2026-12.csv with header Region), (2) a list separating what scenarios.py verified in the sandbox from what you must still check on the real machine, and (3) how report.py kept reports/latest.json at 2,800 when the interrupted run stopped.

Check yourself: Write a pre-release review with three parts: (1) your prediction and observed outcome for Case D (data/sales_2026-12.csv with header Region), (2) a list separating what scenarios.py verified in the sandbox from what you must still check on the real machine, and (3) how report.py kept reports/latest.json at 2,800 when the interrupted run stopped.

Ctrl+Enter or ⌘+Enter sends it.

Answer it yourself