[object Object]

← back to Designer Wallcoverings

Thibaut double-roll: automate — importer stamps min/step=2 at birth (add Thibaut to DOUBLE_ROLL_VENDORS) + once-daily dims/copy/length backfill in cadence runner

7decbc762531af2ff4319b8fa92c07f1c240fd4e · 2026-07-08 10:09:37 -0700 · steve@designerwallcoverings.com

Files touched

Diff

commit 7decbc762531af2ff4319b8fa92c07f1c240fd4e
Author: steve@designerwallcoverings.com <steve@designerwallcoverings.com>
Date:   Wed Jul 8 10:09:37 2026 -0700

    Thibaut double-roll: automate — importer stamps min/step=2 at birth (add Thibaut to DOUBLE_ROLL_VENDORS) + once-daily dims/copy/length backfill in cadence runner
---
 shopify/scripts/cadence/cadence-import.js     | 15 ++++++++++-----
 shopify/scripts/cadence/run-cadence-hourly.sh | 13 +++++++++++++
 2 files changed, 23 insertions(+), 5 deletions(-)

diff --git a/shopify/scripts/cadence/cadence-import.js b/shopify/scripts/cadence/cadence-import.js
index 73578fe5..eeda4bb4 100644
--- a/shopify/scripts/cadence/cadence-import.js
+++ b/shopify/scripts/cadence/cadence-import.js
@@ -76,9 +76,14 @@ const DWBR_HOUSE_LINE = flag('--house-line') || process.env.DWBR_HOUSE_LINE_REMA
 // non-roll goods (soldBy not a roll — fabric/yard/panel), murals, and peel&stick/removable. The
 // retroactive backfill of existing drift is a SEPARATE Steve-gated step (see pending-approval memo).
 const DW_DOUBLE_ROLL_MOQ = flag('--double-roll-moq') || process.env.DW_DOUBLE_ROLL_MOQ === '1';
-// Emitted-vendor house lines that are York/Brewster (sold double-roll). DWBR resolves to one of the
-// two house lines via emitVendorFor(); Jeffrey Stevens + Malibu Wallpaper pass through directly.
-const YORK_BREWSTER_ROLL_VENDORS = new Set(['Jeffrey Stevens', 'Malibu Wallpaper', 'LA Walls']);
+// Emitted vendors whose roll goods are SOLD/PACKAGED in double rolls (min/step=2). Two families:
+//   • York/Brewster house lines — DWBR resolves to one via emitVendorFor(); Jeffrey Stevens +
+//     Malibu Wallpaper + LA Walls pass through directly.
+//   • Thibaut (DWTT) — Steve 2026-07-06 double-roll rule (memory: thibaut-double-roll-packaging).
+//     min/step is stamped here at create time; the double-roll DIMENSIONS + packaging copy +
+//     single-roll-length backfill are applied by the once-daily set-dwtt-doubleroll-min-dims.py
+//     step in run-cadence-hourly.sh (needs thibaut_catalog length, which lives outside this path).
+const DOUBLE_ROLL_VENDORS = new Set(['Jeffrey Stevens', 'Malibu Wallpaper', 'LA Walls', 'Thibaut']);
 const TODAY = new Date().toISOString().slice(0, 10);
 // Defensive vendor denylist — even if a vendor is in vendors.js + discount_confirmed, NEVER
 // import these (belt-and-suspenders for sub-brand/registry drift). Today vendors.js already
@@ -628,11 +633,11 @@ function buildInput(vendor, cfg, row, retail, activate) {
   m('custom','cost',row.cost.toFixed(2),ND);                 // REAL cost
   m('custom','price_updated_at',TODAY,'date');                // 30-day refresh audit
   m('global','unit_of_measure',`Priced Per ${soldBy}`,SL);
-  // ---- Double-roll MOQ for York/Brewster roll lines (gated, inert until DW_DOUBLE_ROLL_MOQ) ----
+  // ---- Double-roll MOQ for double-roll lines (gated, inert until DW_DOUBLE_ROLL_MOQ) ----
   // theme DesignerWallcoverings-product.liquid defaults prods_quantity_order_min=1; any roll product
   // MISSING global.v_prods_quantity_order_min falls back to single-roll-orderable. Stamp 2/2 so the
   // theme forces double-roll. ROLL-only (soldBy contains 'roll'); murals + peel&stick are exempt.
-  if (DW_DOUBLE_ROLL_MOQ && YORK_BREWSTER_ROLL_VENDORS.has(vendor) && /roll/i.test(soldBy)
+  if (DW_DOUBLE_ROLL_MOQ && DOUBLE_ROLL_VENDORS.has(vendor) && /roll/i.test(soldBy)
       && !/\bmurals?\b/i.test(title) && !/\bmurals?\b/i.test(productType)
       && !/peel\s*(?:and|&|-)?\s*stick|removable/i.test(title)) {
     m('global','v_prods_quantity_order_min','2',SL);
diff --git a/shopify/scripts/cadence/run-cadence-hourly.sh b/shopify/scripts/cadence/run-cadence-hourly.sh
index 3ec711cc..a3b9afb8 100755
--- a/shopify/scripts/cadence/run-cadence-hourly.sh
+++ b/shopify/scripts/cadence/run-cadence-hourly.sh
@@ -128,6 +128,19 @@ if [ ! -f "$OZ_MARK" ]; then
   else echo "no budget for Osborne daily this slot — retry next slot"; fi
 fi
 
+# ── once-daily: Thibaut double-roll dims + copy + single-roll-length backfill (Steve 2026-07-08) ──
+# The importer (cadence-import.js DOUBLE_ROLL_VENDORS) already stamps min/step=2 on new Thibaut roll
+# SKUs at birth, but the double-roll DIMENSIONS + "packaged in double rolls only" copy need the
+# single-roll length (from thibaut_catalog) + the doubling logic that live only in this python script.
+# Runs once/day (date-stamped marker), idempotent (--live only writes metafields whose value differs;
+# --fill-catalog backfills missing length by dw_sku), non-fatal. Closes the "one-shot batch rots as
+# new inventory arrives" gap that left Rimba Cornflower DWTT-73858 single-roll-only. Reversible: delete.
+DR_MARK="/tmp/dw-dwtt-doubleroll-daily-$(date +%Y%m%d).done"
+if [ ! -f "$DR_MARK" ]; then
+  echo "── once-daily: Thibaut double-roll dims + copy + length backfill ──"
+  python3 "$SHOP/scripts/set-dwtt-doubleroll-min-dims.py" --live --fill-catalog && touch "$DR_MARK" || echo "DWTT double-roll step failed (non-fatal)"
+fi
+
 # ── post-cadence inventory sweep (Steve 2026-06-20: "schedule it to run after each cadence run") ──
 # Safety-net the new-products-inventory-2026 rule: ensure the newest 1000 products have BOTH
 # variants tracked + on_hand=2026. cadence-import --activate already does this for products it

← 1f5f1ce7 auto-save: 2026-07-08T10:05:08 (5 files) — pending-approval/  ·  back to Designer Wallcoverings  ·  PDP color palette: shrink swatches to ~1/3 (84->28px) + link 6dc6439c →