Loop until API responses match the OpenAPI or JSON Schema contract β catch drift between docs and implementation.
Run contract tests against openapi.yaml or schema fixtures. List every mismatch with endpoint and field.
Fix the smallest change: update handler types/validation or correct the spec if the code is canonical.
All API contract tests pass
Start the "API Contract Until Match" loop. Goal: API implementation matches the published contract Max iterations: 10 Between iterations run: npm run test:contract Exit when: contract test suite exits 0 Step 1: Run contract tests. Fix each schema/response mismatch with minimal diffs, then re-run. Self-pace this loop. After each iteration, run the check command, read the output, and only continue if the exit condition is not met. Stop when the exit condition passes or max iterations is reached. Give a short status update each pass.