Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/aien-architecture-mv/blob/main/scripts/pipeline-proofs/19-pr-gate-refuses-stale.sh # aien-architecture-mv Canonical architecture for the AIEN ecosystem: flows, boundaries, ADRs, and the map from design to implementation repositories. Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `aien-architecture-mv / scripts / pipeline-proofs / 19-pr-gate-refuses-stale.sh` 88 lines ยท 5112 bytes Raw Blame History 1 #!/usr/bin/env bash 2 # 19: since the crumb retirement (2026-11-07, DRA-97) stale, missing or mixed crumbs no longer block admission. 3 # The real scripts/pr-gate.sh (with a fake `gh` that answers from fixtures: open PR, CLEAN, no required contexts) 4 # is run with --worktree on a clone whose PR branch (a) changed source without recompiling (formerly STALE), 5 # (b) deleted a .crumb (formerly MISSING), (c) changed source only, with no crumb commit, (d) changed source and 6 # a .crumb in one last commit (formerly refused by rule 2). Every case must exit 0 with 7 # "GATE crumb: SKIP retired". The crumb tool is never needed: CRUMB and a `crumb` on PATH are stubs that record 8 # any call and exit 99, and the proof checks they were never called. No network. 9 here="$(cd "$(dirname "$0")" && pwd)"; . "$here/lib.sh" 10 proof_begin 19 "pr-gate.sh no longer refuses stale, missing or mixed crumbs (retired, DRA-97)" "${1:-}" 11 GATE=${PR_GATE:-$here/../pr-gate.sh}; [ -x "$GATE" ] || { echo "pr-gate.sh not found at $GATE" >&2; exit 2; } 12 export SLEEP_SECS=0 13 clone_repo "$TMP/seed"; git -C "$TMP/seed" checkout -q -B main 14 git clone -q --bare "$TMP/seed" "$TMP/origin.git" 15 git clone -q "$TMP/origin.git" "$TMP/w"; W=$TMP/w 16 git -C "$W" config user.name proof; git -C "$W" config user.email proof@example.invalid 17 FX="$TMP/fx"; mkdir -p "$FX" "$TMP/bin"; export FX 18 cat > "$TMP/bin/gh" <<'S' 19 #!/usr/bin/env bash 20 d="$FX/$CASE" 21 case "$1 $2" in 22 "pr view") cat "$d/pr.json" ;; 23 "pr list") echo '[]' ;; 24 api\ repos/*) echo '[]' ;; 25 *) echo "fake gh: unhandled: $*" >&2; exit 2 ;; 26 esac 27 S 28 printf '#!/usr/bin/env bash\necho "$*" >> "%s/crumb-called"\nexit 99\n' "$TMP" > "$TMP/bin/crumb" 29 chmod +x "$TMP/bin/gh" "$TMP/bin/crumb"; export PATH="$TMP/bin:$PATH" CRUMB="$TMP/bin/crumb" 30 fx() { # fx 31 mkdir -p "$FX/$1" 32 printf '{"number":1,"state":"OPEN","isDraft":false,"baseRefName":"main","headRefName":"%s","headRefOid":"%s","mergeable":"MERGEABLE","mergeStateStatus":"CLEAN","reviewDecision":"","statusCheckRollup":[]}\n' "$2" "$3" > "$FX/$1/pr.json" 33 } 34 L=$(leaf_crumb_dir "$W") || { echo "no leaf crumb dir" >&2; exit 1; } 35 F=$(tracked_file_in "$W" "$L") 36 MAIN=main 37 branch() { git -C "$W" checkout -q -b "$1" "origin/$MAIN"; } 38 push() { git -C "$W" push -q origin "$1"; git -C "$W" rev-parse HEAD; } 39 admitted() { # admitted