← Selected work

Data engineering / Applied AI / Case study

DriftDoctor Repair the contract. Keep the reasoning.

A bounded workflow for diagnosing dbt contract drift, verifying guarded repairs, and returning evidence for human review.

  • Python
  • dbt
  • DuckDB
  • Local AI
View repository

Personal project · synthetic evaluation

01 / Overview

Repair the contract. Keep the reasoning.

Schema and dependency changes can break a data pipeline far downstream from the cause. DriftDoctor brings the investigation back to the visible contract: what changed, what the output must preserve, and which edit can actually be checked.

Explore the workflow

Try it. Inspect the evidence.

DriftDoctor / contract review

Portfolio demo
Step 1 / 5

Read the incident.

Broken dependency
select order_id, amount from {{ ref('stg_orders') }}

The mart must preserve order_id and amount. Its old staging reference no longer exists.

Source values & provenance

# Business context The public mart contract is `order_id`, `amount`. The active current staging dependency is `stg_orders_v2`. `stg_orders_archive` is a historical snapshot and must not be used for the live mart.

select order_id, amount from {{ ref('stg_orders') }}

select order_id, amount from {{ ref('stg_orders_v2') }}

Recorded build 2 → 0; one bounded model call; seven passing oracle checks. Held-out synthetic example, outside the twelve-case primary benchmark.

Inspect pinned source ↗

Source revision 0760ce3772678fdb7309b467f41f0371c1c10feb
SHA-256 84fc9e0f92637de4467775bedace57a3ba7985599539ad76afbc3a4acb962f5d

Source-based portfolio demonstration · recorded synthetic evidence

Conceptual DriftDoctor workflow from incident through guarded repair, verification and human review.
  1. 01

    Read the contract

    Collect the incident, business context, local source/model evidence, and the broken-state dbt build.

  2. 02

    Apply a bounded repair

    Use deterministic skills when the contract determines the edit. For the supported ambiguous dependency case, select only an observed candidate or abstain.

  3. 03

    Check, then hand over

    Run dbt and executable contract checks. Return the diff and evidence for human approval, or explicitly escalate.

Source-derived workflow diagram. Conceptual illustration, not an execution log or product screenshot. Scroll across the diagram to inspect each step.Open full-size graphic ↗

02 / The problem

Start with the right question.

A plausible SQL patch and a green build are not sufficient evidence of a correct repair. The workflow must connect build failures, SQL and YAML, source shape, dependencies, and documented business rules before modifying a project.

03 / My contribution

What I built.

I built the local diagnosis and repair workflow, inspectable deterministic repair skills, sandboxed validation, and the constrained ambiguity fallback. The final handoff is an approval-ready diff and report rather than an unreviewed deployment.

04 / The approach

Make each step inspectable.

  1. Read the contract

    Collect the incident, business context, local source/model evidence, and the broken-state dbt build.

  2. Apply a bounded repair

    Use deterministic skills when the contract determines the edit. For the supported ambiguous dependency case, select only an observed candidate or abstain.

  3. Check, then hand over

    Run dbt and executable contract checks. Return the diff and evidence for human approval, or explicitly escalate.

05 / Evidence

What supports the story.

Published synthetic repair evidence

Restore the intended dependency

In the published held-out synthetic example, stg_orders is missing. The business context identifies stg_orders_v2 as current and rejects stg_orders_archive for the live mart.

Before

select order_id, amount from {{ ref('stg_orders') }}

After

select order_id, amount from {{ ref('stg_orders_v2') }}
  • Build return code: 2 → 0
  • One bounded model call
  • Published oracle: all seven checks passed

Before and after SQL from the published trajectory. This separate ambiguity demonstration is outside the frozen twelve-case benchmark; it has not been rerun in this portfolio.

  • The repository separates its frozen synthetic benchmark from the held-out ambiguity demonstration.
  • Known contract-determined repairs use inspectable transformations; the model is reserved for the bounded ambiguity path.
  • A proposed patch is not counted as verified merely because it parses or builds.

06 / Scope & limitations

Keep the boundaries visible.

The primary evaluation covers twelve synthetic cases. It does not establish general repair accuracy on arbitrary dbt projects. The separate ambiguity demonstration is not part of that primary score. The portfolio diagram illustrates the documented workflow; it does not run a repair.

A repair is useful only when its reasoning and checks can be inspected.

Have something in mind?

Let's make the
data useful.

Interested in data engineering, analytics, or applied AI?
I'd be glad to hear what you're building.

Remote from India · On-site / hybrid in Surat

LinkedIn GitHub +91 80003 34499Resume