ref:main

fix(runner): platform-scope the prepared-image tag (#44) #52

merged colechristensen cole.christensen@gmail.com wants to merge fix/prepared-tag-platform-scope into main

Closes #44.

`compute_prepared_tag` hashed only the base image and the prepare commands, so an amd64 and an arm64 runner with the same pipeline computed the identical tag.

Invisible today (each runner only consults its own Docker daemon, so they build the same tag independently), but a correctness prerequisite for sharing prepared images through the registry (fangorn/anvil#359): an arm64 runner would pull a tag built on amd64, image_exists_locally would report a hit, and the step would run wrong-arch bytes — exec format error, or silent emulation.

The base-image string is also not the invariant it appears to be: a multi-arch manifest like hexpm/elixir:1.20.2-...-trixie resolves to different per-arch layers, and the prepare commands themselves fetch arch-specific artifacts (this repo’s own .anvil.yml downloads zig-$(uname -m)-linux).

Change: fold os + arch into the hash, length-delimited so ("linux","amd64") cannot collide with ("linuxamd","64"). Existing images miss and rebuild once.

Split out compute_prepared_tag_for(os, arch, ...) so the cross-arch divergence is actually testable — a test reading the host’s env::consts could not prove the property it asserts. 6 tests added; full suite 418 passing, clippy -D warnings and fmt clean.

🤖 Generated with Claude Code

https://claude.ai/code/session_01NbPigycqAeQnfY39C1WZMt

Created Jul 27, 2026 at 01:27 UTC | Merged Jul 30, 2026 at 04:18 UTC by colechristensen cole.christensen@gmail.com