# Compatibility

This page is the compatibility contract: what a version of the packages promises across the five surfaces an app depends on, and how a change is announced before it lands. It teaches one check, `durable-sdk verify`, and one rule: nothing is renamed or removed inside a major.

The packages (`@durable-sdk/core`, `@durable-sdk/postgres`, `@durable-sdk/vercel`, `@durable-sdk/testing`, `@durable-sdk/app`, `durable-sdk`) share one version, released together. Semantic versioning: a patch fixes, a minor adds, a major removes or changes a meaning. The supported runtimes are written down: the Node major the packages' own CI proves and the one before it; Postgres 16 and newer.

## The five surfaces

### 1. The stored rows

The engine's tables are versioned schema versions applied by `durable-sdk migrate`, each with a down. A minor release may add a version, expand-only (a column, a table, an index), with its down. A version that contracts (a drop, a rename) ships in a major alone, after every supported line stopped writing the shape. A package reads a schema ahead of its own and says so once (`ahead`); a schema behind the package refuses every run until `migrate` ran (`schemaPolicy: "refuse"`). `durable-sdk verify` says where a database stands against the package. On the platform the build runs `migrate` before the code, so a deployment never runs ahead of its schema.

### 2. The relay wire

Facts shared between apps cross a signed relay with a wire version (`v: 2`). A new version is negotiated, never forced: a sender keeps the old envelope until the peer answers the new one, and a peer on the previous major still relays.

### 3. The operator API

Every app's operator API (`/admin/api/*`, what the dashboard's console and the console proxy read) carries `X-Durable-Api: <major>.<minor>` and a contract lock. The major moves when a path or a field is removed or its meaning changes; the minor when one is added. The dashboard reads any minor of its major and shows one banner behind an older major; `durable-sdk platform check` reads a major apart as red, and the platform's own check does the same before a promotion. The current version is the `api.version` of `GET /admin/api` on any app and the `X-Durable-Api` in [`/openapi.json`](https://durablesdk.com/docs/reference/api.md#openapi).

The platform API itself (`/api/v1`) carries its own version in `X-Durable-Plane` under the same rule: a field is never removed from an answer or renamed inside `1.x`; a new field or route is a minor.

### 4. The CLI's verbs and the Action's inputs

A verb, a flag or an input of the CI Action is never renamed inside a major. One removed is refused by name with the new spelling for a release first, then removed. `durable-sdk explain` keeps every refusal id under its id.

### 5. The authoring API

`defineWorkflow`, `on`, the context's verbs (`ctx.step`, `ctx.emit`, `ctx.wait`, `ctx.poll`, `ctx.all`, `ctx.reply`), the duration grammar (`30s`, `5m`, `2h`): an option removed is refused by name (`*.option.unknown`), an alias is admitted one release beside its word, and a sentence a door throws is kept under its refusal id. A workflow that compiled and passed its tests on `1.x` compiles and passes on every later `1.y`.

## The deprecation policy

A release warns: one log line per process under a catalog name, a doctor finding with the new spelling (`durable-sdk doctor --host`), an entry on [the changelog](https://durablesdk.com/docs/changelog.md). The next release removes. An alias stands one release. A stored column no verb reads contracts only in a major, after every supported line stopped writing it.

What this means for an upgrade: read the changelog's entry, run `durable-sdk doctor --host` on the new version (every deprecation is a finding with its fix), run `durable-sdk test --changed`, deploy a preview, then `--prod`.

## The LTS line

The major an Enterprise contract was signed on is an LTS line: security fixes for eighteen months from its cut, published under a dist-tag (`lts-<major>`), no feature; at most one LTS line beside the current major at a time.

## The platform's own promises

- The hostnames `<slug>.durablesdk.com` and `<slug>-git-<branch>.durablesdk.com` do not change shape; a custom domain stands beside.
- The template's file layout (`durable.config.ts`, `src/workflows/`, `src/events/catalog.ts`, `src/listeners.ts`, `api/`) is the contract `durable-sdk init` writes and the doctor reads; a new template version is a new `templateVersion` on the app's record, applied only when you deploy a tree that carries it.
- Nothing a hosted app imports is private to the platform: the packages it is written with are the published ones.
- An error code `plane.*` is never removed inside a major of the platform API; a new one is a minor. [Errors](https://durablesdk.com/docs/reference/api/errors.md).

## Release notes

The release notes are generated from the merged changes between two tags, one line each; a change that moves the operator contract carries its `Api:` line, one that moves a schema version its number. [The changelog](https://durablesdk.com/docs/changelog.md) is those notes; [the roadmap](https://durablesdk.com/docs/roadmap.md) is what is next, by unit id.

---

Prompt for an agent:

```text
Read https://durablesdk.com/docs/reference/compatibility.md, then judge whether an upgrade of @durable-sdk/* is safe for this app by the five surfaces; run durable-sdk doctor --host before and after; a refused line is a refusal id: durable-sdk explain <id>
```
