[object Object]

← back to Dw Pairs Well

WS-1: set pattern_id image-confirm threshold to 30 (Yakatore+La Corka fully merge, over-merge flat 42); point write.js at title-first map

6476f17104fc4e7fe3d6a7aff7d5e3838c55bf92 · 2026-06-26 12:46:35 -0700 · Steve

Files touched

Diff

commit 6476f17104fc4e7fe3d6a7aff7d5e3838c55bf92
Author: Steve <steve@designerwallcoverings.com>
Date:   Fri Jun 26 12:46:35 2026 -0700

    WS-1: set pattern_id image-confirm threshold to 30 (Yakatore+La Corka fully merge, over-merge flat 42); point write.js at title-first map
---
 tools/pattern-id-titlefirst-final.py | 2 +-
 tools/pattern-id-write.js            | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/tools/pattern-id-titlefirst-final.py b/tools/pattern-id-titlefirst-final.py
index 0a7a6bc..f55acaa 100644
--- a/tools/pattern-id-titlefirst-final.py
+++ b/tools/pattern-id-titlefirst-final.py
@@ -21,7 +21,7 @@ Input on stdin: dw_sku<TAB>vendor<TAB>title<TAB>mfr_sku<TAB>image_url
 import sys, json, re, os
 from collections import defaultdict, Counter
 
-THRESH = int(os.environ.get("HAM_THRESH", "12"))
+THRESH = int(os.environ.get("HAM_THRESH", "30"))  # WS-1 chosen 2026-06-26: lowest TH that fully merges Yakatore(1)+La Corka(1); over-merge flat at 42, under-merge 5682->559
 HERE = os.path.dirname(__file__)
 CI_PATH  = os.path.join(HERE, "ci-hashes.jsonl")
 OLD_MAP  = os.path.join(HERE, "pattern-id-by-dwsku.json")
diff --git a/tools/pattern-id-write.js b/tools/pattern-id-write.js
index 9a92f0d..4819bf5 100644
--- a/tools/pattern-id-write.js
+++ b/tools/pattern-id-write.js
@@ -5,7 +5,8 @@ const STORE='designer-laboratory-sandbox.myshopify.com', API='2024-10';
 const TOK=cp.execSync(`grep -rhoE 'shpat_[a-f0-9]{32}' ~/Projects/secrets-manager/.env ~/Projects/Designer-Wallcoverings/DW-Agents ~/Projects/Designer-Wallcoverings/shopify 2>/dev/null | sort -u`).toString().split('\n').find(t=>t.startsWith('shpat_307')&&t.endsWith('a43b'));
 function gql(q,v){return new Promise((res,rej)=>{const b=JSON.stringify({query:q,variables:v||{}});const r=https.request({host:STORE,path:`/admin/api/${API}/graphql.json`,method:'POST',headers:{'X-Shopify-Access-Token':TOK,'Content-Type':'application/json','Content-Length':Buffer.byteLength(b)}},x=>{let d='';x.on('data',c=>d+=c);x.on('end',()=>{try{res(JSON.parse(d))}catch(e){rej(d.slice(0,400))}})});r.on('error',rej);r.write(b);r.end();});}
 (async()=>{
-  const map=require('./pattern-id-by-dwsku.json');
+  // WS-1 re-backfill 2026-06-26: NEW title-first + color-invariant map (TH=30), NOT the old mfr-first map.
+  const map=require('./pattern-id-titlefirst-by-dwsku.json');
   const lines=Object.values(map).filter(p=>p.sid&&p.pid)
     .map(p=>JSON.stringify({metafields:[{ownerId:p.sid,namespace:'custom',key:'pattern_id',type:'single_line_text_field',value:String(p.pid).slice(0,255)}]}));
   fs.writeFileSync('tools/pattern-id-write.jsonl', lines.join('\n')+'\n');

← 11cab42 WS-1: title-first + color-invariant image-confirm pattern_id  ·  back to Dw Pairs Well  ·  WS-1: server.js AUTH_PID prefers title-first pattern_id map 671721d →