$ fssg build --deterministic --validate |

How to Gate Contract Changes in an IOSM Cycle

IOSM

A contract test can pass while the system is still unsafe to change.

That sounds contradictory only if we treat a contract as one file and one test suite. In a real system, a public interface has producers, consumers, deployed revisions, compatibility assumptions, migration work, and an owner who can accept the residual risk. A green test proves something about the candidate interface. It does not prove that every affected consumer can move with it.

IOSM v1.0 makes the Contract Catalog a required artifact and requires contract checks at the Modularize gate. I think the operational mechanism between those two requirements should be a contract delta: a machine-readable account of what changed, who depends on it, how compatibility was classified, and what evidence permits the cycle to close.

Three possible controls

I considered three ways to handle interface change inside a cycle.

  1. Run the latest contract tests. Necessary, but blind to consumers that are not represented in the suite.
  2. Require a semantic version bump. Useful communication, but the version number records a conclusion; it does not contain the evidence behind it.
  3. Produce a contract delta against the catalog. This keeps the old and new interface identities, change classification, consumer map, evidence, and migration state in one reviewable object.

The third control has the right boundary. Tests and versioning remain inputs. The delta becomes the admission artifact for Gate M.

The contract delta

I would keep the object small enough to generate in CI and strict enough to fail closed:

contract_delta:
  id: cd-checkout-api-2026-08-02
  contract: checkout-api
  base_revision: sha256:8d2c...
  candidate_revision: sha256:25aa...
  changes:
    - path: POST /checkout
      kind: response_field_removed
      field: legacy_discount
      compatibility: breaking
  affected_consumers:
    - id: pricing-ui
      observed_revision: git:41c7...
      status: migration_required
    - id: reporting-worker
      observed_revision: git:9b13...
      status: compatible
  evidence:
    schema_diff: artifact://openapi-diff.json
    provider_tests: artifact://provider-contract.xml
    consumer_tests: artifact://consumer-matrix.json
  approval:
    required: true
    receipt: null
  closure: blocked

The two revisions matter. Without them, the review can drift: an engineer approves one candidate while the pipeline deploys another. The change list matters because “schema changed” is too coarse for policy. Adding an optional response field, removing a required request field, and changing authorization semantics are not the same event.

Most importantly, the consumer list is not a mailing list. It is executable migration state.

Compatibility is a policy result

OpenAPI gives teams a machine-readable description of HTTP APIs, and tools such as oasdiff can detect changes that may break clients. That is a useful detector, not a universal oracle. Compatibility depends on the contract type and on local policy.

A JSON response field removal may be breaking. A protobuf field-number reuse has a different failure mode. An event schema can remain syntactically readable while changing business meaning. A CLI flag rename may break automation even if the interactive experience improves.

I would therefore make compatibility classification explicit:

Result Meaning Gate M action
compatible Existing declared consumers can continue unchanged Verify evidence and continue
conditionally_compatible Safe only under a named capability, rollout order, or time window Require the condition as a gate input
breaking At least one declared consumer must change Block until migration or approved waiver
unknown Consumer coverage or semantics are insufficient Block; missing knowledge is not compatibility

This resembles the rule I use for missing IOSM metrics: unknown must remain a control state. Converting it to “probably compatible” only rewards incomplete inventories.

Consumer closure comes before modularity closure

A provider can satisfy its new schema while a consumer still depends on the old one. That is why the contract delta needs a consumer state machine:

discovered -> assessed -> compatible
                       -> migration_required -> migrated -> verified
                       -> retired
                       -> waived

Gate M may close only when every in-scope consumer reaches a terminal state accepted by policy. migrated is not enough; the new consumer revision needs verification against the exact candidate contract. retired needs evidence that the deployment or subscription no longer exists. waived must point to the IOSM Waiver Register and remain distinct from a pass.

This also prevents false modularity. Splitting a service into cleaner modules can make the repository look better while increasing coordinated change across consumers. IOSM already measures change surface. The contract delta makes that surface addressable instead of leaving it as an aggregate number.

Put the delta between the catalog and Gate M

The control flow is straightforward:

Contract Catalog (base)
        |
        v
candidate contract -> semantic diff -> compatibility policy
        |                                  |
        v                                  v
consumer discovery ----------------> migration matrix
                                           |
                                           v
                                evidence + approvals
                                           |
                                           v
                                 Gate M decision
                                           |
                                           v
                              Contract Catalog (new base)

The catalog is the durable baseline. The delta is the transaction. Gate M is the commit boundary.

That separation matters. If a failed cycle mutates the catalog before the migration closes, the repository loses the last accepted state. The candidate should become the new catalog revision only after the gate records a successful decision. This is the contract equivalent of binding an IOSM decision to exact evidence rather than to a mutable report path, as I described in evidence binding.

What the mechanism cannot prove

A contract delta does not discover every hidden consumer. Dynamic calls, copied schemas, undocumented scripts, and external clients may remain invisible. The mechanism is only as complete as the consumer inventory and observation boundary.

It also does not prove semantic compatibility by itself. A schema diff can identify structural changes; domain-level meaning still needs executable examples, invariants, or human review. For high-risk interfaces, the catalog should name the required evidence sources and the authority allowed to approve a break.

Finally, this article proposes an operational extension around the current IOSM artifact model. IOSM v1.0 requires the Contract Catalog, contract checks, and human approval for public contract changes, but it does not define this exact delta schema or lifecycle.

The engineering rule

I do not want Gate M to ask only, “Do the contract tests pass?” I want it to ask a harder, more useful question:

Can we prove that the exact candidate contract has a closed path through every declared consumer?

When the answer is yes, the Contract Catalog advances to a new accepted revision. When the answer is unknown, the cycle remains open. That is not bureaucracy. It is how modularity stops being a diagram and becomes a safe change property.

Sources

FACET AI CLI Terminal
facet@ai:~$