[object Object]

← back to Wallco Ai

refresh_designs_snapshot: PRESERVE room_mockups across rebuilds (DTD verdict B). Rooms are rendered on PROD (PNGs only there) and set in prod's designs.json, but NOT in Mac2 PG — so the every-5min bleed_guard→refresh rebuild was DROPPING them (99%→31% room coverage every cycle, the recurring revert). Now: when DB room_mockups is empty, fall back to the prior snapshot's value (additive; resolveRoomUrl still verifies the PNG). Validated: a full rebuild now keeps 4186/4186 published-with-room (was collapsing to 1315)

ea752a7d1d1273ccaebd1c2c3db94f2c9288bb58 · 2026-06-03 17:07:39 -0700 · Steve Abrams

Files touched

Diff

commit ea752a7d1d1273ccaebd1c2c3db94f2c9288bb58
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Wed Jun 3 17:07:39 2026 -0700

    refresh_designs_snapshot: PRESERVE room_mockups across rebuilds (DTD verdict B). Rooms are rendered on PROD (PNGs only there) and set in prod's designs.json, but NOT in Mac2 PG — so the every-5min bleed_guard→refresh rebuild was DROPPING them (99%→31% room coverage every cycle, the recurring revert). Now: when DB room_mockups is empty, fall back to the prior snapshot's value (additive; resolveRoomUrl still verifies the PNG). Validated: a full rebuild now keeps 4186/4186 published-with-room (was collapsing to 1315)
---
 scripts/refresh_designs_snapshot.py | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/scripts/refresh_designs_snapshot.py b/scripts/refresh_designs_snapshot.py
index 22b05a6..ed3f7e5 100644
--- a/scripts/refresh_designs_snapshot.py
+++ b/scripts/refresh_designs_snapshot.py
@@ -250,6 +250,25 @@ def extract_edges_tag(notes):
     return f"{m.group(1)}: {m.group(2).strip()}"
 
 out = []
+# Preserve room_mockups across rebuilds (2026-06-03). Rooms rendered on PROD set
+# room_mockups in prod's designs.json but NOT in Mac2 PG (the room PNGs live only
+# on prod, where the backfill runs). A DB-sourced rebuild here would DROP them on
+# every cycle (bleed_guard refreshes every ~5min), blanking thousands of live PDP
+# "See it in a room". Fall back to the PRIOR snapshot's room_mockups when the DB
+# value is empty — additive: never removes a DB-present room, and server.js
+# resolveRoomUrl still verifies the PNG exists on disk before rendering, so a
+# stale pointer can't show a broken image.
+_prior_rooms = {}
+try:
+    with open(OUT) as _pf:
+        _pd = json.load(_pf)
+    _plist = _pd if isinstance(_pd, list) else _pd.get('designs', [])
+    for _x in _plist:
+        _rm = _x.get('room_mockups') or []
+        if _rm:
+            _prior_rooms[_x.get('id')] = _rm
+except Exception:
+    _prior_rooms = {}
 for r in rows:
     h, l, s = hex_to_hls(r['dominant_hex'] or '')
     filename = os.path.basename(r['local_path'] or '')
@@ -314,7 +333,7 @@ for r in rows:
             else sorted({ (x.get('room_type') if isinstance(x, dict) else x) for x in (r.get('room_mockups') or []) if x })
             if isinstance(r.get('room_mockups'), list)
             else []
-        ),
+        ) or _prior_rooms.get(r['id'], []),   # preserve prod-set rooms the DB lacks
         # Extracted edges-agent flag (NULL when clean). Drives the admin red-outline
         # treatment + the per-design "why this is not active" tooltip. Format:
         #   "EDGES_FAIL: lens=top:78.6,bottom:78.6 max=78.6 grid=mids_only ts=..."

← 1e91a5a YOLO ledger: T4 grid-search color-aware  ·  back to Wallco Ai  ·  YOLO ledger: T5 true root-cause of room-revert (Mac2 PG/refr 306171e →