AI Research Library

Data Contracts Before Model Contracts

Rajesh Ranjan Mahapatra

A model can obey its interface perfectly while consuming the wrong proposition; enterprise AI therefore needs executable guarantees about meaning, quality and time at the source-model boundary.

© 2026 Rajesh Ranjan Mahapatra. 30 min read

Data Contracts Before Model Contracts

A model can obey its interface perfectly while consuming the wrong proposition; enterprise AI therefore needs executable guarantees about meaning, quality and time at the source-model boundary.

TLDR

  • A model contract can constrain what a model accepts and returns. It cannot tell whether an upstream number still means what the producer and consumer think it means.
  • A usable data contract binds structure to semantics, quality, time, provenance, ownership and failure behaviour, then produces an admissibility receipt before the model sees the record.
  • This moves many fluent but wrong answers from model debugging to deterministic source or transformation failures, where they can be blocked, assigned and replayed.
  • Contracts do not certify reality, fairness or sufficiency. They fail when the underlying concept is contested, the source is wrong, or the important shift was never expressed as a test.
  • The release rule changes: no new enterprise source becomes model context until producer and consumer agree its grain, meaning, clocks, thresholds, version policy and safe fallback.

The number that passed every model check

A credit pre-screen receives an applicant's income as a floating-point number. On Friday the producer sends annual gross income in pounds. On Monday a source refactor sends monthly net income, still in the same field and still as a floating-point number. The model service accepts both.

The serving signature is satisfied. The input has the right name and type. The feature transformation runs. The model returns a properly formed proposal. Monitoring shows no latency fault, no exception and no malformed output. Yet an applicant earning £72,000 a year can be represented as 6000.0, and a downstream loan-to-income calculation can move by a factor of twelve.

The incident will be tempting to describe as model drift, a weak model or an explainability failure. None of those diagnoses reaches the first cause. The model was given a different proposition under a familiar representation. Its interface contract could see a number. It could not see that the number's period, deduction basis and decision meaning had changed.

A model contract becomes meaningful only after the consumed data has earned admission under a data contract. The ordering is causal, not ceremonial. The upstream contract must establish what the record asserts, about which entity and time, under whose authority, with which known limitations. The downstream model contract can then constrain how a model consumes that admitted representation and what behaviour it may produce.

One numeric input, three different propositions Three source records share a numeric income field. Only the current annual gross GBP record satisfies the intended proposition. A monthly net record and a stale annual record still satisfy the narrow model signature. Source proposition Model signature 72,000 · annual · gross · GBP · current One applicant, verified payroll observation ADMISSIBLE 6,000 · monthly · net · GBP · current Same field type, different period and deduction basis BLOCK 72,000 · annual · gross · GBP · 24 hours old Meaning is stable, decision-time validity is not BLOCK Input check income_amount type: number PASS for all three rows Period invisible Basis invisible
  1. Current annual gross GBP: the intended proposition, so the data contract admits it.
  2. Current monthly net GBP: the type still matches, but period and basis change, so the contract blocks it.
  3. Stale annual gross GBP: the meaning matches, but the decision-time freshness promise fails.
  4. Model signature: all three contain a numeric income_amount, so all three pass the narrow interface check.
Figure 1. One numeric input, three different propositions. Synthetic records. The signature checks representation; the data contract checks whether the represented proposition is admissible for this use.
Part one

The proposition before the prediction

Data pipelines usually make values visible before they make propositions explicit. A table shows income_amount = 72000. An API returns status = active. A document index stores a policy sentence. The downstream system can move these values through parsers, tensors and prompts. It still does not know enough to act.

A consequential consumer needs at least the value, unit, entity grain, scope, valid time, recording time, source authority and transformation history. The useful object is therefore closer to a proposition:

proposition = (value, meaning, subject, scope, valid_time, recorded_time, provenance)

Here, value is the encoded observation; meaning includes unit and business definition; subject identifies what the observation concerns; scope limits where it applies; valid time says when it holds in the represented world; recorded time says when the system knew it; and provenance identifies the source and transformations. Change any one component and the same bytes may assert something else.

A data defect is often a proposition defect before it is a numerical defect. Null checks and range checks find some failures. They do not find a change from booked balance to available balance, household income to individual income, event time to ingestion time, or approved policy to draft policy when the representation remains compatible.

Thought experiment one: the same double

Imagine two pipelines that differ in only one causal feature. Both emit the IEEE floating-point value 6000.0. Both use the field name income_amount. Both arrive within a second and satisfy the same model signature.

In pipeline A, the value means annual gross income in pounds. In pipeline B, it means monthly net income in pounds. A model trained on annual gross values does not receive the distinction because the tensor contains only 6000.0. If it proposes a loan decision, its output may be internally consistent with pipeline A while being operationally inappropriate for pipeline B.

