← back to Gmc Titlefix
TK-11233: publish the 62 Malibu products to the Online Store (Steve-authorized)
1a8f855c149ad70a019e0a41a3d6a2fa93f251e7 · 2026-09-10 09:42:48 -0700 · Steve Abrams
Steve explicitly authorized this with 'publish the 62' after being shown three
times that 34 of them carry only a $4.25 memo-sample variant. His call;
executed faithfully, in full, and reversibly.
62 published, 0 failed, independently re-verified 62/62 live.
Ordered so the 28 with a real sellable variant went first and the 34
sample-only last, so an interrupted run leaves the safer half done. The 28
carry a genuine Sold Per Roll variant at $56.74-$206.39 - those were never
the concern.
Standing exposure: 34 are now live with $4.25 as the only buyable item.
Reversible in one command via --rollback against the run-log. The durable fix
is real roll pricing + bolt variants on those 34.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Files touched
A data/tk11233-publish62-2026-09-10T16-39-41-250Z.jsonlA tk11233-publish-62-malibu.mjs
Diff
commit 1a8f855c149ad70a019e0a41a3d6a2fa93f251e7
Author: Steve Abrams <steve@designerwallcoverings.com>
Date: Thu Sep 10 09:42:48 2026 -0700
TK-11233: publish the 62 Malibu products to the Online Store (Steve-authorized)
Steve explicitly authorized this with 'publish the 62' after being shown three
times that 34 of them carry only a $4.25 memo-sample variant. His call;
executed faithfully, in full, and reversibly.
62 published, 0 failed, independently re-verified 62/62 live.
Ordered so the 28 with a real sellable variant went first and the 34
sample-only last, so an interrupted run leaves the safer half done. The 28
carry a genuine Sold Per Roll variant at $56.74-$206.39 - those were never
the concern.
Standing exposure: 34 are now live with $4.25 as the only buyable item.
Reversible in one command via --rollback against the run-log. The durable fix
is real roll pricing + bolt variants on those 34.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
---
...k11233-publish62-2026-09-10T16-39-41-250Z.jsonl | 62 ++++++++++
tk11233-publish-62-malibu.mjs | 132 +++++++++++++++++++++
2 files changed, 194 insertions(+)
diff --git a/data/tk11233-publish62-2026-09-10T16-39-41-250Z.jsonl b/data/tk11233-publish62-2026-09-10T16-39-41-250Z.jsonl
new file mode 100644
index 0000000..4ded55f
--- /dev/null
+++ b/data/tk11233-publish62-2026-09-10T16-39-41-250Z.jsonl
@@ -0,0 +1,62 @@
+{"gid":"gid://shopify/Product/7822363263027","handle":"anemone-watercolor-floral-pink-lemonade-and-wine-wallcovering-malibu-wallpaper","ok":true,"prior_onlineStore":false,"sellable_variants":1,"undo":"publishableUnpublish from gid://shopify/Publication/22208643184"}
+{"gid":"gid://shopify/Product/7822360576051","handle":"tiger-island-meadow-wallcovering-malibu-wallpaper","ok":true,"prior_onlineStore":false,"sellable_variants":1,"undo":"publishableUnpublish from gid://shopify/Publication/22208643184"}
+{"gid":"gid://shopify/Product/7822361034803","handle":"carina-cloud-9-wallcovering-malibu-wallpaper","ok":true,"prior_onlineStore":false,"sellable_variants":1,"undo":"publishableUnpublish from gid://shopify/Publication/22208643184"}
+{"gid":"gid://shopify/Product/7822361559091","handle":"kauai-blue-sea-wallcovering-malibu-wallpaper","ok":true,"prior_onlineStore":false,"sellable_variants":1,"undo":"publishableUnpublish from gid://shopify/Publication/22208643184"}
+{"gid":"gid://shopify/Product/7822365524019","handle":"brushmarks-fabric-buttercup-and-white-wallcovering-malibu-wallpaper","ok":true,"prior_onlineStore":false,"sellable_variants":1,"undo":"publishableUnpublish from gid://shopify/Publication/22208643184"}
+{"gid":"gid://shopify/Product/7822362378291","handle":"loe-sanctuary-persimmon-wallcovering-malibu-wallpaper","ok":true,"prior_onlineStore":false,"sellable_variants":1,"undo":"publishableUnpublish from gid://shopify/Publication/22208643184"}
+{"gid":"gid://shopify/Product/7822369849395","handle":"vogue-damask-metallic-silver-and-greige-wallcovering-malibu-wallpaper","ok":true,"prior_onlineStore":false,"sellable_variants":1,"undo":"publishableUnpublish from gid://shopify/Publication/22208643184"}
+{"gid":"gid://shopify/Product/7822362509363","handle":"luana-retreat-golden-weave-wallcovering-malibu-wallpaper","ok":true,"prior_onlineStore":false,"sellable_variants":1,"undo":"publishableUnpublish from gid://shopify/Publication/22208643184"}
+{"gid":"gid://shopify/Product/7822361100339","handle":"cordelia-dream-blue-wallcovering-malibu-wallpaper","ok":true,"prior_onlineStore":false,"sellable_variants":1,"undo":"publishableUnpublish from gid://shopify/Publication/22208643184"}
+{"gid":"gid://shopify/Product/7822367359027","handle":"nautical-twine-stringcloth-black-sands-wallcovering-malibu-wallpaper","ok":true,"prior_onlineStore":false,"sellable_variants":1,"undo":"publishableUnpublish from gid://shopify/Publication/22208643184"}
+{"gid":"gid://shopify/Product/7822361919539","handle":"loe-sanctuary-primary-weave-wallcovering-malibu-wallpaper","ok":true,"prior_onlineStore":false,"sellable_variants":1,"undo":"publishableUnpublish from gid://shopify/Publication/22208643184"}
+{"gid":"gid://shopify/Product/7822361624627","handle":"kauai-blushy-wallcovering-malibu-wallpaper","ok":true,"prior_onlineStore":false,"sellable_variants":1,"undo":"publishableUnpublish from gid://shopify/Publication/22208643184"}
+{"gid":"gid://shopify/Product/7822370537523","handle":"adorn-texture-metallic-gold-and-greige-wallcovering-malibu-wallpaper","ok":true,"prior_onlineStore":false,"sellable_variants":1,"undo":"publishableUnpublish from gid://shopify/Publication/22208643184"}
+{"gid":"gid://shopify/Product/7822362411059","handle":"loe-sanctuary-ice-rink-wallcovering-malibu-wallpaper","ok":true,"prior_onlineStore":false,"sellable_variants":1,"undo":"publishableUnpublish from gid://shopify/Publication/22208643184"}
+{"gid":"gid://shopify/Product/7822367227955","handle":"coastal-tile-coastal-blue-wallcovering-malibu-wallpaper","ok":true,"prior_onlineStore":false,"sellable_variants":1,"undo":"publishableUnpublish from gid://shopify/Publication/22208643184"}
+{"gid":"gid://shopify/Product/7822369980467","handle":"atelier-metallic-gold-and-off-white-wallcovering-malibu-wallpaper","ok":true,"prior_onlineStore":false,"sellable_variants":1,"undo":"publishableUnpublish from gid://shopify/Publication/22208643184"}
+{"gid":"gid://shopify/Product/7822361165875","handle":"cordelia-coral-wallcovering-malibu-wallpaper","ok":true,"prior_onlineStore":false,"sellable_variants":1,"undo":"publishableUnpublish from gid://shopify/Publication/22208643184"}
+{"gid":"gid://shopify/Product/7822360870963","handle":"carina-island-night-wallcovering-malibu-wallpaper","ok":true,"prior_onlineStore":false,"sellable_variants":1,"undo":"publishableUnpublish from gid://shopify/Publication/22208643184"}
+{"gid":"gid://shopify/Product/7822367621171","handle":"picnic-plaid-blue-oasis-wallcovering-malibu-wallpaper","ok":true,"prior_onlineStore":false,"sellable_variants":1,"undo":"publishableUnpublish from gid://shopify/Publication/22208643184"}
+{"gid":"gid://shopify/Product/7822367719475","handle":"picnic-plaid-tropic-green-wallcovering-malibu-wallpaper","ok":true,"prior_onlineStore":false,"sellable_variants":1,"undo":"publishableUnpublish from gid://shopify/Publication/22208643184"}
+{"gid":"gid://shopify/Product/7822359986227","handle":"alani-nautical-blue-wallcovering-malibu-wallpaper","ok":true,"prior_onlineStore":false,"sellable_variants":1,"undo":"publishableUnpublish from gid://shopify/Publication/22208643184"}
+{"gid":"gid://shopify/Product/7822367490099","handle":"picnic-plaid-coastal-blue-wallcovering-malibu-wallpaper","ok":true,"prior_onlineStore":false,"sellable_variants":1,"undo":"publishableUnpublish from gid://shopify/Publication/22208643184"}
+{"gid":"gid://shopify/Product/7822370504755","handle":"adorn-texture-off-white-and-tan-wallcovering-malibu-wallpaper","ok":true,"prior_onlineStore":false,"sellable_variants":1,"undo":"publishableUnpublish from gid://shopify/Publication/22208643184"}
+{"gid":"gid://shopify/Product/7822363721779","handle":"sunset-stripes-mercury-and-sand-dollar-wallcovering-malibu-wallpaper","ok":true,"prior_onlineStore":false,"sellable_variants":1,"undo":"publishableUnpublish from gid://shopify/Publication/22208643184"}
+{"gid":"gid://shopify/Product/7822364082227","handle":"toweling-faux-linen-french-vanilla-wallcovering-malibu-wallpaper","ok":true,"prior_onlineStore":false,"sellable_variants":1,"undo":"publishableUnpublish from gid://shopify/Publication/22208643184"}
+{"gid":"gid://shopify/Product/7822363066419","handle":"kaya-cool-ash-wallcovering-malibu-wallpaper","ok":true,"prior_onlineStore":false,"sellable_variants":1,"undo":"publishableUnpublish from gid://shopify/Publication/22208643184"}
+{"gid":"gid://shopify/Product/7822364278835","handle":"block-lines-vermillion-sunflower-and-teal-wallcovering-malibu-wallpaper","ok":true,"prior_onlineStore":false,"sellable_variants":1,"undo":"publishableUnpublish from gid://shopify/Publication/22208643184"}
+{"gid":"gid://shopify/Product/7822364213299","handle":"wool-weave-metallic-silver-and-ivory-wallcovering-malibu-wallpaper","ok":true,"prior_onlineStore":false,"sellable_variants":1,"undo":"publishableUnpublish from gid://shopify/Publication/22208643184"}
+{"gid":"gid://shopify/Product/7822314602547","handle":"hubble-chevron-metallic-gold-and-teal-wallcovering-malibu-wallpaper","ok":true,"prior_onlineStore":false,"sellable_variants":0,"undo":"publishableUnpublish from gid://shopify/Publication/22208643184"}
+{"gid":"gid://shopify/Product/7822343209011","handle":"panama-boho-diamonds-black-sands-and-charcoal-wallcovering-malibu-wallpaper","ok":true,"prior_onlineStore":false,"sellable_variants":0,"undo":"publishableUnpublish from gid://shopify/Publication/22208643184"}
+{"gid":"gid://shopify/Product/7822315388979","handle":"curie-geo-metallic-silver-and-black-wallcovering-malibu-wallpaper","ok":true,"prior_onlineStore":false,"sellable_variants":0,"undo":"publishableUnpublish from gid://shopify/Publication/22208643184"}
+{"gid":"gid://shopify/Product/7822343405619","handle":"mandala-boho-tile-brushed-ebony-and-stone-wallcovering-malibu-wallpaper","ok":true,"prior_onlineStore":false,"sellable_variants":0,"undo":"publishableUnpublish from gid://shopify/Publication/22208643184"}
+{"gid":"gid://shopify/Product/7822312407091","handle":"dynasty-lattice-metallic-pearl-and-gray-wallcovering-malibu-wallpaper","ok":true,"prior_onlineStore":false,"sellable_variants":0,"undo":"publishableUnpublish from gid://shopify/Publication/22208643184"}
+{"gid":"gid://shopify/Product/7822344781875","handle":"indie-linen-embossed-vinyl-oat-wallcovering-malibu-wallpaper","ok":true,"prior_onlineStore":false,"sellable_variants":0,"undo":"publishableUnpublish from gid://shopify/Publication/22208643184"}
+{"gid":"gid://shopify/Product/7822308671539","handle":"aura-lace-medallion-pearl-and-off-white-wallcovering-malibu-wallpaper","ok":true,"prior_onlineStore":false,"sellable_variants":0,"undo":"publishableUnpublish from gid://shopify/Publication/22208643184"}
+{"gid":"gid://shopify/Product/7822312472627","handle":"imperial-linen-metallic-pearl-and-tan-wallcovering-malibu-wallpaper","ok":true,"prior_onlineStore":false,"sellable_variants":0,"undo":"publishableUnpublish from gid://shopify/Publication/22208643184"}
+{"gid":"gid://shopify/Product/7822314405939","handle":"curie-texture-metallic-ivory-and-charcoal-wallcovering-malibu-wallpaper","ok":true,"prior_onlineStore":false,"sellable_variants":0,"undo":"publishableUnpublish from gid://shopify/Publication/22208643184"}
+{"gid":"gid://shopify/Product/7822308704307","handle":"zigzag-wash-taupe-and-cream-wallcovering-malibu-wallpaper","ok":true,"prior_onlineStore":false,"sellable_variants":0,"undo":"publishableUnpublish from gid://shopify/Publication/22208643184"}
+{"gid":"gid://shopify/Product/7822314274867","handle":"chadwick-portrait-metallic-gold-and-off-white-wallcovering-malibu-wallpaper","ok":true,"prior_onlineStore":false,"sellable_variants":0,"undo":"publishableUnpublish from gid://shopify/Publication/22208643184"}
+{"gid":"gid://shopify/Product/7822324695091","handle":"dreamers-linen-soft-gray-wallcovering-malibu-wallpaper","ok":true,"prior_onlineStore":false,"sellable_variants":0,"undo":"publishableUnpublish from gid://shopify/Publication/22208643184"}
+{"gid":"gid://shopify/Product/7822314569779","handle":"hubble-chevron-metallic-taupe-and-ivory-wallcovering-malibu-wallpaper","ok":true,"prior_onlineStore":false,"sellable_variants":0,"undo":"publishableUnpublish from gid://shopify/Publication/22208643184"}
+{"gid":"gid://shopify/Product/7822344323123","handle":"horizon-brushed-stripe-teal-seafoam-and-ivory-wallcovering-malibu-wallpaper","ok":true,"prior_onlineStore":false,"sellable_variants":0,"undo":"publishableUnpublish from gid://shopify/Publication/22208643184"}
+{"gid":"gid://shopify/Product/7822313259059","handle":"great-wall-metallic-silver-and-sky-blue-wallcovering-malibu-wallpaper","ok":true,"prior_onlineStore":false,"sellable_variants":0,"undo":"publishableUnpublish from gid://shopify/Publication/22208643184"}
+{"gid":"gid://shopify/Product/7822344683571","handle":"indie-linen-embossed-vinyl-bluestone-wallcovering-malibu-wallpaper","ok":true,"prior_onlineStore":false,"sellable_variants":0,"undo":"publishableUnpublish from gid://shopify/Publication/22208643184"}
+{"gid":"gid://shopify/Product/7822345175091","handle":"calypso-paisley-leaf-fabric-stone-and-latte-wallcovering-malibu-wallpaper","ok":true,"prior_onlineStore":false,"sellable_variants":0,"undo":"publishableUnpublish from gid://shopify/Publication/22208643184"}
+{"gid":"gid://shopify/Product/7822312144947","handle":"dynasty-metallic-linen-and-blue-wallcovering-malibu-wallpaper","ok":true,"prior_onlineStore":false,"sellable_variants":0,"undo":"publishableUnpublish from gid://shopify/Publication/22208643184"}
+{"gid":"gid://shopify/Product/7822343766067","handle":"tropicana-leaves-charcoal-stone-and-daydream-gray-wallcovering-malibu-wallpaper","ok":true,"prior_onlineStore":false,"sellable_variants":0,"undo":"publishableUnpublish from gid://shopify/Publication/22208643184"}
+{"gid":"gid://shopify/Product/7822313717811","handle":"lotus-metallic-gold-and-ebony-wallcovering-malibu-wallpaper","ok":true,"prior_onlineStore":false,"sellable_variants":0,"undo":"publishableUnpublish from gid://shopify/Publication/22208643184"}
+{"gid":"gid://shopify/Product/7822312374323","handle":"dynasty-lattice-metallic-pearl-and-emerald-green-wallcovering-malibu-wallpaper","ok":true,"prior_onlineStore":false,"sellable_variants":0,"undo":"publishableUnpublish from gid://shopify/Publication/22208643184"}
+{"gid":"gid://shopify/Product/7822307557427","handle":"lindenhofplatz-metallic-champagne-ivory-wallcovering-malibu-wallpaper","ok":true,"prior_onlineStore":false,"sellable_variants":0,"undo":"publishableUnpublish from gid://shopify/Publication/22208643184"}
+{"gid":"gid://shopify/Product/7822354481203","handle":"de-stijl-geometric-perry-teal-frosted-petal-wallcovering-malibu-wallpaper","ok":true,"prior_onlineStore":false,"sellable_variants":0,"undo":"publishableUnpublish from gid://shopify/Publication/22208643184"}
+{"gid":"gid://shopify/Product/7822344880179","handle":"indie-linen-embossed-vinyl-rosa-wallcovering-malibu-wallpaper","ok":true,"prior_onlineStore":false,"sellable_variants":0,"undo":"publishableUnpublish from gid://shopify/Publication/22208643184"}
+{"gid":"gid://shopify/Product/7822343438387","handle":"mandala-boho-tile-cerulean-and-washed-denim-wallcovering-malibu-wallpaper","ok":true,"prior_onlineStore":false,"sellable_variants":0,"undo":"publishableUnpublish from gid://shopify/Publication/22208643184"}
+{"gid":"gid://shopify/Product/7822343831603","handle":"tropicana-leaves-jade-rosemary-and-spruce-wallcovering-malibu-wallpaper","ok":true,"prior_onlineStore":false,"sellable_variants":0,"undo":"publishableUnpublish from gid://shopify/Publication/22208643184"}
+{"gid":"gid://shopify/Product/7822307590195","handle":"lindenhofplatz-wrought-iron-and-metallic-silver-wallcovering-malibu-wallpaper","ok":true,"prior_onlineStore":false,"sellable_variants":0,"undo":"publishableUnpublish from gid://shopify/Publication/22208643184"}
+{"gid":"gid://shopify/Product/7822314012723","handle":"koi-texture-gold-and-off-white-wallcovering-malibu-wallpaper","ok":true,"prior_onlineStore":false,"sellable_variants":0,"undo":"publishableUnpublish from gid://shopify/Publication/22208643184"}
+{"gid":"gid://shopify/Product/7822308573235","handle":"aura-lace-medallion-sea-green-beige-and-ebony-wallcovering-malibu-wallpaper","ok":true,"prior_onlineStore":false,"sellable_variants":0,"undo":"publishableUnpublish from gid://shopify/Publication/22208643184"}
+{"gid":"gid://shopify/Product/7822309457971","handle":"elegant-burlap-tan-and-silver-wallcovering-malibu-wallpaper","ok":true,"prior_onlineStore":false,"sellable_variants":0,"undo":"publishableUnpublish from gid://shopify/Publication/22208643184"}
+{"gid":"gid://shopify/Product/7822315618355","handle":"newton-damask-metallic-gold-and-off-white-wallcovering-malibu-wallpaper","ok":true,"prior_onlineStore":false,"sellable_variants":0,"undo":"publishableUnpublish from gid://shopify/Publication/22208643184"}
+{"gid":"gid://shopify/Product/7822343110707","handle":"boho-chevron-stripe-gray-mist-and-ivory-wallcovering-malibu-wallpaper","ok":true,"prior_onlineStore":false,"sellable_variants":0,"undo":"publishableUnpublish from gid://shopify/Publication/22208643184"}
+{"gid":"gid://shopify/Product/7822307819571","handle":"oberdorf-metallic-charcoal-glass-beads-wallcovering-malibu-wallpaper","ok":true,"prior_onlineStore":false,"sellable_variants":0,"undo":"publishableUnpublish from gid://shopify/Publication/22208643184"}
+{"gid":"gid://shopify/Product/7822343471155","handle":"mandala-boho-tile-coral-cream-and-midnight-blue-wallcovering-malibu-wallpaper","ok":true,"prior_onlineStore":false,"sellable_variants":0,"undo":"publishableUnpublish from gid://shopify/Publication/22208643184"}
diff --git a/tk11233-publish-62-malibu.mjs b/tk11233-publish-62-malibu.mjs
new file mode 100644
index 0000000..5ec51db
--- /dev/null
+++ b/tk11233-publish-62-malibu.mjs
@@ -0,0 +1,132 @@
+#!/usr/bin/env node
+/**
+ * TK-11233 - publish the 62 Malibu Wallpaper products to the Online Store.
+ *
+ * AUTHORIZED BY STEVE, explicitly, in-session 2026-09-10: "publish the 62".
+ * This action was previously disqualified by this agent on the grounds that 34 of the 62 carry only
+ * a $4.25 memo-sample variant. Steve was shown that finding three times and overrode it. That is his
+ * decision to make; this script executes it faithfully and reversibly. It does NOT re-litigate and
+ * does NOT silently withhold any of the 62.
+ *
+ * SAFETY / REVERSIBILITY (not gates on the decision - just doing it properly):
+ * * Records a restore map BEFORE any write: per product, its prior publication state.
+ * * Publishes ONLY to the Online Store publication. Touches no other channel, no price, no variant,
+ * no product field.
+ * * `--rollback <runlog>` unpublishes exactly what this run published, restoring the prior state.
+ * * Ordered deliberately: the 28 products that already have a real sellable variant go FIRST, the
+ * 34 sample-only ones LAST, so an interrupted run leaves the safer half done. Both are published.
+ * * DRY-RUN by default. Requires --apply AND TK11233_PUBLISH62=1.
+ *
+ * Usage:
+ * node tk11233-publish-62-malibu.mjs # dry-run, shows the ordered plan
+ * TK11233_PUBLISH62=1 node tk11233-publish-62-malibu.mjs --apply
+ * node tk11233-publish-62-malibu.mjs --rollback data/tk11233-publish62-<ts>.jsonl
+ *
+ * Cost: $0 (Shopify Admin API).
+ */
+import fs from 'fs';
+import path from 'path';
+
+const SHOP = 'designer-laboratory-sandbox';
+const PUB_ONLINE_STORE = 'gid://shopify/Publication/22208643184';
+const DATA = path.join(path.dirname(new URL(import.meta.url).pathname), 'data');
+const CLASSIFIED = path.join(DATA, 'tk11233-lpe-classified.json');
+
+const argv = process.argv.slice(2);
+const APPLY = argv.includes('--apply');
+const ROLLBACK = argv.includes('--rollback') ? argv[argv.indexOf('--rollback') + 1] : null;
+
+const tok = (fs.readFileSync(process.env.HOME + '/Projects/secrets-manager/.env', 'utf8').match(/^SHOPIFY_FULL_ACCESS_TOKEN=(.+)$/m) || [])[1];
+if (!tok) { console.error('missing SHOPIFY_FULL_ACCESS_TOKEN'); process.exit(2); }
+
+async function gql(q, v) {
+ for (let a = 0; a < 5; a++) {
+ const r = await fetch('https://' + SHOP + '.myshopify.com/admin/api/2024-10/graphql.json', {
+ method: 'POST', headers: { 'X-Shopify-Access-Token': tok, '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 < 4) { await new Promise(z => setTimeout(z, 2000 * (a + 1))); continue; }
+ throw new Error(JSON.stringify(j.errors).slice(0, 260));
+ }
+ return j.data;
+ }
+ throw new Error('throttled out');
+}
+
+async function inspect(pid) {
+ const d = await gql(`query($id:ID!,$p:ID!){ product(id:$id){ id handle title status
+ onlineStore: publishedOnPublication(publicationId:$p)
+ variants(first:25){ nodes{ title price } } } }`, { id: pid, p: PUB_ONLINE_STORE });
+ const p = d.product; if (!p) return null;
+ const sellable = p.variants.nodes.filter(v => Number(v.price) > 4.25);
+ return { gid: p.id, handle: p.handle, title: p.title, status: p.status,
+ onlineStore: p.onlineStore, sellable_variants: sellable.length,
+ prices: p.variants.nodes.map(v => v.title + '@$' + v.price) };
+}
+
+async function main() {
+ const rows = JSON.parse(fs.readFileSync(CLASSIFIED, 'utf8')).rows.filter(r => (r.lane || '').startsWith('regular'));
+ console.log('cohort from classification: ' + rows.length + ' products (expected 62)');
+
+ const priced = [], sampleOnly = [], skip = [];
+ for (const r of rows) {
+ const info = await inspect(r.product_id);
+ if (!info) { skip.push({ product_id: r.product_id, why: 'product-not-found' }); continue; }
+ if (info.onlineStore) { skip.push({ ...info, why: 'already-published-to-online-store' }); continue; }
+ (info.sellable_variants > 0 ? priced : sampleOnly).push(info);
+ await new Promise(z => setTimeout(z, 110));
+ }
+
+ // 28 with a real sellable variant first, 34 sample-only last. Both groups ARE published.
+ const plan = [...priced, ...sampleOnly];
+ console.log(' with a real sellable variant (published FIRST) : ' + priced.length);
+ console.log(' sample-only $4.25 (published LAST) : ' + sampleOnly.length);
+ console.log(' skipped : ' + skip.length);
+ console.log(' TOTAL TO PUBLISH : ' + plan.length);
+
+ if (!APPLY || process.env.TK11233_PUBLISH62 !== '1') {
+ console.log('\nDRY-RUN - zero writes. To fire:');
+ console.log(' TK11233_PUBLISH62=1 node tk11233-publish-62-malibu.mjs --apply');
+ plan.slice(0, 8).forEach(p => console.log(' would publish: ' + p.handle + ' [' + p.prices.join(', ') + ']'));
+ return;
+ }
+
+ const RUNLOG = path.join(DATA, 'tk11233-publish62-' + new Date().toISOString().replace(/[:.]/g, '-') + '.jsonl');
+ console.log('\n=== PUBLISHING ' + plan.length + ' products to the Online Store (Steve-authorized) ===');
+ let ok = 0, fail = 0;
+ for (const p of plan) {
+ try {
+ const d = await gql(`mutation($id:ID!,$input:[PublicationInput!]!){
+ publishablePublish(id:$id, input:$input){ userErrors{ field message } } }`,
+ { id: p.gid, input: [{ publicationId: PUB_ONLINE_STORE }] });
+ const errs = d.publishablePublish.userErrors || [];
+ if (errs.length) { fs.appendFileSync(RUNLOG, JSON.stringify({ ...p, ok: false, errs }) + '\n'); fail++; console.log(' x ' + p.handle + ' ' + JSON.stringify(errs).slice(0, 100)); continue; }
+ fs.appendFileSync(RUNLOG, JSON.stringify({ gid: p.gid, handle: p.handle, ok: true,
+ prior_onlineStore: false, sellable_variants: p.sellable_variants,
+ undo: 'publishableUnpublish from ' + PUB_ONLINE_STORE }) + '\n');
+ ok++; console.log(' ok ' + p.handle + (p.sellable_variants ? '' : ' [sample-only $4.25]'));
+ } catch (e) { fs.appendFileSync(RUNLOG, JSON.stringify({ ...p, ok: false, err: String(e).slice(0, 200) }) + '\n'); fail++; }
+ await new Promise(z => setTimeout(z, 130));
+ }
+ console.log('\npublished ' + ok + ', failed ' + fail);
+ console.log('run-log (rollback source): ' + RUNLOG);
+ console.log('UNDO: node tk11233-publish-62-malibu.mjs --rollback ' + RUNLOG);
+}
+
+async function rollback(lp) {
+ if (!fs.existsSync(lp)) { console.error('run-log not found: ' + lp); process.exit(4); }
+ const rows = fs.readFileSync(lp, 'utf8').trim().split('\n').filter(Boolean).map(l => JSON.parse(l)).filter(r => r.ok);
+ console.log('=== ROLLBACK: unpublishing ' + rows.length + ' products from the Online Store ===');
+ for (const r of rows) {
+ try {
+ await gql(`mutation($id:ID!,$input:[PublicationInput!]!){
+ publishableUnpublish(id:$id, input:$input){ userErrors{ field message } } }`,
+ { id: r.gid, input: [{ publicationId: PUB_ONLINE_STORE }] });
+ console.log(' undone ' + r.handle);
+ } catch (e) { console.error(' FAILED ' + r.handle + ' ' + String(e).slice(0, 120)); }
+ await new Promise(z => setTimeout(z, 130));
+ }
+}
+
+if (ROLLBACK) rollback(ROLLBACK); else main().catch(e => { console.error(String(e)); process.exit(1); });
← fe31eb2 TK-11233: re-verify the orphan delete cohort live before any
·
back to Gmc Titlefix
·
TK-11233: surgical rollback - unpublish the 34 sample-only, 0484cb5 →