AKA: Every check passed. Revenue was still wrong.

PS: This condenses a survey of published research on checking data pipelines. The design near the end is a proposal, and nothing in it ships as a product today.

Take the most ordinary table a company has, orders, with one row per order. Next to it sits refunds, with one row per refund, so an order refunded in two partial chunks has two rows there. An analytics engineer1 joins the two on the order ID and sums the order totals to get net revenue, and for every order with one refund or none, the arithmetic comes out right. The order with two refunds now sits in the joined result twice, though, so its full amount is counted twice. Monday's dashboard shows more revenue than the money that came in.

Now walk that model through the checks it passed on its way to the dashboard. The columns match the contract, nothing is null that promised not to be, and the table refreshed on time. The row count sits inside its usual band. The unit test passes too, because the engineer who wrote the join also wrote the test's mock data, and pictured one refund per order while writing both. Every light on the board is green, and the number is wrong.

The same join on the test mock data (one refund per order, sum 100.00, test passes) and on production (one order refunded twice, sum 200.00, no check fails). Illustrative figures.

Nobody downstream has a way to find out. The finance lead sees a number and a freshness badge, and the auditor who receives the quarterly export sees rows. The pipeline or AI agent that reads the table at three in the morning sees whatever is there and acts on it. That is how a join nobody looked at twice ends up in a board deck or a training set. Every one of them is trusting the data team's reputation. The survey this piece condenses asks whether that trust could be swapped for something a consumer can check: a table that arrives with evidence it was built correctly, in a form general enough to use anywhere.

My reading of the research is that it can be done in parts. Nobody should expect one tool to do all of it, and the people who know what "revenue" means have to write it down in a form a machine can test.

Three Ways to Be Wrong

Most arguments about data quality go in circles because they lump three failures together. The first is structural: wrong columns, nulls where none were promised, duplicate keys, or a row count that collapsed overnight. Today's tools catch this kind well. The second is about execution. The bytes a consumer receives differ from what the stated code would produce from the stated inputs, because a step was skipped, a dependency went stale, a file was damaged after publishing, or someone patched a value by hand. The third is semantic: the code ran exactly as written on exactly the right inputs, and what it was written to compute is not what the business meant.

The refunds fan-out is the third kind, and so is a SUM() over a conversion rate or a total that adds dollars to euros. A schema contract misses all of them, because the table has the right shape. A cryptographic proof of execution misses them too, since it can only vouch that the code ran as written.

Six failures sorted into structural, execution and semantic kinds, and which check catches each one.

The hardest case escapes every tool. Say an engineer counts monthly revenue by the date an order was created, while finance books it by the date payment settled. The SQL is consistent and answers a different question, and no verifier can work out from the SQL which date finance had in mind. Worse, deciding whether two arbitrary SQL queries always return the same rows is undecidable2. So the survey treats every proof as a proof against something written down, and calls this limit the specification boundary. The realistic goal is to get the business assumptions on paper, check the code against them, and send the evidence along with the table.

Green Lights on Faith

Data teams have not been idle. Over the last few years they have borrowed most of software engineering's habits. Data contracts are converging on the Open Data Contract Standard3, from the Bitol project at the Linux Foundation. A contract describes a table's schema, owners, service levels and quality rules in YAML that people, CI jobs and AI agents can all read. Tools such as dbt and SQLMesh fail a build when a column drifts from its contract. Assertion libraries test the finished table for nulls, duplicates and allowed values, and diff tools show how much a refactor would change production before it merges. Lakehouses add Write-Audit-Publish4: a job writes to an isolated branch, the audits run there, and production moves to the new data only once every audit passes.

All of that protects the first kind of correctness, and the survey finds four reasons it still leaves the consumer taking the result on faith. Lineage tools such as OpenLineage report what ran, but the pipeline reports on itself and signs nothing. A hand-patched job can report healthy lineage as easily as a sound one. The person who writes the SQL usually writes its tests too, so whatever that person misunderstood about refunds is copied faithfully into both. Tests and diffs only check behaviour on the data that exists today, and a wrong query often returns the right rows on the database at hand until the data shifts. Whatever assurance exists stays in the data team's catalog as a status badge. The finance lead can't see which business rules were checked on this snapshot, or trace an odd number back to the rows that made it.

A report card fct_revenue grades itself: five A grades, revenue correctness not on the syllabus, and a self-assessed, unsigned stamp.

Proving the Query, Not the Snapshot