Now restore the distinction as contracted metadata and enforce it before tensorisation. Pipeline A passes. Pipeline B either transforms under an approved, versioned rule or stops. The model has not become more intelligent. The system has stopped asking it to infer a hidden data agreement from a number.

Structural compatibility and semantic continuity form separate axes A two-by-two field. The most dangerous quadrant has stable structure but changed meaning because machine interfaces continue to pass. Changed structure with stable meaning causes an obvious break. Both stable is admissible after other checks. Semantic continuity Meaning changed Meaning stable Structure stable Structure changed Silent semantic break Types and shapes still pass Meaning, unit or grain changed Highest concealment risk Compatible candidate Representation and meaning stable Still test time, quality and authority Visible contract break Structure and meaning changed Parsers usually fail early Representation migration Meaning preserved, encoding changed Repairable with explicit adapter
  • Structure stable, meaning stable: a compatible candidate, subject to time, quality and authority checks.
  • Structure stable, meaning changed: the dangerous silent break because model interfaces continue to pass.
  • Structure changed, meaning stable: a visible migration that an explicit adapter can repair.
  • Structure changed, meaning changed: an obvious break that should stop at the boundary.
Figure 2. Compatibility is two-dimensional. Conceptual matrix. Structural compatibility is necessary for transport; semantic continuity is necessary for interpretation. Neither establishes freshness, quality or authority.

Why compatibility stops early

Interface technologies are designed to answer narrower questions. JSON Schema can describe and validate JSON structure and values. Apache Avro defines writer and reader schemas plus resolution rules. Model-serving systems likewise use signatures or inference protocols to state expected names, datatypes, shapes, parameters and outputs, as shown by MLflow model signatures and the KServe V2 protocol.

These mechanisms are valuable. They catch incompatible records before a model sees them. The mistake is to treat their success as evidence that the business proposition is unchanged. Avro's parsing canonical form, for example, removes attributes such as doc because they do not affect how readers parse serialized data. That is sensible for wire compatibility. It also illustrates the boundary: a documentation change can be irrelevant to parsing while being crucial to human meaning.

A model signature has the same limitation. It can require a numerical input called income_amount. It cannot establish whether the amount is individual or household, verified or self-reported, annual or monthly, gross or net, current or historical. Adding these fields to the signature makes them available, but it does not create agreement, ownership, thresholds or a safe response when they violate expectations.

Shape tells the consumer how to read a value; a data contract tells the consumer when that reading is authorised. The contract therefore spans the producer-consumer relationship, not merely the serialisation format.

Why robustness cannot repair a hidden redefinition

Models can be trained to tolerate noise, missingness and bounded distribution shift. That defence applies when the training and operating task still share enough meaning. A systematic change from annual to monthly income is not ordinary noise around the same variable. It replaces the variable while preserving its container.

End-to-end evaluation can eventually expose the harm. A decline rate may move, a calibration curve may degrade, or human reviewers may disagree. Detection at the output, however, leaves many candidate causes: the source, transformation, feature code, model, threshold, policy or population. The later the defect is found, the more decisions it may have touched and the harder attribution becomes.

Research on ML systems has repeatedly warned about this wider boundary. Hidden Technical Debt in Machine Learning Systems identifies undeclared consumers, data dependencies and external changes as sources of system debt. Data Validation for Machine Learning treats input data as a production asset and describes validation for anomalies and train-serving skew. A study of 53 AI practitioners characterised data cascades as compounding downstream effects of upstream data problems.

These findings do not prove that every defect requires a formal contract. They support a narrower engineering conclusion: when a model consumes changing enterprise data, upstream assumptions must become testable at the point where responsibility can still be assigned.

The asymmetry of reconstruction

The causal problem can be stated without any particular data technology. Several upstream worlds can produce the same downstream representation. The number 6000.0 can encode annual income, monthly income, a converted currency, a capped value or a transcription error. Once period, unit, subject and source are removed, the mapping from proposition to tensor is many-to-one.

A downstream model may guess the missing meaning from surrounding records. That guess can be statistically useful, but it is not an authoritative reconstruction. A batch dominated by annual values can make monthly values look like outliers; a new population can reverse the pattern. The model is then asked to infer both the evidence and the decision from the same ambiguous signal.

The contract restores information before that lossy step. It does not make the representation infinitely rich. It preserves the distinctions that the consumer has declared material. Once a material distinction has been erased upstream, no downstream behavioural guarantee can reliably put it back. This irreversibility is why the data boundary precedes the model boundary.

