[object Object]

← back to Dw Title Repair

TK-11376: derive ledger tag from the map filename

192fcfdd5411dbf0fa33be085cc7c1dba9c69929 · 2026-09-10 11:48:16 -0700 · steve

Both supplements matched MAP.includes('supp') and wrote into one shared
apply-supp-progress.jsonl (1,822 records = 920 + 902). Restore maps are separate
and authoritative so rollback was never affected, but per-supplement forensics
were muddied. Tag now comes from the map's own filename.

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

Files touched

Diff

commit 192fcfdd5411dbf0fa33be085cc7c1dba9c69929
Author: steve <steve@designerwallcoverings.com>
Date:   Thu Sep 10 11:48:16 2026 -0700

    TK-11376: derive ledger tag from the map filename
    
    Both supplements matched MAP.includes('supp') and wrote into one shared
    apply-supp-progress.jsonl (1,822 records = 920 + 902). Restore maps are separate
    and authoritative so rollback was never affected, but per-supplement forensics
    were muddied. Tag now comes from the map's own filename.
    
    Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
---
 apply.mjs | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/apply.mjs b/apply.mjs
index efd27dc..84232a7 100755
--- a/apply.mjs
+++ b/apply.mjs
@@ -6,7 +6,8 @@ const APPLY=process.env.APPLY==='1', DIR=process.env.UNDO==='1'?'undo':'apply';
 const LIMIT=parseInt(process.env.LIMIT||'0',10);
 if(!DOM||!TOK){console.error('missing SHOPIFY_STORE_DOMAIN / SHOPIFY_ADMIN_TOKEN');process.exit(1);}
 const MAP=process.env.MAP||'data/restore-map.tsv';
-const TAG=MAP.includes('supp')?'-supp':'';
+// derive the tag from the map's own filename so supp and supp2 never share a ledger
+const TAG=(MAP.match(/restore-map-([a-z0-9]+)\.tsv/)||[])[1] ? '-'+(MAP.match(/restore-map-([a-z0-9]+)\.tsv/))[1] : '';
 const rows=fs.readFileSync(MAP,'utf8').trim().split('\n')
   .map(l=>{const [id,oldT,newT]=l.split('\t');return {id,from:DIR==='apply'?oldT:newT,to:DIR==='apply'?newT:oldT};});
 const work=LIMIT?rows.slice(0,LIMIT):rows;

← 85acf92 TK-11376 supplement 2: 902 more via clean manufacturer_sku m  ·  back to Dw Title Repair  ·  auto-data-snapshot: 2026-09-10T12:25:41 (1 data files) — dat d25e390 →