[object Object]

← back to Rentv Slideshow Canary

rentv-slideshow-canary: read-only revert watch for the /consulting/slideshow fix

fa98cf945e978a6f91063ceeafad04c9d3f9ffe0 · 2026-08-07 15:38:54 -0700 · Steve Abrams

Curls the live page every 15m, greps for the /consulting fix marker, alerts on
OK->REVERTED (tk + CNCP). Baseline-aware, single-shot, UNKNOWN preserves baseline.
Closes the silent-revert gap the DTD contrarian flagged (TK-10357).

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

Files touched

Diff

commit fa98cf945e978a6f91063ceeafad04c9d3f9ffe0
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Fri Aug 7 15:38:54 2026 -0700

    rentv-slideshow-canary: read-only revert watch for the /consulting/slideshow fix
    
    Curls the live page every 15m, greps for the /consulting fix marker, alerts on
    OK->REVERTED (tk + CNCP). Baseline-aware, single-shot, UNKNOWN preserves baseline.
    Closes the silent-revert gap the DTD contrarian flagged (TK-10357).
    
    Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---
 .gitignore |  4 ++++
 README.md  | 18 +++++++++++++++++
 check.sh   | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 90 insertions(+)

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..be3fd5c
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,4 @@
+data/*.log
+data/latest.json
+node_modules/
+.DS_Store
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..30a9423
--- /dev/null
+++ b/README.md
@@ -0,0 +1,18 @@
+# rentv-slideshow-canary
+
+READ-ONLY revert watch for the `rentv.agentabrams.com/consulting/slideshow` fix.
+
+The fix (deliverable fetch fallback resolves `/consulting`) is live on prod + committed
+as `d70fac6` in `~/Projects/rentv`. But rsync ships the WORKING TREE, not HEAD (fleet
+gotcha, TK-10295) — if claude-rentv deploys from a separate checkout still holding the
+old `/portal`-only line, the next deploy SILENTLY reverts prod. This canary GETs the live
+page every 15 min and greps for the fix marker `return load('/consulting')`; on an
+OK→REVERTED transition it alerts (tk comment/DM on TK-10357 + best-effort CNCP card).
+
+- Baseline-aware: alerts ONLY on OK→REVERTED. Silent on first run, steady state, recovery,
+  and transient non-200 (UNKNOWN, which preserves the last-known-good baseline).
+- Single-shot: won't re-nag while reverted.
+- Touches nothing but an outbound HTTPS GET — no prod shell, no worktree, no external writes.
+
+Run manually: `./check.sh`  ·  Dry-run alert path: `CANARY_MARKER=nope CANARY_DRYRUN=1 ./check.sh`
+Scheduled by launchd `com.steve.rentv-slideshow-canary` (StartInterval 900s).
diff --git a/check.sh b/check.sh
new file mode 100755
index 0000000..66db098
--- /dev/null
+++ b/check.sh
@@ -0,0 +1,68 @@
+#!/bin/bash
+# rentv-slideshow-canary — READ-ONLY revert watch for the /consulting/slideshow fix.
+#
+# WHY: the fix (fetch fallback resolves the deliverable at /consulting) is live on prod
+# via single-file rsync + committed as d70fac6 in ~/Projects/rentv. But rsync ships the
+# WORKING TREE not HEAD (fleet gotcha, TK-10295) — if claude-rentv deploys from a separate
+# checkout whose working tree still has the old /portal-only line, the next deploy SILENTLY
+# reverts prod and nothing would notice until a human hits the broken URL. This canary GETs
+# the live page and greps for the fix marker; on an OK->REVERTED transition it alerts.
+#
+# Touches nothing but an outbound HTTPS GET. No prod shell, no worktree, no writes anywhere
+# except this dir's data/. Baseline-aware: alerts ONLY on the worsening transition (prev=OK),
+# never on first run, steady state, recovery, or a transient non-200 (UNKNOWN). Single-shot
+# (won't re-nag) so a sustained revert can't spam.
+
+set -uo pipefail
+# launchd runs with a minimal PATH — make tk/curl resolvable.
+export PATH="/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:$PATH"
+# Env overrides (for testing): CANARY_URL, CANARY_MARKER, CANARY_DRYRUN=1 (print, don't alert).
+URL="${CANARY_URL:-https://rentv.agentabrams.com/consulting/slideshow}"
+CRED="admin:DW2024!"
+MARKER="${CANARY_MARKER:-return load('/consulting')}"
+DIR="$(cd "$(dirname "$0")" && pwd)"
+LATEST="$DIR/data/latest.json"
+NOW="$(date -u +%Y-%m-%dT%H:%M:%SZ)"
+
+prev="NONE"
+[ -f "$LATEST" ] && prev="$(grep -o '"status":"[A-Z]*"' "$LATEST" | head -1 | cut -d'"' -f4)"
+[ -z "$prev" ] && prev="NONE"
+
+resp="$(curl -s -m 20 -u "$CRED" -w $'\n%{http_code}' "$URL" 2>/dev/null)"
+code="$(printf '%s' "$resp" | tail -1)"
+html="$(printf '%s' "$resp" | sed '$d')"
+
+if [ "$code" != "200" ]; then
+  status="UNKNOWN"            # transient reachability blip — never alert on this
+elif printf '%s' "$html" | grep -qF "$MARKER"; then
+  status="OK"
+else
+  status="REVERTED"          # page loads but the fix marker is gone = broken deck again
+fi
+
+mkdir -p "$DIR/data"
+# A transient UNKNOWN (unreachable/non-200) must NOT erase the last-known-good baseline,
+# or a real revert right after a blip (UNKNOWN->REVERTED) would be missed. Carry prev forward.
+persist="$status"
+[ "$status" = "UNKNOWN" ] && persist="$prev"
+printf '{"status":"%s","http":"%s","at":"%s","observed":"%s","prev":"%s","url":"%s"}\n' \
+  "$persist" "$code" "$NOW" "$status" "$prev" "$URL" > "$LATEST"
+
+# Worsening transition only: OK -> REVERTED (first run prev=NONE is silent by design).
+if [ "$status" = "REVERTED" ] && [ "$prev" = "OK" ]; then
+  MSG="⚠️ rentv /consulting/slideshow REVERTED at $NOW (http $code): live page lost the fix marker \"$MARKER\" — the slideshow is broken again (falls back to news-homepage scrape). A deploy overwrote the fix. Re-apply commit d70fac6 to the prod deploy source's WORKING TREE. Ref TK-10357."
+  if [ "${CANARY_DRYRUN:-0}" = "1" ]; then
+    echo "[$NOW] DRYRUN: WOULD ALERT (OK->REVERTED). MSG: $MSG"
+    echo "[$NOW] status=$status http=$code prev=$prev"; exit 0
+  fi
+  export TK_AGENT=canary-rentv-slideshow
+  tk comment TK-10357 "$MSG" >/dev/null 2>&1 || true
+  tk dm claude-rentv "$MSG" -t TK-10357 >/dev/null 2>&1 || true
+  # CNCP parking-lot card (best-effort; never fail the canary if CNCP is down)
+  curl -s -m 5 -o /dev/null -X POST http://127.0.0.1:3333/api/parking-lot \
+    -H 'Content-Type: application/json' \
+    -d "$(printf '{"project":"rentv","title":"slideshow fix REVERTED on prod","note":%s}' "$(printf '%s' "$MSG" | sed 's/\\/\\\\/g; s/"/\\"/g' | awk '{printf "\"%s\"", $0}')")" 2>/dev/null || true
+  echo "[$NOW] ALERT sent: OK->REVERTED (http $code)"
+fi
+
+echo "[$NOW] status=$status http=$code prev=$prev"

(oldest)  ·  back to Rentv Slideshow Canary  ·  canary: auto-retire after 48h continuous OK (revert scare re 0491e86 →