Pin both base images by digest and assert the Gleam resolve carries its hashes (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

  • Containerfile: both FROMs by @sha256 at the FROM line. The tag stays beside each digest as a comment; the ARGs that carried the tag are gone.
  • scripts/assert_manifest_has_hashes.sh, run from .github/workflows/ci.yml after gleam deps download and before Lint: every package the Gleam resolve names must carry the hash published with it, and the check fails when the manifest names no package at all.
  • The second commit is the review fix Neptunus asked for: a resolve with no hashes at all is refused, not passed.

Why
A tag can be moved, so a build that names one builds other bytes later. A resolve that names package names and versions without their hashes pins a name, not bytes, and the signer that builds releases refuses a tree on exactly that.

Proof
The checker passes the real manifest and refuses a stripped hash, an empty manifest and a missing one (25 of 25 cases in the review).

The branch also merges main (which carries this repository's workflow port) so the pin fast-forwards onto it. ci.yml auto-merged the port's guards 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** - `Containerfile`: both `FROM`s by `@sha256` at the `FROM` line. The tag stays beside each digest as a comment; the ARGs that carried the tag are gone. - `scripts/assert_manifest_has_hashes.sh`, run from `.github/workflows/ci.yml` after `gleam deps download` and before Lint: every package the Gleam resolve names must carry the hash published with it, and the check fails when the manifest names no package at all. - The second commit is the review fix Neptunus asked for: a resolve with no hashes at all is refused, not passed. **Why** A tag can be moved, so a build that names one builds other bytes later. A resolve that names package names and versions without their hashes pins a name, not bytes, and the signer that builds releases refuses a tree on exactly that. **Proof** The checker passes the real manifest and refuses a stripped hash, an empty manifest and a missing one (25 of 25 cases in the review). The branch also merges `main` (which carries this repository's workflow port) so the pin fast-forwards onto it. `ci.yml` auto-merged the port's guards and this branch's step; both sides were read back after the merge.
The P1e row asks every repo for a check that the build-resolved lock
carries hashes. Gleam's manifest.toml carries outer_checksum per hex
package, so the check is owed here too: gleam deps download, then
scripts/assert_manifest_has_hashes.sh, before the lint and the tests.
It fails on a missing or empty manifest, on a manifest that names no
hex package, and names each hex package with no checksum.
Merge forge main into pluto/p1-pin (images-to-forge P1e, macula-io/martha#601)
Some checks failed
c4 model / c4-model-1 (pull_request) Successful in 3s
ci / guard-1 (pull_request) Has been skipped
c4 model / c4-model (pull_request) Successful in 0s
ci / guard (pull_request) Successful in 0s
ci / gates (OTP 28.4.3 / Gleam 1.18.1) (pull_request) Failing after 3s
ci / image (amd64) (pull_request) Has been cancelled
ci / attest (pull_request) Has been cancelled
47d2b80cb5
ci: the container job checks out in plain shell, no marketplace action (macula-io/martha#601)
Some checks failed
c4 model / c4-model-1 (pull_request) Successful in 3s
c4 model / c4-model (pull_request) Successful in 0s
ci / gates (OTP 28.4.3 / Gleam 1.18.1) (pull_request) Successful in 3m35s
ci / guard-1 (pull_request) Has been skipped
ci / guard (pull_request) Successful in 0s
ci / image (amd64) (pull_request) Has been skipped
ci / attest (pull_request) Failing after 0s
c3433d0467
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").
Some checks failed
c4 model / c4-model-1 (pull_request) Successful in 3s
c4 model / c4-model (pull_request) Successful in 0s
ci / gates (OTP 28.4.3 / Gleam 1.18.1) (pull_request) Successful in 3m35s
ci / guard-1 (pull_request) Has been skipped
ci / guard (pull_request) Successful in 0s
ci / image (amd64) (pull_request) Has been skipped
ci / attest (pull_request) Failing after 0s
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-bookclub-gleam!1
No description provided.