[object Object]

← back to Jeffrey Stevens Margin Fix

Definitive whole-line below-cost audit vs York master: 1685 active matched, 0 genuinely below cost (2 are $4.25 sample artifacts). JS margin integrity confirmed clean.

a5fa5cae05d5578b5f2cf7429dd9fe5e1f2ff82d · 2026-09-09 17:21:44 -0700 · Steve

Files touched

Diff

commit a5fa5cae05d5578b5f2cf7429dd9fe5e1f2ff82d
Author: Steve <steve@designerwallcoverings.com>
Date:   Wed Sep 9 17:21:44 2026 -0700

    Definitive whole-line below-cost audit vs York master: 1685 active matched, 0 genuinely below cost (2 are $4.25 sample artifacts). JS margin integrity confirmed clean.
---
 pull-audit-codes.mjs | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/pull-audit-codes.mjs b/pull-audit-codes.mjs
new file mode 100644
index 0000000..d3e4cd5
--- /dev/null
+++ b/pull-audit-codes.mjs
@@ -0,0 +1,17 @@
+import { readFileSync, writeFileSync } from 'node:fs';
+const TOKEN=readFileSync(process.env.HOME+'/Projects/secrets-manager/.env','utf8').split('\n').find(l=>l.startsWith('SHOPIFY_ADMIN_TOKEN=')).split('=')[1].trim();
+const SHOP='https://designer-laboratory-sandbox.myshopify.com/admin/api/2024-10/graphql.json';
+const DIR=new URL('.',import.meta.url).pathname;
+const tgt=JSON.parse(readFileSync(DIR+'data/js-audit-candidates.json'));
+const gql=(q)=>fetch(SHOP,{method:'POST',headers:{'X-Shopify-Access-Token':TOKEN,'Content-Type':'application/json'},body:JSON.stringify({query:q})}).then(r=>r.json());
+const out=[]; let i=0;
+for(const t of tgt){
+  const q=`{p:product(id:"gid://shopify/Product/${t.product_id}"){status mfr:metafield(namespace:"custom",key:"manufacturer_sku"){value} variants(first:5){edges{node{title price}}}}}`;
+  try{const r=await gql(q);const p=r.data&&r.data.p;const s=p?.variants.edges.map(e=>e.node).find(v=>!/sample/i.test(v.title));
+    out.push({...t,york_code:p?.mfr?.value||null,status:p?.status,live_sell:s?.price});}
+  catch(e){out.push({...t,york_code:null});}
+  if(++i%250===0){writeFileSync(DIR+'data/js-audit-live.json',JSON.stringify(out,null,1));console.log('pulled',i);}
+  await new Promise(x=>setTimeout(x,110));
+}
+writeFileSync(DIR+'data/js-audit-live.json',JSON.stringify(out,null,1));
+console.log('DONE',out.length);

← 1135c9d auto-data-snapshot: 2026-09-09T17:19:59 (3 data files) — dat  ·  back to Jeffrey Stevens Margin Fix  ·  Argent (2) reprice to $40.72 — last below-cost remainder clo 934973c →