FIX7 P0 Shaped-Clone CI-Gate — RERUN.sh
#!/usr/bin/env bash
FIX7 P0 - shaped-clone + CI-gate packet :: re-run harnesses, recompute manifest,
and compare its sha256 to packet_tree.sha256. No clone/production/CI/secrets.
set -u cd "$(dirname "$0")"
bash commands.sh RC_CMDS=$?
Recompute HASH_MANIFEST.txt over every file except HASH_MANIFEST.txt and packet_tree.sha256.
python3 - <<'PY' import hashlib, os EXCLUDE = {"HASH_MANIFEST.txt", "packet_tree.sha256"} names = sorted(f for f in os.listdir(".") if os.path.isfile(f) and f not in EXCLUDE) lines = [] for n in names: with open(n, "rb") as fh: lines.append("%s %s" % (hashlib.sha256(fh.read()).hexdigest(), n)) manifest = "\n".join(lines) + "\n" with open("HASH_MANIFEST.txt", "w", encoding="utf-8") as fh: fh.write(manifest) tree = hashlib.sha256(manifest.encode("utf-8")).hexdigest() with open("packet_tree.sha256.recomputed", "w", encoding="utf-8") as fh: fh.write(tree + " HASH_MANIFEST.txt\n") print("RECOMPUTED_PACKET_TREE: " + tree) PY
EXPECTED=$(awk '{print $1}' packet_tree.sha256) ACTUAL=$(awk '{print $1}' packet_tree.sha256.recomputed) rm -f packet_tree.sha256.recomputed echo "EXPECTED_PACKET_TREE: $EXPECTED" echo "ACTUAL_PACKET_TREE: $ACTUAL" if [ "$RC_CMDS" -eq 0 ] && [ "$EXPECTED" = "$ACTUAL" ]; then echo "RERUN_RESULT: PASS (PACKET_TREE MATCH)" exit 0 else echo "RERUN_RESULT: FAIL" exit 1 fi