fix(13-09): verify-aiui-deploy false-negative — pipefail EPIPEs curl on grep -q early exit

curl | grep -q under set -o pipefail: grep's first-match exit EPIPEs curl
(exit 23) whenever the marker precedes the tail of a >64KB chunk, so a
genuine deploy read as FAIL (bit during 13-08's AIUI redeploy — marker at
27% of a 416KB chunk failed 3/3 runs). Fetch to a temp file, then grep.
Negative control still fails as it should.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
archipelago
2026-08-05 13:05:42 -04:00
co-authored by Claude Fable 5
parent cfbbd268e5
commit 830b77af18
+7 -1
View File
@@ -63,11 +63,17 @@ echo "$(timestamp) Resolved ${#LIVE_PATHS[@]} live chunk(s) from the precache ma
FOUND=0
CHECKED=0
# Fetch to a temp file and grep that, NOT `curl | grep -q`: under this
# script's pipefail, grep -q's early exit EPIPEs curl (exit 23) whenever
# the marker sits before the tail of a >64KB chunk, turning a genuine
# match into a nondeterministic FAIL.
BODY_TMP="$(mktemp)"
trap 'rm -f "$BODY_TMP"' EXIT
for path in "${LIVE_PATHS[@]}"; do
[ -z "$path" ] && continue
CHECKED=$((CHECKED + 1))
url="${BASE}/aiui/${path}"
if curl -sf -m 15 "$url" 2>/dev/null | grep -q -- "$MARKER"; then
if curl -sf -m 15 -o "$BODY_TMP" "$url" 2>/dev/null && grep -q -- "$MARKER" "$BODY_TMP"; then
echo "$(timestamp) MATCH: $path"
FOUND=1
break