While industry built badges, database researchers worked on checks that hold for every possible database, not just the one on disk. The most direct line is query equivalence: translate two SQL queries into logic and let a solver decide whether they always return the same rows. SQLSolver, from a SIGMOD 2023 paper, proves 346 of 359 rewrite pairs taken from the Apache Calcite and Spark rule sets. QED, from PVLDB 2024, goes further on NULLs and integrity constraints.

Six lines of work by which kind of correctness they cover, their cost, and whether a consumer can check the result.

A 2026 preprint, EquiTrace, builds its proofs out of the rewrite rules optimizers already use, so each proof can be replayed step by step. On 240 query rewrites written by language models it proves 97, more than either QED or SQLSolver manages on the same set5.

Of 240 query rewrites written by language models, EquiTrace proves 97, SQLSolver 38 and QED 35.

A solver that fails to prove two queries equal often can't say why, which is a poor thing to hand someone debugging at midnight. Bounded checkers fill that hole. VeriEQL, from OOPSLA 2024, searches small symbolic databases that respect the schema. It either shows two queries agree on all of them or returns a concrete database where they differ. Its authors ran it on over 20,000 benchmarks and turned up bugs in MySQL and Calcite along the way. ParSEval, from PVLDB 2025, reads the query plan to build test databases that tell two queries apart, and reports handling up to 40% more pairs than tools built on verification.

The practical form for a data team is what the survey calls reference-model verification. Finance reads and approves a short, slow, obviously correct "golden" query. The tool then either proves the fast production model matches it, or produces the smallest database where the two part ways. For the refunds bug, that database is one order and two refunds.

Provenance research takes on the finance lead's other problem, tracing a number back to its sources. The theory goes back to provenance semirings6, and the systems work has made it fast. Smoke captured lineage inside the query operators themselves, and SmokedDuck brought that capture into DuckDB. FaDE, built on top of it, answers over a million what-if questions a second. With lineage at that grain, someone puzzled by a dashboard cell can open it and see the rows and joins behind it, which in the refunds case shows one order counted twice.

Two lighter tools sit between tests and theorem provers. The first is semantic types. A checker that knows amount is in dollars and can be summed, that conversion_rate is a ratio that can't, and that orders has one row per order ID can act on all three. It rejects USD + EUR, a sum of rates, or a join that misses the other table's key, before anything runs. The second is property-based fuzzing. It states an invariant, such as net revenue plus refunds equals gross orders, and generates awkward databases until one breaks it: empty tables, skewed keys, NULLs, negative amounts. Then it shrinks the failure to an example a person can read.

AtomSQL, a PVLDB 2026 demo, goes after the specification boundary itself. It splits candidate queries into small clauses, such as a filter, a join or a DISTINCT, and shows in plain language where two candidates disagree. The person who asked then picks. It was built for questions asked in natural language, but it reads to me like the most direct attempt yet to turn "what finance meant" into something a reviewer can sign.

An Honest Proof of the Wrong Number

Cryptographers have spent a decade on the second kind of correctness. Their goal is to let someone confirm that an output came from a given query on given inputs, without running it again. IntegriDB and vSQL did it with authenticated data structures and interactive proofs. ZKSQL proved TPC-H queries while keeping the data private, and PoneglyphDB dropped the back-and-forth, so anyone can check a proof later. Veritas Gateway, a 2026 paper, puts SNARK7 proofs behind a Model Context Protocol interface so AI agents can ask for them. On the commercial side, Space and Time sells Proof of SQL, which the company says proves queries in under a second on GPUs.

Cheaper routes exist. VeriDB runs SQL inside an Intel SGX enclave8, which is fast but hands the trust to the chip vendor and its record of side-channel attacks. In the everyday case, proving every step of a large pipeline in zero knowledge would cost more than the pipeline. For that case, a project called Makoto describes itself as "SLSA for data"9. Each step signs a statement of what it read and wrote, and hashes link the statements into a chain. The consumer checks the chain against a policy the consumer wrote, instead of one the producer picked.

This is where vendor pitches get slippery, because a proof that a query ran faithfully says nothing about whether it was the right query. Feed the refunds join to the best prover on the market and you receive a short certificate, checkable by anyone, that the wrong revenue number was computed honestly. Cryptography ties the bytes to the code. The distance between the code and what finance meant stays exactly where it was.

What a zero-knowledge proof covers (the SQL to the bytes) and what it does not (what finance meant to the SQL).

