Pin the runtime base by digest, and read only pkg_hash in the lock check (images-to-forge P1e) #2
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "pluto/p1-pin"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
P1e of the images-to-forge package (macula-io/martha#601), under DECIDED 2026-11-22 "images should move to forgejo".
What it pins
Containerfile: the alpine runtime base by@sha256. The tag stays beside the digest as a comment; the ARG that carried the tag is gone.scripts/assert_rebar_lock_has_hashes.sh, run from.github/workflows/lint.ymlafter the resolve: every hex package inrebar.lockmust carry itspkg_hash, and the check fails when the lock names no package at all.The second commit is the lock-check fix
The first version matched a checksum line by its shape, so a package's own blake2b line in
pkg_hash_extsatisfied it after itspkg_hashwas stripped: it said "all N packages carry their sha256" on a lock that carried none for that package. The fix follows the list headers ({pkg_hash,[only), needs 64 hex, and refuses a missing list.Why
A tag can be moved, so a build that names one builds other bytes later. A lock without
pkg_hashpins a name and a version, not bytes, and the signer that builds releases refuses a tree on exactly that.Proof
On real locks the check passes 9/9, 8/8, 7/7 and 29/29. A copy with a
pkg_hashline stripped is now refused by name; so are an empty lock, a missing lock and a six-hex value. Terra PASSed the fix.The branch also merges
main(which carries this repository's workflow port) so the pin fast-forwards onto it.The check found a checksum line by its shape, so the same package name in pkg_hash_ext — a blake2b digest, not the sha256 the signer checks — satisfied it. On this repository's own lock, with one package's pkg_hash line removed and its pkg_hash_ext line left in place, it answered "all packages carry their sha256". It now follows the list headers: only lines under {pkg_hash,[ count, the value must be 64 hex digits, and a lock with no pkg_hash list at all is refused too. Proved on this repository's lock (every package carries its sha256) and on the stripped copy above, which it now refuses by name, plus an empty file, a missing file and a 6-digit value.actions/checkout@v4 is a JavaScript action, and this job runs in its own container — a macula-ci image, which carries no node — so the action died at step 0 with exitcode 127 ("node": executable file not found). The replacement step is BYTE-IDENTICAL in every repository on the forge: the token reaches git through GIT_CONFIG_COUNT/GIT_CONFIG_KEY_0/GIT_CONFIG_VALUE_0 (http.extraHeader) in the environment, never through a URL or on a command line; the run's own sha is fetched and checked out; and the step refuses any tree that is not that sha. It is also the candidate for option B, one script baked into macula-ci-images (a follow-up there, not tonight). This follows the no-marketplace CI rule (DECIDED 2026-11-22 "do both").View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.