diff --git a/AGENTS.md b/AGENTS.md index f7cf940..7a9c2ed 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -15,3 +15,40 @@ Before guessing a command or flag, use `appctl search "" --json`, then ` Keep the Python application on the standard library until a concrete requirement needs a package. Use `uv` for Python commands. Do not add database, authentication, deployment, or compatibility scaffolding without an explicit requirement. +## Application versioning + +Use [SemVer 2.0.0](https://semver.org/spec/v2.0.0.html) for application releases: + +- Use `X.Y.Z`, with nonnegative integers and no leading zeroes (clause 2). +- Never change the contents of a published version or move, rename, delete, or reuse its release tag (clause 3). +- Publish changes under a new version. +- Use only `X.Y.Z-alpha.N`, `X.Y.Z-beta.N`, or `X.Y.Z-rc.N` for prereleases (clause 9). +- Start `N` at 1 and increase it for each publication within the same target version and stage, without leading zeroes. +- Compare versions by SemVer precedence (clause 11), with numeric comparisons for the core and `N`. + +For the same core version, precedence is `alpha < beta < rc < final`. +For example, `1.2.3-rc.2 < 1.2.3-rc.10 < 1.2.3`. +Do not use `-fix.N`, `-hotfix.N`, build metadata, or `git describe` output as release versions. +Declare the public API, CLI, configuration, and data contracts before choosing a version increment. +Increment MAJOR for incompatible changes, MINOR for compatible features, and PATCH for compatible fixes. +Reset lower components to zero when incrementing MAJOR or MINOR. +During `0.y.z`, increment MINOR for incompatible changes. + +Use `pyproject.toml` `project.version` as the Python version source. +Derive the release tag from that value with this exact [PEP 440 mapping](https://packaging.python.org/en/latest/specifications/version-specifiers/#pre-releases): + +| Release Git tag | `project.version` | +| --- | --- | +| `vX.Y.Z` | `X.Y.Z` | +| `vX.Y.Z-alpha.N` | `X.Y.ZaN` | +| `vX.Y.Z-beta.N` | `X.Y.ZbN` | +| `vX.Y.Z-rc.N` | `X.Y.ZrcN` | + +Before release, make sure that the tag and manifest at the tagged commit represent the same logical version. +Keep `v` and artifact prefixes out of Python metadata. +Keep prereleases out of stable channels. +If the Python server and generated Go CLI release independently, use separate version sequences and a fixed tag prefix for each artifact. +For example, use `v1.2.3-rc.2` for Python version `1.2.3rc2` and `appctl-v0.4.0` for CLI version `0.4.0`. +Use the CLI tag as its Go version source, without a separate version file. +Apply this convention to future releases without changing published tags. + diff --git a/README.md b/README.md index a433aea..586622a 100644 --- a/README.md +++ b/README.md @@ -22,3 +22,40 @@ In another terminal: Generated output under `internal/generated/` and `skills/appctl/` is committed with API changes. The pipeline uses [Lathe](https://github.com/lathe-cli/lathe), pinned by version. +## Application versioning + +Application releases follow [SemVer 2.0.0](https://semver.org/spec/v2.0.0.html): + +- The core is `X.Y.Z`, with nonnegative integers and no leading zeroes (clause 2). +- Published versions are immutable (clause 3). Never change their contents or move, rename, delete, or reuse their release tags. +- Changes require a new version. +- Prereleases use only `X.Y.Z-alpha.N`, `X.Y.Z-beta.N`, or `X.Y.Z-rc.N` (clause 9). +- `N` starts at 1 and increases for each publication within the same target version and stage, without leading zeroes. +- SemVer precedence compares the core and `N` numerically (clause 11). + +For the same core version, precedence is `alpha < beta < rc < final`. +For example, `1.2.3-rc.2 < 1.2.3-rc.10 < 1.2.3`. +Release versions exclude `-fix.N`, `-hotfix.N`, build metadata, and `git describe` output. +The public contract includes the API, CLI, configuration, and data formats. +Increment MAJOR for incompatible changes, MINOR for compatible features, and PATCH for compatible fixes. +Reset lower components to zero when incrementing MAJOR or MINOR. +During `0.y.z`, increment MINOR for incompatible changes. + +The Python version source is `pyproject.toml` `project.version`. +Derive the release tag from that value with this exact [PEP 440 mapping](https://packaging.python.org/en/latest/specifications/version-specifiers/#pre-releases): + +| Release Git tag | `project.version` | Example | +| --- | --- | --- | +| `vX.Y.Z` | `X.Y.Z` | `v1.2.3` → `1.2.3` | +| `vX.Y.Z-alpha.N` | `X.Y.ZaN` | `v1.2.3-alpha.1` → `1.2.3a1` | +| `vX.Y.Z-beta.N` | `X.Y.ZbN` | `v1.2.3-beta.2` → `1.2.3b2` | +| `vX.Y.Z-rc.N` | `X.Y.ZrcN` | `v1.2.3-rc.2` → `1.2.3rc2` | + +Before release, make sure that the tag and manifest at the tagged commit represent the same logical version. +Python metadata excludes `v` and artifact prefixes. +Prereleases stay out of stable channels. +If the Python server and generated Go CLI release independently, each artifact uses a separate version sequence and a fixed tag prefix. +For example, `v1.2.3-rc.2` represents Python version `1.2.3rc2`, while `appctl-v0.4.0` represents CLI version `0.4.0`. +The CLI tag supplies its Go version, without a separate version file. +This convention applies to future releases and does not change published tags. +