Assert the resolve carries its hashes, reading only pkg_hash in the lock check (images-to-forge P1e) #1

Open
pluto wants to merge 4 commits from pluto/p1-pin into main
Member

P1e of the images-to-forge package (macula-io/martha#601), under DECIDED 2026-11-22 "images should move to forgejo".

What it pins

  • scripts/assert_rebar_lock_has_hashes.sh, run from .github/workflows/lint-and-test.yml after the resolve: every hex package in rebar.lock must carry its pkg_hash, and the check fails when the lock names no package at all.
  • This repository has no Containerfile, so there is no base image of its own to pin: the lock step is the whole pin half, and it is not a partial one.

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_ext satisfied it after its pkg_hash was 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 lock without pkg_hash pins 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_hash line 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. lint-and-test.yml auto-merged the port's changes and this branch's step; both sides were read back after the merge.

P1e of the images-to-forge package (macula-io/martha#601), under DECIDED 2026-11-22 "images should move to forgejo". **What it pins** - `scripts/assert_rebar_lock_has_hashes.sh`, run from `.github/workflows/lint-and-test.yml` after the resolve: every hex package in `rebar.lock` must carry its `pkg_hash`, and the check fails when the lock names no package at all. - This repository has no Containerfile, so there is no base image of its own to pin: the lock step is the whole pin half, and it is not a partial one. **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_ext` satisfied it after its `pkg_hash` was 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 lock without `pkg_hash` pins 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_hash` line 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. `lint-and-test.yml` auto-merged the port's changes and this branch's step; both sides were read back after the merge.
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.
Merge forge main into pluto/p1-pin (images-to-forge P1e, macula-io/martha#601)
Some checks failed
docs / snippets (push) Failing after 3s
docs / Erlang blocks in the docs (push) Failing after 0s
lint-and-test / lint + eunit + ct (OTP 28.4.3) (pull_request) Failing after 3s
lint-and-test / scaffold lint toolchain runs in its pinned image (pull_request) Failing after 4s
lint-and-test / erlang in . (container) (pull_request) Has been skipped
lint-and-test / erlang in . (pull_request) Failing after 3s
lint-and-test / Dependency advisories (pull_request) Failing after 0s
docs / snippets (pull_request) Failing after 4s
docs / Erlang blocks in the docs (pull_request) Failing after 0s
ced44c16bb
ci: the container job checks out in plain shell, no marketplace action (macula-io/martha#601)
Some checks failed
lint-and-test / scaffold lint toolchain runs in its pinned image (pull_request) Failing after 5s
lint-and-test / erlang in . (container) (pull_request) Has been skipped
lint-and-test / Dependency advisories (pull_request) Failing after 0s
docs / snippets (push) Failing after 3s
docs / Erlang blocks in the docs (push) Failing after 0s
docs / snippets (pull_request) Failing after 2s
docs / Erlang blocks in the docs (pull_request) Failing after 0s
lint-and-test / erlang in . (pull_request) Failing after 2s
lint-and-test / lint + eunit + ct (OTP 28.4.3) (pull_request) Successful in 4m42s
3e410196d5
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).

The hex cache step goes with it: the instance runner keeps no cache for a
plain-shell step.

This follows the no-marketplace CI rule (DECIDED 2026-11-22 "do both").
Some checks failed
lint-and-test / scaffold lint toolchain runs in its pinned image (pull_request) Failing after 5s
lint-and-test / erlang in . (container) (pull_request) Has been skipped
lint-and-test / Dependency advisories (pull_request) Failing after 0s
docs / snippets (push) Failing after 3s
docs / Erlang blocks in the docs (push) Failing after 0s
docs / snippets (pull_request) Failing after 2s
docs / Erlang blocks in the docs (pull_request) Failing after 0s
lint-and-test / erlang in . (pull_request) Failing after 2s
lint-and-test / lint + eunit + ct (OTP 28.4.3) (pull_request) Successful in 4m42s
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin pluto/p1-pin:pluto/p1-pin
git switch pluto/p1-pin
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
macula-services/mcl-om!1
No description provided.