Upgrade and compatibility
InferCrane v1 separates four compatibility surfaces: the control API, DeploymentSpec, integration contracts, and PostgreSQL schema. A passing runtime or provider conformance test does not override the policy for another surface. For an application SDK, OpenAI-compatible protocol, or runtime behavior change, use the complete development → staging → production protocol rollout. It defines the buffered, streaming, cancellation, error-schema, consumer-canary, fail-closed promotion, and restoration gates; the control-plane binary procedure on this page is a separate compatibility boundary.Before upgrading
- Read the release notes and compatibility matrix.
- Back up PostgreSQL and verify the dump with
pg_restore --list. - Run
infercrane planfor representative DeploymentSpecs with the new CLI. - Run local qualification against the exact candidate commit.
- Verify provider credentials and inventory with
infercrane doctorandinfercrane orphans. - Upgrade the control plane before upgrading generated SDKs or automation clients.
Automate a provider or serving-plan change safely
A provider change is a candidate revision, not an in-place infrastructure edit. Automation should stop before mutation unless the exact combination is present in release evidence:unsupported, unknown, planned, or lacks the environment-specific qualification required by
policy. Do not reinterpret missing evidence as a warning in deployment automation.
Only after the dry run and qualification gate pass should automation submit the same reviewed spec:
apply stages an immutable candidate; it does not replace active traffic. Run Release Guard and
promote explicitly. If provisioning or validation fails, preserve the operation/evaluation evidence
and reject the candidate; the active provider remains routed. The current decision must be ACCEPT
for the same active/candidate pair before promotion. After a post-promotion regression, restore the
retained previous revision with rollout rollback; never delete the deployment as release recovery.
PostgreSQL migration contract
Migrations are embedded, ordered, forward-only, and transactionally applied under a PostgreSQL advisory lock. The migration ledger stores a SHA-256 checksum for every migration. Startup fails if:- a previously applied migration was edited;
- the ledger has a gap;
- the database contains a migration unknown to the running binary; or
- a migration cannot commit atomically.
DeploymentSpec
The current file contract is:Control API and SDKs
/api/v1 is the stable v1 namespace. Within v1:
- new optional response fields are additive;
- clients must ignore response fields they do not understand;
- existing field meaning and error codes do not change silently;
- removal requires deprecation in release notes for at least two minor releases;
- generated SDK major versions track the API major version.
--output json, the generated SDKs,
or Terraform.
Provider and runtime contracts
Provider Contractinfercrane.provider/v1 and Runtime Contract infercrane.runtime/v1 are versioned
separately from the product. Registration exposes an adapter to composition; only the capability and
qualification inventory establishes evidence for an exact runtime/provider/mode combination.
Current release support boundary
Safe release-candidate upgrade
Because no adjacent pair is currently qualified, a mixed-version rollout is **not a supported release-candidate workflow. Use this maintenance procedure instead:1
Converge or record active operations
2
Back up and stop the old application replicas
3
Start exactly one new-version replica
Start the candidate image against the preserved database. Its startup migration lock and ledger
validation must complete before
/readyz becomes healthy. If startup rejects the ledger or a
migration fails, stop and follow the release-specific restore procedure; do not edit migration
rows.4
Verify recovery before adding replicas
Roll back without erasing evidence
If the new binary or migration fails, do not start the old binary against the migrated database and do not delete provider resources. While the failed-version API can still serve read-only requests, export its post-upgrade state as a separate evidence set:INFERCRANE_DATABASE_URL at it, set
INFERCRANE_RESTORE_TARGET_DATABASE to its exact database name, and restore the verified pre-upgrade
dump using Backup and restore.
The restored database is authoritative only through the backup timestamp. Post-backup exports and
the failed-upgrade database remain immutable external audit evidence; the current release cannot
reattach those rows automatically to the restored ledger. Before enabling reconciliation, compare
the restored active revision and provider identities with the retained exports and read-only
provider inventory. Any provider mutation after the backup is a manual reconciliation boundary.
Future rolling-upgrade contract
Every live replica registers its binary version and control protocol interval. Startup fails before serving when that interval cannot overlap a live member. Inspect the actual window:/readyz and the membership list, then remove old replicas one
at a time. An expired operation lease is reclaimed by another worker; the old fence token cannot
checkpoint or complete work. This is not permission to mix arbitrary schema versions: take a verified
backup first and follow the migration compatibility statement for both releases.
Rotate server or client certificates by temporarily trusting both CA generations, rolling clients,
then servers, and finally removing the old CA. InferCrane reads certificate files at process startup,
so each trust change requires a graceful rolling restart.