Can a Data Contract Catch a Column Whose Meaning Changed but Whose Schema Didn't?
Shape checks pass when meaning shifts, so the breaking-change decision needs a second layer
Not on its own: a contract that checks names, types and constraints passes when a column's meaning changes and its shape does not. The dbt model contract docs say a contract guarantees the shape of a model's output and validates "shape only". A data engineering newsletter makes the same point with an amount column that moves from including tax to excluding it while the schema check stays green. We think that change should count as breaking, and the rest of this post explains how to detect it.
Key Takeaways
- •A shape-only data contract cannot detect a column whose meaning changed, because name, type and constraints are identical before and after.
- •dbt flags only structural breaking changes: removing a column, changing a data_type, changing a constraint (v1.6 or higher), or removing a contracted model (v1.9 or higher).
- •A change in meaning should be classified as breaking regardless of the schema diff, because downstream consumers break even though pipelines keep running.
- •Meaning drift is caught by layering a human declaration, a distribution check and a downstream impact check on top of the structural contract.
- •The Schema Agent can run the structural diff and the downstream impact projection together, so the review question becomes whether to approve, not what changed.
What a data contract checks today
Most contract tooling compares a declared shape to an actual shape. In dbt, setting contract: enforced: true makes a build verify that the query returns the declared column names and data types, and it fails the build on a mismatch. The dbt docs list the breaking changes it flags: removing a column, changing a data_type, removing or modifying a constraint (dbt v1.6 or higher), and removing a contracted model (dbt v1.9 or higher).
Other contract products add rule checks on content. One rule-based contract product's docs show an example contract with a schema check and a freshness rule requiring data no older than 24 hours on an order timestamp column. Freshness, null rates and accepted ranges are useful, and each one answers a question about the data that was written down in advance.
That is the limit. Every one of these checks needs someone to have anticipated the failure and encoded it. A column that keeps the same type, stays non-null, arrives on time and sits inside its accepted range can still mean something different today than it did last week. The contract was never asked about meaning, so it never answers.
Why a change in meaning slips through
The newsletter's example is the clearest one we know. A producer changes amount from tax-inclusive to tax-exclusive. The column is still a decimal, still not null and still populated, so the structural diff is empty. Pipelines run and reports generate, but the numbers are wrong. The author's observation is that a structural check only compares the shape of the data and "knows nothing about its meaning."
The cause is rarely carelessness. The newsletter argues that producers follow the process and respect the tooling, but have not taken ownership of the data as a product, so they have not asked how a change lands on downstream customers. That is a process gap, and a schema tool cannot close a process gap by checking harder.
It also fails quietly. A dropped column fails loudly in CI or at build time. A meaning change fails in a dashboard three weeks later, when someone asks why revenue per order moved. By then the original pull request is buried, and the incident starts with no pointer to the change that caused it.
Five layers that catch meaning drift
No single check catches this, so we stack five. Each layer is cheap alone, and together they turn an invisible change into a reviewed one.
- •Layer 1, structural contract: enforce names, types and constraints, so shape changes fail the build.
- •Layer 2, meaning declaration: every pull request touching a contracted model answers one mandatory question, does this change what the data means?
- •Layer 3, distribution check: compare summary statistics of a column before and after, such as mean, null rate and distinct count, and flag shifts.
- •Layer 4, downstream impact: list the models, dashboards and metrics that read the column, so the reviewer sees who is affected.
- •Layer 5, approval and audit: route flagged changes to the column's owner and keep the decision on record.
Layer 2 is the one the newsletter proposes, and it is the only layer that captures intent. If the answer is yes, the change is breaking no matter what the schema diff says. Layer 3 is the safety net for when the answer is no and the author is wrong. A tax-inclusive to tax-exclusive switch shifts the mean of amount immediately, even though no type changed.
Layers 4 and 5 decide what happens next. Knowing that a column feeds a finance metric changes how carefully the change should be reviewed. Recording who approved it means the next incident starts with a name and a date instead of a search through commit history.
Should a meaning change count as breaking?
Yes, and the reason is the consumer's view. A breaking change is one that forces a downstream consumer to change something or silently get a wrong answer. A column that now means something else meets that definition exactly, and it is arguably worse than a dropped column, because nothing fails to tell the consumer.
The practical consequence is versioning. In dbt, a breaking change to a contracted model is meant to be handled through model versions, so consumers can move on their own schedule. Treating a meaning change the same way means publishing the new definition as a new version, or as a new column name, and leaving the old one in place until consumers migrate.
We would not flag every semantic edit. Fixing a wrong description, or correcting a bug so the column finally matches its documented meaning, is a different case. The test is the same one in both directions: does a downstream reader who relied on the old definition now get a different answer? If so, it is breaking.
Where the Schema Agent fits
The Schema Agent detects column-level schema drift, projects downstream impact and generates safe migrations. That covers layers 1 and 4 directly. A reviewer can ask "What's the blast radius if I drop this column?" or "What changed in the orders schema since last deploy?" from Claude Code or Cursor and get the structural diff and the list of dependents in one answer.
For meaning drift, the agent's job is to put the evidence in front of the reviewer. It surfaces the distribution shift next to the dependent list, so a change whose schema diff is empty still arrives with a flag attached. It chains with the quality and incident agents, so if a drifted column does reach production, the incident starts with the originating change already identified.
The decision stays with a person. Our open-source edition is read-only by default, and writes and approval workflows sit behind Pro. An agent that can find the meaning change should not also be the one that waves it through.
What to do this week
Start with the cheapest layer. Add the meaning question to your pull request template for contracted models, and make it a required field. It costs nothing, and it creates the habit the other layers depend on.
Next, pick the five columns whose meaning matters most, usually money, status and timestamp columns, and add a before-and-after distribution comparison for them. Keep the thresholds loose at first. The goal is a short list of flagged changes that a human reads, not an alert stream that people learn to ignore.
Finally, decide your versioning rule in advance. If a meaning change means a new column name or a new model version, write that down once, so nobody argues it during a release. A rule agreed before the incident is much easier to follow than one invented during it.
Frequently Asked Questions
Can a data contract detect a change in a column's meaning?
Not a shape-only contract. Names, types and constraints stay identical when meaning changes. Detection needs a declared intent in the change process, a distribution comparison, or a semantic-layer definition that is itself versioned and diffed. Contracts are the right foundation, but they cover only the structural layer.
Is a semantic change really a breaking change?
Yes, if a downstream consumer who relied on the old definition now gets a different answer. The schema diff does not decide this. The consumer's outcome does. Treat it as breaking, version it, and give consumers time to migrate.
How do we catch it without flagging every edit?
Combine the human question with a statistical check. The question captures intent, and the distribution comparison catches the cases where the author answered no incorrectly. Tune thresholds on a few high-value columns first, and widen coverage only when the flagged list stays short enough to read.