[object Object]

← back to Gmc Titlefix

TK-11844: authoritative Shopify->GMC identity join for Phillip Jeffries showroom-only offers

e92df0cd935b64c020ec829e2d996e232be596cf · 2026-09-16 15:48:54 -0700 · Steve

READ-ONLY. Complete 61,992-offer GMC walk joined by product/variant identity (both
offerId forms) against vendor='Phillip Jeffries' (4147 products/4278 variants). True
count = 27 live GMC offers (16 SERVING, 11 disapproved), not the TK-11449 text-match
count of 7 — the text matcher missed 20 pattern-named PJ products. 0 false positives.

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

Files touched

Diff

commit e92df0cd935b64c020ec829e2d996e232be596cf
Author: Steve <steve@designerwallcoverings.com>
Date:   Wed Sep 16 15:48:54 2026 -0700

    TK-11844: authoritative Shopify->GMC identity join for Phillip Jeffries showroom-only offers
    
    READ-ONLY. Complete 61,992-offer GMC walk joined by product/variant identity (both
    offerId forms) against vendor='Phillip Jeffries' (4147 products/4278 variants). True
    count = 27 live GMC offers (16 SERVING, 11 disapproved), not the TK-11449 text-match
    count of 7 — the text matcher missed 20 pattern-named PJ products. 0 false positives.
    
    Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---
 data/tk11844-bare-resolved.json        |  86 +++++++
 data/tk11844-remediation-products.json | 409 +++++++++++++++++++++++++++++++++
 tk11844-pj-authoritative-join.mjs      | 128 +++++++++++
 3 files changed, 623 insertions(+)