The source-model fault line Data moves from source state through transformations to an admissibility gate. Only contracted evidence crosses into model context. Source and transformation defects are blocked on the left; model and decision defects remain attributable on the right. Data responsibility Model and decision responsibility SOURCE-MODEL FAULT LINE Authoritative source world assertion + source ID Transformation normalise, join, aggregate Contract gate meaning quality · time authority · lineage receipt Model context admitted evidence only Model proposal + confidence Policy and authority approve, decline or escalate block, quarantine or repair faults remain separable after admission
  1. Source: supplies an assertion with a replayable source identity.
  2. Transformation: normalises, joins or aggregates under versioned logic.
  3. Contract gate: tests meaning, quality, time, authority and lineage, then emits a receipt.
  4. Model boundary: receives only admitted evidence, making later model and decision faults easier to separate.
  5. Failed records: stop, quarantine, repair or escalate before they enter model context.
Figure 3. The source-model fault line. Conceptual system boundary. The gate does not prove truth; it proves that declared producer-consumer conditions were evaluated before model use.
Part two

Anatomy of an executable data contract

A data contract is sometimes reduced to a schema file. At the other extreme it becomes a long governance document that no running system can evaluate. Neither form is sufficient for a consequential model consumer. The useful contract joins a human agreement to machine-enforced checks and a change process.

Datasheets for Datasets proposed documentation covering motivation, composition, collection and recommended uses. That work helps people reason about datasets before reuse. The Open Data Contract Standard offers a machine-readable structure spanning schema, quality, service levels, roles and related terms. These are complementary ideas. Documentation makes assumptions inspectable; executable clauses decide whether a particular record or release may cross a particular boundary.

The contract is not the file. It is the producer-consumer promise, its tests, its version policy and the evidence that those tests ran. Six clauses usually carry the burden.

1. Identity, grain and scope

The contract must name the entity and the row's unit of observation. “One row per customer” is different from one row per account, household, application, relationship or customer-day. A join can preserve every datatype while duplicating the grain. A model then sees repeated evidence and may treat it as independent support.

Scope states which population and decision the product supports. A source verified for salaried income may not support self-employment. A product holding current balances may not support historical reconstruction. Scope prevents successful transport from becoming unauthorised reuse.

2. Structure and encoding

This is the familiar layer: field names, types, nullability, cardinality, nested structure, categorical domains and encoding rules. It should use standard validators where possible. A duplicate bespoke type system creates another compatibility problem.

Structural checks are still important even when semantics dominate the argument. A contract that cannot reliably parse a record cannot evaluate its meaning. The ordering inside the gate is therefore pragmatic: parse first, then test the proposition.

3. Meaning, unit and transformation

Every material field needs a definition precise enough to distinguish plausible alternatives. “Income” is too broad. “Verified annual gross employment income before tax and deductions, expressed in GBP for the named applicant” is testable against period, basis, currency, source and subject fields.

Derived fields need transformation identity. An affordability ratio without its numerator, denominator, cut-off dates and code version is not reproducible evidence. The contract does not need to embed an entire code repository. It needs a stable reference to the logic that produced the value and the dependencies that would invalidate it.

4. Quality and reconciliation

Quality is fitness for a declared use, not a generic score. ISO/IEC 25012 provides a general data-quality model, but an operating contract must translate dimensions into decision-specific rules. Ninety-nine per cent completeness may be excellent for exploration and unacceptable if the missing one per cent is the field that determines legal eligibility.

Useful checks include required-field completeness, ranges, uniqueness, referential integrity, distribution expectations, cross-field consistency and reconciliation to an authoritative total. Each failure needs a severity and a disposition. Logging a violation while continuing silently is monitoring, not enforcement.

5. Temporal status and correction

A field named updated_at rarely answers the full temporal question. The contract should distinguish when a fact held in the world, when the system recorded it, when the consumer retrieved it and when the decision used it. Late arrival, back-dated validity and corrections require at least valid-time and transaction-time semantics.

Classic temporal-database work defines valid time as when a fact is true in the represented reality and transaction time as when it is present in the database. Keeping both supports bitemporal questions such as, “What did the system know on Tuesday about what was valid on Monday?” The data contract must also state freshness thresholds, clock tolerance, late-arrival behaviour and whether a correction replaces, amends or invalidates a prior assertion.

6. Authority, lineage, change and failure

The contract names the producer, consumer and steward. It identifies permitted source systems, transformation versions and source record references. OpenLineage supplies a general model for jobs, runs, datasets and extensible facets. Lineage can show where a record travelled; the contract states whether that path and source are permitted for this decision.

