## What this PR does
Follow-up to #4997 (merged as d32092ac9), which puts the SBOM into each
release image's index. Rebased onto `main` at that merge, one commit
`57346c16d`; bats on the touched files 36/36, shellcheck clean. This is
the follow-up agreed there, and the image half of #4759: the release
images get signed, and their SBOMs become a release asset, along the
lines of #4861.
Refs #4759, #2937, #3278
`hack/sign-release-images.sh` runs in `tags.yaml::prepare-release` after
the stitch, before `make upload_assets`. It enumerates every first-party
`<repo>@<digest>` the repinned tree holds the way
`hack/stitch-multiarch.sh` does (the shared enumeration, refs under the
registry, `cozystack-packages` left out), skips each one that already
verifies, signs the rest with the job's OIDC identity, one `cosign sign
--yes` call per ref so that cosign's per-call `--timeout` (3 minutes by
default) does not have to cover every ref's key, Fulcio certificate,
Rekor entry and registry round trips, and verifies every one against the
identity regexp of `hack/sign-release-assets.sh` before returning; the
two scripts' regexps are held equal by bats. A signature that does not
verify fails the job with nothing uploaded. A signature over an index
covers every manifest the index lists by digest, the attestation
manifest with the SBOM included, so the SBOM has no signature of its
own. cosign v3.1.3 writes the signature as a Sigstore bundle, an OCI
referrer of the digest in the same repository (`--new-bundle-format`
defaults to true). GHCR answers `/v2/<name>/referrers/<digest>` with
404, so go-containerregistry lists the referrer under the fallback tag
`sha256-<hex>`, without `.sig`, which `cosign verify` reads the same
way; the `.sig` tag exists only with `--new-bundle-format=false`.
`hack/promote-retag.sh` copies a digest to its stable tag inside that
repository, so the stable release's images carry the rc's signatures.
`promote-rc.yaml::promote` runs the rc tree's script with
`--verify-only` before it stages the stable release, and prints a notice
instead for an rc cut from a tree without the script. Under
`--verify-only` cosign's stderr is kept, so a registry 429 or a Rekor
fetch error is not reported as a missing signature;
`docs/release/ci-failures.md` has a row for that step.
`hack/collect-image-sboms.sh` reads `docker buildx imagetools inspect
<ref> --format '{{ json .SBOM }}'` for the same refs, takes the
platforms the index serves from `--raw` (entries that are not
attestation manifests, keyed as buildx keys them), and writes
`<image>.<os>-<arch>.spdx.json` per platform (or `<image>.spdx.json` for
an image with one platform, whose SBOM buildx prints unkeyed) into
`cozystack-images-sbom.tar.gz`, with fixed order, times and owners so a
re-run gives the same bytes. An image without a non-null SBOM for every
platform its index serves fails the run, naming it and the platforms:
after #4997 every pinned first-party image is built with `SBOM=1`, so a
missing one is a lost attestation, and I preferred no allowlist over one
with no entry (the Talos installer image, which has no SBOM, is not
pinned in the tree).
`hack/upload-assets.sh` adds `cozystack-images.txt` (the refs, one per
line, from `--list`) and the archive to the list it hands to
`hack/sign-release-assets.sh`, so the existing checksums signature
covers both and nothing new signs anything. `promote-rc.yaml` downloads
every rc asset, so both travel to the stable release as the other assets
do. `docs/release/signatures-and-sbom.md` describes the two files and
the image signatures, drops #4997's "The attestations are not signed",
and gains a "How to verify a release" block that checks the checksums,
every asset, every image signature and unpacks the SBOMs in one go, the
image loop in a subshell that exits on the first image that fails;
`docs/agents/image-refs.md` lists the two new consumers of the
enumeration; the SBOM row and the "Signed / reproducible builds" gap of
`docs/security/self-assessment.md` now say what a release publishes and
signs.
### How it was checked
- Bats 1.14.0: `hack/sign-release-images.bats` (13 tests: the refs it
signs and skips, one `cosign sign` call per ref, the identity and issuer
it verifies, equality with the assets regexp and with
`docs/release/signatures-and-sbom.md`, the fenced verify block of
`docs/release/signatures-and-sbom.md` run with cosign stubbed, which
fails on a rejected first image, on a list read from stdin, on a
checksums file that lacks either image asset and on one that lists one
asset twice in place of the other, a failed verify, `--verify-only`,
`--list`, an empty tree, and the shape of both workflow steps by `yq`)
and `hack/collect-image-sboms.bats` (5: file names and content per
platform, member order, owners and times read from the archive headers,
the same bytes twice, an image without an SBOM, an index with an SBOM on
one platform only, a platform with `"SPDX": null`, an empty tree;
dropping `--sort=name`, the owner flags or `--mtime` fails it on XFS and
ZFS), both with cosign and docker stubbed; `hack/upload-assets.bats`
updated for the two assets; `hack/sign-release-assets.bats` and
`hack/ci-tool-installs-contract.bats` unchanged and green. The
repository's bats contract suites (strict setup, no negated asserts, no
exit traps, runner coverage) pass with the two new files. `make
bats-unit-tests`: see the last comment of this PR for the count.
- `shellcheck -x` on both scripts; `zizmor` on `tags.yaml` and
`promote-rc.yaml` reports nothing.
- Checked against the registry, not the code: GHCR has no referrers API
for a cozystack image (404), so the referrer lands in the `sha256-<hex>`
fallback tag; `hack/promote-retag.sh` copies within the repository; `gh
release download` in promote takes every rc asset.
- Not checked: a real keyless run (the first alpha after the merge, like
#4861 and #4997), a stitched index against a live registry (the `.SBOM`
shape follows buildx v0.31.0 `util/imagetools/printers.go`: keyed by
platform for more than one platform, bare otherwise; @lexfrei's ttl.sh
run on #4997 saw the map), and the time the signing adds to
`prepare-release`.
### Decisions for the release owners
- The packages artifact (`cozystack-packages`) and the installer chart
are not signed: promotion republishes both under a new digest, so
signing them means a signing step in `promote` too. Follow-up if wanted.
- Every pre-release signs about forty indexes, each with its own Fulcio
certificate and Rekor entry. #4861 already writes one per release, so
the policy question is settled; the volume is new.
- An image without an SBOM fails the release rather than being listed as
missing. If an exception appears, an allowlist with a reason, as
`hack/multiarch-allowlist`, is the shape to add.
- The identity regexp accepts `promote-rc.yaml` on `main` as well as
`tags.yaml` on a `v*` tag, though only `tags.yaml` signs images today,
so that `docs/release/signatures-and-sbom.md` has one expression for
every release signature. A reader who wants the tighter check drops the
alternative.
### Screenshots
<!-- REQUIRED for UI changes: attach screenshots or screen recordings
demonstrating
the visual impact of your changes. PRs with UI changes without
screenshots will not be merged. -->
### Downstream repositories
- [x] No downstream repository is affected by this change
- [ ] [cozystack/website](https://github.com/cozystack/website) -
follow-up:
- [ ]
[cozystack/terraform-provider-cozystack](https://github.com/cozystack/terraform-provider-cozystack)
- follow-up:
- [ ]
[cozystack/ansible-cozystack](https://github.com/cozystack/ansible-cozystack)
- follow-up:
- [ ] [cozystack/ccp](https://github.com/cozystack/ccp) - follow-up:
- [ ] [cozystack/talm](https://github.com/cozystack/talm) - follow-up:
- [ ] [cozystack/cozyhr](https://github.com/cozystack/cozyhr) -
follow-up:
- [ ] [cozystack/cozy-proxy](https://github.com/cozystack/cozy-proxy) -
follow-up:
- [ ]
[cozystack/cozystack-telemetry-server](https://github.com/cozystack/cozystack-telemetry-server)
- follow-up:
- [ ]
[cozystack/external-apps-example](https://github.com/cozystack/external-apps-example)
- follow-up:
- [ ] [cozystack/examples](https://github.com/cozystack/examples) -
follow-up:
- [ ] [cozystack/community](https://github.com/cozystack/community) -
follow-up:
I walked the trigger map against the diff. `hack/upload-assets.sh` adds
two assets and renames none, so the install pages that hardcode asset
filenames on the website are untouched. `tags.yaml` gains a step between
the stitch and the upload and `promote-rc.yaml` a check before the
upload; who cuts and who promotes a release, which the ccp guidance
rests on, is the same. `hack/package.mk` and `hack/common-envs.mk` are
not touched.
### Release note
```release-note
feat(release): every first-party container image of a release is signed with cosign, keylessly, by the `tags.yaml` run that prepared it, and a release carries `cozystack-images.txt` (the pinned images by digest) and `cozystack-images-sbom.tar.gz` (the SPDX SBOM of each image, per platform) as assets covered by the signed checksums. `docs/release/signatures-and-sbom.md` shows how to verify a release end to end. Releases cut from this change on have them.
```
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## Summary by CodeRabbit
* **New Features**
* Releases now include a list of pinned first-party image digests and an
archive of image software bills of materials (SBOMs), with coverage for
each image platform.
* Release image digests are signed, and release checksums cover the
image list and SBOM archive.
* RC promotion checks image signatures before creating a stable release;
unsigned images can block promotion.
* **Documentation**
* Added guidance on release image signatures, SBOM assets, verification,
and related release failures.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
20 KiB
Image references: where they live and what their tags mean
This is the contract for every container image reference cozystack vendors. Read it before changing how an image is built, stamped, promoted, mirrored, or referenced from a chart, and before writing any tool that reads image references out of the tree. The rules below are not descriptive of what the scripts happen to do today — they are the invariants those scripts are required to hold, and each has been broken at least once in a way that shipped.
The two things a reference carries
Every first-party reference is a tag plus a digest: ghcr.io/cozystack/cozystack/cozystack-api:v1.5.0@sha256:ef50b1….
The digest decides what actually runs. It is content-addressed and immutable, so a reference carrying one is reproducible no matter what happens to the tag afterwards. This is why a tag that reads latest@sha256:… is not a floating reference — the digest wins, and tag movement cannot change the bytes pulled.
The tag decides what humans and tooling believe is running, and it is not decoration. A release whose images are tagged v1.6.0-rc.4 is indistinguishable, to anyone auditing it, from a release candidate. Tooling that constructs <repo>:<version> by convention gets a 404 against a tag that was never created. So an inaccurate tag is a real defect even though the digest still resolves — it just fails later, and quietly, which is worse.
Both must be correct. Neither is allowed to be approximate.
Three classes of tag
Which tag an image carries depends on what versions it. Confusing these classes is what makes a correct promotion look broken and a broken one look correct.
| Class | Tag shape | Example | Moves at release? |
|---|---|---|---|
| Version-line | the cozystack version | cozystack-api:v1.5.0 |
Yes — every release |
| Component-versioned | upstream version + cozystack suffix | cluster-api-control-plane-provider-kamaji:v0.19.0-cozystack.0 |
No |
| Third-party pass-through | whatever upstream publishes | docker.io/library/busybox:1.37.0 |
No |
Version-line images are first-party builds whose version is the cozystack version; they are the ones a release rewrites and retags. Component-versioned images are first-party rebuilds of an upstream component, versioned by that component so the provenance stays legible — kamaji keeping v0.19.0-cozystack.0 across a cozystack release is correct, not a missed rewrite. Only a release build pushes that tag (PUBLISH_VERSIONED=1); every other build pushes the image under its build-unique IMAGE_TAG, so in a CI registry the component tag in the ref may not exist and the digest is what resolves. Third-party images are vendored by digest from registries cozystack cannot push to; they are never retagged and never mirrored.
Only class 1 is touched by a promotion. A tool that "fixes" a class 2 or 3 tag to the cozystack version is introducing a bug, not removing one.
Three storage shapes
A reference can be stored in three different kinds of file, and all three are first-class. Every consumer must read all three. The single most repeated defect in this area is a tool that knows about one shape and silently ignores another; it does not fail, it just quietly skips images, and the gap surfaces a release later.
packages/<group>/<pkg>/values.yaml— the common case, in the YAML sub-shapes listed here: single string, split map withdigest, split map with the digest insidetag, chart-globalglobal.registry.address+global.images[], the OCI-artifactplatformSourceUrl/platformSourceRefpair, and upstream ingress-nginx's split map with the repository inimageand a separatedigest. The sub-shapes exist because vendored upstream charts choose their own values layout; the list is empirical, not closed.packages/<group>/<pkg>/images/<name>.tag— a plain file holding one reference, read by templates via.Files.Getrather than through values. Easy to forget precisely because it never appears in a values file; otherwise an ordinary first-party reference that carries the cozystack version like any other.- A declared file that embeds a reference in surrounding text — used when a package vendors an upstream manifest and its
image:targetseds the built reference straight into it.packages/system/multus/templates/multus-daemonset-thick.ymlis the only vendored instance today. It is vendored and patched: it carries Helm conditionals, soyqcannot parse it at all and the YAML pass yields nothing for it. What keeps its reference visible is the textual scrapecollect_image_refsruns over every declared extra — for this entry that leg is not a backstop but the only one that works.packages/library/cozy-lib/templates/_etcd.tplis declared the same way: the etcd maintenance jobs of every chart that includes it pull a digest-pinned third-party image from that template.
hack/lib/image-refs.sh is the single enumeration of all three, and the only place that knowledge is allowed to live. image_ref_files <root> yields the files; collect_image_refs <root> yields the references inside them. Shape 3 is an explicit list (IMAGE_REF_EXTRA_FILES) rather than a templates/** glob, because such a glob would sweep in vendored upstream chart templates and Helm-templated image: lines where a blind rewrite corrupts a value that make update regenerates. The declared entry is safe from that despite now containing Helm conditionals: its image: lines are plain, and declaring a file is the deliberate statement that its references are stamped rather than templated.
Adding a reference in a new location
If a package stamps a reference somewhere the two globs do not cover, add that file to IMAGE_REF_EXTRA_FILES in hack/lib/image-refs.sh — and nowhere else. Every consumer picks it up at once. Do not teach an individual script about a new path; that is how the shapes diverged in the first place.
Invariants
- Every first-party reference is tag+digest. A bare tag with no digest is not reproducible and must not be committed. The one exception is the first commit of a new image: it has no digest until it is built, so it lands as a bare
<repo>:<tag>that the producingmake imagereplaces. PR CI and release preparation both stamp it before anything pulls it, but a tree applied without a build pulls a tag that does not exist. In PR CI the stamp comes fromhack/overlay-main-images.shwhen the PR does not rebuild the package, and it takes a bare first-party ref even from a file whose configuration drifted from the artifact, because a tag that was never pushed cannot install. The cost is that any other digest-less first-party ref in such a file also runs main's image with the PR's older config; third-party refs in it keep their committed pair. - Exactly one producer stamps each reference. A reference no
Makefilewrites will never be refreshed by anything, including release preparation. - A package that stamps a reference is in the root
Makefilebuild:list.build-matrix.sh, the main build and release preparation all iterate that one list, so a package outside it is never rebuilt by any path and its pin freezes permanently.hack/build-matrix_test.batscomputes the set of packages whose Makefile runsdocker buildx buildand fails on any the list misses. - Every consumer of references reads all three storage shapes, via
hack/lib/image-refs.sh. - Scan wider than you rewrite. A rewrite is deliberately narrow to avoid corrupting vendored defaults, so the check that follows it must not share that blind spot.
hack/promote-rewrite-tags.shrewrites the enumerated files, then greps the whole tree and fails if any reference to the release candidate survives. - A pin can name an index that carries attestation manifests. An image built with
SBOM=1is pushed as an index of the image and its attestation manifest, and the ref pins that index, not a single-platform manifest. A consumer that reads a pin's manifest takes the entries withplatform.os == "linux"as its platforms: an entry whose platform isunknown/unknownis an attestation, not a platform.hack/stitch-multiarch.shandhack/verify-multiarch.shread pins this way, andskopeo copy --multi-arch all, which the retag and the mirror run, copies the attestation with the image.
What each consumer does
| Tool | Reads | Job |
|---|---|---|
hack/promote-rewrite-tags.sh |
all three shapes | rewrite X.Y.Z-rc.N → X.Y.Z in the tree, then fail if any survives |
hack/promote-packages-artifact.sh |
the rewritten packages tree | publish a reproducible temporary stable-candidate artifact and pin its digest in the installer |
hack/verify-promoted-packages.sh |
pinned candidate + merged tree + embedded rc artifact ref | before any stable tag is created, prove the candidate contains the merged tree and the rc's container digests |
hack/promote-retag.sh |
all three shapes | copy each digest to its stable tag in the registry |
hack/nightly-mirror.sh |
all three shapes | copy each digest to the public registry, then rewrite hosts in the same file set |
hack/overlay-main-images.sh |
values.yaml + *.tag |
overlay current-main references onto packages a PR did not rebuild |
hack/stitch-multiarch.sh |
all three shapes | join each amd64 image and its -arm64 twin into one index, each side an image or, built with SBOM=1, an index of the image and its attestation that the result keeps, repin the tree on it, then fail if any old digest survives |
hack/retention-packages.sh |
all three shapes, in the published nightly tree | name the GHCR packages the retention workflow prunes (those linked to another repository are then skipped); a ref it cannot see is a package whose nightlies are never pruned |
hack/verify-multiarch.sh |
all three shapes, first- and third-party | fail a release unless every pinned image is an index with linux/amd64 and linux/arm64, attestation entries not counted, bar the repositories in hack/multiarch-allowlist |
| PR build job, image smoke step | all three shapes | list the references a package build stamped, by diffing the tree before and after it, for hack/image-smoke.bats to run |
hack/sign-release-images.sh |
all three shapes, first-party | sign every pinned digest keylessly after the stitch, skipping one that already verifies, or with --verify-only fail a promotion whose rc images are unsigned; --list writes the cozystack-images.txt release asset |
hack/collect-image-sboms.sh |
all three shapes, first-party | read the SBOM attestation of every pinned index into the cozystack-images-sbom.tar.gz release asset, one document per platform; an image missing one for any platform its index serves fails the release |
hack/multiarch-allowlist is the only bypass for that gate, and it is for images that cannot exist for arm64, not for images nobody has rebuilt yet. An entry is a repository with no tag or digest, so bumping an allowed image needs no edit, and it must carry a reason after # on the same line: the script refuses an entry without one. Allowed refs are still printed, under their own "allowed single-arch" heading, and in tree mode an entry that matches no ref that failed the check is reported as stale without changing the exit status, so it gets removed once the image is multi-arch or gone. --refs-file reports no stale entries, since a list of pulled images omits everything the run did not pull.
The gate reads this enumeration, so it covers exactly the refs pinned by digest in the three storage shapes. An image a vendored chart renders from its own defaults, or one an operator launches, is outside it. verify-multiarch.sh --refs-file checks a plain list of refs instead, tag-only ones resolved by tag, and the rc e2e feeds it image-refs.txt from hack/collect-images.sh: every image the sandbox nodes pulled, by the digest each pull resolved to. Neither covers a package that e2e never installs and the tree does not pin by digest.
Two rows do not source the shared library, for opposite reasons. hack/overlay-main-images.sh reads references and walks the tree itself, so it is a real exception to the invariant above: a file newly declared in IMAGE_REF_EXTRA_FILES does not automatically reach it. Its line classifier also has to know the bare-reference shape by itself: a *.tag file holds one reference with no YAML key around it, and until a build stamps it there is no @sha256: either, so a changed line there is recognised by shape rather than by key, scoped to *.tag because only there is a whole line known to be a reference and nothing else. hack/promote-rewrite-tags.sh carries a second match branch for that same shape and for the same reason. hack/promote-packages-artifact.sh is not a consumer of references at all — it hands the whole packages tree to flux push artifact and touches exactly one reference, the installer's own platformSourceUrl/platformSourceRef pair, by key with yq. Every shape travels inside the artifact because every file does, so there is nothing there for the enumeration to widen and no gap for a newly declared file to fall into.
nightly-mirror.sh is the one where a missed file is worst. The set it rewrites hosts in must equal the set it mirrored: a file rewritten but not mirrored leaves a dangling reference to an image never pushed, and a file mirrored but not rewritten leaves the published tree pointing at the private build registry.
Known gaps
These predate the shared enumeration. Each entry says whether the tree works around it today; they are recorded here so nobody rediscovers them as surprises.
The nightly host rewrite cannot reach a host split across two keys. The primary pass is a literal <src-registry>/ substring replace, so it only rewrites a reference whose host sits contiguously in front of the repository. Two layouts in the tree defeated it; one is handled by a second expression and the other was removed from the tree.
kubeovn puts the whole host in global.registry.address with the bare repository in a sibling key, so there is no trailing slash to match. This one is rewritten now, by a second, end-of-line-anchored expression that fires only when the source registry is the complete scalar value — a contiguous <src>/<repo>@<digest> ref continues past the host, so the two expressions can never both fire on one reference. It had to be fixed when kubeovn's image build moved into this repository: until then the image was built and pushed to the public registry by cozystack/kubeovn-chart, the baked ref kept the committed public-registry host, and the ownership filter skipped it. The moment a CI build stamps the build-registry host into that key, the image is mirrored but the host is not rewritten, and the published tree points at the private build registry. Covered by hack/nightly-mirror_test.bats.
keycloak-operator split at a different boundary: registry: ghcr.io beside repository: cozystack/cozystack/<name>, with an image: target that stamped only tag. A CI build would have rendered the committed public host with a digest that exists only in the build registry, and stamping the build host into registry instead would spread the source registry across two keys (iad.ocir.io and idyksih5sir9/cozystack/<name>), where no anchored replace can reach it. Rather than a structure-aware rewrite pass, the package now sets registry: "" and keeps the whole host in repository, which renders the same image string because the upstream chart joins the two keys, and its image: target stamps repository the same way. The rewrite still cannot reach a host split at that boundary, so a package must not stamp one: keep the host inside repository, or make it the complete value of its key as kubeovn does. Covered by hack/nightly-mirror_test.bats.
Collection understands both shapes — the host is rejoined, so a split-key ref carrying the source-registry host is still selected and mirrored. This is a defect in the host dimension; the version dimension the promote rewrite handles is unaffected, because the version always lives in a tag key regardless of where the host is.
A reference inside a gzip is invisible. capi-providers-cpprovider stamps its kamaji reference into files/control-plane-components.yaml and into the files/components.gz built from it, and the chart ships the .gz. Nothing enumerates either: declaring only the readable copy would rewrite what nothing consumes and diverge it from what does. Note the promote postcondition cannot catch this class at all — grep -rIl skips binary files — so it fails silently rather than loudly. No tag rewrite is owed (kamaji is component-versioned) and the image is still mirrored and retagged via its .tag file, so the residual is that a nightly's kamaji ConfigMap keeps the build-registry host. The fix is decompress, rewrite, recompress with gzip -n for reproducibility. hack/stitch-multiarch.sh does exactly that for its digest rewrite: it declares the .gz together with its plain source in its own GZIP_COPIES, rewrites both, and looks inside every .gz in the tree both before rewriting, to skip an image pinned in an undeclared one, and after, in its leftover-digest check. The rewritten .gz is byte-identical to what the package's image target writes only when both use GNU gzip, as CI does; Apple's gzip compresses to different bytes, so a stitch run on macOS rewrites the right content into a different file. The other consumers still leave both copies alone.
charts/ is excluded, and is almost always right. Vendored upstream chart values are regenerated by make update and their images are neither built nor pushed here. The one exception is packages/system/cozystack-scheduler/charts/cozystack-scheduler/values.yaml, which pins a first-party-namespace image. Excluding it is still correct — it is built by a separate repository, component-versioned, and already published to the public registry, so no retag or mirror is owed — but "everything under charts/ is third-party" is not literally true.
Why promotion does not rebuild containers
Promotion copies the release candidate's container images to the stable tag by digest, so every executable image in the stable release is bit-for-bit what passed end-to-end testing. Nothing is recompiled. The packages OCI artifact is declarative configuration rather than a container image, and its content must change: hack/promote-rewrite-tags.sh replaces the rc tag strings in the tree, the workflow commits that exact content, then hack/promote-packages-artifact.sh serializes it under a run-specific temporary promotion-* tag and a second commit pins its new digest in the installer. Promotion first requires the target base to carry the candidate-aware pipeline. The promotion PR checks the candidate against its prospective merge; finalize repeats the check before creating any stable name. Both require the candidate and its embedded rc baseline to use the trusted public cozystack-packages repository, follow the old self-reference back to that rc artifact, and prove that all container digests stayed fixed.
The packages artifact includes core/installer/values.yaml, so it cannot contain its own digest: writing that digest changes the payload and produces another digest forever. The separately published installer chart carries the real candidate pin used at runtime; the older platformSourceRef embedded inside the packages artifact is inert because the platform PackageSource does not install core/installer. Verification normalizes exactly that field and rejects every other difference. It also models Flux's established archive semantics: symlinks in the source tree are omitted rather than followed, matching the RC packages artifacts produced by the existing build.
Testing
hack/promote-rewrite-tags_test.bats round-trips the rewrite against the real tree: it stamps a synthetic release-candidate version into every first-party reference, runs the rewrite, and asserts nothing retains it. hack/promote-packages-artifact_test.bats covers deterministic candidate naming, metadata and digest pinning; hack/verify-promoted-packages_test.bats proves the self-reference exception is narrow and catches rc refs or post-publish tree drift. These checks run under make unit-tests without a cluster, a registry or a release. Any change to how references are stored or promoted must keep them passing.