March 8, 2026
API Drift Detection and Contract Alerting
Most integration failures are not sudden outages. They are slow contract drift that nobody sees until deployment day.
Our current model is to run spec-driven checks continuously and treat schema mismatch as an alerting event, not a debugging surprise. This catches nullable flips, enum additions, and response-shape regressions while teams still have rollback room.
The practical win is faster triage: failures now include endpoint, expected shape, observed payload, and severity metadata so operators can route to the right service owner immediately.
Reality: keep mocks aligned with the API
Mock fidelity is in development. The definition comparison, fixture checks and admin panel below require an upcoming release. Follow the fidelity implementation for availability.
Keep the definition used to generate your mock, then compare it with the current OpenAPI or AsyncAPI contract. Add a recent upstream capture to check the traffic you actually observed. The report identifies changed fields, types and operations so an old response shape cannot quietly become your test's source of truth.
mockforge verify-mocks --spec upstream-current.yaml \
--mock-spec mock-generated-from.yaml \
--capture-db upstream-recordings.db --fail-on-drift \
--output fidelity.json
Per-route results distinguish Verified, Drift detected, Not verified and Not sampled. Verification covers the supplied contract and captured sample. Missing capture data or unsupported formats stay visible as incomplete evidence. A matching definition alone does not prove that every production behavior was exercised.
Use the CI gate to make drift fail the build, inspect field-level changes in the admin panel, and refresh the affected mocks from the source you checked. Captures remain read-only, with timestamps in the report so the team can see which evidence supported the result.