AI Anonymous · from JAB Systems — October 20, 2026
Let AI draft the query. Check the math.

Fictional nine-row CSV; two human-authored SQL queries. No AI/API calls.
Tested on Windows, Python 3.13.15 and duckdb 1.5.6.
Prerequisite: Python installed and callable as python in PowerShell.

Extract to a new folder. Read all files, especially check-the-math.py and
both SQL files, before execution. From the extracted folder:
python -m venv .venv
.\.venv\Scripts\python.exe -m pip install "duckdb==1.5.6"
.\.venv\Scripts\python.exe .\check-the-math.py

The runner resolves its CSV/SQL relative to itself and uses an in-memory
connection. It reads the two supplied SQL files and prints JSON, checks the
result using independent CSV/Decimal arithmetic, and checks the CSV hash.
Expected paid October totals: Studio 3 orders/600.00; Workshop 2/300.00.
Intentionally wrong missing-status-filter totals: Studio 4/1100.00;
Workshop 3/700.00. The wrong query is valid SQL but answers another question.

The prompt file is optional and untested with a model. Never automatically
execute model output or replace these reviewed SQL files with arbitrary SQL.
A venv separates dependencies; it is not a sandbox. DuckDB can access files,
networks and extensions. Installation requires network. No security/privacy
audit or model/performance test is claimed. Input is deliberately tiny,
complete, single-currency, unique-order, ISO-date fictional data with no nulls.
Real exports require separate checks for missing amounts, duplicates, mixed
currencies, refunds, partial payments, date semantics and allowed statuses.

Guide: https://jabsystems.io/ai-anonymous/duckdb-check-the-math
