Your model consumes other teams' work. The sales feed belongs to the point-of-sale team. The promotions calendar belongs to merchandising. The stock file belongs to the warehouse system. Each of those teams will change its system, for its own good reasons, on its own schedule, without thinking of your model. From where they sit, your model is one consumer among many, and not the loudest.
So the question is not whether your inputs will change. They will. The question is whether you find out from an alarm you arranged in advance, or from the business's losses after the fact. A data contract is how you arrange the first of those.
A common misconception needs correcting here. It says that the data comes from the warehouse, so keeping it right is the warehouse's job, and if it breaks, that is a data problem rather than a model problem. To the business absorbing the losses, there is only a system problem. Your system consumed the data without checking it. Ownership of an input's correctness stays with its supplier, but ownership of verifying it before your model bets a night's orders on it is yours. No supplier's good intentions substitute for a test that runs every night.
A contract covers five things
A data contract, in the sense used here, is a written, testable agreement between a supplying team and your system. It covers five things, and each one earns its place.
First, schema: the fields, types, and keys that will be present. A given column will exist, and it will hold the type of value promised.
Second, semantics: what the values actually mean. A quantity field might mean units sold, not units ordered, and not cases. This is the clause that fails most often and matters most, because schema checks pass happily while meaning quietly walks away.
Third, timing: when the data lands, and how late it may be before your system treats the night as broken rather than merely slow.
Fourth, range and quality bounds: the values will sit inside stated limits. Quantities will be non-negative. Store identifiers will be drawn from the chain's actual stores. No more than a stated fraction of rows will be missing a key field.
Fifth, ownership: a named person on the supplying side who knows, in advance and in writing, that this agreement exists, and that changes to any clause require notice before they ship, not discovery after.
Contracts earn their keep through tests, not paper
Every clause that can be checked mechanically must be checked mechanically, on every delivery, before the data is allowed anywhere near a feature job. Schema tests reject a missing or re-typed column. Semantic probes watch distributions, because meaning leaves fingerprints. If a quantity that meant units suddenly becomes cases, values fall to roughly a twelfth of their former size, and a distribution check notices that pattern for what it is. Bounds checks count out-of-range rows and fail the delivery when they exceed the agreed fraction.
A failed contract test is not an inconvenience to route around. It is the contract working. The agreed behavior on failure belongs in the contract itself: reject the delivery, fall back to the last good one if the decision the model supports allows that, and alert both sides, your on-call and the supplier's named owner, in the same hour rather than the same week.
What a contract really buys
Notice what a contract does not do. It does not prevent change. Suppliers must remain free to improve their systems, and a contract that froze them would fail everyone. What it buys is conversion. Change stops being a silent event inside your model's inputs and becomes a negotiated event between two teams, with notice, a test that witnesses it, and a named human at each end.
One retailer learned this the expensive way. Merchandising rebuilt its promotions calendar and began recording the funded discount where the feed had previously carried the shelf discount. The schema was unchanged. The timing was unchanged. The meaning was different. The forecaster spent a full promotion cycle expecting demand lifts that the shelf prices never delivered, and the orders placed on those expectations were confidently wrong for a month. Under a contract with a semantic clause and a distribution probe, that change would have failed a test on its first night and arrived as a conversation between two teams. Without one, it arrived as losses.
Start where corruption would hurt most
No team needs perfection across every feed on day one. Write contracts first for the inputs whose corruption would hurt most. The top few inputs usually carry the great majority of the risk, and a short list of enforced contracts beats a long list of unenforced intentions.
Keep each contract beside the code that consumes the feed. Version it with that code. Review it whenever either side's system changes on purpose. A contract treated as paperwork filed at a project's birth will describe a system that no longer exists within a year. A contract treated as a living document, with owners on both sides, keeps describing the real exchange, and keeps witnessing it every night.
That witnessing is the whole point. Suppliers will change their systems, and they should. Your model will keep consuming their work, and it should. The contract is what stands between those two healthy facts and a month of wrong orders nobody can explain. It turns trust from a hope about another team's intentions into a check your own system runs before it acts.
Experience it, don’t just read about it
Treating every critical input as a written, testable promise, verified on every delivery before the model may use it, is Concept 3 of Machine Learning Systems in Depth: Features, Pipelines and Models That Survive Production (Course No. 593), from Cognosco Learning, a learning company powered by AI. The course builds production machine learning beyond this distinction — Features with a Point in Time, Pipelines That Fail Loudly, and Watch the Inputs First — each worked through with an Agentic Socratic AI coach, one learner at a time. Try a Free Preview at cognoscolearning.com.
Navigate your own course.
© 2026 Cognosco Learning. All rights reserved.