50.1 Semantic Versioning
MAJOR.MINOR.PATCH
│ │ │
│ │ └── Bug fixes, no API changes
│ └──────── New features, backward compatible
└────────────── Breaking changes
50.2 API Versioning Approaches
| Strategy | Description | Pros | Cons |
|---|---|---|---|
| URL versioning | /api/v1/tools, /api/v2/tools |
Clear, explicit | URL pollution |
| Header versioning | Accept: application/vnd.api.v2+json |
Clean URLs | Less discoverable |
| Query parameter | /api/tools?version=2 |
Simple | Can be missed/omitted accidentally |
| Content negotiation | Multiple representations per resource | RESTful | More complex to implement |
50.3 Backward Compatibility Rules
- Never remove fields from response schemas — deprecate instead.
- New required parameters must ship with sensible defaults.
- Any real behavior change requires a new major version.
- Deprecation cycle: announce → support for a defined number of versions → remove.
- Gate new behavior behind feature flags rather than an immediate hard cutover.
50.4 Plugin Dependency Management
# plugin.yaml
name: advanced-analytics
version: 3.1.0
platform_version: ">=2.0.0, <4.0.0"
dependencies:
- name: data-connector
version: ">=1.5.0"
- name: visualization-engine
version: "^2.0.0"
incompatible_with:
- name: legacy-analytics
version: "*"
50.5 Multi-Version Support and Migration Path
Plugin Router:
Request(tool="search", version="1.x") → Plugin v1.3.2
Request(tool="search", version="2.x") → Plugin v2.1.0
Request(tool="search", version="latest") → Plugin v2.1.0
Provide migration guides per major version; offer auto-migration tooling for configuration changes; run side-by-side testing (shadow mode) comparing old vs. new version outputs before cutover; set an explicit sunset timeline (e.g., 6 months) from deprecation announcement to removal.
Section 50 — Interview Q&A
Q1: How do you handle versioning and backward compatibility in a plugin ecosystem with many independent plugin authors? Mandate semantic versioning and require every plugin manifest to declare its minimum supported platform version; the platform maintains a compatibility matrix mapping plugin versions to supported platform versions. Enforce the compatibility contract structurally: minor versions must never break existing tool call signatures, new parameters must default sensibly, response schemas only ever add fields. Support multiple major versions concurrently via a version-aware router so consumers aren’t forced onto a breaking change on the platform’s timeline, and run a defined deprecation cycle (announce → warn → remove) with a fixed sunset window, backed by shadow-mode side-by-side testing before any consumer is migrated.
Q2: A plugin’s new major version changes response schema in a way old consumers can’t parse. How do you roll it out without breaking anyone? Ship the new version alongside the old under distinct version identifiers (URL or header versioning), keep both live during a deprecation window, use shadow mode to run the new version against real traffic and compare its output against the old version without exposing it to consumers yet, migrate consumers incrementally with feature flags, and only retire the old version once telemetry confirms zero remaining traffic against it — never a hard cutover on a fixed calendar date alone.