diff --git a/scripts/verify-aiui-deploy.sh b/scripts/verify-aiui-deploy.sh index 11476d32..e0204209 100755 --- a/scripts/verify-aiui-deploy.sh +++ b/scripts/verify-aiui-deploy.sh @@ -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