Skip to content
Vibedata

Re-engineer something you own

Convert a stored procedure into a dbt model and prove parity

  • When the nightly load is a stored procedure nobody fully understands anymore.
  • When a procedure's insert, update, delete, and merge steps are the only record of what the load is supposed to do.

Convert a stored procedure's insert, update, delete, and merge steps into a declarative incremental dbt model, and run both in parallel to prove parity before the procedure is retired. Covers the translation and its parity evidence, not retiring the procedure itself.

Area
Transformation
Runs on
  • Microsoft Fabric Warehouse
Built with
  • dbt
Readiness
PlannedAt least one capability or object type this Recipe needs is not supported yet.
Before you start
needs sign-off before the procedure is retired

Sample This Recipe has not been materialized in the Cookbook repository yet. Its trigger, description, prompt, agent guidance and acceptance conditions, and the explanation below, are prototype drafts. Its name, job, area and readiness come from the reconciled Cookbook seed snapshot. Readiness is a separate question from this one: it says whether the capability exists, not whether the writing has been reviewed.

Review planned Recipe

At least one capability or object type this Recipe needs is not supported yet.

Read the VibeData Recipe `stored-procedure-to-dbt` at https://getvibedata.ai/cookbook/stored-procedure-to-dbt At least one capability or object type this Recipe needs is not supported yet. Treat it as a reference, not as work to execute.

Recipe id stored-procedure-to-dbt · Not yet materialized in the Cookbook repository, so the pointer addresses this page.

Verified by

What has to be observably true before this Recipe is finished.

  • the model's output matches the procedure's output over the agreed comparison period
  • each procedural step has a declared declarative equivalent in the model
  • a repeated incremental run creates no duplicate keys
  • the procedure keeps running until sign-off is given to retire it
Recipe promptThe task specification the agent reads. Reference only — it is not what you copy.
Deliver: Convert a stored procedure into a dbt model and prove parity.

Convert a stored procedure's insert, update, delete, and merge steps into a declarative incremental dbt model, and run both in parallel to prove parity before the procedure is retired. Covers the translation and its parity evidence, not retiring the procedure itself.

Execute inside the current Intent. Its Domain, repository, platform, environment and attached sources are the context for this work — read them rather than asking for them.

The work is done when:
- the model's output matches the procedure's output over the agreed comparison period
- each procedural step has a declared declarative equivalent in the model
- a repeated incremental run creates no duplicate keys
- the procedure keeps running until sign-off is given to retire it

Report the evidence for each condition above with the result. A condition you cannot meet is something to say, not something to work around.
Agent guidanceHow the agent approaches the work, and what it will not do.

Write down the behaviour that has to stay constant before you touch the current form, and get that agreed. Rebuild in an isolated copy, then reconcile old against new at the grain the consumers read. The reconciliation is the deliverable; the diff is not.

Composes

  • dbt model authoring and layering
  • dbt in the project
  • isolated-copy execution and gate verification

Guardrails

  • Build in an isolated copy. Production is read, never written.
  • Do not edit the object being held constant. Parity that required a change to the original is not parity.
  • At least one capability this Recipe needs is not supported yet. Say so and stop rather than substituting a different approach.

What you need

  • Microsoft Fabric Warehouse.
  • A dbt project you can build, and read access to the models it starts from.
  • dbt in the project, or the intent to add it.
  • Needs sign-off before the procedure is retired.

How it goes

  1. Name the thing you own, and what about its behaviour has to stay the same.
  2. Let it read the current form and write down the behaviour it is holding constant.
  3. Review the design before any SQL is written. Grain first.
  4. Let it rebuild in an isolated copy of your estate. Production is untouched throughout.
  5. Reconcile the new form against the old one, row by row.
  6. Read the acceptance conditions. They are the contract; the diff is not.

What you end up with

The deliverable, in your own repository, as transformation work a reviewer who knows the project reads as native to it. Alongside it, the evidence for every one of the acceptance conditions above — which is the part that is still there in three weeks when somebody asks.