Change policy is part of the semantics. A new nullable field may be compatible. A change in unit, grain, definition, source authority or temporal role is breaking even when no parser fails. The contract should state which changes require a new major version, consumer acceptance, parallel validation or rollback.

Finally, failure behaviour must be explicit. The useful choices are not only pass and fail. A low-consequence analytical view might accept a qualified record with a visible caveat. A live payment instruction may need to block on stale state. Other cases require quarantine, repair or human escalation. Admissibility is a decision, not a dashboard colour.

Turn each promise into a proof obligation

A contract clause is strongest when it has four parts: a claim, a test, evidence and a disposition. “Income is annual gross GBP” is the claim. Allowed period, basis and currency values form the mechanical test. The cited payroll record and transformation reference provide evidence. Blocking or re-verification supplies the disposition.

This form prevents two common failures. The first is a threshold without a reason, such as rejecting values older than fifteen minutes without naming the decision that requires that limit. The second is a definition without an observable test, such as calling a field “trusted” while omitting source identity and reconciliation. The four-part clause lets reviewers challenge both the business premise and its implementation.

It also supports controlled exceptions. An authorised reviewer can accept a bounded deviation only by naming the failed claim, evidence considered, permitted scope and expiry. The exception becomes another governed event rather than an invisible override that teaches future operators to ignore the gate.

A data contract is a layered admissibility instrument A geological cutaway shows six layers from identity and structure through semantics, quality, time and authority. A change-policy seam crosses all layers. At the bottom, a receipt records the evaluated contract and failures. Identity, grain and scope Structure and encoding Meaning, unit and transformation Quality and reconciliation Temporal status and correction Authority, lineage and failure change policy crosses all layers contract receipt: version · checks · evidence · verdict
  1. Identity: entity, grain, population and authorised use.
  2. Structure: fields, types, nullability and encodings.
  3. Meaning: definitions, units and transformation identities.
  4. Quality: completeness, constraints and reconciliation.
  5. Time: validity, recording, retrieval, freshness and correction.
  6. Authority: producer, lineage, change policy and failure disposition.
  7. Receipt: contract version, evaluated checks, evidence references and verdict.
Figure 4. Contract anatomy as a cutaway. Practitioner synthesis. The layers are separable for diagnosis but negotiated together; a change in any layer can invalidate downstream use.

Thought experiment two: three clocks, one balance

Hold the account balance constant at £10,000 and vary only time.

In case A, the balance was valid at 09:55, recorded at 09:56 and retrieved for a 10:00 decision. In case B, the same balance was valid yesterday, recorded yesterday and retrieved at 10:00. In case C, a correction recorded at 10:05 states that the balance used at 10:00 was wrong at the time.

A model receiving only balance = 10000 sees identical evidence. A timestamp named updated_at may still be ambiguous. The cases require different answers: current admissible state, stale state, and historical decision evidence later corrected.

The contract turns the difference into fields and rules. observed_at carries the source-world observation. recorded_at carries system knowledge. The gate evaluates freshness against decision_at or retrieval time. A correction creates a new assertion linked to the earlier one instead of overwriting history.

Freshness is not a property of a row in isolation. It is a promise between a proposition, a source, a decision and a time. Fifteen minutes may be acceptable for verified income and impossible for an account hold. The contract names the threshold and the safe stale behaviour.

The same value occupies three temporal frames Three horizontal timelines show valid time in the world, transaction time in the system and decision time. An observation is valid before it is recorded. A decision occurs, then a later correction changes current knowledge without erasing the earlier decision evidence. Valid time Recorded time Decision frame 09:55 observed 09:56 recorded 10:00 decision 10:05 correction changes current knowledge £10,000 valid for the 10:00 decision replay preserves then-known and later-corrected states
  1. 09:55 valid time: the source observes a £10,000 balance.
  2. 09:56 recorded time: the governed store receives the observation.
  3. 10:00 decision time: the consumer uses the then-known record.
  4. 10:05 correction: current knowledge changes, but the earlier evidence state must remain replayable.
Figure 5. The three-clock test. Illustrative timeline. Valid time, recorded time and decision time answer different questions; a later correction changes current truth without erasing what was available earlier.
Part three
The argument in one passChart · flow
flowchart TD
  A["The number that passed every<br/>model check"] --> B["The proposition before the<br/>prediction"]
  B --> C["Anatomy of an executable data<br/>contract"]
  C --> D["Contracts as executable<br/>operating evidence"]
  D -. "re-test" .-> A
  classDef first fill:#0a1424,stroke:#D95545,stroke-width:2px,color:#e6f3ff
  classDef step fill:#0a1424,stroke:#3f7da0,stroke-width:1px,color:#e6f3ff
  class A first
  class B,C,D step
