Guides

Repair API contract drift

Align checked-in server, schema, client, fixture, and generated API artifacts without silently changing the public contract.

Answers: use a coding agent to fix API contract drift · Updated

SHORT ANSWER

Use this finite shift only when the repository already identifies an authoritative API source and an established comparison command. Nightshift repairs objective, non-breaking artifact drift and stages every potentially breaking choice for owner review.

01

Establish authority before changing artifacts

Identify the source the repository already treats as authoritative: an OpenAPI or GraphQL definition, protobuf schema, server routes, consumer-contract suite, or equivalent. Run the configured generation, diff, compatibility, or contract command before editing.

  • Record the authoritative source and exact comparison command.
  • Compare server routes, schemas, generated clients, fixtures, and contract tests as applicable.
  • Do not add contract tooling or guess which artifact wins.
02

Separate drift from breaking policy

A regenerated non-breaking artifact can follow the established source. Removal, narrowing, renaming, required fields, status codes, and compatibility policy remain owner decisions.

  • Repair one coherent non-breaking cluster per commit.
  • Park potentially breaking mismatches with affected consumers and rollback evidence.
  • Review generated output semantically instead of accepting a clean diff as proof.
03

End on the repository’s contract check

The shift finishes when the configured comparison reports no actionable non-breaking drift and every breaking question is staged for review.

Run the API contract drift ready shift. Use the repository's established contract source and comparison command; never choose a breaking API change unattended.
TRY IT

Start with a bounded prompt

This prompt names the outcome and preserves Nightshift’s review boundary. Paste it into the supported coding host from the project you want to change.

Run the API contract drift shift using this repository's established source and comparison command. Repair only non-breaking artifact drift and park breaking choices.
BOUNDARIES

What this workflow does not claim

  • The shift requires both an authoritative contract source and an existing comparison command.
  • Breaking removals, renames, required fields, and compatibility policy remain owner decisions.
SOURCES

Evidence and sources

These links support the released behavior, public outcomes, or problem language described on this page.

api-contract-drift contractThe released finite API artifact-alignment contract.Open evidence ↗Versioned workflow contractThe shipped one-item loop, decision boundary, gates, recovery, and clock-out behavior.Open evidence ↗Versioned Quality skillThe released quality survey and disposition workflow.Open evidence ↗
RELATED QUESTIONS

Continue from the question you have

compare OpenAPI server and generated clientRead the answer →repair GraphQL schema driftRead the answer →harden a release contractRead the answer →