[object Object]

← back to Dw Unbuyable Recovery Pilot

TK-11252 fork-1: set 8 Hollywood/Versa dead-ends to DRAFT (Steve Option B), re-verify + undo scripts

18ec8a379dae6ac9f106c3ab9dd4acb22db0b19c · 2026-09-14 14:20:17 -0700 · claude

Files touched

Diff

commit 18ec8a379dae6ac9f106c3ab9dd4acb22db0b19c
Author: claude <steve@designerwallcoverings.com>
Date:   Mon Sep 14 14:20:17 2026 -0700

    TK-11252 fork-1: set 8 Hollywood/Versa dead-ends to DRAFT (Steve Option B), re-verify + undo scripts
---
 tk11252-hollywood/reverify-8-result.json | 573 +++++++++++++++++++++++++++++++
 tk11252-hollywood/reverify-8.mjs         |  97 ++++++
 tk11252-hollywood/set-status-8.mjs       |  52 +++
 3 files changed, 722 insertions(+)

diff --git a/tk11252-hollywood/reverify-8-result.json b/tk11252-hollywood/reverify-8-result.json
new file mode 100644
index 0000000..1d6c1f8
--- /dev/null
+++ b/tk11252-hollywood/reverify-8-result.json
@@ -0,0 +1,573 @@
+{
+  "measured_at": "2026-09-14T21:16:20.069Z",
+  "n": 8,
+  "results": [
+    {
+      "expectSku": "A166-189",
+      "gid": "gid://shopify/Product/7800001003571",
+      "legacyId": "7800001003571",
+      "title": "Aura - Canvas Wallcovering",
+      "handle": "aura-canvas-wallcovering",
+      "status": "ACTIVE",
+      "tags": [
+        "#EAE4D5",
+        "#F2EDE1",
+        "20 oz. Vinyl",
+        "A166-189",
+        "Abstract",
+        "AI-Analyzed-v2",
+        "Architectural",
+        "Aura",
+        "Bedroom",
+        "Beige",
+        "Brushstroke",
+        "CAN/ULC S102",
+        "Canvas",
+        "Champagne",
+        "Class A Fire Rated",
+        "Coastal",
+        "Commercial",
+        "Commercial Wallcovering",
+        "Contemporary",
+        "Cream",
+        "display_variant",
+        "Hallway",
+        "Healthcare",
+        "Hospitality",
+        "Light Beige",
+        "Living Room",
+        "Minimalist",
+        "NFPA 101 Life Safety Code",
+        "Off-white",
+        "Office",
+        "Organic Modern",
+        "Paper",
+        "Passes NFPA 286 Corner Burn",
+        "Residential",
+        "Reverse Hang/Drop @ Arrows",
+        "Serene",
+        "Showroom Line",
+        "Solid",
+        "Tan",
+        "Textured",
+        "Transitional",
+        "Vinyl",
+        "Wallcovering",
+        "Yellow}",
+        "{\"#D6CEC0"
+      ],
+      "hasQuoteTag": false,
+      "variantCount": 1,
+      "variants": [
+        {
+          "sku": "A166-189-Sample",
+          "title": "Sample",
+          "price": "4.25"
+        }
+      ],
+      "nonSampleVariantCount": 0,
+      "pdp": {
+        "httpStatus": 200,
+        "finalUrl": "https://www.designerwallcoverings.com/products/aura-canvas-wallcovering",
+        "size": 1329021,
+        "quoteCTA": 0,
+        "addToCart": 1
+      },
+      "stillDeadEnd": true
+    },
+    {
+      "expectSku": "A166-322",
+      "gid": "gid://shopify/Product/7800001036339",
+      "legacyId": "7800001036339",
+      "title": "Aura - Lagoon Wallcovering",
+      "handle": "aura-lagoon-wallcovering",
+      "status": "ACTIVE",
+      "tags": [
+        "#89A7AE",
+        "#93B1B8",
+        "#A0BCC3",
+        "20 oz. Vinyl",
+        "A166-322",
+        "Abstract",
+        "AI-Analyzed-v2",
+        "Architectural",
+        "Aura",
+        "Bedroom",
+        "Beige",
+        "Blue",
+        "Brushstroke",
+        "CAN/ULC S102",
+        "Cerulean",
+        "Class A Fire Rated",
+        "Commercial",
+        "Contemporary",
+        "Dark Teal",
+        "display_variant",
+        "Fabric",
+        "Hallway",
+        "Healthcare",
+        "Hospitality",
+        "Lagoon",
+        "Light Beige",
+        "Light Blue",
+        "Living Room",
+        "Minimalist",
+        "NFPA 101 Life Safety Code",
+        "Office",
+        "Passes NFPA 286 Corner Burn",
+        "Pattern",
+        "Residential",
+        "Reverse Hang/Drop @ Arrows",
+        "Serene",
+        "Showroom Line",
+        "Solid",
+        "Steel Blue",
+        "Teal",
+        "Textured",
+        "Vinyl",
+        "Wallcovering}",
+        "{\"#7D9DA4"
+      ],
+      "hasQuoteTag": false,
+      "variantCount": 1,
+      "variants": [
+        {
+          "sku": "A166-322-Sample",
+          "title": "Sample",
+          "price": "4.25"
+        }
+      ],
+      "nonSampleVariantCount": 0,
+      "pdp": {
+        "httpStatus": 200,
+        "finalUrl": "https://www.designerwallcoverings.com/products/aura-lagoon-wallcovering",
+        "size": 1330173,
+        "quoteCTA": 0,
+        "addToCart": 1
+      },
+      "stillDeadEnd": true
+    },
+    {
+      "expectSku": "A166-421",
+      "gid": "gid://shopify/Product/7800001101875",
+      "legacyId": "7800001101875",
+      "title": "Aura - Sunset Wallcovering",
+      "handle": "aura-sunset-wallcovering",
+      "status": "ACTIVE",
+      "tags": [
+        "20 oz. Vinyl",
+        "A166-421",
+        "AI-Analyzed-v2",
+        "Architectural",
+        "Aura",
+        "Bedroom",
+        "Beige",
+        "CAN/ULC S102",
+        "Champagne",
+        "Class A Fire Rated",
+        "Commercial",
+        "Commercial Wallcovering",
+        "Contemporary",
+        "Coral",
+        "display_variant",
+        "Energetic",
+        "every visible color",
+        "Hallway",
+        "Healthcare",
+        "Hospitality",
+        "Living Room",
+        "Minimalist",
+        "Modern",
+        "NFPA 101 Life Safety Code",
+        "Office",
+        "Orange",
+        "Paper",
+        "Passes NFPA 286 Corner Burn",
+        "Pink",
+        "Red",
+        "Residential",
+        "Reverse Hang/Drop @ Arrows",
+        "Showroom Line",
+        "Solid",
+        "Stripe",
+        "Sunset",
+        "Textured",
+        "Vinyl",
+        "Wallcovering",
+        "Yellow}",
+        "{\"Abstract"
+      ],
+      "hasQuoteTag": false,
+      "variantCount": 1,
+      "variants": [
+        {
+          "sku": "A166-421-Sample",
+          "title": "Sample",
+          "price": "4.25"
+        }
+      ],
+      "nonSampleVariantCount": 0,
+      "pdp": {
+        "httpStatus": 200,
+        "finalUrl": "https://www.designerwallcoverings.com/products/aura-sunset-wallcovering",
+        "size": 1328671,
+        "quoteCTA": 0,
+        "addToCart": 1
+      },
+      "stillDeadEnd": true
+    },
+    {
+      "expectSku": "A166-503",
+      "gid": "gid://shopify/Product/7800001134643",
+      "legacyId": "7800001134643",
+      "title": "Aura - Fresco Wallcovering",
+      "handle": "aura-fresco-wallcovering",
+      "status": "ACTIVE",
+      "tags": [
+        "#B9B1A6",
+        "#D1C9BE",
+        "#E8E3D9",
+        "20 oz. Vinyl",
+        "A166-503",
+        "Abstract",
+        "AI-Analyzed-v2",
+        "Architectural",
+        "Aura",
+        "Bedroom",
+        "Beige",
+        "CAN/ULC S102",
+        "Champagne",
+        "Class A Fire Rated",
+        "Commercial",
+        "Commercial Wallcovering",
+        "Contemporary",
+        "display_variant",
+        "Eggshell",
+        "Fresco",
+        "Hallway",
+        "Healthcare",
+        "Hospitality",
+        "Light Gray",
+        "Living Room",
+        "Luxury",
+        "NFPA 101 Life Safety Code",
+        "Non-woven",
+        "Office",
+        "Pale Yellow",
+        "Passes NFPA 286 Corner Burn",
+        "Residential",
+        "Reverse Hang/Drop @ Arrows",
+        "Serene",
+        "Showroom Line",
+        "Silver",
+        "Solid",
+        "Tan",
+        "Textured",
+        "Traditional",
+        "Transitional",
+        "Vinyl",
+        "Wallcovering",
+        "Yellow}",
+        "{\"#A1998E"
+      ],
+      "hasQuoteTag": false,
+      "variantCount": 1,
+      "variants": [
+        {
+          "sku": "A166-503-Sample",
+          "title": "Sample",
+          "price": "4.25"
+        }
+      ],
+      "nonSampleVariantCount": 0,
+      "pdp": {
+        "httpStatus": 200,
+        "finalUrl": "https://www.designerwallcoverings.com/products/aura-fresco-wallcovering",
+        "size": 1329445,
+        "quoteCTA": 0,
+        "addToCart": 1
+      },
+      "stillDeadEnd": true
+    },
+    {
+      "expectSku": "A166-545",
+      "gid": "gid://shopify/Product/7800001167411",
+      "legacyId": "7800001167411",
+      "title": "Aura - Desert Gem Wallcovering",
+      "handle": "aura-desert-gem-wallcovering",
+      "status": "ACTIVE",
+      "tags": [
+        "#A68A64",
+        "#D2B48C",
+        "#E5D8C2",
+        "20 oz. Vinyl",
+        "A166-545",
+        "Abstract",
+        "AI-Analyzed-v2",
+        "Architectural",
+        "Aura",
+        "Bathroom",
+        "Bedroom",
+        "Beige",
+        "CAN/ULC S102",
+        "Class A Fire Rated",
+        "Coastal",
+        "Commercial",
+        "Commercial Wallcovering",
+        "Contemporary",
+        "Desert Gem",
+        "display_variant",
+        "Farmhouse",
+        "Healthcare",
+        "Hospitality",
+        "Light Blue",
+        "Living Room",
+        "Luxury",
+        "NFPA 101 Life Safety Code",
+        "Oatmeal",
+        "Paper",
+        "Passes NFPA 286 Corner Burn",
+        "Residential",
+        "Reverse Hang/Drop @ Arrows",
+        "Rustic",
+        "Serene",
+        "Showroom Line",
+        "Solid",
+        "Stripe",
+        "Suitable Environments: Office",
+        "Tan",
+        "Taupe",
+        "Textured",
+        "Transitional",
+        "Turquoise",
+        "Vinyl",
+        "Wallcovering",
+        "Wood Grain}",
+        "{\"#8C7352"
+      ],
+      "hasQuoteTag": false,
+      "variantCount": 1,
+      "variants": [
+        {
+          "sku": "A166-545-Sample",
+          "title": "Sample",
+          "price": "4.25"
+        }
+      ],
+      "nonSampleVariantCount": 0,
+      "pdp": {
+        "httpStatus": 200,
+        "finalUrl": "https://www.designerwallcoverings.com/products/aura-desert-gem-wallcovering",
+        "size": 1330037,
+        "quoteCTA": 0,
+        "addToCart": 1
+      },
+      "stillDeadEnd": true
+    },
+    {
+      "expectSku": "A166-814",
+      "gid": "gid://shopify/Product/7800001200179",
+      "legacyId": "7800001200179",
+      "title": "Aura - Cirrus Wallcovering",
+      "handle": "aura-cirrus-wallcovering",
+      "status": "ACTIVE",
+      "tags": [
+        "#E8E7E3",
+        "#F2F1EE",
+        "20 oz. Vinyl",
+        "A166-814",
+        "AI-Analyzed-v2",
+        "Architectural",
+        "Aura",
+        "Bedroom",
+        "Beige",
+        "CAN/ULC S102",
+        "Cirrus",
+        "Class A Fire Rated",
+        "Coastal",
+        "Coastal Farmhouse",
+        "Commercial",
+        "Commercial Wallcovering",
+        "Contemporary",
+        "Cream",
+        "display_variant",
+        "Farmhouse",
+        "Hallway",
+        "Healthcare",
+        "Hospitality",
+        "Light Gray",
+        "Living Room",
+        "Minimalist",
+        "NFPA 101 Life Safety Code",
+        "Off-white",
+        "Paper",
+        "Passes NFPA 286 Corner Burn",
+        "Residential",
+        "Reverse Hang/Drop @ Arrows",
+        "Rustic",
+        "Scandinavian",
+        "Serene",
+        "Showroom Line",
+        "Solid",
+        "Stripe",
+        "Suitable Environments: Office",
+        "Textured",
+        "Transitional",
+        "Vinyl",
+        "Wallcovering",
+        "White",
+        "Wood Grain}",
+        "{\"#D1D0CC"
+      ],
+      "hasQuoteTag": false,
+      "variantCount": 1,
+      "variants": [
+        {
+          "sku": "A166-814-Sample",
+          "title": "Sample",
+          "price": "4.25"
+        }
+      ],
+      "nonSampleVariantCount": 0,
+      "pdp": {
+        "httpStatus": 200,
+        "finalUrl": "https://www.designerwallcoverings.com/products/aura-cirrus-wallcovering",
+        "size": 1329741,
+        "quoteCTA": 0,
+        "addToCart": 1
+      },
+      "stillDeadEnd": true
+    },
+    {
+      "expectSku": "A166-895",
+      "gid": "gid://shopify/Product/7800001232947",
+      "legacyId": "7800001232947",
+      "title": "Aura - Silverado Wallcovering",
+      "handle": "aura-silverado-wallcovering",
+      "status": "ACTIVE",
+      "tags": [
+        "#BDBBB7",
+        "#D3D0CB",
+        "#E5E2E0",
+        "20 oz. Vinyl",
+        "A166-895",
+        "Abstract",
+        "AI-Analyzed-v2",
+        "Architectural",
+        "Aura",
+        "Bedroom",
+        "CAN/ULC S102",
+        "Class A Fire Rated",
+        "Commercial",
+        "Commercial Wallcovering",
+        "Contemporary",
+        "display_variant",
+        "Gray",
+        "Grey",
+        "Hallway",
+        "Healthcare",
+        "Hospitality",
+        "Light Gray",
+        "Light Grey",
+        "Living Room",
+        "Luxury",
+        "Mushroom",
+        "NFPA 101 Life Safety Code",
+        "Non-woven",
+        "Office",
+        "Passes NFPA 286 Corner Burn",
+        "Residential",
+        "Reverse Hang/Drop @ Arrows",
+        "Serene",
+        "Showroom Line",
+        "Silver",
+        "Silverado",
+        "Solid",
+        "Taupe",
+        "Textured",
+        "Vinyl",
+        "Wallcovering}",
+        "{\"#A8A6A3"
+      ],
+      "hasQuoteTag": false,
+      "variantCount": 1,
+      "variants": [
+        {
+          "sku": "A166-895-Sample",
+          "title": "Sample",
+          "price": "4.25"
+        }
+      ],
+      "nonSampleVariantCount": 0,
+      "pdp": {
+        "httpStatus": 200,
+        "finalUrl": "https://www.designerwallcoverings.com/products/aura-silverado-wallcovering",
+        "size": 1329073,
+        "quoteCTA": 0,
+        "addToCart": 1
+      },
+      "stillDeadEnd": true
+    },
+    {
+      "expectSku": "A125-356-261",
+      "gid": "gid://shopify/Product/7799848108083",
+      "legacyId": "7799848108083",
+      "title": "Kibesillah Gulch - Pewter Type II Vinyl Wallcovering",
+      "handle": "kibesillah-gulch-pewter-type-ii-vinyl-wallcovering",
+      "status": "ACTIVE",
+      "tags": [
+        "15 oz",
+        "A125-356-261",
+        "Bedroom",
+        "Charcoal",
+        "Charcoal Gray",
+        "Class A Fire Rated",
+        "Commercial",
+        "Commercial Wallcovering",
+        "Contemporary",
+        "Dark Charcoal",
+        "Dark Gray",
+        "display_variant",
+        "Gray",
+        "Grey",
+        "Hallway",
+        "Healthcare",
+        "Hospitality",
+        "Industrial",
+        "Living Room",
+        "Medium Gray",
+        "Minimalist",
+        "Modern",
+        "Office",
+        "Residential",
+        "Showroom Line",
+        "Skylines",
+        "Sophisticated",
+        "Stripe",
+        "Textured",
+        "Type 2",
+        "Vinyl",
+        "Wallcovering}",
+        "{\"Architectural"
+      ],
+      "hasQuoteTag": false,
+      "variantCount": 1,
+      "variants": [
+        {
+          "sku": "A125-356-261-Sample",
+          "title": "Sample",
+          "price": "4.25"
+        }
+      ],
+      "nonSampleVariantCount": 0,
+      "pdp": {
+        "httpStatus": 200,
+        "finalUrl": "https://www.designerwallcoverings.com/products/kibesillah-gulch-pewter-type-ii-vinyl-wallcovering",
+        "size": 1330843,
+        "quoteCTA": 0,
+        "addToCart": 1
+      },
+      "stillDeadEnd": true
+    }
+  ]
+}
\ No newline at end of file
diff --git a/tk11252-hollywood/reverify-8.mjs b/tk11252-hollywood/reverify-8.mjs
new file mode 100644
index 0000000..9d4b23a
--- /dev/null
+++ b/tk11252-hollywood/reverify-8.mjs
@@ -0,0 +1,97 @@
+#!/usr/bin/env node
+// TK-11252 fork-1 — READ-ONLY re-verify of the 8 genuine dead-ends before the DRAFT write.
+// For each of the 8: live Shopify status/handle/tags/variants + live PDP quoteCTA check.
+// Writes prestate snapshot for clean re-activate undo. NO WRITES to Shopify here.
+import { readFileSync, writeFileSync } from 'node:fs';
+const TOKEN = readFileSync(new URL('/Users/macstudio3/Projects/secrets-manager/.env', 'file://'),'utf8')
+  .split('\n').find(l=>l.startsWith('SHOPIFY_ADMIN_TOKEN=')).split('=').slice(1).join('=').trim();
+const SHOP = 'designer-laboratory-sandbox.myshopify.com';
+const API = '2024-10';
+
+// The 8 genuine dead-ends (SKU -> numeric product id), from unbuyable-live.json @ 2026-09-14.
+const TARGETS = [
+  { sku:'A166-189', id:'7800001003571', handle:'aura-canvas-wallcovering' },
+  { sku:'A166-322', id:'7800001036339', handle:'aura-lagoon-wallcovering' },
+  { sku:'A166-421', id:'7800001101875', handle:'aura-sunset-wallcovering' },
+  { sku:'A166-503', id:'7800001134643', handle:'aura-fresco-wallcovering' },
+  { sku:'A166-545', id:'7800001167411', handle:'aura-desert-gem-wallcovering' },
+  { sku:'A166-814', id:'7800001200179', handle:'aura-cirrus-wallcovering' },
+  { sku:'A166-895', id:'7800001232947', handle:'aura-silverado-wallcovering' },
+  { sku:'A125-356-261', id:'7799848108083', handle:'kibesillah-gulch-pewter-type-ii-vinyl-wallcovering' },
+];
+
+async function gql(query, variables){
+  const r = await fetch(`https://${SHOP}/admin/api/${API}/graphql.json`, {
+    method:'POST',
+    headers:{'Content-Type':'application/json','X-Shopify-Access-Token':TOKEN},
+    body: JSON.stringify({ query, variables }),
+  });
+  const j = await r.json();
+  if (j.errors) throw new Error('GraphQL: '+JSON.stringify(j.errors));
+  return j.data;
+}
+
+const Q = `query($id:ID!){
+  product(id:$id){
+    id legacyResourceId title handle status tags onlineStoreUrl
+    variants(first:20){ nodes{ id sku title price } }
+  }
+}`;
+
+async function checkPdp(handle){
+  // follow redirects; a quote CTA renders the "Request a Quote" text
+  try {
+    const url = `https://designerwallcoverings.com/products/${handle}`;
+    const r = await fetch(url, { redirect:'follow', headers:{'User-Agent':'Mozilla/5.0 tk11252-reverify'} });
+    const html = await r.text();
+    const finalUrl = r.url;
+    const quoteCTA = /request a quote/i.test(html) ? 1 : 0;
+    const addToCart = /add to cart|name="add"/i.test(html) ? 1 : 0;
+    return { httpStatus:r.status, finalUrl, size:html.length, quoteCTA, addToCart };
+  } catch(e){ return { error:String(e) }; }
+}
+
+const results = [];
+for (const t of TARGETS){
+  const gid = `gid://shopify/Product/${t.id}`;
+  const d = await gql(Q, { id: gid });
+  const p = d.product;
+  const pdp = await checkPdp(p.handle);
+  const nonSampleVariants = p.variants.nodes.filter(v => !/-sample$/i.test(v.sku||'') && !/^sample$/i.test(v.title||''));
+  results.push({
+    expectSku:t.sku, gid, legacyId:p.legacyResourceId, title:p.title, handle:p.handle,
+    status:p.status, tags:p.tags,
+    hasQuoteTag: p.tags.map(x=>x.toLowerCase()).includes('quotes'),
+    variantCount:p.variants.nodes.length,
+    variants:p.variants.nodes.map(v=>({sku:v.sku,title:v.title,price:v.price})),
+    nonSampleVariantCount: nonSampleVariants.length,
+    pdp,
+  });
+  await new Promise(r=>setTimeout(r,350));
+}
+
+// Determine which are still genuine dead-ends: ACTIVE + no quote tag + no quote CTA + sole variant = Sample
+for (const r of results){
+  r.stillDeadEnd = (r.status==='ACTIVE') && !r.hasQuoteTag &&
+    (r.pdp && r.pdp.quoteCTA===0) && (r.nonSampleVariantCount===0) && (r.variantCount===1);
+}
+
+const out = { measured_at:new Date().toISOString(), n:results.length, results };
+writeFileSync(new URL('./reverify-8-result.json','file://'+process.cwd()+'/'), JSON.stringify(out,null,2));
+
+console.log('SKU            STATUS   qTag qCTA http  nonSampleV  soleVar  DEADEND');
+for (const r of results){
+  console.log(
+    (r.expectSku).padEnd(14),
+    (r.status||'?').padEnd(8),
+    String(r.hasQuoteTag?'Y':'n').padEnd(4),
+    String(r.pdp?.quoteCTA ?? '?').padEnd(4),
+    String(r.pdp?.httpStatus ?? r.pdp?.error ?? '?').padEnd(5),
+    String(r.nonSampleVariantCount).padEnd(11),
+    String(r.variantCount===1?'Y':'n').padEnd(8),
+    r.stillDeadEnd ? 'YES' : 'NO(skip)'
+  );
+}
+const still = results.filter(r=>r.stillDeadEnd).length;
+console.log(`\nSTILL-DEAD-END: ${still}/8  |  SKIP: ${8-still}/8`);
+writeFileSync('/tmp/tk11252-still.txt', String(still));
diff --git a/tk11252-hollywood/set-status-8.mjs b/tk11252-hollywood/set-status-8.mjs
new file mode 100644
index 0000000..5043ce0
--- /dev/null
+++ b/tk11252-hollywood/set-status-8.mjs
@@ -0,0 +1,52 @@
+#!/usr/bin/env node
+// TK-11252 fork-1 — set the 8 genuine dead-ends to DRAFT (Steve-approved Option B, 2026-09-14),
+// with a clean re-activate undo. Reads the prestate snapshot for the exact 8 GIDs.
+//   node set-status-8.mjs --draft <prestate.json>     # set the 8 -> DRAFT (verifies each)
+//   node set-status-8.mjs --activate <prestate.json>  # UNDO: set them back -> ACTIVE
+import { readFileSync } from 'node:fs';
+const TOKEN = readFileSync('/Users/macstudio3/Projects/secrets-manager/.env','utf8')
+  .split('\n').find(l=>l.startsWith('SHOPIFY_ADMIN_TOKEN=')).split('=').slice(1).join('=').trim();
+const SHOP='designer-laboratory-sandbox.myshopify.com', API='2024-10';
+
+const mode = process.argv[2];
+const snapPath = process.argv[3];
+if (!['--draft','--activate'].includes(mode) || !snapPath){
+  console.error('usage: node set-status-8.mjs --draft|--activate <prestate.json>');
+  process.exit(2);
+}
+const TARGET_STATUS = mode==='--draft' ? 'DRAFT' : 'ACTIVE';
+const snap = JSON.parse(readFileSync(snapPath,'utf8'));
+const products = snap.products;
+if (mode==='--draft'){
+  // hard guard: only proceed if every product was ACTIVE in prestate (matches Steve's approval scope)
+  const bad = products.filter(p=>p.prior_status!=='ACTIVE');
+  if (bad.length){ console.error('ABORT: prestate has non-ACTIVE rows', bad.map(b=>b.sku)); process.exit(3); }
+}
+
+async function gql(query, variables){
+  const r = await fetch(`https://${SHOP}/admin/api/${API}/graphql.json`, {
+    method:'POST', headers:{'Content-Type':'application/json','X-Shopify-Access-Token':TOKEN},
+    body: JSON.stringify({ query, variables }) });
+  const j = await r.json();
+  if (j.errors) throw new Error('GraphQL: '+JSON.stringify(j.errors));
+  return j.data;
+}
+const M = `mutation($input:ProductInput!){
+  productUpdate(input:$input){ product{ id status } userErrors{ field message } } }`;
+const READ = `query($id:ID!){ product(id:$id){ id status } }`;
+
+let ok=0, fail=0;
+for (const p of products){
+  const res = await gql(M, { input:{ id:p.gid, status:TARGET_STATUS } });
+  const ue = res.productUpdate.userErrors;
+  if (ue && ue.length){ console.log(`FAIL ${p.sku}: ${JSON.stringify(ue)}`); fail++; continue; }
+  // verify by independent re-read
+  const chk = await gql(READ, { id:p.gid });
+  const got = chk.product.status;
+  const good = got===TARGET_STATUS;
+  console.log(`${good?'OK  ':'FAIL'} ${p.sku.padEnd(14)} ${p.gid.split('/').pop()}  -> ${got}${good?'':' (EXPECTED '+TARGET_STATUS+')'}`);
+  good ? ok++ : fail++;
+  await new Promise(r=>setTimeout(r,300));
+}
+console.log(`\n${mode} complete: ${ok}/${products.length} verified ${TARGET_STATUS}, ${fail} fail`);
+process.exit(fail?1:0);

← 0c20d0d auto-data-snapshot: 2026-09-14T00:22:42 (1 data files) — tk1  ·  back to Dw Unbuyable Recovery Pilot  ·  TK-11041: Innovations reprice — LIST basis, decimal-safe /0. d4fae99 →