Skip to content

Don't break the API or the database: the hard rules, and a pointer to them everywhere - #2061

Merged
davidmckayv merged 1 commit into
mainfrom
docs/api-and-migration-rules
Nov 23, 2026
Merged

davidmckayv merged 1 commit into
mainfrom
docs/api-and-migration-rules

Conversation

@davidmckayv

Copy link
Copy Markdown
Contributor

What this changes

OpenBot is live, so changes to its API and its database have to keep working for released apps and servers. This adds one short page of hard rules, docs/api-and-migrations.md, and points to it from every place a contributor or a coding agent starts.

  • The API: anything a released app uses keeps working for 12 months. Only add. New request inputs are optional. Response enums that will grow are x-extensible-enum. Replace beside the old, deprecate with an x-sunset at least 365 days out, and remove only after the sunset once nothing has used it for 12 months. It gives the exact commands CI runs, so a change can be checked before it is pushed.
  • The database: the previous release keeps working on every migration. Expand in any release, contract only what a release already out stopped using, backfill twice, the API change before the contract, no long locks, forward only with a backup first, and a merged migration never changes. It covers release-policy.json's database.to, database.from and fromVersions, and what the management agent refuses.
  • Pointers: a new root AGENTS.md and CLAUDE.md, a new mobile/AGENTS.md and mobile/CLAUDE.md, CONTRIBUTING.md, a checkbox in the PR template, api/README.md, the docs index, docs/api-versioning.md and the openbot-data-access skill.

The page states only rules the code and CI already hold, and links to api-versioning.md and api/README.md for the detail. Docs only: nothing a deployment runs changes.

Changelog

  • No line: a deployment behaves no differently afterwards.

Proof

Read every link target and anchor on the page against main. Checked each rule against what enforces it: the API spec job in ci.yml, scripts/support-window.ts, api/openapi-extensible-enums.test.ts, shared/tests/api-deprecations.test.ts, planUpgrade in shared/release-manifest.ts, the management agent's backup step, and scripts/release-manifest.ts's database checks.

… them everywhere an agent starts

docs/api-and-migrations.md is a short list of hard rules: anything a released app uses keeps working for 12 months, only add, deprecate with a sunset at least 365 days out, every database change an expand or a later contract, forward only with a backup first, release-policy.json's database.to and database.from, and what a managed upgrade refuses. It links to api-versioning.md and api/README.md for the detail. Root AGENTS.md and CLAUDE.md, mobile/AGENTS.md and CLAUDE.md, CONTRIBUTING.md, the PR template, api/README.md, the docs index and the openbot-data-access skill each point to it.
@davidmckayv
davidmckayv merged commit afb2da4 into main Nov 23, 2026
17 checks passed
@davidmckayv
davidmckayv deleted the docs/api-and-migration-rules branch November 23, 2026 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant