[object Object]

← back to Designerwallcoverings

sanderson TK-11046: verify canary gains orphan detector (golive-done but not ACTIVE)

ddeda43fdd92fe5cd22ae4e90dd20999759882ae · 2026-09-02 10:10:11 -0700 · Steve Abrams

Catches the silent-stuck class that hid 4 CLEAR products in DRAFT — a SKU marked
done in golive-done.jsonl but status<>ACTIVE on the store (go-live won't retry,
create won't recreate). Read-only psql against the dw_unified mirror, graceful
skip if unreachable; adds orphans + orphan_skus to out/latest.json. Currently
flags DWXH-255002/255085/255118/255121 (remediation drafted to pending-approval).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

Files touched

Diff

commit ddeda43fdd92fe5cd22ae4e90dd20999759882ae
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Wed Sep 2 10:10:11 2026 -0700

    sanderson TK-11046: verify canary gains orphan detector (golive-done but not ACTIVE)
    
    Catches the silent-stuck class that hid 4 CLEAR products in DRAFT — a SKU marked
    done in golive-done.jsonl but status<>ACTIVE on the store (go-live won't retry,
    create won't recreate). Read-only psql against the dw_unified mirror, graceful
    skip if unreachable; adds orphans + orphan_skus to out/latest.json. Currently
    flags DWXH-255002/255085/255118/255121 (remediation drafted to pending-approval).
    
    Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---
 scripts/sanderson-onboard/verify.sh | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/scripts/sanderson-onboard/verify.sh b/scripts/sanderson-onboard/verify.sh
index ad53305..15ed144 100755
--- a/scripts/sanderson-onboard/verify.sh
+++ b/scripts/sanderson-onboard/verify.sh
@@ -54,6 +54,25 @@ if [ "${TO_CREATE:-0}" -gt 0 ] 2>/dev/null && [ "$CREATED" = "$PREV_CREATED" ] &
   add "STALLED: created unchanged at $CREATED for ${ELAPSED_H}h (since $PREV_TS) while to-create=$TO_CREATE"; worse WARN
 fi
 
+# 4b. orphan detector — a SKU marked done in golive-done.jsonl but NOT ACTIVE on the
+#     store is silently stuck (go-live won't retry, create won't recreate). This is the
+#     class that hid 4 CLEAR products in DRAFT (TK-11046). Read-only; skips if DB down.
+ORPHANS=0; ORPHAN_SKUS=""
+PSQL="$(command -v psql || echo /opt/homebrew/opt/postgresql@14/bin/psql)"
+if [ -x "$PSQL" ] || command -v psql >/dev/null 2>&1; then
+  NONACTIVE="$("$PSQL" -h /tmp -d dw_unified -tAc "SELECT sku FROM shopify_products WHERE vendor='Sanderson' AND status<>'ACTIVE'" 2>/dev/null)"
+  if [ $? -eq 0 ]; then
+    for s in $NONACTIVE; do
+      if grep -q "\"$s\"" out/golive-done.jsonl 2>/dev/null || grep -q "$s" out/golive-done.jsonl 2>/dev/null; then
+        ORPHANS=$((ORPHANS+1)); ORPHAN_SKUS="${ORPHAN_SKUS:+$ORPHAN_SKUS,}$s"
+      fi
+    done
+    if [ "$ORPHANS" -gt 0 ]; then add "ORPHANS=$ORPHANS marked golive-done but DRAFT: $ORPHAN_SKUS"; worse WARN; fi
+  else
+    add "orphan-check skipped (mirror unreachable)"
+  fi
+fi
+
 # 5. completion — all created + all CLEAR live
 DONE=0
 if [ "${TO_CREATE:-1}" = "0" ] && [ "$CREATED" -ge 506 ] && [ "$GOLIVE" -ge "$CLEARC" ]; then
@@ -65,7 +84,7 @@ SUMMARY="[$verdict] created=$CREATED/506 to-create=${TO_CREATE} golive=$GOLIVE c
 
 # heartbeat (fleet-health-rollup reads verdict+status)
 cat > "$LATEST" <<JSON
-{"skill":"sanderson-verify","ticket":"TK-11046","ts":"$NOW","verdict":"$verdict","status":"$STATUS","created":$CREATED,"to_create":${TO_CREATE:-null},"golive_done":$GOLIVE,"clear":$CLEARC,"live_variants":${LIVE_VARS:-null},"kill_switch":$KILL,"complete":$DONE,"summary":"$SUMMARY"}
+{"skill":"sanderson-verify","ticket":"TK-11046","ts":"$NOW","verdict":"$verdict","status":"$STATUS","created":$CREATED,"to_create":${TO_CREATE:-null},"golive_done":$GOLIVE,"clear":$CLEARC,"live_variants":${LIVE_VARS:-null},"kill_switch":$KILL,"orphans":$ORPHANS,"orphan_skus":"$ORPHAN_SKUS","complete":$DONE,"summary":"$SUMMARY"}
 JSON
 cat > "$STATE" <<JSON
 {"ts":"$NOW","created":$CREATED,"to_create":${TO_CREATE:-null},"verdict":"$verdict"}

← e27a790 auto-data-snapshot: 2026-09-02T10:09:29 (3 data files) — scr  ·  back to Designerwallcoverings  ·  auto-data-snapshot: 2026-09-02T10:48:45 (4 data files) — scr 9bce15d →