diff --git a/scripts/check_ladder_apr_release_pin.sh b/scripts/check_ladder_apr_release_pin.sh new file mode 100755 index 0000000000..ee643d7397 --- /dev/null +++ b/scripts/check_ladder_apr_release_pin.sh @@ -0,0 +1,101 @@ +#!/usr/bin/env bash +# check_ladder_apr_release_pin.sh — the release cells run the apr UNDER TEST, never a PATH lookup (#3715 A3). +# +# WHY. Operator 2026-09-28 17:28Z: "cells and every gate step invoke the binary UNDER TEST by absolute path +# (the rc.1 artifact) with a sha256 check; each receipt records `apr --version` SHA == rc.1 tag SHA. +# Falsifier: plant a different-sha apr first on PATH -> cell refuses. PATH lookup of apr on the gate path = 0." +# Four `apr` binaries once coexisted on one box and a bare `apr` resolved to a 26-day-old one. A cell measured +# on the wrong binary is a confident verdict about code nobody is shipping. +# +# WHAT. model_ladder.sh step 0, release mode (APR_RELEASE_SHA256 / APR_RELEASE_COMMIT set), driven through +# `--lock-probe` -- the same apr_locked every cell goes through -- in a temp root whose PATH has a PLANTED apr +# first. Every fake apr logs each invocation, so "the planted apr ran zero times" is observed, not assumed. +# +# Exit: 0 every case as expected and every mutant killed · 1 a case or mutant landed wrong · 2 could not check. +set -uo pipefail +cd "$(dirname "$0")/.." || exit 2 +LADDER_SH=scripts/model_ladder.sh +for t in sha256sum flock choom; do command -v "$t" > /dev/null || { echo "check_ladder_apr_release_pin: $t absent" >&2; exit 2; }; done +[ -f "$LADDER_SH" ] || { echo "check_ladder_apr_release_pin: $LADDER_SH absent" >&2; exit 2; } + +W=$(mktemp -d "${TMPDIR:-/tmp}/apr-pin.XXXXXX") || exit 2 +trap 'rm -rf -- "${W:?}"' EXIT +GOOD=abcdef1234567890abcdef1234567890abcdef12 # the "release commit" +OTHER=0123456789abcdef0123456789abcdef01234567 +mkdir -p "$W/root" "$W/rc" "$W/path" "$W/imp" +for d in contracts scripts evidence Cargo.toml; do ln -s "$PWD/$d" "$W/root/$d"; done +LOG="$W/calls" +fake() { #