Generated Code
Owner: Engineering Last reviewed: 2026-Q2
This page defines how generated files are produced, reviewed, and committed.
OpenAPI And Orval
- Backend routes and schemas produce the OpenAPI contract.
frontend/openapi.jsonis the frontend input spec.frontend/orval.config.tsgenerates clients and models intofrontend/src/api/generated.- Generated files must not be hand-edited.
Regeneration Workflow
When a backend route or schema consumed by the frontend changes:
- Export or refresh the backend OpenAPI JSON into
frontend/openapi.json. - Run from
frontend:
npm run orval- Update thin wrappers in
frontend/src/api/*if function names or types changed. - Run
npm run build. - Review generated diffs for expected contract changes.
Review Policy
- Generated diffs should be reviewed for shape and compatibility, not style.
- Unexpected generated churn usually means the OpenAPI input changed more broadly than intended.
- Do not hide API breaking changes inside generated diffs; call them out in the PR description.
- Keep handwritten compatibility wrappers when a generated hook rename would cause broad frontend churn.
Commit Policy
- Commit generated client changes when the frontend relies on the changed contract.
- Do not commit generated output from local-only experiments.
- If generated code changes without an intentional API change, investigate before committing.
Other Generated Or Local Artifacts
- Do not commit dependency folders, caches, build outputs, virtual environments,
.DS_Store, or local machine artifacts. - If a generated artifact is required for deployment or development, document its source command and review policy here.