You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[tech-debt] Make OpenAPI spec authoritative + CI route-contract drift check #8546
The client/server contract is maintained by hand in 5+ places with no codegen. docs/api-reference/openapi.json exists but is docs-only — no client is generated from it and nothing verifies it matches the actual FastAPI routes. Result: silent drift between the spec, the server, and every hand-rolled client.
Evidence
Hand-rolled clients: desktop/macos/Desktop/Sources/APIClient.swift (5,263 lines), web/app/src/lib/api.ts (2,251), 31 files under app/lib/backend/http/, plus a separate Windows TS client.
openapi.json is under docs/ and not wired to client generation.
Scope of this PR (one coherent change — backend side, make the spec authoritative)
Generate the OpenAPI spec from the live FastAPI app (single source of truth) instead of a hand-maintained file.
Add a CI check that fails if the committed spec drifts from the actual routes.
Document the spec as the contract clients must conform to.
Acceptance criteria
The committed OpenAPI spec is produced from the app and verified in CI.
A route added/changed without updating the spec fails CI.
Out of scope
Generating the Swift/Dart/TS clients from the spec (follow-up). This PR makes the contract real and drift-proof on the server side first, which is the cheap high-value step.
Part of a tech-debt / agent-friendliness audit. Filed via Claude Code.
Activity
[codex] Add hermetic OpenAPI contract drift check (#8629)