Where trusted numbers come from

A pipeline rail from raw rows to a checked number, through model layers and a definitions tag, with a dashed loop returning from the checked number to the source labeled reconciled against source.
The part that makes it trustworthy is the loop, not the rail.

In the last note I typed eleven sentences and got a revenue dashboard. That film shows the last inch of the system. Every number on those widgets is the end of a pipeline that starts in an operational platform’s API, and the pipeline, not the AI, is where trust is won or lost. This note is about that pipeline as it actually runs in production: what gets landed, what gets modeled, where meaning gets decided, and the checking loop that holds the whole thing accountable.

Anyone can render a chart from an API response. The distance between that and a number an operator will act on is four decisions.

Land everything, and prove you landed it

The warehouse is fed two ways: nightly incremental pulls from the source system’s APIs, and a live webhook feed for the operational day. Incremental sync sounds simple and is not, because the interesting failure is silent. A watermark pull asks “what changed since my last high-water mark”, and it will faithfully collect every insert and update forever. What it will never see is a deletion. Operational systems delete quietly: a voided ticket, a merged guest, a row an upstream job removed. If all you ever do is add, your copy drifts away from the source’s own reports one invisible row at a time, and no error will ever tell you.

Inserts and updates flow along a conveyor past a dashed watermark gate into a warehouse. Below, a ghosted deleted row's path stops short at a small cross, captioned the deletion never arrives.
Watermark sync collects every change it can see. A deletion is not a change, it is an absence.

So deletion is reconciled explicitly: a nightly pass compares what the warehouse holds against what the source still has, and removes the ghosts. Ingestion runs at about 1.3 million invoice lines and reconciles to 99.87 percent against source, and the remaining fraction is itself an artifact worth having, because it points at rows the source system dropped on its own.

Transformations are code, and grain is a contract

Raw landings are kept raw: the source’s names, the source’s types, warts intact. Everything after that is a versioned transformation, staged and rebuilt deterministically, so the entire modeled layer can be dropped and reproduced from the raw tables at any time. There is no hand-edited table anywhere in the chain, because a number nobody can rebuild is a number nobody can check.

The modeling rule that carries the most weight is the plainest one: one table, one grain. The atom of this business is the invoice line, and the fact tables hold it at exactly that grain, one row per line, with payments, appointments and package redemptions at their own grains beside it. Most reporting bugs I have chased were secretly grain bugs, a join that quietly doubled rows or a sum taken one level too high. The other lesson, learned the hard way during a backfill: join on the business’s natural keys, never on a warehouse’s internal surrogate ids, because surrogates do not survive a reload and natural keys do.

Left panel: a fact table with three rows and an accented check, labeled one row per invoice line, sums once. Right panel: a lines table and a payments table meet at a join bowtie and one row fans into two identical rows marked times two, labeled the sum is quietly doubled.
Most reporting bugs are grain bugs wearing a disguise.

Meaning is decided once, in one place

“Net sales” is not a column. It is a decision: does it include tax, does a refund subtract on the day it happens or the day of the original sale, where do gift cards land, what does a membership redemption do. In this platform every metric is defined once, in a governed catalog, and every surface reads the same definition: the dashboards, the CSV export, the drill panel, and the AI that builds widgets. When the definition is wrong, it is wrong in one place, visibly, instead of wrong in forty widget formulas, differently.

The catalog is also where honesty gets enforced. Revenue and net sales are two different metrics here, because a package sold today is money collected, not money earned, and the two lines are allowed to disagree on a chart:

Net salesRevenue
A service performed todaycounted todaycounted today
A package sold todaycounted today, in fullcounted as its sessions are redeemed
A membership fee collected todaycounted todaycounted as the benefit is actually used
A gift card sold todaycounted todaycounted when it pays for something

Fast paths are not allowed to change answers

Dashboards want answers in milliseconds, and scanning millions of lines per widget is not that. So there are pre-aggregated tables underneath the common questions. The rule is that a fast path must give the same answer as the slow one: the aggregates carry the same definitions from the same catalog, and anything they cannot express falls back to the line-level facts rather than approximating. A performance optimization that shifts a number is not an optimization, it is a second source of truth.

Second sources of truth are how organizations end up arguing about whose spreadsheet is right.

The loop is the product

Everything above still only produces numbers. What makes them trustworthy is the habit of closing the loop: computing a figure independently and checking it against what the source system says, line by line, to the cent. The commission engine here is reconciled against actually-paid amounts at invoice-line grain, and that reconciliation has surfaced six-figure discrepancies that traced back to individual rate-configuration defects, in the source, not in the warehouse. The demo tenant that appears in these notes is built the same way: its simulator emits both the fact plane and the report plane, and billed equals collected to the cent before anything gets filmed.

That is the shape of the whole system: land everything, prove you landed it, model it at honest grains, decide meaning once, keep the fast paths faithful, and check the output against the source until the two agree or you can say precisely why they do not. The AI in the last note sits on top of all of this. Without it, an AI is a fluent narrator of unverified numbers, and fluency makes that worse, not better.

Status

Same project, one layer down. The figures quoted are from the production pipeline and the public project notes on this site; everything filmable runs on the demo tenant. Demo data only; no customer numbers appear anywhere on this site.