A structural route through Data Contracts Before Model Contracts, from The number that passed every model check to Source ledger. Reading use: follow the relation, then test it against the surrounding evidence and limits.

Contracts as executable operating evidence

A contract earns its place in an AI system when it changes runtime behaviour and leaves evidence. A prose definition without enforcement is useful documentation. A validator without definitions is a collection of unexplained thresholds. The operating instrument combines both and emits a contract receipt.

A receipt should identify the contract and version, evaluated time, source record, transformation version, checks run, failures, verdict and evidence references. It need not contain private source content. Its purpose is to let an operator answer, “Why was this record admitted, qualified or blocked?” and to replay that answer under the same contract.

Five verdicts cover most operating needs:

  • Pass: the declared conditions hold and the record may enter the intended context.
  • Qualify: the record may support a bounded, low-consequence use with an explicit limitation.
  • Quarantine: preserve the record for investigation without exposing it to the consumer.
  • Block: deny use because a mandatory condition failed.
  • Escalate: route an unresolved conflict or exception to accountable human judgement.

The verdict belongs to the specific use. A stale address can be qualified for meeting preparation and blocked for a legally required notice. The same source record can therefore receive different receipts under different consumer contracts without contradiction.

Worked example one: a minimal income gate

The companion laboratory defines a source-to-consumer contract for one verified annual gross income observation. The required grain is one applicant per payroll observation. The amount must be non-negative annual gross GBP. The observation must be no more than fifteen minutes old, recording lag must stay within five minutes, and the source must be the approved payroll-verification system.

The downstream model signature is deliberately narrow. It accepts an applicant identifier and a numerical income amount. That is enough to illustrate the fault line. Five synthetic records pass the model signature: one valid record, one monthly-net record, one stale record, one unapproved-source record and one record missing a source identifier.

The data contract admits only the valid record. Four defects are therefore invisible to the model signature. In the semantic case, treating £6,000 monthly income as £6,000 annual income changes the synthetic loan-to-income ratio by a factor of twelve. The contract blocks the record before the calculation can masquerade as a model judgement.

What changed? The model was not asked to detect period, source authority or staleness from the value. Deterministic checks evaluated those conditions first, and the model received only a record whose assumptions were explicit.

Executable artefact: the admissibility gate

Select a synthetic record. The browser lab runs a minimal model-signature check and an article-specific data-contract check. The downloadable Python suite records the same cases as machine-readable receipts.

Model signature

PASS

Applicant ID is text and income amount is numeric.

Data contract

PASS

Meaning, time, authority and lineage satisfy the consumer contract.

Downstream proposal

PASS

Loan-to-income ratio: 3.47, assuming annual gross GBP.

receipt.verdict = "PASS"\nreceipt.failed_checks = []
Core validation logic and expected output
signature_ok = isinstance(record["applicant_id"], str) \
    and isinstance(record["income_amount"], (int, float))

semantic_ok = record["income_basis"] == "annual" \
    and record["income_kind"] == "gross" \
    and record["currency"] == "GBP"

temporal_ok = evaluated_at - parse(record["observed_at"]) \
    <= timedelta(minutes=15)

provenance_ok = record["source_system"] == "payroll_verification" \
    and bool(record.get("source_record_id"))

admissible = semantic_ok and temporal_ok and provenance_ok

Expected suite summary: five cases accepted by the minimal model signature; one admitted by the data contract; four defects invisible to the model signature; semantic distortion factor 12.0.

Later detection increases propagation and attribution ambiguity An illustrative chart has pipeline stages on the horizontal axis and a synthetic index from zero to one hundred on the vertical axis. Both affected decisions and plausible fault locations rise as detection moves from source to complaint. 0 25 50 75 100 Source Transform Feature Model Decision Complaint affected-decision index attribution-ambiguity index Synthetic index (0 to 100)

Illustrative trend: a defect caught at the source has touched few decisions and has few plausible causes. Detection after a model decision or customer complaint increases both propagation and attribution ambiguity.

  1. Source contract failure: narrow blast radius, clear owner.
  2. Transformation or feature failure: more records and code paths involved.
  3. Model or decision outcome: source, pipeline, model and policy all become plausible.
  4. Customer complaint: highest illustrative propagation and investigative ambiguity.
Figure 6. The cost of finding the defect late. Illustrative indices, not measured empirical values. The figure expresses the mechanism that downstream detection broadens both blast radius and the set of plausible causes.

Worked example two: a production-shaped credit evidence packet

Consider a synthetic credit-preparation workflow. It reads an applicant profile from customer records, verified income from a payroll provider, liabilities from a bureau, account behaviour from a banking core and policy thresholds from an approved policy service. A language model drafts an evidence summary and a risk model proposes a score. A deterministic policy layer and an accountable reviewer retain decision authority.

