[object Object]

← back to Designer Wallcoverings

PR real-textile cadence DRIP (leak-safe): push --limit + drip runner + launchd draft

a43dc36e343f74ec984c6daf356fbdf662a55794 · 2026-07-10 07:33:25 -0700 · Steve

Steve's choice: drip via the leak-safe push (base64 LOCAL images, no wallquest URL) instead
of the URL-based cadence-import (which would leak wallquest.com image src). push-drafts-book.cjs
gains LIMIT (drip N/slot); push-drafts-drip.sh creates <=SLOT_LIMIT/run across both books
(LA then Daisy v2), settlement-clean, idempotent, grep-token. launchd plist drafted to
pending-approval (2x/day, 20/slot ~= 180 over ~5 days) — Steve installs (autonomous live writer).

Files touched

Diff

commit a43dc36e343f74ec984c6daf356fbdf662a55794
Author: Steve <steve@designerwallcoverings.com>
Date:   Fri Jul 10 07:33:25 2026 -0700

    PR real-textile cadence DRIP (leak-safe): push --limit + drip runner + launchd draft
    
    Steve's choice: drip via the leak-safe push (base64 LOCAL images, no wallquest URL) instead
    of the URL-based cadence-import (which would leak wallquest.com image src). push-drafts-book.cjs
    gains LIMIT (drip N/slot); push-drafts-drip.sh creates <=SLOT_LIMIT/run across both books
    (LA then Daisy v2), settlement-clean, idempotent, grep-token. launchd plist drafted to
    pending-approval (2x/day, 20/slot ~= 180 over ~5 days) — Steve installs (autonomous live writer).
---
 scripts/wallquest-refresh/push-drafts-book.cjs |  3 ++-
 scripts/wallquest-refresh/push-drafts-drip.sh  | 27 ++++++++++++++++++++++++++
 2 files changed, 29 insertions(+), 1 deletion(-)

diff --git a/scripts/wallquest-refresh/push-drafts-book.cjs b/scripts/wallquest-refresh/push-drafts-book.cjs
index 975210a5..67262d02 100644
--- a/scripts/wallquest-refresh/push-drafts-book.cjs
+++ b/scripts/wallquest-refresh/push-drafts-book.cjs
@@ -5,6 +5,7 @@
 //   TABLE=lillian_august_catalog VIEW=<dir> node push-drafts-book.cjs --dry-run
 const fs = require('fs'), https = require('https'), { execSync } = require('child_process');
 const DRY = process.argv.includes('--dry-run');
+const LIMIT = parseInt(process.env.LIMIT || '0') || Infinity;
 const STORE = 'designer-laboratory-sandbox.myshopify.com', API = '2024-10';
 const TOKEN = process.env.SHOPIFY_ADMIN_TOKEN;
 const TABLE = process.env.TABLE, VIEW = process.env.VIEW;
@@ -78,7 +79,7 @@ const rows = psql(`SELECT dw_sku, pattern_name, color_name, material, our_price,
       if (u.status >= 200 && u.status < 300 && u.j.product) {
         const pid = u.j.product.id;
         psql(`UPDATE ${TABLE} SET shopify_product_id=${pid} WHERE dw_sku='${r.dw_sku}'`);
-        created++; console.log(`  ✓ ${r.dw_sku} ${title}`);
+        created++; console.log(`  ✓ ${r.dw_sku} ${title}`); if (created >= LIMIT) { console.log(`  [drip limit ${LIMIT} reached]`); break; }
       } else { err++; console.log(`  ✗ ${r.dw_sku} HTTP ${u.status} ${(u.raw||JSON.stringify(u.j)).slice(0,120)}`); }
       await sleep(600);
     } catch (e) { err++; console.log(`  ✗ ${r.dw_sku} ${String(e).slice(0,70)}`); }
diff --git a/scripts/wallquest-refresh/push-drafts-drip.sh b/scripts/wallquest-refresh/push-drafts-drip.sh
new file mode 100755
index 00000000..6fddd57a
--- /dev/null
+++ b/scripts/wallquest-refresh/push-drafts-drip.sh
@@ -0,0 +1,27 @@
+#!/bin/zsh
+# Cadence-style DRIP for the WallQuest real-textile books (Phillipe Romano).
+# Creates up to SLOT_LIMIT DRAFT products per run across both books (LA first, then Daisy v2),
+# via push-drafts-book.cjs — LEAK-SAFE (base64 LOCAL swatch+room, never a wallquest.com URL).
+# Idempotent (skips created), settlement-clean (push skips settlement_flag rows).
+# Token via grep (dodges the .env line-83 source bug). Run manually or from launchd.
+set -u
+BASE=/Users/macstudio3/Projects/Designer-Wallcoverings/scripts/wallquest-refresh
+SLOT_LIMIT=${SLOT_LIMIT:-20}
+LOG=$BASE/data/pr-drip.log; mkdir -p $BASE/data
+export SHOPIFY_ADMIN_TOKEN="$(grep -E '^SHOPIFY_ADMIN_TOKEN=' ~/Projects/secrets-manager/.env | head -1 | sed -E 's/^SHOPIFY_ADMIN_TOKEN=//; s/^["'\'']//; s/["'\'']$//')"
+[ -z "$SHOPIFY_ADMIN_TOKEN" ] && { echo "no token"; exit 1; }
+DRY=${DRY:+--dry-run}
+echo "=== $(date '+%F %T') drip slot (limit $SLOT_LIMIT) ${DRY:-LIVE} ===" >> $LOG
+# Book 1: Lillian August (both new lines, 135)
+out=$(LIMIT=$SLOT_LIMIT TABLE=lillian_august_catalog VIEW=$BASE/lillian-august-onboard-viewer node $BASE/push-drafts-book.cjs $DRY 2>&1)
+echo "$out" | tail -3 >> $LOG
+la_made=$(echo "$out" | grep -oE 'created=[0-9]+' | head -1 | cut -d= -f2); la_made=${la_made:-0}
+rem=$(( SLOT_LIMIT - la_made ))
+# Book 2: Daisy v2 (45 clear) — only if the slot has room left
+if [ "$rem" -gt 0 ]; then
+  out2=$(LIMIT=$rem TABLE=daisy_bennett_v2_catalog VIEW=$BASE/daisy-v2-onboard-viewer node $BASE/push-drafts-book.cjs $DRY 2>&1)
+  echo "$out2" | tail -3 >> $LOG
+fi
+# progress
+psql "postgresql://dw_admin@127.0.0.1:5432/dw_unified" -tAc "SELECT 'PROGRESS staged: LA '||count(*) FILTER (WHERE shopify_product_id IS NOT NULL)||'/135' FROM lillian_august_catalog" >> $LOG
+echo "drip slot done -> $LOG"

← bff72e45 auto-save: 2026-07-10T06:44:22 (6 files) — pending-approval/  ·  back to Designer Wallcoverings  ·  auto-save: 2026-07-10T07:44:35 (7 files) — DW-Programming/Im bec3d768 →