[object Object]

← back to Gmc Titlefix

TK-11233 B3: skip >5000px/25MP originals up front (avoid Shopify processing-fail churn)

7480c9d344781678227976b704f67dbdbf0c70df · 2026-09-04 11:33:17 -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 7480c9d344781678227976b704f67dbdbf0c70df
Author: Steve <steve@designerwallcoverings.com>
Date:   Fri Sep 4 11:33:17 2026 -0700

    TK-11233 B3: skip >5000px/25MP originals up front (avoid Shopify processing-fail churn)
    
    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 451c93c..2602ead 100644
--- a/tk11233-kravet-hires-canary.mjs
+++ b/tk11233-kravet-hires-canary.mjs
@@ -31,6 +31,7 @@ const SHOP = 'designer-laboratory-sandbox';
 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 MAX_HIRES = 5000;          // originals >~5000px (>25MP) fail Shopify media processing — skip up front (4803² OK, 6000² FAILED)
 const LIMIT = parseInt((process.argv.find(a=>a==='--limit') ? process.argv[process.argv.indexOf('--limit')+1] : '25'), 10);
 const APPLY = process.argv.includes('--apply');
 const ROLLBACK = process.argv.includes('--rollback') ? process.argv[process.argv.indexOf('--rollback')+1] : null;
@@ -85,7 +86,7 @@ async function primaryMedia(pid) {
 
 async function enumerate() {
   const cands = pickCandidates(LIMIT);
-  const needs = [], origSmall = [], alreadyOk = [], errors = [];
+  const needs = [], origSmall = [], alreadyOk = [], tooLarge = [], errors = [];
   const rollbackMap = [];
   for (const c of cands) {
     try {
@@ -98,6 +99,7 @@ async function enumerate() {
         served_long: servedLong, served: `${m.first.image.width}x${m.first.image.height}`,
         orig_long: od.long, orig: `${od.w}x${od.h}`, orig_url: c.orig };
       if (servedLong >= SERVED_MAX_OK) { alreadyOk.push(row); }
+      else if (od.long > MAX_HIRES) { tooLarge.push({ ...row, note: `original >${MAX_HIRES}px (~>25MP) — Shopify would fail processing; skip/downscale later` }); }
       else if (od.long >= MIN_HIRES) { needs.push(row);
         rollbackMap.push({ gid: m.gid, old_primary_media_id: m.first.id, old_primary_src: m.first.image.url, old_media_count: m.mediaCount }); }
       else { origSmall.push({ ...row, note: 'original-also-small → excluded (defer to upscale program)' }); }
@@ -108,8 +110,8 @@ async function enumerate() {
     scope: 'ACTIVE Kravet-family products in kravet_catalog with Brandfolder originals',
     thresholds: { served_ok_px: SERVED_MAX_OK, min_original_px: MIN_HIRES },
     sample: cands.length,
-    counts: { needs_hires: needs.length, original_also_small_excluded: origSmall.length, already_ok: alreadyOk.length, errors: errors.length },
-    needs_hires: needs, original_also_small_excluded: origSmall, already_ok: alreadyOk, errors,
+    counts: { needs_hires: needs.length, original_also_small_excluded: origSmall.length, original_too_large_excluded: tooLarge.length, already_ok: alreadyOk.length, errors: errors.length },
+    needs_hires: needs, original_also_small_excluded: origSmall, original_too_large_excluded: tooLarge, already_ok: alreadyOk, errors,
     rollback_map: rollbackMap,
     apply_gate: 'HARD-GATED — requires --apply AND env TK11233_APPROVED=1; apply ADDS new media (never deletes the original); reversible via --rollback <run-log>.'
   };

← eb7b9da TK-11233 B3: canary run 25@1200 + self-heal FAILED media (Sh  ·  back to Gmc Titlefix  ·  TK-11233 B3: deterministic --offset pagination + chunked res e2478b3 →