← back to Dw Pairs Well
auto-save: 2026-07-13T00:51:43 (1 files) — tools/live-link-check.sh
79e1c62e1bdd84271a03c198262733b581a1dfaf · 2026-07-13 00:51:47 -0700 · Steve Abrams
Files touched
A tools/live-link-check.sh
Diff
commit 79e1c62e1bdd84271a03c198262733b581a1dfaf
Author: Steve Abrams <steve@designerwallcoverings.com>
Date: Mon Jul 13 00:51:47 2026 -0700
auto-save: 2026-07-13T00:51:43 (1 files) — tools/live-link-check.sh
---
tools/live-link-check.sh | 38 ++++++++++++++++++++++++++++++++++++++
1 file changed, 38 insertions(+)
diff --git a/tools/live-link-check.sh b/tools/live-link-check.sh
new file mode 100644
index 0000000..51f8623
--- /dev/null
+++ b/tools/live-link-check.sh
@@ -0,0 +1,38 @@
+#!/usr/bin/env bash
+# Live-link guarantee check: for N random ACTIVE+published heroes, pull /api/pairs and
+# /api/similar (clip engines active) from a pairs-well instance and HEAD every suggested
+# /products/<handle> against the LIVE store. Any non-200 is a FAIL.
+# Usage: BASE=http://127.0.0.1:9821 STORE=https://designerwallcoverings.com N=5 bash tools/live-link-check.sh
+set -u
+BASE="${BASE:-http://127.0.0.1:9821}"
+STORE="${STORE:-https://designerwallcoverings.com}"
+N="${N:-5}"
+
+HEROES=$(psql -d dw_unified -h /tmp -tA -c "
+ SELECT dw_sku FROM (
+ SELECT DISTINCT dw_sku FROM shopify_products
+ WHERE status='ACTIVE' AND online_store_published IS TRUE
+ AND handle IS NOT NULL AND dw_sku IS NOT NULL AND tags IS NOT NULL AND image_url IS NOT NULL
+ ) x ORDER BY md5(dw_sku) LIMIT $N;")
+
+total=0; bad=0
+for SKU in $HEROES; do
+ for EP in "pairs?dw_sku=$SKU&limit=8" "similar?dw_sku=$SKU&engine=clip&limit=8"; do
+ URLS=$(curl -s --max-time 20 "$BASE/api/$EP" | python3 -c "
+import sys, json
+try: d = json.load(sys.stdin)
+except Exception: sys.exit(0)
+for p in d.get('pairs', d.get('similar', [])) or []:
+ u = p.get('url') or ''
+ if u: print(u)")
+ for U in $URLS; do
+ total=$((total+1))
+ CODE=$(curl -s -o /dev/null -w '%{http_code}' --max-time 15 -L "$STORE$U")
+ if [ "$CODE" != "200" ]; then
+ bad=$((bad+1)); echo "FAIL $CODE $STORE$U (hero $SKU via ${EP%%\?*})"
+ fi
+ done
+ done
+done
+echo "checked $total suggested links · $bad broken"
+[ "$bad" -eq 0 ] && echo "LINK GUARANTEE: PASS" || echo "LINK GUARANTEE: FAIL"
← b2207f5 pairs: trip CLIP circuit-breaker on 5xx (service alive but e
·
back to Dw Pairs Well
·
CLIP-3: hard link guarantee — every suggested SKU must be AC 7fcb7a9 →