Skip to content

Commit a297936

Browse files
InterGenJLUclaude
andcommitted
feat(pkm): bump to 0.2.0 for the audit change-set + first-party versioning policy
The pkm every-aspect audit (A01-A30 + A24, 29/29 verified) is new, backward- compatible behavior + fixes on top of 0.1.0 — a SemVer MINOR change, not a packaging revision. Bumped pkm 0.1.0 -> 0.2.0 (release reset to 1) across all three places a first-party version is declared: - pkm/__init__.py __version__ (pkm --version, User-Agent, min_pkm_version check) - packages/core/pkm/package.yml version (pkgrel source) - scripts/chroot-build-core-extra.sh run_package arg (pkgver / archive version) (min_pkm_version stays 0.1.0 — it's the compatibility floor, not the current version; the index format is unchanged. repo.py:80 stale version comment fixed.) Origin: operator caught that a 29-finding audit left pkm reading "0.1.0" because every prior change had bumped release only — we had never defined a versioning policy for packages we author. Now documented in docs/operations/08-adding- packages.md (new "Versioning policy" section): version = the software's own version (SemVer for first-party, mirror-upstream for third-party); release = packaging revision of the SAME code; the decision rule (source changed -> version, packaging changed -> release); and the gotcha that a first-party version lives in multiple files that must be bumped together (grep name+old-version before a bump). Policy applies going forward; other first-party packages (intergen/theme/helper- lib) reconcile to a real version the next time each changes. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
1 parent 1992e89 commit a297936

5 files changed

Lines changed: 51 additions & 6 deletions

File tree

docs/operations/08-adding-packages.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,51 @@ pending_acquisition: "<reason — e.g., Microsoft UEFI CA sponsorship still pend
103103

104104
The pre-squashfs audit skips packages with `pending_acquisition` set. Don't use this as a workaround for unwilling-to-author cases; it's specifically for blocked-on-external dependencies.
105105

106+
#### Versioning policy — `version` vs `release` (what declares a version change)
107+
108+
`version` and `release` mean different things, and conflating them was a real
109+
defect (we caught it 2026-06-16: pkm had absorbed a 29-finding audit yet still read
110+
`0.1.0` because every change had bumped `release` only). The policy:
111+
112+
- **`version`** = the *software's own* version.
113+
- **Third-party packages:** mirror the upstream release exactly (e.g. `git`
114+
`2.51.0`). It changes only when we package a new upstream version.
115+
- **First-party packages** (we author them — pkm, intergen, forge, the theme,
116+
helper-lib, etc.): **we are upstream, so `version` is ours to bump, by SemVer:**
117+
- **PATCH** (`0.2.0 → 0.2.1`) — bug fixes only, no behavior/interface change.
118+
- **MINOR** (`0.1.0 → 0.2.0`) — new, backward-compatible behavior or features.
119+
- **MAJOR** (`0.x → 1.0`, `1.x → 2.0`) — a stability milestone or a breaking change.
120+
- **`release`** = the *packaging* revision of the **same** `version`. Bump it **only**
121+
when the code is unchanged and the *packaging* changed: a `build.sh`/recipe tweak, a
122+
rebuild against a new dependency, a `.PKGINFO` fix, or a mirror republish of identical
123+
code. A `release` bump is **not** a substitute for a `version` bump when the software
124+
itself changed.
125+
126+
**Decision rule:** did the package's *own source* change in a way a user would
127+
notice (a fix, new behavior, new output)? → bump **`version`** (and reset `release`
128+
to `1`). Did only the *recipe/packaging* change? → bump **`release`**, keep `version`.
129+
130+
> **Both still matter mechanically.** A `version` *or* `release` change flips the
131+
> template hash so `--skip-built` rebuilds it, and the mirror index orders by
132+
> `(version, release)` so a same-version republish must still advance `release` to be
133+
> visible to `pkm upgrade` (see `first-publish-runbook.md`). The policy above governs
134+
> *which* field is semantically correct; the mechanical "must change to rebuild/ship"
135+
> rule is unchanged.
136+
137+
**⚠️ A first-party `version` is declared in MORE THAN ONE place — bump them together.**
138+
The build driver passes the version as a literal arg, separate from `package.yml`, and
139+
some packages also carry their own `__version__`. For **pkm** the version lives in
140+
THREE files that must all match, or the built archive/`pkm --version`/the recipe disagree:
141+
142+
1. `packages/core/pkm/package.yml` — `version:` (and `release:`).
143+
2. `scripts/chroot-build-core-extra.sh` — the `run_package "pkm" "pkm" "<version>"` arg
144+
(the driver supplies the build/archive `pkgver`; `package.yml` supplies `pkgrel`).
145+
3. `pkm/__init__.py` — `__version__` (what `pkm --version`, the User-Agent, and the
146+
index `min_pkm_version` check report).
147+
148+
When bumping any first-party package, grep its name + the old version across
149+
`packages/`, `scripts/`, and the package's own source to catch every literal.
150+
106151
### 2. Author build.sh
107152

108153
For `build_style: custom`, `build.sh` defines `configure`, `build`, and `do_install` functions. The orchestrator sources the script inside the chroot's per-package work directory and calls each function in sequence.

packages/core/pkm/package.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: pkm
2-
version: "0.1.0"
3-
release: 6
2+
version: "0.2.0"
3+
release: 1
44
description: InterGenOS package manager — install, remove, query, verify
55
license: GPL-3.0-or-later
66
homepage: https://github.com/InterGenJLU/intergenos

pkm/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@
1919
pkm history Show operation history
2020
"""
2121

22-
__version__ = "0.1.0"
22+
__version__ = "0.2.0"

pkm/repo.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@
7777
_TRACE_AVAILABLE = False
7878

7979
# L-020: _parse_index references __version__ for the min_pkm_version
80-
# envelope check. pkm/__init__.py:20 defines __version__ = "0.1.0".
81-
# Importing via the package surface keeps this single-sourced.
80+
# envelope check. pkm/__init__.py defines __version__ (the canonical pkm
81+
# software version). Importing via the package surface keeps this single-sourced.
8282
from . import __version__
8383

8484
from .database import PackageDB

scripts/chroot-build-core-extra.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,7 @@ run_package "apparmor" "apparmor" "3.1.7" \
606606
"apparmor-v3.1.7.tar.gz" \
607607
"AppArmor MAC framework — libapparmor, parser, profiles"
608608

609-
run_package "pkm" "pkm" "0.1.0" \
609+
run_package "pkm" "pkm" "0.2.0" \
610610
"" \
611611
"InterGenOS package manager — install, remove, query, verify"
612612

0 commit comments

Comments
 (0)