Command-line tool · Python standard library
Invoice Triage
A small command-line tool for a bookkeeper’s monthly batch. It has no screen, so every check works on its real outputs.

- User
- A bookkeeper at a 20-person agency who reviews supplier invoices each month.
- Risky assumption
- Simple rules catch the problems the bookkeeper now finds by hand.
- Stack
- Python 3 standard library, with unittest.
- Status
- Runs on any machine with Python 3. Sample data invented.
Codex built the tool, the sample batch and the tests from a fixed brief; Claude Code ran the sample task by hand and sent two rounds of fixes.
What it does
- Review a folder of invoice files. Each invoice gets ok or flag with the reason: duplicate, over budget, missing purchase order or unknown supplier.
- A row with a broken amount is reported by file and line, and the rest of the batch still goes through.
- Approve a clean invoice and it is posted to a simulated ledger. A flagged invoice needs an override with a reason.
- Approve the same invoice twice and the tool says it is already posted.
- Write a review report with totals, flags and approvals.
What is real and what is simulated
| Accounting ledger | Simulated: each post is written to a local outbox and marked as simulated |
|---|---|
| Invoices, suppliers and purchase orders | Invented sample files, including one of each problem |
| Review state | Local files, cleared by reset |
How we checked it
- Nine fixed criteria and 13 unit tests, one per rule. A recorded session shows the sample task end to end.
- The separate reviewer found the very bug this tool exists to prevent: re-running the review forgot earlier approvals, so approving again posted the same invoice twice.
- Approvals now survive a re-run, the outbox is checked before every post and a test repeats the reviewer’s exact sequence.
Screens

What happens next
An MVP needs the real accounting service with idempotent posting, PDF intake and approval limits by role. No user feedback has been collected; the next test is last quarter’s real batch beside the bookkeeper’s own notes.