Without source contracts, the workflow might join the latest available row from each system and label the result “current customer context”. That phrase hides several assumptions. “Latest” could mean last ingested, last observed, last approved or currently effective. Customer identifiers may be scoped differently. Bureau liabilities may be individual while the application is joint. Policy version 8 may be published but not yet effective.

With contracts, each producer emits or supports a typed evidence envelope. The income contract states annual gross GBP, individual applicant grain, verification source, observation time and freshness. The bureau contract states liability coverage, joint-account treatment, report time and correction rules. The policy contract states publication, approval and effective intervals. Transformations carry version references and reconciliation results.

A context compiler admits only envelopes whose receipts support the requested decision frame. The model sees the claim plus its bounded evidence, not an unqualified extract. If income is stale, the system can request re-verification. If the bureau record is individual but the case requires household exposure, the system can mark the evidence insufficient rather than asking the model to bridge the missing scope.

The model contract now starts at a cleaner boundary. It can specify expected evidence classes, supported missingness, output schema, calibration requirements, abstention and prohibited actions. When the final proposal is wrong, the trace can distinguish an admitted-data failure from a model-behaviour failure or a decision-policy failure.

This separation does not eliminate integration work. It changes its shape. Producers own assertions and change notices. Consumers own decision fitness and failure behaviour. Platform teams provide contract registries, validators, lineage and receipts. Domain stewards arbitrate contested definitions. Model owners stop becoming the default owners of every upstream ambiguity.

Four fault classes become testable

The receipt enables a useful diagnostic split. A source fault occurs when the producer assertion violates the promised meaning, time, quality or authority. A transformation fault occurs when an admitted source is joined, aggregated or converted incorrectly. A model fault occurs when admissible evidence still yields an unacceptable proposal. A decision fault occurs when policy, authority or execution mishandles an otherwise traceable proposal.

The classes are not perfectly independent. A model may amplify a small source error, and a policy threshold may be brittle to a valid population shift. The purpose is not to force every incident into one box. It is to preserve enough operating evidence to test competing explanations instead of treating the final model output as the only observable.

Good data contracts do not protect models from accountability. They remove upstream ambiguity so model evaluation can carry more causal weight. If an admitted, decision-fit packet repeatedly produces poor proposals, the model and task design deserve scrutiny rather than another round of source blame.

A production-shaped evidence river with contract receipts Four sources feed contract gates. Valid envelopes converge into a decision-specific evidence packet. Failed records branch to repair or escalation. The packet enters a model proposal stage, then deterministic policy and human decision authority. Producer sources Contract gates Evidence packet Proposal and authority Customer profile Payroll evidence Bureau report Effective policy identity · timereceipt unit · sourcereceipt scope · qualityreceipt effective timereceipt Decision-specific packet claims · receipts · evidence refs Model proposalscore + narrative Policy + reviewerdecision authority repair or human escalation
  1. Sources: customer profile, payroll evidence, bureau report and effective policy.
  2. Per-source gates: test identity, units, time, scope, quality and authority; each emits a receipt.
  3. Evidence packet: combines only decision-compatible claims and references.
  4. Model: produces a score or narrative proposal from admitted evidence.
  5. Authority: deterministic policy and an accountable reviewer make or approve the decision.
  6. Failures: branch to repair or escalation rather than being silently passed to the model.
Figure 7. A production-shaped evidence river. Synthetic architecture. The contract gates preserve source-specific meaning before a decision-specific packet reaches models, policy and accountable human authority.

Negotiate change before release

A contract is tested on ordinary days and valued on change days. The producer replaces a source, redefines a field, changes an aggregation window, adds late-arriving corrections or moves from event time to ingestion time. A registry entry that merely reports the new schema has not completed the job.

The release process should classify the change against every contract layer. Structural compatibility can be automated. Semantic and scope changes usually require named consumer acceptance. Temporal changes need replay against historical cases. Quality-threshold changes need an explicit reason and consequence analysis. Source changes need authority and reconciliation evidence.

Parallel running is often more informative than a blanket approval. The old and new products can feed the same contract suite over a bounded period. Differences are grouped by clause: missing records, changed grain, value deltas, temporal lag, source disagreement and downstream decision impact. The output is not “99.8 per cent match” without context. It identifies which propositions changed and whether the consumer accepts them.

Model canaries remain useful after this gate. They answer whether an admitted input distribution changes model behaviour. Data-contract canaries answer an earlier question: whether the new producer continues to assert the proposition the model was built to consume. The two tests should not be collapsed.

A practical release decision

