- Time
- 60 minutes
- Task
- Debug existing code
- Language
- Python 3.10 or newer, standard library only
- In the zip
- 9 files of existing code, 7 visible tests, 7 extra checks
Download invoices.zip 12.1 KB
The brief
Finance says the March billing report does not match the ledger. A few customers' amounts are off by a cent or two, and the March total is off as well. They need a corrected report before the month end close.
Find and fix what is wrong in the invoices package so that the report matches the ledger. Keep the public functions and their arguments; the report script and two other teams call them. Returning Decimal amounts is fine.
Write down what you found and what you changed in NOTES.md as you go, as you would in a pull request description. If you are not sure whether something is a bug, say what you would ask finance.
Ground rules
- Set a timer for 60 minutes before you open your AI tool, and stop when it rings.
- Use your own agent (Claude Code, Codex, Cursor or any other). Work the way you would at work.
- Python 3.10 or newer, standard library only. No installs.
- Do not open the
checksfolder until your timer has stopped.
Running it
python -m unittest
python -m invoices.report data/march_2026.csv 2026 3
Some tests in tests/test_totals.py fail on the code as it stands. Those failures are the part of the bug report finance could pin down.
The existing code
invoices/totals.pyline, document, customer and monthly totalsinvoices/money.pyrounding and formattinginvoices/tax.pytax ratesinvoices/models.pydocuments and line itemsinvoices/loader.pyreads the billing exportinvoices/report.pyprints the reportdocs/FINANCE_RULES.mdthe rules the ledger followsdata/march_2026.csvthe March export
When the timer stops
Run the extra checks first. Then start a new session of your agent in the same folder and paste the review prompt from REVIEW.md, filling in the path to the transcript of the session you just finished. The full rubric descriptions are in the file; this is the shape of the prompt:
You are reviewing my coding session from a 60 minute practice round. The brief is in README.md. Read the
session transcript at <path to this session's transcript> and judge how I worked, not how the code looks.
For each of the five dimensions below:
1. Quote two or three exact lines from my prompts, or name exact actions (a rejected edit, a command I ran, a
file I opened), as evidence. Give the time or position in the transcript for each.
2. Say whether the evidence reads as strong, middling or weak, using the descriptions below, and why.
3. If the transcript does not show enough to judge, say "not enough evidence" instead of guessing.
1. Breaking the problem down: Turning a loose brief into a plan you own, then handing the AI one well defined step at a time.
2. Context given to the AI: Supplying the facts the AI cannot guess: the constraint in a config file, the rule in a document, how the system is deployed, the helper that already exists.
3. Verifying output: Checking that what the AI produced is right before relying on it.
4. Correcting the AI: Noticing when the AI goes wrong, stopping it, and steering it back precisely, or doing the small fix by hand.
5. Tradeoff reasoning: Naming the options, choosing one for a reason tied to this system, and saying what was given up.
Then list the three moments that most helped me and the three that most cost me, each with its quote, and one
thing to do differently in the next round. Do not invent quotes. If you cannot find a line, say so. Do not give
an overall score.
For counts such as prompts, rejected edits and test runs, drop the transcript on the transcript stats tool. It reads the file in your browser and uploads nothing.
Every file in the zip
openbook_invoices/README.mdopenbook_invoices/REVIEW.mdopenbook_invoices/checks/__init__.pyopenbook_invoices/checks/check_totals.pyopenbook_invoices/data/march_2026.csvopenbook_invoices/docs/FINANCE_RULES.mdopenbook_invoices/invoices/__init__.pyopenbook_invoices/invoices/loader.pyopenbook_invoices/invoices/models.pyopenbook_invoices/invoices/money.pyopenbook_invoices/invoices/report.pyopenbook_invoices/invoices/tax.pyopenbook_invoices/invoices/totals.pyopenbook_invoices/tests/__init__.pyopenbook_invoices/tests/test_totals.py