Principle:A5c ai Babysitter Semantic Versioning
| Knowledge Sources | |
|---|---|
| Domains | Release_Pipeline, Version_Management |
| Last Updated | 2026-10-23 00:00 GMT |
Overview
A versioning scheme that encodes release channel, commit identity, and branch semantics into a single canonical version string.
Description
Semantic Versioning for the Babysitter monorepo extends standard semver with branch-aware channel resolution. Each branch maps to a dist-tag (latest, staging, develop). Prerelease branches produce commit-pinned versions (e.g. 6.0.4-develop.abc12345), while release branches produce stable versions (e.g. 6.0.4).
The single-authority principle ensures that version resolution happens in exactly one place — the resolveReleaseVersion function — and every downstream step (publication, tagging, promotion) uses that resolved version without re-deriving it.
Usage
Use this principle when designing release pipelines for monorepos where multiple branches publish to different channels with strict version-to-commit binding.
Theoretical Basis
The version resolution is a pure function of branch, root version, and commit SHA:
resolveReleaseVersion(branch, rootVersion, shortSha) -> {
releaseVersion: string, // canonical version
distTag: string, // npm dist-tag
releaseTag: string, // git tag name
}
Channel mapping:
- main → dist-tag latest, stable version MAJOR.MINOR.PATCH
- staging → dist-tag staging, stable version
- develop → dist-tag develop, prerelease MAJOR.MINOR.(PATCH+1)-develop.SHA
Idempotent tagging: The ensureReleaseTag function creates an annotated git tag babysitter/<branch>/v<version> that is never pushed or moved once created. The tag body carries provenance metadata.
Parse/format round-trip: parseReleaseTag(formatReleaseTag(x)) === x — the tag format is unambiguous and reversible.