From 28395fe5d84dacc11d1e4be95ae4271f9e43a442 Mon Sep 17 00:00:00 2001 From: igneum-labs <337424239+igneum-labs@users.noreply.github.com> Date: Thu, 8 Oct 2026 08:36:59 +0000 Subject: [PATCH 1/3] Site deploy checks: pages read into a variable before grep (curl | grep -q under pipefail read false on a match: three false DEPLOY REDs) Co-Authored-By: Claude Fable 5.1 --- tools/site-deploy-from-mirror.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/site-deploy-from-mirror.sh b/tools/site-deploy-from-mirror.sh index 1c7b0d2b1..b0e4f45ab 100755 --- a/tools/site-deploy-from-mirror.sh +++ b/tools/site-deploy-from-mirror.sh @@ -27,8 +27,12 @@ post_checks() { # one pass: prints the first mismatch as "field: detail" and ret [ "$n" = "$LIVE_NETWORK" ] || { echo "api/live network: $n (want $LIVE_NETWORK)"; return 1; } idx=$(curl -fsS "${nc[@]}" --max-time 20 "$SITE/?x=$RANDOM" 2>/dev/null) || { echo "index: not reachable"; return 1; } for m in "${INDEX_STRINGS[@]}"; do printf '%s' "$idx" | /usr/bin/grep -qF -- "$m" || { echo "index string missing: \"$m\""; return 1; }; done - curl -fsS "${nc[@]}" --max-time 20 "$SITE$LEGAL_PAGE?x=$RANDOM" 2>/dev/null | /usr/bin/grep -qiF -- "$LEGAL_STRING" || { echo "legal string missing on $LEGAL_PAGE: \"$LEGAL_STRING\""; return 1; } - rows=$(curl -fsS "${nc[@]}" --max-time 20 "$SITE/miners?x=$RANDOM" 2>/dev/null | /usr/bin/grep -c '/dev/null) || { echo "$LEGAL_PAGE: not reachable"; return 1; } + printf '%s' "$legal" | /usr/bin/grep -qiF -- "$LEGAL_STRING" || { echo "legal string missing on $LEGAL_PAGE: \"$LEGAL_STRING\""; return 1; } + local miners; miners=$(curl -fsS "${nc[@]}" --max-time 20 "$SITE/miners?x=$RANDOM" 2>/dev/null) || { echo "miners: not reachable"; return 1; } + rows=$(printf '%s' "$miners" | /usr/bin/grep -c ' Date: Thu, 8 Oct 2026 08:44:00 +0000 Subject: [PATCH 2/3] Site deploy checks: the /miners row count reads table#bench-current (the regrouped bench), known-failed first (an empty current table reads 0), floor 20 Co-Authored-By: Claude Fable 5.1 --- tools/site-deploy-from-mirror.sh | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/tools/site-deploy-from-mirror.sh b/tools/site-deploy-from-mirror.sh index b0e4f45ab..02070742a 100755 --- a/tools/site-deploy-from-mirror.sh +++ b/tools/site-deploy-from-mirror.sh @@ -17,8 +17,14 @@ set -euo pipefail LIVE_NETWORK="${LIVE_NETWORK:-igneum-devnet-3}" INDEX_STRINGS=("At launch the strongest chip in our public model" "git.igneum.network/igneum-network/") LEGAL_PAGE="${LEGAL_PAGE:-/litepaper}"; LEGAL_STRING="Not legal advice" # the legal line lives on the litepaper in master's tree (22:16 UK: no commit put it on the index) -MINERS_MIN_ROWS="${MINERS_MIN_ROWS:-30}" +MINERS_MIN_ROWS="${MINERS_MIN_ROWS:-20}" # the current-class table alone (the datacentre rows sit in their own table since 8 Oct 2026) SITE="${SITE_URL:-https://igneum.network}" +# the /miners row count: the rows of the current-class table (table#bench-current, the regrouped bench of 8 Oct 2026; the datacentre +# and earlier tables sit under their own ids); known-failed: an empty table reads 0 +miners_rows() { printf '%s' "$1" | python3 -c ' +import sys,re +h=sys.stdin.read(); m=re.search(r"]*id=\"bench-current\".*?", h, re.S) +print(len(re.findall(r"/dev/null) || { echo "$LEGAL_PAGE: not reachable"; return 1; } printf '%s' "$legal" | /usr/bin/grep -qiF -- "$LEGAL_STRING" || { echo "legal string missing on $LEGAL_PAGE: \"$LEGAL_STRING\""; return 1; } local miners; miners=$(curl -fsS "${nc[@]}" --max-time 20 "$SITE/miners?x=$RANDOM" 2>/dev/null) || { echo "miners: not reachable"; return 1; } - rows=$(printf '%s' "$miners" | /usr/bin/grep -c '/dev/null 2>&1 && { echo "post-deploy self-test: FAIL: a wrong network passed"; exit 1; } out=$(LIVE_NETWORK="igneum-no-such-network" post_checks 2>&1 || true); case "$out" in "api/live network:"*) ;; *) echo "post-deploy self-test: FAIL: the wrong-network line was '$out'"; exit 1 ;; esac INDEX_STRINGS=("no such string on any page 7f3a") LIVE_NETWORK="$(curl -fsS --max-time 20 "$SITE/api/live" | python3 -c 'import sys,json; print(json.load(sys.stdin)["state"]["network"])')" post_checks >/dev/null 2>&1 && { echo "post-deploy self-test: FAIL: a missing index string passed"; exit 1; } - echo "post-deploy self-test: a wrong network and a missing index string read RED with the field" + [ "$(miners_rows '
')" = 0 ] || { echo "post-deploy self-test: FAIL: an empty current table did not read 0 rows"; exit 1; } + [ "$(miners_rows '
')" = 2 ] || { echo "post-deploy self-test: FAIL: two rows did not read 2"; exit 1; } + echo "post-deploy self-test: a wrong network and a missing index string read RED with the field; an empty current table reads 0 rows, two rows read 2" echo "live site now: $(post_checks 2>&1 || true)" exit 0 fi From 103ceb0f3c83d433520211d5b840c28e9d2e3ad7 Mon Sep 17 00:00:00 2001 From: igneum-labs <337424239+igneum-labs@users.noreply.github.com> Date: Thu, 8 Oct 2026 08:44:32 +0000 Subject: [PATCH 3/3] Site deploy checks: grep -c in place of grep -q on every piped read (grep -q exits on the first match and the writer fails under pipefail) Co-Authored-By: Claude Fable 5.1 --- tools/site-deploy-from-mirror.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/site-deploy-from-mirror.sh b/tools/site-deploy-from-mirror.sh index 02070742a..85b1a875b 100755 --- a/tools/site-deploy-from-mirror.sh +++ b/tools/site-deploy-from-mirror.sh @@ -32,11 +32,11 @@ post_checks() { # one pass: prints the first mismatch as "field: detail" and ret n=$(printf '%s' "$j" | python3 -c 'import sys,json; print(json.load(sys.stdin)["state"]["network"])' 2>/dev/null || echo "?") [ "$n" = "$LIVE_NETWORK" ] || { echo "api/live network: $n (want $LIVE_NETWORK)"; return 1; } idx=$(curl -fsS "${nc[@]}" --max-time 20 "$SITE/?x=$RANDOM" 2>/dev/null) || { echo "index: not reachable"; return 1; } - for m in "${INDEX_STRINGS[@]}"; do printf '%s' "$idx" | /usr/bin/grep -qF -- "$m" || { echo "index string missing: \"$m\""; return 1; }; done + for m in "${INDEX_STRINGS[@]}"; do printf '%s' "$idx" | /usr/bin/grep -cF -- "$m" >/dev/null || { echo "index string missing: \"$m\""; return 1; }; done # the page is read into a variable first: `curl | grep -q` under pipefail reads false on a MATCH (grep closes the pipe, curl exits 56; # three false DEPLOY REDs on 7 and 8 October 2026) local legal; legal=$(curl -fsS "${nc[@]}" --max-time 20 "$SITE$LEGAL_PAGE?x=$RANDOM" 2>/dev/null) || { echo "$LEGAL_PAGE: not reachable"; return 1; } - printf '%s' "$legal" | /usr/bin/grep -qiF -- "$LEGAL_STRING" || { echo "legal string missing on $LEGAL_PAGE: \"$LEGAL_STRING\""; return 1; } + printf '%s' "$legal" | /usr/bin/grep -ciF -- "$LEGAL_STRING" >/dev/null || { echo "legal string missing on $LEGAL_PAGE: \"$LEGAL_STRING\""; return 1; } local miners; miners=$(curl -fsS "${nc[@]}" --max-time 20 "$SITE/miners?x=$RANDOM" 2>/dev/null) || { echo "miners: not reachable"; return 1; } rows=$(miners_rows "$miners") [ "${rows:-0}" -ge "$MINERS_MIN_ROWS" ] || { echo "miners rows: ${rows:-0} (want at least $MINERS_MIN_ROWS)"; return 1; }