Skip to content

feat(release): stamp eval.input-hash on every pushed image - #303

Merged
elronbandel merged 2 commits into
mainfrom
elron/stamp-input-hash
Aug 9, 2026
Merged

feat(release): stamp eval.input-hash on every pushed image#303
elronbandel merged 2 commits into
mainfrom
elron/stamp-input-hash

Conversation

@elronbandel

Copy link
Copy Markdown
Contributor

Resolves #302. Rung 3 of #292's migration path (rules #293, hash primitive #298).

What

Every push site in the fleet release now stamps eval.input-hash — the image's build-input hash — into the image config (delivery rule 12). No build behavior changes; the label is the value the freshness diff (rung 4) and selective retag (rung 5) will consume.

Push site Mechanism
bases (~19 targets, one invocation) one fleet-hash run → one --set "<target>.labels…" per dep
leaves (per-leaf matrix job) --set "$T.labels…" from the leaf's row (~0.4s/job)
per-task, bake path (swe-bench) fleet-hash per-task <b> <task> → per-target --set
per-task, script path (terminal-bench, skills-bench) build.sh gains an optional EVAL_INPUT_HASH env hook → --label on the final build (no bake invocation exists on this path)
combos (eval + eval-standalone) fleet-hash combo <b> <a> [task] → one --set per target

Never *.labels — the #298 audit flagged this exact trap: a single bake invocation covers targets with different hashes (bases bakes ~19, combos bakes both variants), so a wildcard would stamp one wrong value everywhere.

Script change (additive only)

fleet-hash combo accepts an optional [task]: mixes the task id into both hashes exactly the way per-task does, and names rows with the release's <bench>-<tid> convention. The frozen definition is untouched — verified by diffing full output against the merged #298 script: byte-identical for all 153 targets and the no-task combo rows.

Label semantics (the open decision from the audit, resolved)

The label records the repo-computed inputs at the stamped commit. On a frozen-bases dev dispatch, a leaf can build FROM an older frozen base than its hash's base component claims — accepted and documented inline, because tagged releases always rebuild bases first (nothing exists at a fresh :TAG), so labels are exact where rules 13–14 gate.

Verification

  • All three --set shapes exercised locally via bake --print: per-target labels land on their own targets only (bases multi-target, leaf single-target, combo eval+standalone with distinct hashes).
  • tests/static/input_hash.rs extended: per-task combo rows follow the naming convention, track the task id, and differ from the shared combo and the standalone variant. Suite green (4 tests, ~6.8s); fleet-hash.sweep.sh green (153 targets, both directions).
  • The fleet workflow itself only validates in a real run — a dry_run=true dispatch on this branch exercises the bases/leaves label path via --print.

Rules checked against

Rung 3 of the carried-forward ladder (#292; primitive merged in #298):
every push site now records the image's build-input hash in its config
(delivery/RULES.md rule 12), the value rungs 4-5 will diff and retag on.

Per-target --set at every bake site — never *.labels, because a single
invocation bakes targets with different hashes (bases bakes ~19, combos
bakes eval + eval-standalone):

- bases: one fleet-hash run, one --set per shared dep
- leaves: --set "$T.labels.eval.input-hash" from the leaf's row
- per-task bake (swe-bench): per-task hash via fleet-hash per-task
- per-task script (terminal-bench, skills-bench): build.sh gains an
  optional EVAL_INPUT_HASH env hook -> --label on the final build (this
  path has no bake invocation to --set)
- combos: fleet-hash combo <b> <a> [task] — the new optional task arg
  mixes the task id into the hash exactly like per-task does and names
  rows with the release's <bench>-<tid> convention. No-task hashes are
  byte-identical to the frozen #298 definition (verified against the
  merged script across all 153 targets + combos).

Label semantics: the hash records the repo-computed inputs at the
stamped commit. On a frozen-bases dev dispatch a leaf may build FROM an
older base than its hash's base component claims; tagged releases always
rebuild bases first, so release labels are exact (noted inline).

All three --set shapes verified locally via bake --print: per-target
labels land on their own targets only.

Signed-off-by: Elron Bandel <elron.bandel@ibm.com>
Signed-off-by: Elron Bandel <elron.bandel@ibm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

drift: delivery/RULES.md#12 — no push site records the build-input hash in the image config

1 participant