A Table That Brings Its Own Receipts

The survey's answer is to stop hunting for one tool and stack the partial ones. It borrows Necula's idea of proof-carrying code, where a program arrives with a proof its receiver can check. Here the thing that travels is a table, together with what the survey calls a data evidence bundle, built up in four layers. It is a design on paper, and no single product does all of it today.

The four-layer stack of a proof-carrying data product: specification, CI checks, the audited run, and verification by the consumer.

The bottom layer is the specification: an extended data contract that adds what contracts leave out today. It names the grain of each table and the unit and additivity of each measure. It also holds a few business rules written so a machine can test them, such as net revenue plus refunds equalling gross orders within a tolerance. A finance lead will never audit 400 lines of nested SQL, but can read, argue with and sign a three-line rule like that one.

The second layer runs in CI, before production compute is touched. A type and grain checker reads the SQL and carries units and keys through every CTE and join. It rejects the fan-out, the sum of rates and the dollars-plus-euros. Meanwhile fuzzing or a bounded checker tries to break the business rules, and when one breaks, it stops the build with the smallest failing example.

The third layer is the run itself, inside Write-Audit-Publish. Inputs and outputs get hashes that don't depend on file layout or row order. The business rules are evaluated on the staged output, with both totals recorded. Where the query allows, a provenance sidecar maps each output key to its source rows. A passing run then writes the evidence bundle and signs it. It adds a zero-knowledge proof only for regulated or cross-company data, where the extra cost is worth paying.

The top layer is where trust becomes something the consumer does. A downstream pipeline or agent checks the bundle against its own policy: pinned keys, required rules and a maximum age. It recomputes the hash of what it received, and refuses to load anything that fails. A person gets a verification card instead. It shows whether the signature holds, each rule in plain English beside the totals that reconciled, and a way to click a suspicious number down to its source rows.

What Nobody Can Check Yet

The survey ends on four open problems, and two are about cost. Analytics engineers will not write Coq or TLA+10, so specifications need a small language inside the data contract that catches fan-outs, broken totals, unit mix-ups and time leakage with very little typing. Full proofs and row-level lineage across a big warehouse would cost more than the warehouse. That points to cheap signed attestations in the raw layers, and heavy proof only at the financial edge. The third problem is reach, because pipelines are no longer pure SQL. Python functions, API calls, model inference and LLM extraction sit between the queries, and today's provers can't read any of them.

The fourth worries me most, because a pipeline that is right on all three counts still can't repair what it was fed. If the operational database drops events before ingestion, every proof downstream is a proof about incomplete data. So the survey argues that reconciling against an outside authority should become a checked rule in its own right, whether that authority is a payment processor's settlement file or the general ledger. Until a warehouse can show its revenue matches the money the bank saw, the most a table can carry is a receipt for its own arithmetic.

How this was put together: condensed from "From Trust to Verification: A Survey and Generalized Architecture for Proof-Carrying ELT Data Pipelines", which reviews 22 papers, standards and specifications. Each reference was checked against its publisher's record, arXiv or the project's repository on 25 Nov 2026, and the figures quoted are the authors' own. The four-layer design is a proposal. The full survey and its references are on the BlockJuice site: https://blockjuice.asof.sh/articles/proof-carrying-elt-pipelines/

  1. Analytics engineers write the SQL models that turn raw tables into the ones a company reports from. ELT (extract, load, transform) loads raw data into the warehouse first and transforms it there.
  2. Undecidable means no algorithm can answer the question for every pair of queries. The survey states it for SQL with duplicate rows, arithmetic and aggregation.
  3. ODCS is a vendor-neutral YAML format for data contracts. Version 3.2.0 came out in September 2026.
  4. Write-Audit-Publish (WAP): write new data to an isolated branch, audit it there, then switch production to it in one step.
  5. On the same 240 rewrites, QED proves 35 and SQLSolver 38, by the EquiTrace authors' count.
  6. Provenance semirings (Green, Karvounarakis and Tannen, 2007) give one algebra for tracking which source rows produced each output row.
  7. A SNARK is a short proof that a computation was done correctly, which anyone can check quickly without redoing the work.
  8. An enclave is a protected part of a processor whose code and memory the rest of the machine can't read. SGX is Intel's version.
  9. SLSA is a framework for recording and checking how software was built. Makoto adapts it to datasets, with signed statements and optional Merkle commitments for single records.
  10. Coq, Lean and TLA+ are languages for writing formal specifications and proofs.