What a user of the SDK, the REST API, the CLI or MCP may rely on across releases, what counts as a breaking change, and what a change owes before it merges. The snapshots below make the policy a test rather than a promise: an unannounced change to a public surface fails CI.
| Surface | Public means | Pinned by |
|---|---|---|
| SDK | The service classes exported from visionset.kernel.services (__all__), their public methods and properties, the exceptions in visionset.kernel.errors, and visionset.kernel.error_codes. |
tests/fixtures/public_surface/sdk.json |
| REST API | The operations, parameters, request bodies and response bodies in openapi.json. |
openapi.json and tests/server/test_openapi_contract.py (api.md) |
| CLI | Every command path, argument, option, its type, default, choices and flag-ness, as visionset --help lists them. Exit codes and the --json output shapes, which are the wire's. |
tests/fixtures/public_surface/cli.json |
| MCP | Tool names and their input schemas, the default read/write/destroy annotation, and the top-level keys a result carries. | tests/fixtures/public_surface/mcp.json |
| Error codes | The code on every refusal, on every surface. |
error-codes.md, which is generated |
Anything else is not public and may change in any release without notice: underscore-prefixed
names, the rest of visionset.kernel (domain models, ports, adapters), visionset.server,
visionset.cli, visionset.mcp and the other packages as Python imports, the wording of an
error message or a tool description, the browser app's markup and routes, and anything not in the
snapshots above. Code that imports an internal module is on its own.
A new documented entry point is not public until a snapshot lists it; regenerating the snapshots is what makes it so.
| Breaking | Not breaking |
|---|---|
| Removing or renaming a service, method, command, option, tool, parameter, route or error code. | Adding a service method, command, option, tool or route. |
| Making an optional parameter required, or adding a required one. | Adding an optional parameter with a default that keeps today's behavior. |
| Narrowing a parameter type or an accepted value set, or changing a default so a call without it behaves differently. | Widening a parameter type or an accepted value set. |
Changing or removing a field of a response or a --json shape, or changing its type. |
Adding a response field: clients ignore unknown keys (api.md). A vocabulary marked x-visionset-open may gain members. |
Changing the code a given refusal carries, or the exit code a command ends with. |
Adding an error code. |
| Refusing something that used to succeed. | Making something that used to be refused succeed. |
Branch on an error code, never on its sentence (error-codes.md). The sentence
is prose and may be reworded.
The repository-root VERSION is the single source of truth, in PEP 440 form, and the npm
packages carry the equivalent semver (see CONTRIBUTING.md).
- Before 1.0.0 (today's
0.xreleases), a breaking change may land in any release. It still has to be announced: a release-note fragment, a regenerated snapshot in the same change, and, where an alias is cheap, the deprecation window below. - From 1.0.0, a breaking change ships only in a major version, after a deprecation window in an earlier release. A minor adds, a patch fixes.
A renamed or retired name keeps working for one release after the release that renames it,
and says so: the CLI prints a deprecation line on stderr naming the current name. The
yolo format name, now ultralytics, is the worked example (cli.md, releases.md).
REST and MCP responses carry no deprecation text, because a response has no field for one; their
alias is documented in the page that owns the route (api.md) and in a deprecated
release-note fragment. The following release removes the alias, announced in a removed fragment.
A code, once published, names one refusal for good. The set grows; a code is not renamed, reused
for something else or silently dropped. A removal follows the deprecation window above.
error-codes.md is generated from the kernel's own tables, so a code cannot be added without the
reference showing it.
A workspace written by one release opens in every later one: migrations run forward, on open,
after a backup of the file. There is no downgrade: a workspace a newer build has
migrated is refused by an older one with WorkspaceFormatTooNew. See
persistence.md.
scripts/export_public_surface.py writes tests/fixtures/public_surface/{sdk,cli,mcp}.json
from the code itself: names, parameter kinds, annotations, defaults, choices and input schemas,
never prose. tests/surfaces/test_public_surface_snapshots.py regenerates each in process and
compares it, so a drifted surface fails with the command to run.
A change to a public surface therefore:
- Regenerate with
uv run python scripts/export_public_surface.pyand commit the diff. The diff is what a reviewer reads, and removed or changed lines are the breaking ones. - Add a release-note fragment in
changelog.d/underadded,changed,deprecatedorremoved. - If it is breaking, follow the version and deprecation rules on this page, and say in the fragment what a caller must do instead.
Regenerating to make a red test pass, without the other two, is the failure this policy exists
to prevent. REST is gated the same way by openapi.json; do not hand-edit it (api.md).
The surfaces deliberately do not offer the same operations. surfaces.md lists
them, and tests/surfaces pins them by name. A gap there is a stated limit, not a compatibility
promise: closing one is an addition.