Releasing pixel
main is the only long-lived branch: pull requests merge into it by
default, and a release is a tag on it. The one exception is a patch that
cannot wait for main to be releasable: the fix still merges into main,
then a maintenance-release pull request targets a release/x.y branch cut
from the line's last tag (see "Patch release while main is not releasable").
The tag is the release. Pushing vX.Y.Z runs .github/workflows/release.yml,
and its verify job gates publication; ordinary CI does not run on tags.
The dependency graph is verify → fuzz → assets → release, then
smoke and virustotal independently:
| Job | Does | A failure means |
| --- | --- | --- |
| verify | check-release $GITHUB_REF (CLI version, every workspace member in Cargo.lock, released heading and empty Unreleased), cargo deny check, then locked workspace tests | nothing built or published |
| fuzz | fuzz.yml called with 120 s per target: every cargo-fuzz target on nightly, cargo deny on fuzz/ first | a crash or a target that ran nothing: nothing built; the reproducer is the run's fuzz-artifacts-* artifact |
| assets | calls release-build.yml: three target builds (musl x86_64/aarch64 with model2vec only, native Apple arm64), checksums and feature-specific CycloneDX SBOMs; attest makes formulas and Linux bottles, signs archives/bottles/install.sh/SBOMs, stages the provenance bundle | nothing published |
| release | publishes the staged assets with the tag's changelog section, then updates LivioGama/homebrew-tap using HOMEBREW_TAP_TOKEN | publication may already be immutable; classify in Recovery |
| smoke (×3, fail-fast: false) | verifies provenance, runs the downloaded asset and one-liner in an empty HOME; checks macOS tap install/test and Linux bottle pouring when available; version and commit must match the tag | already published; distinguish code failure from infrastructure |
| virustotal | submits the three archives and appends report links to the notes when VT_API_KEY exists | already published; missing key is a notice, not a scan pass |
Three facts shape everything below:
- The macOS binary is first run by
smoke.cross-build.ymlbuilds
all three release targets on every push to main with release-build.yml's exact
commands, so a green main proves each lane compiles and links; nothing
before smoke runs the darwin binary. The same job saves the per-target
cache (release-<target>) that the tag's assets / build job restores, and the
verify job restores ci.yml's linux-debug one: a tag run reads the
default branch's caches, never another tag's.
- A published release is immutable. GitHub's release immutability is on:
once release has published, its assets cannot be added, replaced or
deleted, and its tag cannot move or be deleted while the release exists (a
deleted release's tag name cannot be reused). The release tags: immutable
ruleset also refuses deleting or moving any v* tag, with a bypass for the
Admin role only. An asset fix ships as the next patch. **Title and notes
remain editable**: an editorial correction goes through a changelog PR,
then gh release edit --notes-file <complete-corrected-body>, preserving
VirusTotal links and noting the correction after publication. Re-read and
diff the live body immediately before editing so concurrent additions are
preserved. It needs no new tag; never rebuild an asset for a notes fix.
- Users install releases, not
main.install.shis a release asset
(releases/latest/download/install.sh), so main may be ahead of the latest
release, broken script included, without breaking an install.
Authority
Being asked to fix, merge or ship a change is not an authorization to
release. A release starts on the user's explicit ask ("release", "/release",
"cut 0.5.0"), and that ask is the go for the whole happy path: pick the
version, prepare, open the PR, merge it once green, tag its merge commit once
that commit's push CI is green, watch the run and verify the publication.
Run it to the end without pausing for confirmation; say each outward command
(merge, tag push) in a progress line just before running it, and report once,
with the step 5 summary. An ask that limits the scope ("prepare 0.5.0",
"don't tag yet") stops there.
Stop and ask only when something is off — the happy path's evidence is
missing or contradicts itself:
- a precondition fails: dirty tree, red CI/Cross-build on
origin/main's
head, the last tag not on main, nothing to release, less disk than the
gates need after deleting target/debug/incremental (itself routine);
- the version is not clear-cut: a fragment that could read either as patch
or as minor, anything that would make it 1.0.0 or a major, or a user
who named a version the convention contradicts;
prepare.shorcheck-releaserefuses, the diff holds anything beyond
the list in step 3, or a user-visible pull request has no entry you can
write from its body alone;
- a gate is red and the failure is not provably local (reproduce it with the
suspected variable or config unset);
- a PR check is red or cancelled, or a review left an actionable comment;
- the merge commit is not on
main, is not the prepare PR's, or its push
CI is red;
- any failed Release run: classify it (Recovery), and ask before anything
beyond one gh run rerun --failed for an infra failure.
Whatever the path, these always wait for their own go, even inside a release
the user asked for: deleting or moving a tag (an Admin bypass of the tag
ruleset), force-pushing, retagging, editing the tap by hand, and deleting a
release or its assets.
Identify the PR author, eligible reviewer and merge operator before
preparation. GitHub review requirements and the client's execution permissions
remain in force. If a client refuses an unreviewed/admin merge, record the
block, prepare the exact SHA, checks and merge command for the maintainer,
and resume when the merge is observed; do not retry the same bypass. Prefer
an eligible maintainer's review to weakening protection.
For an advisory, read Private advisory release
before promising patched_versions or importing the fix. It owns private
validation, exceptional merge handling and the disclosure order.
Commands use the current names (new-branch, repo-state, commit). A
pixel that rejects them predates 0.2.5: update it before releasing.
The release record
A release spans a workflow run, a PR and possibly a context reset.
Keep its state in release-x.y.z.md in the session scratchpad, written at
the start and updated after every step, so a resumed session reads it instead
of reconstructing the release from gh output:
# pixel x.y.z
- version / reason: x.y.z, patch|minor because …
- candidate: target branch / base SHA / validated prepare head SHA / merge SHA
- coverage: last shipped tag / candidate SHA / PRs and direct commits accounted for
- validation: SHA / exact command / log or run URL / exit status
- prepare PR: #NNN (merged <merge sha> | open); author / reviewer / merge operator
- equivalence: merge parent == base; merge tree == prepare tree
- tag: vx.y.z → <sha> (pushed | not yet)
- release run: <run-id> <url>; verify ✓/✗, assets ✓/✗, release ✓/✗, smoke ✓/✗, virustotal ✓/notice/✗
- publication: assets ✓/✗, install.sh ✓/✗, body ✓/✗, tap ✓/✗, binary ✓/✗
- advisory: GHSA / validated private and imported patch SHAs / patched version / published_at
- exceptions: check / reason / maintainer decision / protection restoration evidence
- follow-ups: PR / open|merged|closed / owner / closure condition
- failure: <job, step, class (code|tooling|infra), evidence>
- next action: <one command, and whether it waits for the user (Authority)>
On resume, trust the record only as a map: re-read the live state it points
at (gh pr view, gh run view, git ls-remote origin refs/tags/vx.y.z)
before acting, and replace stale fields rather than appending contradictory
status blocks. Keep exactly one current next action.
1. Preconditions
unset GIT_DIR GIT_WORK_TREE GIT_COMMON_DIR GIT_INDEX_FILE GIT_OBJECT_DIRECTORY \
GIT_ALTERNATE_OBJECT_DIRECTORIES GIT_PREFIX
git fetch origin --tags
pixel repo-state # clean tree
LAST=$(git tag --list 'v[0-9]*' --sort=-v:refname | head -n 1)
gh run list --branch main --workflow ci.yml --status completed -L 1 # success
gh run list --branch main --workflow cross-build.yml --status completed -L 1 # success
git merge-base --is-ancestor "$LAST" origin/main && echo "$LAST is on main"
git log --oneline "$LAST"..origin/main | head # something to release
gh secret list | grep HOMEBREW_TAP_TOKEN
- Pick the last tag by version sort, not
git describe: v0.2.4's commit is
not an ancestor of main (it was replayed before the histories were
joined), so describe can answer an older tag.
- Read the last completed run of each workflow, not
main's head: a run
still in progress there (a website merge, say) does not hold the prepare,
since step 4 waits for the prepare commit's own push run before tagging.
- A red
Cross-buildonmainmeans a release lane fails with--locked:
the assets job will fail the same way. A red `Dependency policy
(cargo-deny)` blocks every PR, the prepare PR included: a fresh RustSec
advisory is a chore(deps) PR (cargo update -p <crate>) merged before
step 3.
- The local gates need room: a workspace build plus
target/debug/incremental
can fill the disk mid-gates (No space left on device from
cargo nextest). Check df -h . first; target/debug,
target/dev-release and target/release are rebuildable, and
CARGO_INCREMENTAL=0 keeps a one-off gate run from growing the cache.
- Without
HOMEBREW_TAP_TOKENthe tap is not updated (a warning, not a
failure).
mainholds work that must not ship yet? Stop and read "Patch release while
main is not releasable" below.
2. Pick the version
Read .github/changelog.d/ in the repository root and the last tag. Pre-1.0
convention in this repo:
- patch (
0.2.4→0.2.5): fixes, additions, renames that keep the old
spelling as an alias. 0.2.x patches have shipped Added sections.
- minor (
0.2.x→0.3.0): something a user of the previous minor must
act on — a removed command or flag with no alias, a changed JSON output or
protocol field, a changed on-disk format under .pixel/, an install layout
that pixel setup does not migrate.
Pick the version by that convention, state it with its one-line reason in a
progress line, and go on; stop only on the cases Authority lists. Check that
what a Removed or Changed fragment breaks actually shipped in the last
tag (git cat-file -e v<last>:<path>, or git grep the command at the tag):
0.5.0 carried a Removed entry for pixel classify backends that no release
had ever held, so it was no reason for a minor and no entry at all. Start the
record.
Then write .github/changelog.d/_highlights.md on the release branch, unless the
release is a handful of unrelated fixes: a lead paragraph saying what this
release is about, then a ### Highlights list of two or three bullets. It
becomes the top of the released section and of the GitHub release body, which
is what keeps that narrative out of the individual entries (### and below
only, 2000 bytes; prepare.sh refuses more).
3. Prepare the release commit
Set TARGET=main for a regular release or TARGET=release/x.y for a
maintenance release, and prepare from origin/$TARGET on release-x.y.z.
Record the full BASE=$(git rev-parse "origin/$TARGET") before preparation and
PREPARE_HEAD=$(git rev-parse HEAD) after its final validated commit.
A rebase invalidates that record and its changelog coverage, even if Git
reports no conflict: review every newly included PR and direct commit,
fold new fragments into the released section, then validate and record anew.
unset GIT_DIR GIT_WORK_TREE GIT_COMMON_DIR GIT_INDEX_FILE GIT_OBJECT_DIRECTORY \
GIT_ALTERNATE_OBJECT_DIRECTORIES GIT_PREFIX
git fetch origin "refs/heads/$TARGET:refs/remotes/origin/$TARGET"
BASE=$(git rev-parse "origin/$TARGET")
Prepare:
pixel new-branch release-x.y.z --from "origin/$TARGET" --request-id "release-x.y.z-branch"
.agents/skills/release/prepare.sh x.y.z # --date YYYY-MM-DD to override today
prepare.sh refuses before writing when the tag or the ## [x.y.z] heading
already exists, .github/changelog.d/ holds no fragment, or ## [Unreleased] still
carries a bullet of its own. It also refuses before writing when
scripts/ci/check-claims.py --version x.y.z fails, naming each claim in
docs/bench/claims.toml the new version would leave more than one minor
behind with no tracking issue: the prepare PR may not edit the registry and
skips the CI job that checks it, so a stale claim would only turn the merge
commit red (0.10.0, #1359). Re-measure it (`scripts/bench/refresh-claim.sh
<id>) or add tracking = "#<issue>"` to its entry through a pull request into
$TARGET, merge that, then prepare from the new base. Otherwise it:
- sets
[package] versiontox.y.zin every workspace member
(lockstep, as 0.2.4 did);
- folds the fragments into a new
## [x.y.z] - DATEunder a kept, now empty
## [Unreleased], led by _highlights.md when there is one and then
grouped by section in the order the headings have always used, and deletes
them all; an entry that names no pull request (no /pull/<n> in the text,
no number opening the slug) gets ([#<n>](…)) appended from the
first-parent commit that added it ((#<n>) or Merge pull request #<n>),
and one whose commit names none refuses the cut before any write: name the
pull request in that fragment's text, then re-run. A security entry may
instead link this repository's GHSA (including a draft); an advisory import
has no public PR number;
- runs
cargo update --workspacesoCargo.lockfollows; - lists the pull requests merged into
mainsince the last tag that the
candidate contains, then its commits in no merged pull request. The
inventory is collected before any writes, using GitHub's canonical repo
name (an old transferred remote may search empty). A failed, capped or
contradictory lookup refuses the cut; repair it before rerunning;
- runs
cargo run -q -p pixel-cli -- check-release vx.y.z --repo ., the
verify job's command, from the tree. It uses the tree's CLI on purpose: an
installed 0.2.4 binary only knows the old release-check name.
It must end with release-check: all checks passed. Then:
- Changelog completeness. Every
feat,fixandperfpull request
merged since the last tag, and any other with a user-visible effect, needs an
entry (CONTRIBUTING.md exempts pure refactors and CI/deps chores). The run
lists the fragments it released above the pull requests, and a fragment named
after its pull request matches one line to one, so an entry nobody wrote
shows as a pull request with no fragment. Write the missing one straight into
the new ## [x.y.z] section, in the same commit: re-running prepare.sh
would refuse the heading it has already written. The commits listed as
belonging to no pull request are the ones nobody filed an entry for: each
user-visible one needs an entry too. Check whether a feature already shipped
with git cat-file -e v<last>:<path> before calling it new.
- Release body. Read the new
## [x.y.z]section as a stranger: it is
published verbatim. Fix wording or section order now, not after the tag.
- Threat model. Read the same section against