GOAL Build a personal receipt tracker in this project folder. I add a photo of a receipt; a vision-capable AI model extracts the merchant, date, line items, quantities, prices, tax and total into a fixed structure; I review and correct it beside the photo; the app saves it to a spreadsheet and shows my spending by month and category. DONE MEANS On my sample receipts, the merchant, date and total are correct for every clear receipt. Unreadable fields are left empty and flagged, never invented. Every total is checked by code against the item sum. Nothing reaches the spreadsheet until I approve it. The dashboard totals match the spreadsheet exactly. HOW TO WORK Work through every stage below without waiting for me. Verify each stage with a real test before you start the next. Stop only when you need something only I can do: choose local or cloud, check an extraction against a photo, or approve a change. Explain each handoff in plain English. Keep a TEST_LOG.md with every check, its result and the exact error if it failed. STAGE 1: INSPECT, CHOOSE AND PREPARE Inspect my operating system, CPU, RAM, GPU and free disk space. Record them. Create an isolated Python environment for this project only. HANDOFF: explain the trade-off between a local vision model in Ollama (private, free to run, slower, less accurate on hard photos) and a cloud vision API (faster, often more accurate, costs per receipt, sends images off my computer). Recommend one for my hardware. Wait for my choice. If I choose local, check Ollama is installed and pull a vision model from the Ollama library that fits my RAM and supports structured output; record which and why. If I choose cloud, ask me for the API key, store it in a local .env file that is excluded from any sharing, and never print it. Record versions. STAGE 2: DEFINE THE STRUCTURE FIRST Before any AI call, define the receipt schema in code: merchant, date (ISO format), currency, line items (description, quantity, unit price, line total), subtotal, tax, total, payment method, and a confidence or "unreadable" flag per field. Amounts are decimals stored in the smallest currency unit or as Decimal, never floats. Unknown values are null. Ask me for my default currency, my date format (day-first or month-first), and confirm this category list or let me edit it: groceries, eating out, transport, fuel, utilities, health, shopping, entertainment, other. STAGE 3: EXTRACT ONE RECEIPT Prepare each image before the model sees it: fix rotation from the photo's EXIF data, resize very large photos, keep the original file. Send the image with a prompt that asks for the schema and pass the schema as the required output format. Instruct the model to copy text exactly as printed and to return null for anything it cannot read. Validate the response against the schema in code. If it fails validation, retry once with the error message, then mark the receipt for manual entry. Run my three answer-key receipts and report field-by-field accuracy. STAGE 4: LET CODE DO THE CHECKING After extraction, ordinary code checks the result. It adds up the line totals and compares them with the subtotal and total, allowing for tax and rounding. It checks the date is valid and not in the future. It checks for duplicates by merchant, date and total. Any failed check becomes a visible warning on the review screen. The model never does the maths. Assign a category with the model from my fixed list only, plus a rule file I can edit (for example, a merchant name always maps to a category). Rules win over the model. STAGE 5: REVIEW BEFORE SAVE Build a simple local web page. Left: the receipt photo, zoomable. Right: the extracted fields, editable, with warnings highlighted. Buttons: Save, Skip, Re-read. Nothing is written to the spreadsheet until I press Save. Record whether I corrected each field, so we can measure accuracy over time. Save approved receipts to a CSV (UTF-8, opens correctly in Excel and Google Sheets) or an SQLite database with a CSV export: one row per line item, plus a receipt ID, the image file name and the category. Store images and data in a visible folder outside the build files. STAGE 6: DASHBOARD AND PROOF Add a dashboard: spending per month, per category, top merchants, and a list of receipts with warnings. Calculate every number in code from the saved data. Process all ten sample receipts. Report: fields extracted correctly without correction, fields corrected, receipts that needed manual entry, and average time per receipt. Run every acceptance test in this pack. Mark each PASS, FAIL or NOT RUN in TEST_LOG.md. Repair failures before you add any feature. DELIVER The command or launcher I use to start the app, the project folder, the data folder, the schema, the category rules file, the model or API used and its version, a requirements lock file, a short README and the test log. List which checks still need my eyes. No telemetry.