[object Object]

← back to Gmc Titlefix

TK-11233 B3: --min/--cap args for approved canary run (threshold 1200, cap 25)

835144cf718085e3a20d3856f2d4ffd114442841 · 2026-09-04 11:14:45 -0700 · Steve

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Dj5vkpUp18yQkVZEYNdSCG

Files touched

Diff

commit 835144cf718085e3a20d3856f2d4ffd114442841
Author: Steve <steve@designerwallcoverings.com>
Date:   Fri Sep 4 11:14:45 2026 -0700

    TK-11233 B3: --min/--cap args for approved canary run (threshold 1200, cap 25)
    
    Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
    Claude-Session: https://claude.ai/code/session_01Dj5vkpUp18yQkVZEYNdSCG
---
 tk11233-kravet-hires-canary.mjs | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/tk11233-kravet-hires-canary.mjs b/tk11233-kravet-hires-canary.mjs
index 55f192e..6064fd9 100644
--- a/tk11233-kravet-hires-canary.mjs
+++ b/tk11233-kravet-hires-canary.mjs
@@ -28,7 +28,8 @@ import fs from 'fs';
 import os from 'os';
 
 const SHOP = 'designer-laboratory-sandbox';
-const MIN_HIRES = 1500;          // require original ≥1500px on the long edge to bother (Google bar is 1024; headroom)
+const MIN_HIRES = parseInt((process.argv.find(a=>a==='--min') ? process.argv[process.argv.indexOf('--min')+1] : '1500'), 10);  // require original ≥N px on long edge (Google bar 1024)
+const APPLY_CAP = parseInt((process.argv.find(a=>a==='--cap') ? process.argv[process.argv.indexOf('--cap')+1] : '0'), 10);      // hard cap on # applied this run (0 = all)
 const SERVED_MAX_OK = 1024;      // served ≥1024 = already fine, skip
 const LIMIT = parseInt((process.argv.find(a=>a==='--limit') ? process.argv[process.argv.indexOf('--limit')+1] : '25'), 10);
 const APPLY = process.argv.includes('--apply');
@@ -132,8 +133,9 @@ async function apply() {
     process.exit(3);
   }
   const rpt = await enumerate();
-  console.log(`\n=== APPLY (gated, approved) — adding hi-res primary to ${rpt.needs_hires.length} products ===`);
-  for (const r of rpt.needs_hires) {
+  const targets = APPLY_CAP > 0 ? rpt.needs_hires.slice(0, APPLY_CAP) : rpt.needs_hires;
+  console.log(`\n=== APPLY (gated, approved) — min=${MIN_HIRES}px, adding hi-res primary to ${targets.length} of ${rpt.needs_hires.length} candidates (cap=${APPLY_CAP||'none'}) ===`);
+  for (const r of targets) {
     try {
       const cm = await shopify(`mutation($pid:ID!,$media:[CreateMediaInput!]!){
         productCreateMedia(productId:$pid, media:$media){ media{ id status } mediaUserErrors{ field message } } }`,

← 4e97f12 TK-11233 B3: Kravet-family hi-res re-fetch canary (read-only  ·  back to Gmc Titlefix  ·  TK-11233 B3: canary run 25@1200 + self-heal FAILED media (Sh eb7b9da →