Skip to main content

3.1 · The dry run — required

Prompt
You’ll see: Ana discover your schema, diff it against the ontology, and hand you a precise list of fixes — table backings, column names. (A ready-made version of this check lives in validation/dry-run-prompt.md.)

3.2 · Run the validator — required

The dry run is discovery; validation/validate_tql.py is the mechanical gate. It verifies every governed surface against your warehouse: each logical name resolves, each referenced column exists, each query compiles. Ana runs it for you — no terminal needed:
Prompt
You’ll see: the typo’d-backing, wrong-alias, and missing-column bug classes caught here — instead of surfacing as wrong numbers in front of stakeholders.
Prefer the terminal? — The same gate runs locally: python3 validation/validate_tql.py (static — no warehouse needed) · --check-sql (paste the output into Ana: rows = missing columns) · --dsn "<dsn>" --explain (live column check + compile test).

3.3 · Apply the fixes as a PR — required

Prompt
You’ll see: Ana edit the files and open a reviewable PR in your repo. Every physical table name lives in one place (ontology/schema.tql) — re-point it and the metric logic stays put. If you have a resolved household table, point household_grain at it: one line.
Schema validation PR

Validation lands as a reviewable PR — not silent edits.

Why this step matters — Every firm’s warehouse differs from the reference shape somewhere — a renamed column, a missing table, a different grain. Finding those before you trust a number is the difference between a defensible metric and a debugging session in front of stakeholders.

3.4 · Decide your grain & verify your joins — required

Two decisions shape everything downstream, and both are prompts. The first is the most important number-corrupting trap in this domain:
Prompt
You’ll see: the snapshot-vs-series decision made and written down before anything gets edited — summing position snapshots across dates multiplies AUM, the #1 bug in this domain (notes/grain.md).
Prompt
You’ll see: a join-by-join verdict list, and identity resolved before any client/AUM count — so the same investor under multiple custodian ids (post-M&A, joint/trust, multi-custodian) isn’t double-counted.
Prompt
You’ll see: the things a compile check can’t catch — dirty flows that void returns, multi-currency books, missing FIGI — corrected from your real data instead of assumed.
The full checklist — This module covers the core; MIGRATION.md is the complete 8-step re-point (discover → grain & cadence → schema.tql → identity → validator → literals → governance → glossary → goldens). Half a day with warehouse access; most of it is verification, not editing.
Different warehouse dialect? — The starter is authored in ANSI SQL with a portable float idiom (* 1.0) that works on Redshift, Spark/Databricks, DuckDB, and BigQuery. On any engine, extend the dry-run ask: “…also flag any engine-specific SQL in the .tql surfaces and propose [dialect] equivalents.” Dialect adaptation rides the same PR loop as schema fixes.

✅ Checkpoint

  • Ana produced a concrete mismatch list (or confirmed a clean match)
  • The fixes landed as a PR you can review — not silent edits
  • You merged the PR (or know who reviews it)