[object Object]

← back to Designer Wallcoverings

Gated Shopify room push + judge label-normalize fix

bb62c10f69875d4696ac4a611f75eebf4eaa76ae · 2026-07-07 09:04:37 -0700 · Steve

- push_rooms_shopify.cjs: upload chosen local room as 2nd product image, idempotent
  (alt marker), engine derived from filename. --dry-run validates (67/67, 0 missing).
  Live push GATED — Steve runs via ! (never agent).
- judge_rooms.py: normalize maps 'image N (engine)' labels -> engine name

Completes end-to-end: render -> judge -> pick -> apply_winners -> push (gated).

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

Files touched

Diff

commit bb62c10f69875d4696ac4a611f75eebf4eaa76ae
Author: Steve <steve@designerwallcoverings.com>
Date:   Tue Jul 7 09:04:37 2026 -0700

    Gated Shopify room push + judge label-normalize fix
    
    - push_rooms_shopify.cjs: upload chosen local room as 2nd product image, idempotent
      (alt marker), engine derived from filename. --dry-run validates (67/67, 0 missing).
      Live push GATED — Steve runs via ! (never agent).
    - judge_rooms.py: normalize maps 'image N (engine)' labels -> engine name
    
    Completes end-to-end: render -> judge -> pick -> apply_winners -> push (gated).
    
    Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---
 .../carl-robinson-viewer/room-engines/judge_rooms.py                | 5 ++++-
 .../carl-robinson-viewer/room-engines/push_rooms_shopify.cjs        | 6 ++++--
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/scripts/wallquest-refresh/carl-robinson-viewer/room-engines/judge_rooms.py b/scripts/wallquest-refresh/carl-robinson-viewer/room-engines/judge_rooms.py
index e92cd930..998986e5 100644
--- a/scripts/wallquest-refresh/carl-robinson-viewer/room-engines/judge_rooms.py
+++ b/scripts/wallquest-refresh/carl-robinson-viewer/room-engines/judge_rooms.py
@@ -37,8 +37,11 @@ def normalize(j, cand):
     names = {eng for eng, _ in cand}
     def fix(x):
         if not isinstance(x, str): return x
-        s = x.strip().lower().replace('image', '').strip()
         if x in names: return x
+        low = x.lower()
+        for e in names:                       # engine name appears anywhere (e.g. "image 2 (gemini)")
+            if e in low: return e
+        s = low.replace('image', '').split('(')[0].strip()   # leading "image N"
         return pos.get(s, x)
     j['winner'] = fix(j.get('winner'))
     j['ranking'] = [fix(r) for r in j.get('ranking', [])]
diff --git a/scripts/wallquest-refresh/carl-robinson-viewer/room-engines/push_rooms_shopify.cjs b/scripts/wallquest-refresh/carl-robinson-viewer/room-engines/push_rooms_shopify.cjs
index 002ffa55..f5d60508 100644
--- a/scripts/wallquest-refresh/carl-robinson-viewer/room-engines/push_rooms_shopify.cjs
+++ b/scripts/wallquest-refresh/carl-robinson-viewer/room-engines/push_rooms_shopify.cjs
@@ -24,9 +24,11 @@ function rest(method, path, body) {
     if (data) req.write(data); req.end();
   });
 }
-const q = "SELECT dw_sku, shopify_product_id, COALESCE(chosen_room_engine,'?'), COALESCE((room_setting_images::jsonb)->>0,'') FROM carl_robinson_catalog WHERE shopify_product_id IS NOT NULL ORDER BY dw_sku";
+// engine derived from the chosen room's filename (decoupled from apply_winners schema)
+const engOf = room => room.includes('-kontext') ? 'kontext' : room.includes('-sdxl') ? 'sdxl' : 'gemini';
+const q = "SELECT dw_sku, shopify_product_id, COALESCE((room_setting_images::jsonb)->>0,'') FROM carl_robinson_catalog WHERE shopify_product_id IS NOT NULL ORDER BY dw_sku";
 const rows = execSync(`psql "${CONN}" -tAc "${q}"`, { encoding: 'utf8' }).trim().split('\n').filter(Boolean)
-  .map(l => { const [sku, pid, eng, room] = l.split('|'); return { sku, pid, eng, room }; });
+  .map(l => { const [sku, pid, room] = l.split('|'); return { sku, pid, room, eng: engOf(room || '') }; });
 
 (async () => {
   let ok = 0, skip = 0, miss = 0, already = 0;

← 7ffe7cc1 auto-save: 2026-07-07T08:59:35 (6 files) — pending-approval/  ·  back to Designer Wallcoverings  ·  PDP: add color-palette (big swatch cards + %) between produc a2719adf →