diff --git a/data/tk11844-bare-resolved.json b/data/tk11844-bare-resolved.json
new file mode 100644
index 0000000..739b5fb
--- /dev/null
+++ b/data/tk11844-bare-resolved.json
@@ -0,0 +1,86 @@
+[
+ {
+  "offerId": "44455859126323",
+  "price": 5212.67,
+  "serving": true,
+  "status": "SERVING",
+  "productId": "7375889825843",
+  "handle": "dwjp-13182-philip-jeffries-sakka-white-on-marshmallow-manila-hemp-11-panel-height-mural-repeat-264-670-6-cm-h-9022",
+  "product_status": "ACTIVE",
+  "vendor": "Phillip Jeffries",
+  "variant_title": "Single Roll",
+  "product_title": "Sakka - White on Marshmallow Manila Hemp\n11' Panel Height - Mural Repeat: 264\" (670.6 cm) H | Phillip Jeffries"
+ },
+ {
+  "offerId": "44455856701491",
+  "price": 5212.67,
+  "serving": true,
+  "status": "SERVING",
+  "productId": "7375889137715",
+  "handle": "dwjp-13178-philip-jeffries-haiku-red-rejuvination-on-venetian-glass-glam-grass-11-panel-height-mural-repeat-264-670-6-cm-h-9020",
+  "product_status": "ACTIVE",
+  "vendor": "Phillip Jeffries",
+  "variant_title": "Single Roll",
+  "product_title": "Haiku - Red Rejuvination on Venetian Glass Glam Grass 11' Panel Height - Mural Repeat: 264\" (670.6 cm) H | Phillip Jeffries"
+ },
+ {
+  "offerId": "42511636201523",
+  "price": 7,
+  "serving": false,
+  "status": "disapproved",
+  "productId": "7375633416243",
+  "handle": "dwjp-10209-philip-jeffries-common-threads-heathered-brown-1080",
+  "product_status": "ACTIVE",
+  "vendor": "Phillip Jeffries",
+  "variant_title": "Sample",
+  "product_title": "Common Threads - Heathered Brown"
+ },
+ {
+  "offerId": "42511667757107",
+  "price": 7,
+  "serving": false,
+  "status": "disapproved",
+  "productId": "7375654158387",
+  "handle": "dwjp-10624-philip-jeffries-sunset-silk-golden-sun-2314",
+  "product_status": "ACTIVE",
+  "vendor": "Phillip Jeffries",
+  "variant_title": "Sample",
+  "product_title": "Sunset Silk - Golden Sun"
+ },
+ {
+  "offerId": "42511905947699",
+  "price": 7,
+  "serving": false,
+  "status": "disapproved",
+  "productId": "7375739027507",
+  "handle": "dwjp-12174-philip-jeffries-flight-clouds-sunrise-on-cotton-canvas-linen-11-panel-height-mural-repeat-198-502-92-cm-h-7065",
+  "product_status": "ACTIVE",
+  "vendor": "Phillip Jeffries",
+  "variant_title": "Sample",
+  "product_title": "Flight (Clouds) - Sunrise on Cotton Canvas Linen\n11' Panel Height - Mural Repeat: 198\" (502.92 cm.) H"
+ },
+ {
+  "offerId": "42511624405043",
+  "price": 7,
+  "serving": false,
+  "status": "disapproved",
+  "productId": "7375630401587",
+  "handle": "dwjp-10174-philip-jeffries-reflections-beige-brilliance-1003",
+  "product_status": "ACTIVE",
+  "vendor": "Phillip Jeffries",
+  "variant_title": "Sample",
+  "product_title": "Reflections - Beige Brilliance"
+ },
+ {
+  "offerId": "42511885860915",
+  "price": 4.25,
+  "serving": false,
+  "status": "disapproved",
+  "productId": "7375727231027",
+  "handle": "dwjp-11930-philip-jeffries-saint-germain-hemp-ii-silver-on-white-5980",
+  "product_status": "ACTIVE",
+  "vendor": "Phillip Jeffries",
+  "variant_title": "Sample",
+  "product_title": "Saint Germain Hemp II - Silver On White"
+ }
+]
\ No newline at end of file
diff --git a/data/tk11844-remediation-products.json b/data/tk11844-remediation-products.json
new file mode 100644
index 0000000..34461e3
--- /dev/null
+++ b/data/tk11844-remediation-products.json
@@ -0,0 +1,409 @@
+{
+ "ticket": "TK-11844",
+ "generated": "2026-09-16T22:48:30.175Z",
+ "distinct_products": 27,
+ "serving_products": 16,
+ "total_offers": 27,
+ "products": [
+  {
+   "productId": "7375889825843",
+   "offers": [
+    {
+     "offerId": "44455859126323",
+     "form": "bare",
+     "serving": true,
+     "status": "SERVING",
+     "price": 5212.67,
+     "issues": []
+    }
+   ],
+   "serving": true
+  },
+  {
+   "productId": "7375889137715",
+   "offers": [
+    {
+     "offerId": "44455856701491",
+     "form": "bare",
+     "serving": true,
+     "status": "SERVING",
+     "price": 5212.67,
+     "issues": []
+    }
+   ],
+   "serving": true
+  },
+  {
+   "productId": "7375889465395",
+   "offers": [
+    {
+     "offerId": "shopify_US_7375889465395_42512083681331",
+     "form": "prefixed",
+     "serving": true,
+     "status": "SERVING",
+     "price": 5212.67,
+     "issues": []
+    }
+   ],
+   "serving": true
+  },
+  {
+   "productId": "7375725035571",
+   "offers": [
+    {
+     "offerId": "shopify_US_7375725035571_42511883108403",
+     "form": "prefixed",
+     "serving": true,
+     "status": "SERVING",
+     "price": 369.23,
+     "issues": []
+    }
+   ],
+   "serving": true
+  },
+  {
+   "productId": "7375725330483",
+   "offers": [
+    {
+     "offerId": "shopify_US_7375725330483_42511883239475",
+     "form": "prefixed",
+     "serving": true,
+     "status": "SERVING",
+     "price": 369.23,
+     "issues": []
+    }
+   ],
+   "serving": true
+  },
+  {
+   "productId": "7375754395699",
+   "offers": [
+    {
+     "offerId": "shopify_US_7375754395699_42511926263859",
+     "form": "prefixed",
+     "serving": true,
+     "status": "SERVING",
+     "price": 358.37,
+     "issues": []
+    }
+   ],
+   "serving": true
+  },
+  {
+   "productId": "7375685222451",
+   "offers": [
+    {
+     "offerId": "shopify_US_7375685222451_42511777890355",
+     "form": "prefixed",
+     "serving": true,
+     "status": "SERVING",
+     "price": 358.37,
+     "issues": []
+    }
+   ],
+   "serving": true
+  },
+  {
+   "productId": "7375650684979",
+   "offers": [
+    {
+     "offerId": "shopify_US_7375650684979_42511663824947",
+     "form": "prefixed",
+     "serving": true,
+     "status": "SERVING",
+     "price": 358.37,
+     "issues": []
+    }
+   ],
+   "serving": true
+  },
+  {
+   "productId": "7375650619443",
+   "offers": [
+    {
+     "offerId": "shopify_US_7375650619443_42511663726643",
+     "form": "prefixed",
+     "serving": true,
+     "status": "SERVING",
+     "price": 358.37,
+     "issues": []
+    }
+   ],
+   "serving": true
+  },
+  {
+   "productId": "7375681912883",
+   "offers": [
+    {
+     "offerId": "shopify_US_7375681912883_42511770517555",
+     "form": "prefixed",
+     "serving": true,
+     "status": "SERVING",
+     "price": 318.55,
+     "issues": []
+    }
+   ],
+   "serving": true
+  },
+  {
+   "productId": "7375682502707",
+   "offers": [
+    {
+     "offerId": "shopify_US_7375682502707_42511771828275",
+     "form": "prefixed",
+     "serving": true,
+     "status": "SERVING",
+     "price": 318.55,
+     "issues": []
+    }
+   ],
+   "serving": true
+  },
+  {
+   "productId": "7375662710835",
+   "offers": [
+    {
+     "offerId": "shopify_US_7375662710835_42511679062067",
+     "form": "prefixed",
+     "serving": true,
+     "status": "SERVING",
+     "price": 318.55,
+     "issues": []
+    }
+   ],
+   "serving": true
+  },
+  {
+   "productId": "7375641149491",
+   "offers": [
+    {
+     "offerId": "shopify_US_7375641149491_42511652847667",
+     "form": "prefixed",
+     "serving": true,
+     "status": "SERVING",
+     "price": 318.55,
+     "issues": []
+    }
+   ],
+   "serving": true
+  },
+  {
+   "productId": "7375649931315",
+   "offers": [
+    {
+     "offerId": "shopify_US_7375649931315_42511663038515",
+     "form": "prefixed",
+     "serving": true,
+     "status": "SERVING",
+     "price": 318.55,
+     "issues": []
+    }
+   ],
+   "serving": true
+  },
+  {
+   "productId": "7375724544051",
+   "offers": [
+    {
+     "offerId": "shopify_US_7375724544051_42511883010099",
+     "form": "prefixed",
+     "serving": true,
+     "status": "SERVING",
+     "price": 278.73,
+     "issues": []
+    }
+   ],
+   "serving": true
+  },
+  {
+   "productId": "7375699050547",
+   "offers": [
+    {
+     "offerId": "shopify_US_7375699050547_42511796437043",
+     "form": "prefixed",
+     "serving": true,
+     "status": "SERVING",
+     "price": 144.8,
+     "issues": []
+    }
+   ],
+   "serving": true
+  },
+  {
+   "productId": "7375663071283",
+   "offers": [
+    {
+     "offerId": "shopify_US_7375663071283_42511680077875",
+     "form": "prefixed",
+     "serving": false,
+     "status": "disapproved",
+     "price": 358.37,
+     "issues": [
+      "DISAPPROVED|price_mismatch"
+     ]
+    }
+   ],
+   "serving": false
+  },
+  {
+   "productId": "7375774941235",
+   "offers": [
+    {
+     "offerId": "shopify_US_7375774941235_42511949398067",
+     "form": "prefixed",
+     "serving": false,
+     "status": "disapproved",
+     "price": 318.55,
+     "issues": [
+      "DISAPPROVED|price_mismatch"
+     ]
+    }
+   ],
+   "serving": false
+  },
+  {
+   "productId": "7375678636083",
+   "offers": [
+    {
+     "offerId": "shopify_US_7375678636083_42511767699507",
+     "form": "prefixed",
+     "serving": false,
+     "status": "disapproved",
+     "price": 318.55,
+     "issues": [
+      "DISAPPROVED|price_mismatch"
+     ]
+    }
+   ],
+   "serving": false
+  },
+  {
+   "productId": "7375731589171",
+   "offers": [
+    {
+     "offerId": "shopify_US_7375731589171_42511891922995",
+     "form": "prefixed",
+     "serving": false,
+     "status": "disapproved",
+     "price": 171.95,
+     "issues": [
+      "DISAPPROVED|price_mismatch"
+     ]
+    }
+   ],
+   "serving": false
+  },
+  {
+   "productId": "7375731556403",
+   "offers": [
+    {
+     "offerId": "shopify_US_7375731556403_42511891890227",
+     "form": "prefixed",
+     "serving": false,
+     "status": "disapproved",
+     "price": 171.95,
+     "issues": [
+      "DISAPPROVED|price_mismatch"
+     ]
+    }
+   ],
+   "serving": false
+  },
+  {
+   "productId": "7857804935219",
+   "offers": [
+    {
+     "offerId": "shopify_US_7857804935219_44425863299123",
+     "form": "prefixed",
+     "serving": false,
+     "status": "disapproved",
+     "price": 94,
+     "issues": [
+      "DISAPPROVED|item_missing_required_attribute"
+     ]
+    }
+   ],
+   "serving": false
+  },
+  {
+   "productId": "7375633416243",
+   "offers": [
+    {
+     "offerId": "42511636201523",
+     "form": "bare",
+     "serving": false,
+     "status": "disapproved",
+     "price": 7,
+     "issues": [
+      "DISAPPROVED|item_missing_required_attribute"
+     ]
+    }
+   ],
+   "serving": false
+  },
+  {
+   "productId": "7375654158387",
+   "offers": [
+    {
+     "offerId": "42511667757107",
+     "form": "bare",
+     "serving": false,
+     "status": "disapproved",
+     "price": 7,
+     "issues": [
+      "DISAPPROVED|item_missing_required_attribute"
+     ]
+    }
+   ],
+   "serving": false
+  },
+  {
+   "productId": "7375739027507",
+   "offers": [
+    {
+     "offerId": "42511905947699",
+     "form": "bare",
+     "serving": false,
+     "status": "disapproved",
+     "price": 7,
+     "issues": [
+      "DISAPPROVED|item_missing_required_attribute"
+     ]
+    }
+   ],
+   "serving": false
+  },
+  {
+   "productId": "7375630401587",
+   "offers": [
+    {
+     "offerId": "42511624405043",
+     "form": "bare",
+     "serving": false,
+     "status": "disapproved",
+     "price": 7,
+     "issues": [
+      "DISAPPROVED|item_missing_required_attribute"
+     ]
+    }
+   ],
+   "serving": false
+  },
+  {
+   "productId": "7375727231027",
+   "offers": [
+    {
+     "offerId": "42511885860915",
+     "form": "bare",
+     "serving": false,
+     "status": "disapproved",
+     "price": 4.25,
+     "issues": [
+      "DISAPPROVED|tobacco_policy_violation"
+     ]
+    }
+   ],
+   "serving": false
+  }
+ ]
+}
\ No newline at end of file
diff --git a/tk11844-pj-authoritative-join.mjs b/tk11844-pj-authoritative-join.mjs
new file mode 100644
index 0000000..5798486
--- /dev/null
+++ b/tk11844-pj-authoritative-join.mjs
@@ -0,0 +1,128 @@
+// TK-11844 — READ-ONLY, $0. The AUTHORITATIVE Shopify -> GMC join that claude-run-11449
+// explicitly left undone. Its text matcher (/phillip jeffries/i on brand|title|productTypes)
+// self-proved it under-counts: Saint Germain Hemp II is a PJ product whose title carries no
+// vendor name and did NOT match. So "8" was a stated LOWER BOUND.
+//
+// This joins by IDENTITY, not text:
+//   1. Shopify Admin API: vendor='Phillip Jeffries' -> {productId, variantId} sets (authoritative,
+//      NOT the single-variant-blind dw_unified mirror). Captures status+handle+title for the memo.
+//   2. A COMPLETE live GMC products.list walk (refuse to report on a truncated walk).
+//   3. For each live offer, extract its Shopify ids from BOTH offerId forms that appear live:
+//        - bare numeric            = <variantId>
+//        - shopify_<feed>_<pid>_<vid>
+//      An offer belongs to PJ iff its productId OR variantId is in the PJ id sets.
+//   4. Flag each PJ offer with: serving/disapproved, offer-id form, whether the TEXT matcher
+//      would have caught it (to quantify the under-count), and its Shopify product status.
+//
+// Emits data/tk11844-pj-authoritative-join.json. Writes NOTHING to Shopify or GMC.
+import { createRequire } from 'module';
+const require = createRequire(import.meta.url);
+const { token, MERCHANT } = require('/Users/macstudio3/Projects/gmc-titlefix/_auth.js');
+import fs from 'fs';
+
+const SHOP='designer-laboratory-sandbox.myshopify.com', API='2024-10';
+const STOK=(fs.readFileSync(process.env.HOME+'/Projects/secrets-manager/.env','utf8').match(/^SHOPIFY_FULL_ACCESS_TOKEN=(.+)$/m)||[])[1];
+const SURL=`https://${SHOP}/admin/api/${API}/graphql.json`;
+const BASE='https://merchantapi.googleapis.com';
+const money=m=>(m&&m.amountMicros!=null)?Number(m.amountMicros)/1e6:null;
+const isPJtext=s=>/phillip\s*jeffries/i.test(s||'');
+const sleep=ms=>new Promise(r=>setTimeout(r,ms));
+const numTail=gid=>String(gid).split('/').pop();
+
+async function sgql(q,v){for(let a=0;a<6;a++){const r=await fetch(SURL,{method:'POST',headers:{'X-Shopify-Access-Token':STOK,'Content-Type':'application/json'},body:JSON.stringify({query:q,variables:v}),signal:AbortSignal.timeout(60000)});const j=await r.json();if(j.errors){if(JSON.stringify(j.errors).includes('THROTTLED')&&a<5){await sleep(2500*(a+1));continue;}throw new Error(JSON.stringify(j.errors).slice(0,300));}return j.data;}throw new Error('throttled');}
+
+// ---- 1. PJ authoritative id sets from Shopify (paginated, variants inline) ----
+console.error('[1/3] Shopify: enumerating vendor=Phillip Jeffries products+variants...');
+const pjProductIds=new Set(), pjVariantIds=new Set();
+const pjProducts=new Map(); // productId -> {title,handle,status}
+let after=null, ppages=0;
+do{
+  const d=await sgql(`query($a:String){products(first:100,after:$a,query:"vendor:'Phillip Jeffries'"){pageInfo{hasNextPage endCursor} nodes{id title handle status variants(first:100){nodes{id}}}}}`,{a:after});
+  for(const p of d.products.nodes){
+    const pid=numTail(p.id); pjProductIds.add(pid);
+    pjProducts.set(pid,{title:p.title,handle:p.handle,status:p.status});
+    for(const v of p.variants.nodes) pjVariantIds.add(numTail(v.id));
+  }
+  after=d.products.pageInfo.hasNextPage?d.products.pageInfo.endCursor:null; ppages++;
+  if(ppages%5===0) process.stderr.write(` p${ppages}(${pjProductIds.size})`);
+} while(after);
+process.stderr.write('\n');
+console.error(`[1/3] PJ products=${pjProductIds.size} variants=${pjVariantIds.size}`);
+const pjActive=[...pjProducts.values()].filter(p=>p.status==='ACTIVE').length;
+
+// parse a live offerId into {productId, variantId}
+function idsFromOffer(offerId){
+  const s=String(offerId);
+  if(/^\d+$/.test(s)) return {productId:null, variantId:s};            // bare numeric = variant id
+  const m=s.match(/^shopify_[^_]+_(\d+)_(\d+)$/);                       // shopify_US_<pid>_<vid>
+  if(m) return {productId:m[1], variantId:m[2]};
+  return {productId:null, variantId:null};
+}
+
+// ---- 2. COMPLETE live GMC walk + join ----
+console.error('[2/3] GMC: complete products.list walk + identity join...');
+let page='', total=0, pages=0, complete=false; const hits=[];
+try{
+  do{
+    const H={Authorization:'Bearer '+(await token())};
+    const r=await fetch(`${BASE}/products/v1/accounts/${MERCHANT}/products?pageSize=250`+(page?`&pageToken=${encodeURIComponent(page)}`:''),{headers:H,signal:AbortSignal.timeout(90000)});
+    if(!r.ok) throw new Error('HTTP '+r.status);
+    const j=await r.json();
+    for(const p of (j.products||[])){
+      total++;
+      const {productId,variantId}=idsFromOffer(p.offerId);
+      const byPid=productId&&pjProductIds.has(productId);
+      const byVid=variantId&&pjVariantIds.has(variantId);
+      if(byPid||byVid){
+        const a=p.productAttributes||{}, ps=p.productStatus||{};
+        const ds=ps.destinationStatuses||[];
+        const approved=ds.filter(d=>(d.approvedCountries||[]).length>0).length;
+        const disapproved=ds.filter(d=>(d.disapprovedCountries||[]).length>0).length;
+        const textWouldMatch=isPJtext(a.brand)||isPJtext(a.title)||isPJtext((a.productTypes||[]).join(' '));
+        const sp=pjProducts.get(productId)|| (variantId? [...pjProducts.entries()].length&&null : null);
+        hits.push({
+          offerId:p.offerId,
+          form: /^\d+$/.test(String(p.offerId))?'bare':'prefixed',
+          matched_by: byPid&&byVid?'pid+vid':(byPid?'productId':'variantId'),
+          text_matcher_would_catch: textWouldMatch,
+          serving: approved>0,
+          status: approved>0?'SERVING':(disapproved>0?'disapproved':'other'),
+          title:(a.title||'').slice(0,80),
+          brand:a.brand||null,
+          price:money(a.price),
+          shopify_productId:productId||null,
+          shopify_variantId:variantId||null,
+          shopify_product_status: productId&&pjProducts.get(productId)?pjProducts.get(productId).status:'(bare-offer:unknown-pid)',
+          issues:[...new Set((ps.itemLevelIssues||[]).map(i=>`${i.severity}|${i.code}`))],
+          link:a.link||null,
+        });
+      }
+    }
+    page=j.nextPageToken||''; pages++;
+    if(pages%40===0) process.stderr.write(` ${total}`);
+  } while(page);
+  complete=true;
+}catch(e){ console.error('WALK FAILED:',String(e).slice(0,160)); }
+process.stderr.write('\n');
+
+// ---- 3. report ----
+const serving=hits.filter(h=>h.serving);
+const missedByText=hits.filter(h=>!h.text_matcher_would_catch);
+const out={
+  ticket:'TK-11844', read_only:true, fetched_at:new Date().toISOString(),
+  method:'authoritative Shopify vendor->id-set join on live GMC offers (both offerId forms)',
+  walk_complete:complete, total_offers_walked:total,
+  pj_shopify:{products:pjProductIds.size, active_products:pjActive, variants:pjVariantIds.size},
+  pj_gmc_offers:hits.length, pj_serving:serving.length,
+  pj_disapproved_only:hits.filter(h=>!h.serving&&h.status==='disapproved').length,
+  offers_text_matcher_would_MISS: missedByText.length,
+  prior_text_count_TK11449: 7,
+  rows: hits.sort((a,b)=>(b.serving-a.serving)||((b.price||0)-(a.price||0))),
+};
+fs.mkdirSync('data',{recursive:true});
+fs.writeFileSync('data/tk11844-pj-authoritative-join.json',JSON.stringify(out,null,1));
+console.log(`\nwalk_complete=${complete} total=${total}`);
+console.log(`PJ shopify: ${pjProductIds.size} products (${pjActive} ACTIVE), ${pjVariantIds.size} variants`);
+console.log(`PJ live GMC offers=${hits.length} (SERVING=${serving.length}, disapproved_only=${out.pj_disapproved_only})`);
+console.log(`offers the TEXT matcher would MISS = ${missedByText.length}  (prior TK-11449 text count was 7)`);
+if(!complete) console.log('NOT-MEASURED: walk incomplete — counts are not authoritative.');

← 8e63c2e auto-data-snapshot: 2026-09-16T15:43:40 (2 data files) — dat  ·  back to Gmc Titlefix  ·  TK-11844/11847: resolve bare-offer product status; guard des 7657c83 →