Skip to content

0016. API stability and upgrade guarantees for 1.0 ​

Status: proposed (awaiting the architecture owner). Applies to every door (crates/api-graphql, crates/api-mcp, crates/cli, crates/api-scim), the operator commands in crates/orbit-bin, deploy/.env.example, the plugin ABI (ADR 0013) and the release process (docs/release.md). Phase 4 (contract section 13).

Context ​

Orbit 1.0 is the first release that outside people build on: integrations call GraphQL, agents call MCP tools, scripts parse the CLI's --json output, operators script orbit commands and set environment variables, and third-party plugins link against ABI 1. Until now every surface changed freely, and the committed snapshots (crates/orbit-bin/schema*.graphql, mcp-tools*.json, cli-help*.txt) only show that a change was deliberate, not that it was compatible.

Two facts about the code shape the decision:

  • Every GraphQL field takes one typed input argument but returns the JSON scalar (agentsRequestApprove(input: AgentsRequestApproveInput!): JSON). Input shapes are in the schema; output shapes are not, so comparing schema.graphql alone cannot catch an output change.
  • Many input fields are typed JSON too (ids, enums), and the MCP tool list carries the real JSON Schema of each input (mcp-tools*.json, with $defs and patterns). The MCP input schema is the more precise contract for inputs.

Decision ​

1. The public surface ​

Stable in 1.x, for the modules and doors listed as stable in section 4:

SurfaceWhere it is pinned
GraphQL operation names, input types and fieldsschema.v1.graphql
MCP tool names, input JSON Schemas and the sensitive flagmcp-tools.v1.json
CLI verbs, flags, exit codes and the --json envelope ({"ok": true, "data"} / {"ok": false, "error": {"code", "message", "requestId"}})cli-help.v1.txt
Output shapes of every stable command and querythe module README's tables, and a test per module (section 3)
Error codes and the reason and field details a module documentsdocs/api/index.md, module READMEs
HTTP routes outside GraphQL (/mcp, /mcp/token, /files/..., /scim/v2, /api/auth proxy)docs/api/index.md, ADR 0009, ADR 0010
Environment variablesdeploy/.env.example
Operator commands (orbit migrate, tenant provision, keys ..., health, plugin ...) and their flagsdocs/operations.md, cli-help.v1.txt
Plugin ABI 1 and the plugin manifest schemadocs/plugins/abi-v1.md (ADR 0013, ADR 0014)
Event names and payload fields that other modules or plugins consumemodule READMEs ("Events")

Not public: module.toml, database schemas and tables, Cedar policy ids, Rust crate APIs, log lines, audit row layout, the web app's internal GraphQL documents, and anything a schema description labels Preview (section 4).

2. What may change in 1.x ​

Additive only:

  • New operations, tools, verbs, flags, environment variables, routes, events and modules.
  • New optional input fields (absent means the 1.0 behaviour).
  • New output fields. Clients must ignore fields they do not know; every event already allows unknown fields.
  • New error reason values under an existing code. Clients must treat an unknown reason as the code alone.
  • Tighter limits only where a security fix needs them, called out in the release notes.

Not allowed in 1.x: removing or renaming anything above, making an optional input required, narrowing an accepted input, changing a field's type or meaning, changing an error code, or turning a plain MCP tool into a sensitive one without a release note. Making a tool sensitive is a security change and is allowed, because it fails closed (the agent's first call asks for approval instead of running).

3. Deprecation ​

A removal is announced with @deprecated(reason: "...") on the GraphQL field (and the same text in the MCP tool description and CLI help) for at least two minor releases and six months, whichever is longer, and happens only in 2.0. The changelog lists every deprecation under "Deprecated".

4. What is stable in 1.0 (plan decision D13, owner) ​

Default, pending the owner: stable are the kernel, the doors, core, leave, attendance, inbox, agents, payroll, country-lk, the Phase 3 modules (recruitment, lifecycle, expenses, policies, relations), performance, learning, marketplace and plugin ABI 1. Preview: analytics query shapes and the assistant. country-ca, scim and hello are not in the plan's list and need the owner's call (hello is a sample and should be compiled out of release builds or marked Preview).

A Preview operation says so at the start of its schema description (Preview:) and is left out of the stability check. It may change in any minor release.

5. Enforcement in CI (built by plan lane L10) ​

  • At the 1.0 tag, copy the all-modules snapshots to schema.v1.graphql, mcp-tools.v1.json and cli-help.v1.txt. They never change in 1.x.
  • crates/api-graphql/tests/stability.rs parses the baseline and the current schema with async-graphql-parser (already a dependency) and fails on any removed type, field, argument or enum value, any changed type, and any new required input field, except on Preview: items.
  • The same test compares the MCP input schemas (no removed tool, property or enum value, no new required entry, no narrowed pattern) and the CLI help (no removed verb or flag).
  • Because outputs are JSON scalars, each stable module keeps a test that asserts the output fields its README documents. A field removal must fail it. Open: there is no machine-checked output schema today; generating one per handler is future work.

6. Upgrades ​

  • Any 1.x upgrades to any later 1.x with orbit migrate alone, then restarting the serving roles. No manual SQL and no data step outside orbit migrate and jobs it queues.
  • A breaking schema change inside 1.x follows expand, migrate, contract over two releases: release N adds the new column or table and writes both; release N+1 stops reading the old one; the old one is dropped no earlier than N+2.
  • A release may need jobs queued by the previous release to drain first (as issue #31's snapshot chains did). That is said in the release notes and in docs/operations.md, with the query that shows they have drained.
  • Down migrations exist and are tested, but are not supported in production. Roll back by restoring the backup taken before the upgrade (docs/release.md).
  • 1.0 supports upgrading from the last 0.x tag only. Older databases upgrade to that tag first. Open: no tag exists yet; the first 0.x tag must be cut before L10's upgrade test has a baseline.
  • crates/orbit-bin/tests/upgrade.rs (L10) restores a seeded database migrated at the previous tag, runs the current orbit migrate, then the smoke test.
  • The auth sidecar's schema (services/auth, auth-migrate) follows the same rule.
  • A release never re-encrypts or rewrites locked history (contract rule 9); a key or format change goes through orbit keys rotate and the re-encryption jobs.

7. Versions ​

Semantic versioning on the whole product: one version for the workspace, every module.toml, the web app and the sidecar. Module requires become core@^1 at 1.0. Patch releases fix bugs and security issues only. Security fixes are made for the latest minor release of 1.x (see SECURITY.md).

Consequences ​

  • Every new input field must be optional for the life of 1.x, which pushes validation of "required in practice" into the handler with a documented reason.
  • Output stability rests on per-module tests until output schemas are generated. That is weaker than the input check and is recorded as an open item in docs/security-review-1.0.md.
  • The snapshots stay as they are for reviewing diffs; the .v1 copies are the contract.
  • Plugin authors get the same guarantee for ABI 1; ABI 2 can only arrive with Orbit 2.0 or alongside ABI 1.

Orbit by SkySync Tech. Licensed under AGPL-3.0.