fix(nightly): protocol-report writes its PROTOCOL.md when a boot stopped before POST's line

Under set -euo pipefail its lookups of PARITY:V4_POST / PARITY:V4_SYSTEM in a boot log that has
neither -- an aarch64 boot out of its 570 s in POST, 2026-11-17 -- ended the script silently (exit 1),
so a failing protocol had no report; so did a missing test-32.txt. The lookups are guarded as
dict-hash and post-count already guard theirs: the report is written, Result: FAIL, "none" for the
missing lines, "not run" for test-32 (ruled by Captain Bob: "Fix it, test first").

- scripts/test_nightly_protocol_report.sh (new): seen to fail first (7 of 7,
  logs/20261117-dump/test_protocol_report-before.log), then 7 of 7 pass; dict-hash's and post-count's
  tests still pass. NIGHTLY_PROTO, the protocol's scratch, settable for it as NIGHTLY_OUT is.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RzZgrf7V7Zk2iczBXDRbm
This commit is contained in:
Claude
2026-11-17 19:44:37 +00:00
parent c890cadc12
commit 68fd485441
2 changed files with 61 additions and 6 deletions
+8 -6
View File
@@ -97,7 +97,7 @@ usage() {
echo " protocol stages: $PROTOCOL_STAGES" >&2
exit 2
}
PROTO=build/protocol
PROTO=${NIGHTLY_PROTO:-build/protocol} # NIGHTLY_PROTO: the tests' scratch (scripts/test_nightly_protocol_report.sh)
PROTOCOL_STAGES="accept-amd64 accept-aarch64 accept-riscv64 accept-stick-high test-32 proofs images docs"
# The tree, but for the evidence the run writes (logs/, the DoE CSVs) and what builds leave behind
# untracked: what scripts/check_protocol.sh compares.
@@ -434,19 +434,21 @@ protocol-report)
boots=()
for a in amd64 aarch64 riscv64 stick-high; do
log=$(sed -n 's/^LOG: //p' "$OUT/accept-$a.txt" 2>/dev/null | head -1)
post=$( [ -n "$log" ] && grep -aoE "PARITY:V4_POST [^[:cntrl:]]*" "$log" | head -1)
sys=$( [ -n "$log" ] && grep -aoE "PARITY:V4_SYSTEM [^[:cntrl:]]*" "$log" | head -1)
# each lookup may find nothing (a boot that stopped in POST): under set -e that must be an
# answer, "none", not the end of the report (2026-11-17)
post=$( { [ -n "$log" ] && [ -f "$log" ] && grep -aoE "PARITY:V4_POST [^[:cntrl:]]*" "$log" | head -1; } || true)
sys=$( { [ -n "$log" ] && [ -f "$log" ] && grep -aoE "PARITY:V4_SYSTEM [^[:cntrl:]]*" "$log" | head -1; } || true)
boots+=("| $a | \`${log:-none}\` | \`${post:-none}\` | \`${sys:-none}\` |")
done
hashes=$(for a in amd64 aarch64 riscv64; do
log=$(sed -n 's/^LOG: //p' "$OUT/accept-$a.txt" 2>/dev/null | head -1)
[ -n "$log" ] && grep -aoE "PARITY:V4_SYSTEM [^[:cntrl:]]*" "$log" | sed -n 's/.*dict_hash=//p' | head -1
{ [ -n "$log" ] && [ -f "$log" ] && grep -aoE "PARITY:V4_SYSTEM [^[:cntrl:]]*" "$log" | sed -n 's/.*dict_hash=//p' | head -1; } || true
done)
nh=$(grep -c . <<<"$hashes" || true); nu=$(sort -u <<<"$hashes" | grep -c . || true)
if [ "$nh" = 3 ] && [ "$nu" = 1 ]; then same="the same on all three: \`$(head -1 <<<"$hashes")\`"
else same="**not** one value on three architectures ($nh found, $nu distinct)"; result=FAIL; why+=("dict_hash"); fi
t32=$(grep -E '[0-9]+ checks, [0-9]+ failures' "$OUT/test-32.txt" 2>/dev/null |
awk '{c+=$(NF-3); f+=$(NF-1)} END {printf "%d programs, %d checks, %d failures", NR, c, f}')
t32=$( { [ -f "$OUT/test-32.txt" ] && grep -E '[0-9]+ checks, [0-9]+ failures' "$OUT/test-32.txt" |
awk '{c+=$(NF-3); f+=$(NF-1)} END {printf "%d programs, %d checks, %d failures", NR, c, f}'; } || true)
isalog=$(find logs -path '*/isabelle/*.log' -newer "$PROTO/commit" 2>/dev/null | sort | tail -1)
{
echo "# Protocol for ${commit:0:8}"