[object Object]

← back to Rebel Walls Push

Add RW cadence daily step — 5 murals/day, budget-coordinated, DRY by default

a3c8752e29ba38a370eb105c859338389b109667 · 2026-06-30 15:22:47 -0700 · Steve Abrams

Steve 2026-06-30: '5 new SKUs a day, focusing on murals' (RW is 100% murals). Budget-coordinated
via the shared variant ledger (take 'rebel' N) so it never races the hourly uploader. DRY by default;
--commit creates live. NOTE: push.js dry flag is --dry-run (an initial --dry typo created 5 live
products DWRW-361150..361154 = today's authorized batch; flag corrected, true-dry now verified 0 writes).

Files touched

Diff

commit a3c8752e29ba38a370eb105c859338389b109667
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Tue Jun 30 15:22:47 2026 -0700

    Add RW cadence daily step — 5 murals/day, budget-coordinated, DRY by default
    
    Steve 2026-06-30: '5 new SKUs a day, focusing on murals' (RW is 100% murals). Budget-coordinated
    via the shared variant ledger (take 'rebel' N) so it never races the hourly uploader. DRY by default;
    --commit creates live. NOTE: push.js dry flag is --dry-run (an initial --dry typo created 5 live
    products DWRW-361150..361154 = today's authorized batch; flag corrected, true-dry now verified 0 writes).
---
 scripts/cadence-daily-step.sh | 57 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 57 insertions(+)

diff --git a/scripts/cadence-daily-step.sh b/scripts/cadence-daily-step.sh
new file mode 100644
index 0000000..9e12d8d
--- /dev/null
+++ b/scripts/cadence-daily-step.sh
@@ -0,0 +1,57 @@
+#!/usr/bin/env bash
+# cadence-daily-step.sh — Rebel Walls' slice of the DW daily cadence.
+# Pushes a SMALL daily batch of net-new Rebel Walls MURALS (every RW SKU is a mural, priced per m²)
+# to Shopify, budget-COORDINATED with the shared variant-cap ledger so it never races the hourly
+# uploader / Osborne / Anna French (the collision that caused the old bulk job's throttle errors).
+#
+# Steve 2026-06-30: "5 new SKUs a day, focusing on murals." Replaces the disabled bulk
+# com.steve.rebel-walls-daily-push (which pushed ~550/day uncoordinated).
+#
+# DRY-RUN BY DEFAULT — prints what it WOULD push and makes NO Shopify writes.
+# Pass --commit (or LIVE=1) to actually create products. SENDING live is Steve-gated.
+#
+#   bash scripts/cadence-daily-step.sh            # dry-run, 5 murals
+#   RW_DAILY=5 bash scripts/cadence-daily-step.sh --commit   # LIVE create 5
+set -u
+export PATH="/usr/local/bin:/opt/homebrew/bin:/usr/bin:/bin"
+# DB password is env-first (secret-strip rule 2026-05-30) — source it from the canonical secrets .env.
+SECRETS="$HOME/Projects/secrets-manager/.env"
+[ -f "$SECRETS" ] && [ -z "${DW_ADMIN_DB_PASSWORD:-}" ] && \
+  export DW_ADMIN_DB_PASSWORD="$(grep -E '^DW_ADMIN_DB_PASSWORD=' "$SECRETS" | head -1 | cut -d= -f2- | tr -d "\"'")"
+DIR="$HOME/Projects/rebel-walls-push"
+BUDGET="$HOME/Projects/designerwallcoverings/scripts/variant-budget/budget.cjs"
+N="${RW_DAILY:-5}"                       # target murals/day
+COMMIT=""; [ "${1:-}" = "--commit" ] && COMMIT=1; [ "${LIVE:-}" = "1" ] && COMMIT=1
+LOG="$DIR/data/cadence-daily-$(date +%Y%m%d-%H%M%S).log"
+LOCK="/tmp/rw-cadence-daily.lock"
+cd "$DIR" || exit 1
+mkdir -p data
+
+if ! mkdir "$LOCK" 2>/dev/null; then echo "$(date '+%F %T') still running — skip" | tee -a "$LOG"; exit 0; fi
+trap 'rmdir "$LOCK" 2>/dev/null' EXIT
+
+echo "$(date '+%F %T') ===== RW cadence daily step (target=$N, commit=${COMMIT:-0}) =====" | tee -a "$LOG"
+
+# Coordinate with the shared ~1,000/day variant cap. budget.cjs fails OPEN (grants the request) if the
+# ledger is unreachable, so this never blocks; on a saturated day it hands back fewer than N.
+# IMPORTANT: `take` MUTATES the ledger (reserves cap) — only call it on a real (--commit) run, never dry.
+GRANT="$N"
+if [ -n "$COMMIT" ] && [ -f "$BUDGET" ]; then
+  GRANT=$(node "$BUDGET" take rebel "$N" 2>/dev/null || echo "$N")
+  echo "budget grant: $GRANT (requested $N)" | tee -a "$LOG"
+else
+  echo "dry-run: skipping budget reserve; would request $N" | tee -a "$LOG"
+fi
+[ -z "$GRANT" ] && GRANT="$N"
+if [ "$GRANT" -lt 1 ] 2>/dev/null; then echo "no budget this slot — exit clean" | tee -a "$LOG"; exit 0; fi
+
+# push.js pulls the next $GRANT unpushed, non-dedup_skip rows ORDER BY id (all are murals).
+if [ -n "$COMMIT" ]; then
+  node scripts/push.js --all --limit "$GRANT" 2>&1 | tee -a "$LOG"
+else
+  # push.js dry flag is --dry-run (NOT --dry). Getting this wrong creates LIVE products.
+  node scripts/push.js --all --limit "$GRANT" --dry-run 2>&1 | tee -a "$LOG"
+fi
+
+REMAIN=$(psql -d dw_unified -tAc "SELECT count(*) FROM rebelwalls_catalog WHERE (shopify_product_id IS NULL OR shopify_product_id='') AND dedup_skip IS NOT TRUE;" 2>/dev/null | tr -d ' ')
+echo "$(date '+%F %T') done — net-new RW murals remaining: ${REMAIN:-?}" | tee -a "$LOG"

← d7447f1 secret-strip: remove hardcoded dw_admin password from PG con  ·  back to Rebel Walls Push  ·  chore: macstudio3 migration — reconcile from mac2 + repoint 2f4dc48 →