[object Object]

← back to Designer Wallcoverings

fixer: add --max-price hold (park outliers for manual review); shipped 195 live fixes

1e8a2ff79dac8475d9ef6a1f9fd5d423b9b689a4 · 2026-06-11 13:25:56 -0700 · SteveStudio2

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

Files touched

Diff

commit 1e8a2ff79dac8475d9ef6a1f9fd5d423b9b689a4
Author: SteveStudio2 <stevestudio2@SteveStudio2s-Mac-Studio.local>
Date:   Thu Jun 11 13:25:56 2026 -0700

    fixer: add --max-price hold (park outliers for manual review); shipped 195 live fixes
    
    Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
---
 shopify/scripts/cadence/fix-broken-rolls.js | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/shopify/scripts/cadence/fix-broken-rolls.js b/shopify/scripts/cadence/fix-broken-rolls.js
index 9e01a151..de446f30 100644
--- a/shopify/scripts/cadence/fix-broken-rolls.js
+++ b/shopify/scripts/cadence/fix-broken-rolls.js
@@ -35,6 +35,7 @@ const val = (n, d) => { const i = args.indexOf(n); return i >= 0 ? args[i + 1] :
 const COMMIT = flag('--commit');
 const ONLY = val('--vendor', null);
 const LIMIT = parseInt(val('--limit', '50'), 10);
+const MAXP = parseFloat(val('--max-price', 'Infinity'));   // proposed prices above this are HELD for manual review
 
 const SANE_MIN = 5, SANE_MAX = 50000, SAMPLE = 4.25;
 const KILL = path.join(os.homedir(), '.dw-fixer-stop');
@@ -109,7 +110,7 @@ function fixableRows(vendor, cfg) {
   ensureAudit();
 
   const vendors = Object.entries(VENDORS).filter(([v]) => !ONLY || v === ONLY);
-  let batch = [], skipped = [];
+  let batch = [], skipped = [], held = [];
   for (const [v, cfg] of vendors) {
     let rows;
     try { rows = fixableRows(v, cfg); } catch (e) { console.log(`  ${v}: query error ${e.message.slice(0,120)}`); continue; }
@@ -118,12 +119,15 @@ function fixableRows(vendor, cfg) {
       if (!(r.proposed > r.old) || r.proposed < SANE_MIN || r.proposed > SANE_MAX || !isFinite(r.proposed)) {
         skipped.push(r); continue;
       }
+      // --max-price hold: park high-priced outliers for manual review, never auto-ship them
+      if (r.proposed > MAXP) { held.push(r); continue; }
       batch.push(r);
     }
   }
   batch.sort((a, b) => b.proposed - a.proposed);
 
-  console.log(`\nfixable confirmed-cost broken rolls: ${batch.length}  (sanity-skipped: ${skipped.length})`);
+  console.log(`\nfixable confirmed-cost broken rolls: ${batch.length}  (sanity-skipped: ${skipped.length}, held >$${MAXP}: ${held.length})`);
+  if (held.length) held.forEach(r => console.log(`  HELD [${r.vendor}] ${r.mfr_sku} $${r.old} -> $${r.proposed} (review)`));
   const byV = {};
   batch.forEach(r => { byV[r.vendor] = (byV[r.vendor] || 0) + 1; });
   Object.entries(byV).forEach(([v, n]) => console.log(`  ${v}: ${n}`));
@@ -133,7 +137,7 @@ function fixableRows(vendor, cfg) {
   // write the full proposed batch for review
   const outDir = path.join(__dirname, 'data'); fs.mkdirSync(outDir, { recursive: true });
   const outFile = path.join(outDir, 'broken-roll-fixes.json');
-  fs.writeFileSync(outFile, JSON.stringify({ generatedFor: COMMIT ? 'commit' : 'dry-run', total: batch.length, batch, skipped }, null, 1));
+  fs.writeFileSync(outFile, JSON.stringify({ generatedFor: COMMIT ? 'commit' : 'dry-run', total: batch.length, batch, held, skipped }, null, 1));
   console.log(`\nfull batch -> ${outFile}`);
 
   if (!COMMIT) {

← e5cc2b10 schu-activate: normalize mixed pid format (bare-id vs full-g  ·  back to Designer Wallcoverings  ·  Add daily vendor sweep (com.steve.cadence-daily-sweep) — Kra a5291a3f →