Portfolio / Project index

Projects.

(04)

Tools I’m building, with the details behind them.

Project 01
Python CLIRelease candidate
~/query-witness

Connecting to the live runner…

Waiting for a real run

Query Witness

A Python CLI that finds the data where two SQL queries disagree, then saves a witness you can replay.

The idea

Don’t guess. Find the difference.

A rewrite can look right and still return a different answer. Give Query Witness a schema and two queries. It looks for a small, valid database that makes them disagree.

  1. The input

    Start with SQL

    A schema and two queries you want to compare.

    schema.sql + query-a.sql + query-b.sql
  2. SQLGlot

    Check the scope

    Reject unsupported SQL before the search starts.

    subset.py
  3. Python + DuckDB

    Find a difference

    Generate valid tables. Run both queries on the same data.

    core.py
  4. The output

    Keep the witness

    Remove unnecessary rows. Export the evidence and replay it.

    witness.json + reproduce.sql
A real, replayed example

One ticket. Two different counts.

This ticket has no assignee. Counting every row includes it. Counting the assignee column skips the NULL.

The databasetickets
ticket_idassignee_id
-1NULL

One valid row. The ID is unique;
the assignee is allowed to be NULL.

Query ACOUNT(*)
1
Query BCOUNT(assignee_id)
0

Same database. Different results.

Take the evidence with you

The data, both queries, and their results.

query-witness replay witness

Unzip and run with Query Witness 0.1.0, DuckDB 1.5.5, and SQLGlot 30.18.0. This is a constructed example, not a customer incident.

Under the hood

A small stack, with clear jobs.

  • PythonCLI, search & replay
  • SQLGlotSQL validation
  • DuckDBRuns the original SQL

SQL & Bash Β· pytest for tests Β· Hatchling for packaging Β· pip or uv for setup

Where it stops

One table, up to two INTEGER columns, and a restricted SQL subset. A search with no counterexample is not a proof of equivalence. Unsupported input, engine failures, and resource limits are reported separately.

Project 02
Work / 02Placeholder

Project 02

Project details coming soon.

The problem
The need that made this worth building.
My contribution
Scope of work and the engineering decisions behind it.
Project 03
Work / 03Placeholder

Project 03

Project details coming soon.

The problem
The need that made this worth building.
My contribution
Scope of work and the engineering decisions behind it.
Project 04
Work / 04Placeholder

Project 04

Project details coming soon.

The problem
The need that made this worth building.
My contribution
Scope of work and the engineering decisions behind it.
End of the index04 / 04