The contract's depth should follow consequence, change rate, number of consumers, difficulty of correction and ambiguity of meaning. A static, low-consequence file does not need the same machinery as live account state used to authorise an irreversible action.

Use the following decision record before connecting a new source to model context:

  • Name the entity, grain, population and decision purpose.
  • Define material fields with units, scope and approved transformations.
  • Declare valid, recorded, retrieved and decision-time semantics.
  • Set quality and reconciliation thresholds with explicit failure dispositions.
  • Identify producer, consumer, steward, authoritative source and replayable lineage.
  • Classify breaking changes and require consumer acceptance before release.
  • Generate a receipt that can reconstruct why each record crossed the boundary.
  • Specify the fallback when the contract cannot establish admissibility.

The decisive release question is not “Can the model parse this source?” It is “Can the system defend what each admitted record meant at the moment of use?”

Contract depth follows consequence and source volatility A field chart has source volatility on the horizontal axis and decision consequence on the vertical axis. Low-low uses lean checks. High volatility or consequence adds versioning and monitoring. The high-high region requires a full admissibility gate, receipts and safe fallback. Source volatility and semantic ambiguity Decision consequence and irreversibility lowhigh lowhigh Lean checkschema · checksumnamed owner Versioned contractmeaning · grain · timeconsumer acceptance Monitored contractquality · lineage · replayparallel validation Admissibility gateruntime enforcementreceipts · escalationsafe fallback
  1. Low consequence, stable source: lean schema check, checksum and named owner.
  2. Rising volatility or ambiguity: version meaning, grain and time; require consumer acceptance.
  3. Rising consequence: add monitored quality, lineage, replay and parallel validation.
  4. High consequence and high volatility: enforce a runtime admissibility gate with receipts, escalation and safe fallback.
Figure 8. Choose contract depth from consequence and volatility. Practitioner decision field. It is a scaling rule, not a maturity score; low-risk uses may rationally remain lean.
Part four

Where contracts stop helping

The strongest objection is practical. Contracts can become a second bureaucracy around the data platform. Producers fill templates, consumers approve versions, registries multiply and teams spend more time negotiating definitions than learning from data. Meanwhile robust models and outcome monitoring may handle ordinary variation cheaply.

That objection is correct under some conditions. Contract depth should earn its cost. A one-off analysis over a frozen, checksummed public dataset, with one author, one consumer, a deterministic transformation and no live decision, may need only a concise readme, schema, checksum and reproducible script. A full runtime registry, bitemporal history and multi-party approval process would add little fault-localisation value.

This is the negative control. Hold the dataset, semantics, owner and code fixed; remove source volatility, multiple consumers and consequential action. The elaborate contract loses much of its advantage. The result weakens any claim that every dataset deserves the same control stack. It supports the narrower claim that contracts become valuable as ambiguity, change, reuse and consequence increase.

A contract cannot certify reality

An authorised payroll source can still be wrong. A sensor can be calibrated badly. A human can enter a false value. The contract proves that declared checks passed, not that the represented world necessarily matches the record. Independent reconciliation, sampling, audit and postcondition verification remain necessary where consequence warrants them.

A contract also cannot settle a contested concept by naming it. “Vulnerable customer”, “suspicious activity”, “fair outcome” and “creditworthiness” involve legal, institutional and ethical judgement. A precise field definition may expose the dispute, which is useful, but it does not make one interpretation correct.

Nor does passing quality thresholds establish representativeness, causal relevance or fairness. A dataset can be complete relative to its source and systematically exclude a population. It can be fresh and still encode a biased process. The contract should record known limitations and population scope, while evaluation and governance test downstream consequences.

A contract detects only what it expresses

Validators are vulnerable to yesterday's imagination. Teams add a rule after an incident and assume the boundary is now safe. Novel changes can pass all known checks. Distribution monitoring, source comparison, failure injection and review of unexplained model behaviour remain necessary.

Easy-to-measure clauses can also crowd out difficult ones. A team may celebrate 100 per cent schema conformance while leaving “active customer”, “available balance” or “approved policy” undefined. A green contract can create false confidence when its tests cover representation but omit the proposition.

The remedy is not infinitely many rules. It is evidence discipline. Contract claims should state their boundary: “This receipt establishes that the record satisfied version 1.2.0 of the consumer's declared structural, semantic, temporal and provenance conditions at 10:00.” It should not say “the data is correct”.

Failure must remain recoverable

Blocking every uncertain record can create a different hazard. A rigid gate may stop essential operations during a source outage or reject legitimate edge cases. The contract therefore needs safe alternatives: bounded stale use for a permitted task, historical-only use, manual source verification, quarantine, human exception or suspension of the consequential action.

