Coming soon: Build Data + AI systems with evidence built in. Preview
Fathom

Independent verification for Data + AI code

Fathom reviews pull requests, repositories, and API-submitted code for silent methodological failures that ordinary tests and general-purpose code review often miss—including leakage, invalid metrics, incorrect joins, flawed evaluation logic, and reproducibility risks.

The sample below is a real Fathom run on a public repository. The query executes and the output looks plausible, but the resulting training table is methodologically invalid.

Fathom verification example

A real change. A plausible result. An invalid training table.

This is a real Fathom run on a public demonstration repository. The query executes, ordinary checks can pass, and the output looks reasonable. Fathom identified that duplicated rows and future information made the resulting metrics and training data invalid.

Fathom verified a real pull request and found 13 issues that passed tests and code review. Here's the most important one ↓

High Correctness Bug Fathom v5 train.sql:87–164
✓ query runs · ✓ ordinary checks can pass · Mitari flagged it

Refund and revenue metrics are computed from duplicated, future-leaking training rows

1One logical order can become many rows 2Refund rate is measured on duplicates 3Future activity leaks into features

THE FAILURE PATTERN

Root cause: fanout + future data

FROM orders
LEFT JOIN order_items
  ON order_items.order_id = orders.order_id
LEFT JOIN refunds
  ON refunds.order_id = orders.order_id
LEFT JOIN sessions
  ON sessions.customer_id = orders.customer_id
LEFT JOIN marketing_events
  ON marketing_events.customer_id = orders.customer_id
LEFT JOIN payments
  ON payments.customer_id = orders.customer_id

Problem: order_items/refunds can multiply each order, while sessions/events/payments add customer-level rows without point-in-time constraints.

Broken measurement: labels & metrics computed after fanout

AVG(target)        AS refund_rate,
SUM(total_amount)  AS gross_sales,
SUM(refund_amount) AS total_refund,
COUNT(order_id)    AS rows_seen

These aggregates now run over exploded rows, not unique orders. The result can look precise while measuring the wrong thing.

Why it matters

If one $100 order joins to 3 sessions and 2 marketing events, it can appear as 6 training rows. Revenue can be counted six times, refund labels can be over-weighted, and future activity can be treated as if it was known at order time.

Rationale

The joined_orders step combines order-level data with multiple one-to-many sources. That can multiply one logical order into many rows before the query calculates labels and metrics. The same duplicated rows then flow into refund_rate, revenue totals, refund totals, counts, and retention-style outputs. Because sessions, marketing_events, and payments are also joined without as-of constraints, the training table can include future customer activity. The final output can therefore look like a valid training table while the refund label and business metrics are wrong.

Proposed fix

Build the training table at one row per order before calculating labels or metrics. Pre-aggregate order_items and refunds, compute sessions/events/payments as historical lookback features using point-in-time predicates, and validate that the final training table still has one row per order. Then compute refund_rate, revenue, retention, and label fields from that deduplicated, time-aware grain.

Evidence used in this verification

  • Changed code
  • Surrounding query logic
  • Intended data grain
  • Join cardinality
  • Point-in-time constraints
  • Downstream metric calculations

Verification summary

A summary of what this single run produced.

13
Findings
9
Critical
4
Warning

What Fathom evaluated

Coverage across the categories Fathom evaluates for Data + AI code.

Leakage

Data leakage detected in splits or feature pipelines.

Issues found

Eval Integrity

Evaluation methodology and metric usage.

No issues found

Drift / Skew

Potential distribution shift or data skew.

Potential issues found

Reproducibility

Determinism and environment-independent results.

Issues found

Other

All other correctness issues not belonging to the above categories.

Issues found

Other verification findings

A selection of the other findings from the same run.

Lifetime features are computed from all customer orders and leak future information HighCorrectness Bugtrain.sql:149
Refund-derived feature total_refund leaks the refund label into the model inputs HighCorrectness Bugtrain.sql:164
Order-level revenue and discount totals are summed after fanout, overstating monetary metrics HighCorrectness Bugtrain.sql:158

Verify your own code with Fathom

Fathom is the verification engine available today. Coming soon, Mitari will help teams capture intent and evidence earlier—while code is still being created by people and agents.

$ curl -X POST https://mitari.ai/api/v1/reviews/files \
  -H "Authorization: Bearer $MITARI_API_KEY" \
  -F "file=@train.sql"

This is a real Mitari run on the public repository heronsodyssey44/mitari-demo. Commit b934015.