Cows, Men, Paddocks

Prototyper / Examples

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.

A review of the sample batch: four flags with reasons and one broken row reported by file and line.
A review of the sample batch: four flags with reasons and one broken row reported by file and line.
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

  1. Review a folder of invoice files. Each invoice gets ok or flag with the reason: duplicate, over budget, missing purchase order or unknown supplier.
  2. A row with a broken amount is reported by file and line, and the rest of the batch still goes through.
  3. Approve a clean invoice and it is posted to a simulated ledger. A flagged invoice needs an override with a reason.
  4. Approve the same invoice twice and the tool says it is already posted.
  5. Write a review report with totals, flags and approvals.

What is real and what is simulated

Accounting ledgerSimulated: each post is written to a local outbox and marked as simulated
Invoices, suppliers and purchase ordersInvented sample files, including one of each problem
Review stateLocal files, cleared by reset

How we checked it

Screens

Approvals go to a simulated ledger; a second approval is refused; the report says nothing was sent.
Approvals go to a simulated ledger; a second approval is refused; the report says nothing was sent.

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.