Trellis
Decision 2 of 5
  1. 01The model plans; the pipeline writes the SQL
  2. 02Checks decide what gets published
  3. 03Spend is reserved before a run starts
  4. 04The backend authors the screen
  5. 05Evaluation is sealed, and a failure counts

Decision 02 of 05 · 2 min read

Checks decide what gets published

How does a query that runs still get rejected?

SQL that runs can still answer the wrong question: a join at the wrong grain double-counts, the wrong statuses get counted, or a month outside the data reads as zero. Before any number reaches the reader, the pipeline runs three kinds of check and applies one coverage rule.

The checks and the coverage rule
Check or ruleWhat it comparesWhat it stops
integrityOrder-item and product IDs are present and uniqueDuplicate or missing keys that would inflate or drop totals
status exclusionThe eligible counts against the metric's status rulesCancelled, returned or status-less items counted as sales
reconciliationEach result against an independent system queryA group figure that differs from the independent recomputation, or groups that don't add up to the overall total
coverage (a rule, not a check)The requested period against the data's declared coverageA month outside the data shown as 0: it comes back unavailable, a partly covered one is marked partial, and a covered category with no eligible items is a real 0

If any check fails, Trellis gives no answer and names the failed check. A recorded answer's evidence also lists the SQL guard, which every query passes before it runs (decision 3). The development tests include a deliberately wrong join that runs cleanly; the checks reject it.

6queries per by-category answer

The trade-off

More queries per answer: a by-category answer runs six. On sample-sized data that costs fractions of a cent; at warehouse scale the reconciliation strategy would need a cost review.

What was shown

  • OfflineA failed integrity, status or reconciliation check means no answer, with the failed check named. A deliberately wrong join that runs cleanly is caught.
  • StagingA month outside the data's declared coverage comes back unavailable, not 0; a partly covered period is marked partial. Within coverage, a category with no eligible items is a real 0.
  • StagingFor every run checked, the rows, SQL, checks and source on screen matched the stored answer exactly.