Ownership matters here. A platform team can run validators but cannot unilaterally decide that monthly net income is equivalent to annual gross income. Producers understand source generation. Consumers understand decision fitness. Domain stewards resolve definitions. Accountable decision owners accept residual risk. The contract makes this allocation visible; it does not replace it.

Explicit failure boundary: data contracts cease to help when the important property cannot be observed or agreed, when the authorised source is itself false, when a novel shift evades declared tests, or when organisations ignore the receipt and continue anyway.

How the claim changes under pressureChart · state
stateDiagram-v2
  [*] --> Claim
  state "Thought experiment one, the<br/>same double" as Claim
  state "Why compatibility stops early" as Test
  state "Why robustness cannot repair a<br/>hidden redefinition" as Revision
  Claim --> Test: expose mechanism
  Test --> Decision: evidence survives
  Test --> Revision: rival survives
  Revision --> Claim: narrow or rebuild
  Decision --> [*]
The revision loop begins with Thought experiment one, the same double and keeps counterexamples inside the reasoning path. Reading use: follow the relation, then test it against the surrounding evidence and limits.

Compact glossary

Data contract
A producer-consumer agreement that makes structure, meaning, quality, time, authority, change and failure conditions testable.
Model contract
The interface and behavioural obligations governing how a model receives admitted inputs and produces bounded outputs.
Valid time
The time or interval in which a proposition holds in the represented world.
Transaction time
The time or interval in which a system stores or knows a particular assertion.
Contract receipt
A replayable record of contract version, checks, evidence references, failures and the resulting admissibility verdict.
Semantic break
A change in meaning, unit, grain, scope or authority that may occur without a structural incompatibility.

Make the input proposition defensible

A model can be evaluated only against the task and evidence it actually receives. When enterprise data arrives with unstable meaning, hidden scope or ambiguous time, model metrics combine at least two systems: the model and the upstream data estate. A good score can conceal a fortunate source state. A bad score can punish a model for a broken proposition.

The architecture therefore changes at the boundary. Sources no longer become model context merely because they are queryable or structurally compatible. They cross through a decision-specific contract that tests identity, grain, semantics, quality, time, provenance and authority. The gate emits a receipt and enforces a safe disposition. Only then does the model contract govern input representation, model behaviour, output constraints, abstention and escalation.

This ordering improves more than data quality. It improves fault attribution. A rejected source record is a source or contract event, not a mysterious model failure. A passed record that produces a poor proposal is now more credibly a model, task or decision-policy issue. Historical receipts support replay when definitions, sources or policies change.

The design must remain proportional. Frozen, low-consequence work can use a lean contract. Live, reused and consequential sources need stronger semantic, temporal and operating evidence. Contracts do not certify the world, settle contested concepts or guarantee fair outcomes. They make declared assumptions inspectable and enforceable before those assumptions become model behaviour.

The changed release rule is simple: establish the proposition before evaluating the prediction. A model contract without that upstream discipline governs the shape of an answer while leaving the meaning of its evidence unsecured. Data contracts come first because they make the later model contract worth having.

The evidence conversationChart · sequence
sequenceDiagram
  participant Q as Question
  participant M as Mechanism
  participant E as Evidence
  participant D as Decision
  Q->>M: The number that passed every model check
  M->>E: Thought experiment one, the same double
  E-->>M: compare rival explanations
  E->>D: Source ledger
  D-->>Q: revise scope or act
Question, mechanism, evidence and decision exchange the burdens developed in Data Contracts Before Model Contracts. Reading use: follow the relation, then test it against the surrounding evidence and limits.

Source ledger

  1. Primary research Polyzotis, N. et al. Data Validation for Machine Learning. MLSys.
  2. Primary research Sculley, D. et al. Hidden Technical Debt in Machine Learning Systems.
  3. Primary research Sambasivan, N. et al. Data Cascades in High-Stakes AI.
  4. Primary research Gebru, T. et al. Datasheets for Datasets.
  5. Primary research Snodgrass, R. T. and Ahn, I. Temporal Databases, for valid-time and transaction-time distinctions.
  6. Primary research Breck, E. et al. The ML Test Score.
  7. Official standard Open Data Contract Standard.
  8. Official specification JSON Schema specification.
  9. Official specification Apache Avro specification.
  10. Official standard ISO/IEC 25012 data quality model.
  11. Official specification OpenLineage documentation.
  12. Official documentation MLflow model signatures.
  13. Official documentation KServe V2 inference protocol.
  14. Official framework NIST AI Risk Management Framework.
  15. Practitioner synthesis Contract anatomy, receipt states, release decision field and production-shaped scenario in this article. These are bounded design proposals, not reported deployments.