The contract between two parties is a structured, checked model, not a shared assumption.

Typed contract surfaces (the contract is a checked model, not a comment)

Intent — Turn the contract between two parties — an HTTP API and its clients, two languages sharing a wire format, a command-line tool and the scripts that parse its output — into a structured, checked model instead of a shared assumption. The producer's shape and the consumer's expectation both reconcile against one declared surface, so a breaking change reddens a build gate rather than silently breaking the far side at runtime (our instance: a structured endpoint model with visibility and auth extensions, a cross-language marker-and-JSON schema registry, and a per-subcommand stdout spec used as a fuzz oracle).

SummaryThe contract between two parties is a structured, checked model, not a shared assumption.
TargetBridge · System models
Formtyped-ir
Movepackage — a constraint shipped with its sensors
Modelis-a-model — a structured model you check a system property against
EnforcementHard (deterministic) — each contract is a typed surface reconciled against its real producer and consumer; a handler whose shape diverges from the declared endpoint, or output that violates the declared spec, is a build finding
Derivationmodel-from-code — the contract surface is reconciled against the live producer and consumer sites

Its place in the environment — a variant / known-use of Executable Source of Truth, under KNOW · Maintain authoritative system knowledge. Preserved here for its technical texture; the construction kit shows how it folds.

Motivation — the failure it kills

A contract crossing a boundary usually lives as a comment, an example payload, or nothing at all. One side changes its shape; the other keeps parsing the old one; the mismatch surfaces as a runtime error at the far end, far from the edit that caused it. The three classic boundaries all rot the same way. An HTTP endpoint drops a field and a client deserializes null. A worker in one language emits a status marker that a coordinator in another language greps for, and a rename on one side leaves the other matching a string that no longer appears. A command-line tool changes its stdout JSON and every script that piped it breaks at once. In each case the two sides share a shape that is written down nowhere a check can read, so nothing catches the divergence until production does.

Why it's not just a schema file

A schema file on its own is a document, and it drifts like any document. The contract surface earns the word model by being reconciled against both sides at build time: the producer's real output shape and the consumer's real expectation are both checked against the one declared surface, so neither can move without the gate noticing. A plain schema you hand-write and hope stays accurate has no such tie — it goes stale the moment a handler changes, and its staleness is invisible until a client hits the gap. The surface also carries more than field names: which endpoints are public, what auth each demands, which stable output points a fuzzer may treat as an oracle. That extra typed metadata is exactly what a comment or a loose JSON example cannot hold and a checker cannot read. The distinction is the same one this catalogue draws everywhere: a schema that can lie is a document; a schema a drift gate keeps honest is a model.

Mechanism

Prerequisites

Consequences & costs

Known uses

Related mechanisms

Governed by

The mechanisms that hold this model true — inverted from their Governs edges at build time, never hand-written. A direct governor names this model; a trunk mechanism governs every model.