[object Object]

← back to Dw Yolo Loop

Kravet split-brain fix: copy kravet_authoritative_pricing (44734 SKUs) Mac2->Kamatera canonical; 10645 live products now MAP-matched, 457 ROLL safe-reprice target

7131130a41b87aa76fc948e91511536444c5578b · 2026-06-16 13:50:27 -0700 · Steve Abrams

Files touched

Diff

commit 7131130a41b87aa76fc948e91511536444c5578b
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Tue Jun 16 13:50:27 2026 -0700

    Kravet split-brain fix: copy kravet_authoritative_pricing (44734 SKUs) Mac2->Kamatera canonical; 10645 live products now MAP-matched, 457 ROLL safe-reprice target
---
 .../sync_authoritative_mac2_to_kamatera.sh           | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/scripts/kravet-master-2026/sync_authoritative_mac2_to_kamatera.sh b/scripts/kravet-master-2026/sync_authoritative_mac2_to_kamatera.sh
new file mode 100755
index 0000000..a9b0f8c
--- /dev/null
+++ b/scripts/kravet-master-2026/sync_authoritative_mac2_to_kamatera.sh
@@ -0,0 +1,20 @@
+#!/usr/bin/env bash
+# Split-brain fix: the broad Kravet MAP master (kravet_authoritative_pricing, 44,734 SKUs,
+# Mar+Apr 2026 sheets) was built on Mac2's LOCAL dw_unified but never existed on Kamatera
+# (canonical) — which is where the shopify_api_queue write-path runs. This copies it over,
+# additively (CREATE IF NOT EXISTS, no DROP). Keyed by mfr_sku -> joins live shopify_products.
+# Pair with kravet_master_price_2026 (Jan-2026, carries unit_of_measure) for the ROLL-only guard.
+set -euo pipefail
+CSV=/tmp/kravet_auth_pricing.csv
+PGHOST=/tmp psql -d dw_unified -c "\copy (select mfr_sku,old_whls,old_map,new_whls,new_map,source,loaded_at from kravet_authoritative_pricing) to '$CSV' with (format csv, header true)"
+scp -q "$CSV" my-server:"$CSV"
+ssh my-server "psql -U dw_admin -d dw_unified -h 127.0.0.1 -v ON_ERROR_STOP=1 <<'SQL'
+CREATE TABLE IF NOT EXISTS kravet_authoritative_pricing (
+  mfr_sku text PRIMARY KEY, old_whls numeric, old_map numeric,
+  new_whls numeric, new_map numeric, source text, loaded_at timestamptz
+);
+\copy kravet_authoritative_pricing FROM '$CSV' WITH (FORMAT csv, HEADER true)
+CREATE INDEX IF NOT EXISTS idx_kap_mfr_upper ON kravet_authoritative_pricing (upper(mfr_sku));
+ANALYZE kravet_authoritative_pricing;
+SQL"
+ssh my-server "psql -U dw_admin -d dw_unified -h 127.0.0.1 -tA -c \"select count(*) from kravet_authoritative_pricing;\""

← ff928c0 cycle-33: promote-canary.sh harness — generate launchd plist  ·  back to Dw Yolo Loop  ·  dark-inventory scan (c36): only 1,062 sellable-ready archive cb534c8 →