← back to Dw Yolo Loop
cycle 68: fleet $0-Sample signature sweep — P1 BOUNDED to 111 RL (94% coverage, RL-reproduced gate); +534 roll-priced 'Sample' mislabel (P3). v1 hit /products.json 25k cap, v2 collection-enum fixed it
e0dfb6e9dbe4119c9459f4570f46d0ad4dd1962f · 2026-06-17 18:09:10 -0700 · Steve Abrams
Files touched
A scripts/zero-sample-sweep/zero-sample-sweep-v2.mjsA scripts/zero-sample-sweep/zero-sample-sweep.mjs
Diff
commit e0dfb6e9dbe4119c9459f4570f46d0ad4dd1962f
Author: Steve Abrams <steve@designerwallcoverings.com>
Date: Wed Jun 17 18:09:10 2026 -0700
cycle 68: fleet $0-Sample signature sweep — P1 BOUNDED to 111 RL (94% coverage, RL-reproduced gate); +534 roll-priced 'Sample' mislabel (P3). v1 hit /products.json 25k cap, v2 collection-enum fixed it
---
scripts/zero-sample-sweep/zero-sample-sweep-v2.mjs | 68 +++++++++++++++++
scripts/zero-sample-sweep/zero-sample-sweep.mjs | 86 ++++++++++++++++++++++
2 files changed, 154 insertions(+)
diff --git a/scripts/zero-sample-sweep/zero-sample-sweep-v2.mjs b/scripts/zero-sample-sweep/zero-sample-sweep-v2.mjs
new file mode 100644
index 0000000..d8d669b
--- /dev/null
+++ b/scripts/zero-sample-sweep/zero-sample-sweep-v2.mjs
@@ -0,0 +1,68 @@
+// zero-sample-sweep-v2 — READ-ONLY, $0. Cycle 68 (officer-specified P1 sizing).
+// v1 FAILED coverage: global /products.json caps at page 100 (~25k of ~74k) and the
+// known 111 RL $0-Sample positives sit BEYOND that cap → v1 found 0 and its own negative
+// control flagged "RL not reproduced". v2 enumerates the catalog by COLLECTION (the 572
+// collections collectively cover the catalog), pages each, DEDUPES products by id, and
+// classifies by the P1 signature: single-variant + title~"Sample" + price $0 + available.
+// NEGATIVE CONTROL (hard gate): must reproduce RL ~111; if it doesn't, coverage is still
+// incomplete and the total is a LOWER BOUND (stated as such).
+// EXCLUDES Phillip Jeffries.
+const WWW='https://www.designerwallcoverings.com';
+const UA='Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36';
+const sleep=ms=>new Promise(r=>setTimeout(r,ms));
+async function get(u){for(let a=0;a<5;a++){const r=await fetch(u,{headers:{'User-Agent':UA}});if(r.status===429){await sleep(2500*(a+1));continue;}return{status:r.status,text:await r.text()};}return{status:429,text:''};}
+const PJ=/phillip[- ]?jeffries/i;
+const isSample=t=>/sample/i.test(t||'');
+function classify(p){ const vs=p.variants||[]; if(vs.length!==1) return 'multi'; const price=parseFloat(vs[0].price); if(isNaN(price)) return 'multi';
+ if(!isSample(vs[0].title)) return price===0?'zero-nonsample':'ok-single';
+ if(price===0) return 'zero-sample'; if(price===4.25) return 'ok-425'; return 'abnormal-sample'; }
+
+// collection handles from the en collections sitemap
+const idx=await get(`${WWW}/sitemap.xml`);
+const collMaps=[...idx.text.matchAll(/<loc>([^<]+sitemap_collections_\d+\.xml[^<]*)<\/loc>/g)].map(m=>m[1].replace(/&/g,'&')).filter(u=>!/\/en-(ca|gb)\//.test(u));
+let colls=[]; for(const sm of collMaps){ const x=await get(sm); colls.push(...[...x.text.matchAll(/<loc>[^<]*\/collections\/([^<\/?]+)/g)].map(m=>m[1])); }
+colls=[...new Set(colls)];
+console.log(`=== zero-sample-sweep-v2 (READ-ONLY, $0) ===\nenumerating ${colls.length} collections, deduped by product id (PJ excluded)\n`);
+
+const seen=new Map(); // id -> classification (dedupe across collections)
+const vendorOf=new Map();
+let reqs=0, collDone=0;
+for(const h of colls){
+ let page=1;
+ while(page<=12){
+ const r=await get(`${WWW}/collections/${h}/products.json?limit=250&page=${page}`); reqs++;
+ let ps=[]; try{ps=JSON.parse(r.text).products||[];}catch{break;}
+ if(ps.length===0) break;
+ for(const p of ps){ if(PJ.test(p.vendor||'')) continue; if(!seen.has(p.id)){ seen.set(p.id,classify(p)); vendorOf.set(p.id,p.vendor||'(none)'); } }
+ page++; await sleep(120);
+ }
+ collDone++;
+ if(collDone%80===0){ let zs=0; for(const c of seen.values()) if(c==='zero-sample')zs++; console.log(` ${collDone}/${colls.length} collections | unique products=${seen.size} | zero-sample=${zs}`); }
+}
+
+// tally
+let zeroSample=0, abnormal=0, zeroNon=0, ok425=0, okSingle=0, multi=0;
+const vendZero={}, vendAbn={};
+for(const [id,c] of seen){ const v=vendorOf.get(id);
+ if(c==='zero-sample'){ zeroSample++; vendZero[v]=(vendZero[v]||0)+1; }
+ else if(c==='abnormal-sample'){ abnormal++; vendAbn[v]=(vendAbn[v]||0)+1; }
+ else if(c==='zero-nonsample') zeroNon++;
+ else if(c==='ok-425') ok425++; else if(c==='ok-single') okSingle++; else multi++;
+}
+console.log(`\n=== RESULTS (unique products across all collections: ${seen.size}; HTTP reqs: ${reqs}) ===`);
+console.log(` ZERO-SAMPLE (P1 free-checkout signature): ${zeroSample}`);
+console.log(` abnormal-sample (single Sample, non-$0/non-$4.25): ${abnormal}`);
+console.log(` zero-NONsample (single $0, not titled Sample): ${zeroNon}`);
+console.log(` ok $4.25 sample: ${ok425} | ok single: ${okSingle} | multi: ${multi}`);
+console.log(`\n vendors with ZERO-SAMPLE bug:`);
+Object.entries(vendZero).sort((a,b)=>b[1]-a[1]).forEach(([v,n])=>console.log(` ${v}: ${n}`));
+if(Object.keys(vendAbn).length){ console.log(` vendors with abnormal-sample price:`); Object.entries(vendAbn).sort((a,b)=>b[1]-a[1]).slice(0,12).forEach(([v,n])=>console.log(` ${v}: ${n}`)); }
+
+const rl=Object.entries(vendZero).filter(([v])=>/ralph/i.test(v)).reduce((s,[,n])=>s+n,0);
+console.log(`\n-- NEGATIVE CONTROL (coverage gate) --`);
+console.log(` Ralph Lauren zero-sample reproduced: ${rl} (c67 found 111) → ${rl>=100?'COVERAGE OK — total is a credible fleet count':rl>0?'PARTIAL — total is a LOWER BOUND':'FAILED — RL not covered, total unreliable'}`);
+console.log(` unique products covered: ${seen.size} of ~74k (${(100*seen.size/74000).toFixed(0)}%)`);
+
+import fs from 'fs';
+fs.writeFileSync('/tmp/zero-sample-sweep-v2.json',JSON.stringify({ts:new Date().toISOString(),collections:colls.length,uniqueProducts:seen.size,reqs,zeroSample,abnormal,zeroNon,ok425,okSingle,multi,vendZero,vendAbn,rlReproduced:rl},null,2));
+console.log('\nwrote /tmp/zero-sample-sweep-v2.json');
diff --git a/scripts/zero-sample-sweep/zero-sample-sweep.mjs b/scripts/zero-sample-sweep/zero-sample-sweep.mjs
new file mode 100644
index 0000000..7123fb7
--- /dev/null
+++ b/scripts/zero-sample-sweep/zero-sample-sweep.mjs
@@ -0,0 +1,86 @@
+// zero-sample-sweep — READ-ONLY, $0. Cycle 68 (DTD-picked A, unanimous).
+// Sizes the c67 P1 by the OFFICER-SPECIFIED SIGNATURE across vendors:
+// single-variant + variant title ~ "Sample" + price == $0.00 + available==true
+// = an orderable $0 sample = free-checkout exposure (the RL bug, 111 found in c67).
+// METHOD: (Phase 1) discovery scan of the reachable global /products.json (Shopify
+// caps unauth at page 100 = ~25k of ~74k → coverage caveat NAMED), classify by signature,
+// GROUP affected by vendor. (Phase 2) for each affected vendor, page its full
+// /collections/<handle>/products.json for the COMPLETE per-vendor count (reaches products
+// beyond the 25k cap). Secondary bucket: single-variant "Sample" at a non-$0/non-$4.25
+// price (mis-seed in other directions). NEGATIVE CONTROL: count a healthy multi-variant
+// priced product as NOT-defect + reproduce RL in the affected-vendor list.
+// EXCLUDES Phillip Jeffries.
+const WWW='https://www.designerwallcoverings.com';
+const UA='Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36';
+const sleep=ms=>new Promise(r=>setTimeout(r,ms));
+async function get(u){for(let a=0;a<5;a++){const r=await fetch(u,{headers:{'User-Agent':UA}});if(r.status===429){await sleep(2500*(a+1));continue;}return{status:r.status,text:await r.text()};}return{status:429,text:''};}
+const PJ=/phillip[- ]?jeffries/i;
+const isSample=t=>/sample/i.test(t||'');
+function classify(p){
+ const vs=p.variants||[];
+ if(vs.length!==1) return 'multi';
+ const v=vs[0]; const price=parseFloat(v.price);
+ if(isNaN(price)) return 'multi';
+ if(!isSample(v.title)) return price===0?'zero-nonsample':'ok-single';
+ // single-variant Sample:
+ if(price===0) return 'zero-sample'; // THE P1 signature
+ if(price===4.25) return 'ok-sample-425'; // legit showroom-line
+ return 'abnormal-sample'; // mis-seed other direction
+}
+
+// ---- Phase 1: discovery scan of reachable /products.json (cap ~page 100) ----
+console.log(`=== zero-sample-sweep (READ-ONLY, $0) ===\nPhase 1: discovery scan of reachable /products.json (cap ~25k of ~74k)\n`);
+let scanned=0, zeroSample=0, abnormalSample=0, zeroNonsample=0, okSingle=0, ok425=0, multi=0, pjSkip=0;
+const vendZero={}, vendAbnormal={}; const zeroExamples=[], multiCtrl=[];
+for(let page=1; page<=100; page++){
+ const r=await get(`${WWW}/products.json?limit=250&page=${page}`);
+ let ps=[]; try{ps=JSON.parse(r.text).products||[];}catch{}
+ if(ps.length===0) break;
+ for(const p of ps){
+ if(PJ.test(p.vendor||'')){ pjSkip++; continue; }
+ scanned++;
+ const c=classify(p);
+ if(c==='zero-sample'){ zeroSample++; vendZero[p.vendor]=(vendZero[p.vendor]||0)+1; if(zeroExamples.length<8) zeroExamples.push({h:p.handle,vendor:p.vendor,avail:p.variants[0].available}); }
+ else if(c==='abnormal-sample'){ abnormalSample++; vendAbnormal[p.vendor]=(vendAbnormal[p.vendor]||0)+1; }
+ else if(c==='zero-nonsample') zeroNonsample++;
+ else if(c==='ok-single') okSingle++;
+ else if(c==='ok-sample-425') ok425++;
+ else { multi++; if(multiCtrl.length<4) multiCtrl.push({h:p.handle,prices:(p.variants||[]).map(v=>v.price)}); }
+ }
+ if(page%20===0) console.log(` page ${page}/100 scanned=${scanned} zero-sample=${zeroSample}`);
+ await sleep(250);
+}
+console.log(`\n--- Phase 1 results (${scanned} products scanned, ~${(100*scanned/74000).toFixed(0)}% of fleet) ---`);
+console.log(` zero-sample (P1 signature): ${zeroSample}`);
+console.log(` abnormal-sample (non-$0,non-$4.25): ${abnormalSample}`);
+console.log(` zero-NONsample (single $0, not titled Sample): ${zeroNonsample}`);
+console.log(` ok single-variant: ${okSingle} | ok $4.25 sample: ${ok425} | multi-variant: ${multi} | PJ-skip: ${pjSkip}`);
+console.log(`\n vendors with zero-sample bug (in-scan counts):`);
+Object.entries(vendZero).sort((a,b)=>b[1]-a[1]).forEach(([v,n])=>console.log(` ${v}: ${n}`));
+
+// ---- Phase 2: per affected vendor, full collection count ----
+console.log(`\nPhase 2: full per-vendor collection counts (reaches beyond the 25k cap)`);
+const vendHandle=v=>(v||'').toLowerCase().trim().replace(/&/g,'').replace(/[^a-z0-9]+/g,'-').replace(/^-|-$/g,'');
+const vendorFull={};
+for(const v of Object.keys(vendZero)){
+ const h=vendHandle(v); let total=0, zs=0, page=1, ok=false;
+ while(page<=12){ const r=await get(`${WWW}/collections/${h}/products.json?limit=250&page=${page}`); let ps=[]; try{ps=JSON.parse(r.text).products||[];}catch{break;} if(ps.length===0)break; ok=true;
+ for(const p of ps){ if(PJ.test(p.vendor||''))continue; total++; if(classify(p)==='zero-sample') zs++; } page++; await sleep(250); }
+ vendorFull[v]={handle:h, collectionFound:ok, total, zeroSample:zs};
+ console.log(` ${v} (/collections/${h}): ${ok?`${zs} zero-sample of ${total} total`:'collection-handle not found → in-scan count only'}`);
+}
+
+const grandZeroFull=Object.values(vendorFull).reduce((s,x)=>s+(x.collectionFound?x.zeroSample:0),0);
+const inScanOnlyVendors=Object.values(vendorFull).filter(x=>!x.collectionFound);
+console.log(`\n=== TOTALS ===`);
+console.log(`zero-sample (P1) — full count for vendors w/ resolvable collection: ${grandZeroFull}`);
+console.log(`zero-sample — Phase-1 in-scan total (lower bound, all vendors): ${zeroSample}`);
+if(inScanOnlyVendors.length) console.log(`(${inScanOnlyVendors.length} affected vendor(s) had no resolvable collection handle → counted only within the 25k scan)`);
+console.log(`\n-- NEGATIVE CONTROL --`);
+console.log(` healthy multi-variant priced (NOT flagged) examples:`); multiCtrl.forEach(m=>console.log(` ${m.h.slice(0,40)} prices=${JSON.stringify(m.prices)}`));
+console.log(` zero-sample examples (flagged, available shown):`); zeroExamples.forEach(z=>console.log(` ${z.h.slice(0,40)} [${z.vendor}] available=${z.avail}`));
+console.log(` RL reproduced in affected list: ${Object.keys(vendZero).some(v=>/ralph/i.test(v))?'YES':'no (check coverage)'}`);
+
+import fs from 'fs';
+fs.writeFileSync('/tmp/zero-sample-sweep.json',JSON.stringify({ts:new Date().toISOString(),scanned,zeroSample,abnormalSample,zeroNonsample,okSingle,ok425,multi,pjSkip,vendZero,vendAbnormal,vendorFull,grandZeroFull,zeroExamples,multiCtrl},null,2));
+console.log('\nwrote /tmp/zero-sample-sweep.json');
← 304aa1f cycle 67: officer FLAG — root-cause corrected (111 RL 'Sampl
·
back to Dw Yolo Loop
·
cycle 68: officer CONFIRMED + scope sharpened (single-varian 816dc6e →