← back to Designer Wallcoverings
enrich: overwrite legacy 'percentage'-schema color_details (QA found hallucinated hexes — burgundy product showed tan); skip only this pass's 'pct' schema
cbd55ff1d7b79385c430700d8fd4e4705ca14279 · 2026-07-07 09:49:34 -0700 · Steve
Files touched
M shopify/scripts/enrich-color-details-local.py
Diff
commit cbd55ff1d7b79385c430700d8fd4e4705ca14279
Author: Steve <steve@designerwallcoverings.com>
Date: Tue Jul 7 09:49:34 2026 -0700
enrich: overwrite legacy 'percentage'-schema color_details (QA found hallucinated hexes — burgundy product showed tan); skip only this pass's 'pct' schema
---
shopify/scripts/enrich-color-details-local.py | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/shopify/scripts/enrich-color-details-local.py b/shopify/scripts/enrich-color-details-local.py
index 897cbb0b..45079a29 100644
--- a/shopify/scripts/enrich-color-details-local.py
+++ b/shopify/scripts/enrich-color-details-local.py
@@ -65,8 +65,16 @@ def iter_published(skip_enriched=True):
n = e['node']
if not n.get('featuredImage'):
continue
+ # Skip ONLY if already enriched by THIS hybrid pass (items keyed 'pct').
+ # Legacy color_details (keyed 'percentage') has inaccurate/hallucinated
+ # hexes and MUST be overwritten, so we do NOT skip it.
if skip_enriched and n.get('cd') and n['cd'].get('value'):
- continue
+ try:
+ first = json.loads(n['cd']['value'])[0]
+ if isinstance(first, dict) and 'pct' in first and 'percentage' not in first:
+ continue
+ except Exception:
+ pass
yield n
if not conn['pageInfo']['hasNextPage']:
break
← b8804ebf enrich: add resumable --all-published batch mode (cursor pag
·
back to Designer Wallcoverings
·
material envelope fix: unwrap 523 + Ultrasuede + live-theme 660a9307 →