18. Semantic Versioning Strategy
Date: 2025-10-13Status
AcceptedCategory
Development & ToolingContext
Software projects need a clear, predictable versioning strategy that:- Communicates breaking changes to users
- Manages expectations for upgrades
- Enables dependency management for downstream consumers
- Supports multiple release channels (stable, pre-release, nightly)
- Integrates with CI/CD for automated releases
- Users cannot predict upgrade safety (will it break?)
- Dependency managers struggle with version constraints
- Changelogs become ambiguous about impact
- Release automation becomes inconsistent
Decision
We will adopt Semantic Versioning 2.0.0 (SemVer) with the following conventions:Version Format
Version Incrementation Rules
MAJOR version (X.0.0)
Increment when making incompatible API changes:- Breaking changes to public APIs
- Removal of deprecated features
- Major architectural changes
- Non-backward-compatible configuration changes
- Changing authentication from JWT-only to OAuth2-only
- Removing
InMemoryUserProviderclass - Changing MCP protocol version (v1 → v2)
MINOR version (x.Y.0)
Increment when adding backward-compatible functionality:- New features
- New optional configuration parameters
- New API endpoints
- Performance improvements
- Internal refactorings (no API impact)
- Adding Keycloak authentication provider
- Adding Redis session backend
- New observability features (LangSmith, Prometheus metrics)
- New deployment targets (Helm, Kustomize)
PATCH version (x.y.Z)
Increment when making backward-compatible bug fixes:- Bug fixes
- Security patches
- Documentation updates
- Dependency updates (non-breaking)
- Test improvements
- Fixing session expiration bug
- Patching JWT verification vulnerability
- Updating Pydantic to fix deprecation warnings
- Correcting documentation typos
Pre-release Versions
Format:X.Y.Z-PRERELEASE.NUMBER
Supported pre-release identifiers:
- alpha: Early development, unstable API
- beta: Feature complete, testing phase
- rc: Release candidate, final testing
Build Metadata
Format:X.Y.Z+BUILD.INFO
Used for CI/CD builds:
Consequences
Positive Consequences
- Predictable Upgrades: Users know PATCH = safe, MINOR = safe, MAJOR = review required
- Clear Communication: Breaking changes are immediately visible
- Dependency Management: Package managers (pip, npm, cargo) work correctly
- Automated Releases: CI/CD can auto-increment versions based on commit messages
- Industry Standard: SemVer is widely adopted (npm, Rust, Go, Python)
Negative Consequences
- Strictness: Requires discipline to follow rules consistently
- Breaking Change Caution: Major versions are disruptive, may delay necessary changes
- Tooling Dependency: Requires automation to avoid human error
- Edge Cases: Some changes are ambiguous (is it MINOR or PATCH?)
Neutral Consequences
- Version 0.x.x: Pre-1.0 versions have relaxed rules (anything can break)
- API Surface: Must clearly define “public API” vs internal implementation
Implementation Details
Version Storage
__init__.py is authoritative, pyproject.toml syncs on release
Changelog Format
We use Keep a Changelog format:Git Tagging Convention
v{VERSION} (lowercase ‘v’ prefix)
Automated Version Bumping
Using GitHub Actions.github/workflows/release.yaml:
Dependency Version Constraints
Inpyproject.toml, we follow these constraints:
>=X.Y.Z: Accept MINOR and PATCH updates<MAJOR+1.0.0: Block next MAJOR version (breaking changes)
Breaking Change Migration
When making MAJOR version increments:- Deprecation Period: Mark features deprecated in MINOR release first
- Migration Guide: Provide upgrade documentation
- Backward Compatibility: Maintain for 1-2 MINOR releases
- Changelog: Clearly list all breaking changes
Alternatives Considered
1. Calendar Versioning (CalVer)
Description: Version format based on release date (e.g.,2025.10.1)
Pros:
- Easy to understand (date-based)
- No ambiguity about version age
- Used by Ubuntu, pip, Twisted
- No semantic meaning (cannot determine breaking changes)
- Poor dependency management (how to specify constraints?)
- No pre-release concept
2. Romantic Versioning
Description: Free-form versioning with creative names (e.g., “Starship”, “Phoenix”) Pros:- Marketing-friendly
- Memorable names
- Used by macOS (Catalina, Big Sur)
- No ordering (is “Phoenix” newer than “Starship”?)
- No automation (cannot auto-increment)
- Poor dependency management
3. Simple Integer Versioning
Description: Increment single integer on each release (e.g.,1, 2, 3)
Pros:
- Extremely simple
- No rules to remember
- Used by some mobile apps
- No semantic meaning
- Cannot express breaking changes
- Poor for libraries (users cannot specify safety constraints)
4. Major.Minor Only (No PATCH)
Description: Only use MAJOR and MINOR versions (e.g.,2.3, 2.4)
Pros:
- Simpler (fewer decisions)
- Used by some projects
- No distinction between features and bug fixes
- Forces MINOR bump for security patches (confusing)
- Less granular for dependency constraints
Integration Points
Deployment Automation
Kubernetes/Helm: Version tags trigger Docker image buildsDocumentation
README.md: Display current version badgeHealth Endpoint
Version History
| Version | Release Date | Type | Notable Changes |
|---|---|---|---|
| 2.2.0 | 2025-10-13 | MINOR | Session management, advanced role mapping, compliance framework |
| 2.1.0 | 2025-10-12 | MINOR | Keycloak integration, HIPAA compliance, SLA monitoring |
| 2.0.0 | 2025-10-11 | MAJOR | OpenFGA authorization, Infisical secrets, multi-deployment support |
| 1.5.0 | 2025-10-10 | MINOR | Feature flag system, Pydantic AI integration |
| 1.0.0 | 2025-10-01 | MAJOR | Initial production release |
Future Enhancements
- Automated version bumping from commit messages (Conventional Commits)
- Changelog generation from Git history
- Deprecation warnings in code (logged when deprecated features used)
- Version compatibility matrix for LLM providers, Python versions, deployment platforms
References
- Semantic Versioning Specification: https://semver.org/spec/v2.0.0.html
- Keep a Changelog: https://keepachangelog.com/en/1.0.0/
- Conventional Commits: https://www.conventionalcommits.org/
- Version in Code:
src/mcp_server_langgraph/__init__.py:8 - Changelog:
CHANGELOG.md - Release Workflow:
.github/workflows/release.yaml - Package Version:
pyproject.toml:7