[object Object]

← back to Kravet Wrongjoin Reprice 2026 07

contrarian addendum: refute format-diff attack, disclose MAP-metafield conflict, add freshness pre-flight + tiering

6c245ab1d9f57f700a8867cccba87c211de4fd33 · 2026-07-15 14:31:53 -0700 · Steve Abrams

Files touched

Diff

commit 6c245ab1d9f57f700a8867cccba87c211de4fd33
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Wed Jul 15 14:31:53 2026 -0700

    contrarian addendum: refute format-diff attack, disclose MAP-metafield conflict, add freshness pre-flight + tiering
---
 MEMO-COPY.md | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 60 insertions(+)

diff --git a/MEMO-COPY.md b/MEMO-COPY.md
new file mode 100644
index 0000000..dcb7673
--- /dev/null
+++ b/MEMO-COPY.md
@@ -0,0 +1,60 @@
+# GATED — DWKK wrong-join MAP reprice (425 ACTIVE products)
+
+**Date:** 2026-07-15 · **Officer:** vp-dw-commerce · **Type:** customer-facing price write (Shopify LIVE) — Steve approval required
+**Repo:** `~/Projects/kravet-wrongjoin-reprice-2026-07/` (CSV committed) · **Cost of fix run: ~$0** (Shopify Admin API is free; local script, $0 local)
+
+## What happened (plain English)
+
+425 ACTIVE DWKK (Kravet-family) products on the live store are priced off the **wrong SKU's MAP**. The local mirror column `shopify_products.mfr_sku` is corrupted for 593 active DWKK rows — it holds a *different* Kravet-family SKU than the product's true one (ground truth = metafield `global.Item`, which matches title/barcode/tags on every product checked). A repricer then **joined `kravet_authoritative_pricing` on that corrupt column** and pushed the wrong SKU's MAP live.
+
+Root-cause trace (full detail in `~/Projects/kravet-wrongjoin-reprice-2026-07/ROOT-CAUSE.md`):
+- **Column corruption:** 524/593 corrupt mirror values exactly equal `kravet_catalog.mfr_sku` for the same `dw_sku` — the mirror was stamped from `kravet_catalog`, whose dw_sku↔Shopify-product assignments were cross-wired by the April-2026 bulk-push dw_sku collisions + the dw_sku-keyed pointer reconcile (`fix_catalog_drift.sql`).
+- **The wrong-join writer:** `DW-Programming/archive-recovery/reprice-restore-kravet.js` (ran 2026-06-11, Kamatera) — joins the April sheet `ON s.mfr_sku_norm = <normalized sp.mfr_sku>` and sets every non-sample variant `price = max(s.map_num)`, while force-reactivating archived products. Exactly the observed signature.
+
+## Scale + proof
+
+- **425 products** affected (list: `~/Projects/kravet-wrongjoin-reprice-2026-07/affected-dwkk-wrongjoin.csv`, sorted by |delta|).
+- **360 are BELOW true MAP** — live Kravet MAP-compliance exposure. Under-gap sums to **~$142,635** (avg ~$396/product).
+- **65 are ABOVE true MAP** — not a compliance breach, but violates the price-at-MAP standing rule. Included in the same 425-row fix.
+- **Proof:** 12/15 random live spot-checks have live price EXACTLY == the wrong-join SKU's `new_map`.
+- **Example:** DWKK-100001 (handle `dwkk-g1d98bf09`, Zina Moire, true SKU `8012112.30.0`, true MAP **$274.05**) is live at **$469.35** == MAP of `114/16033.CS.0` — the value sitting in its corrupt mirror `mfr_sku`. Zina's metafields contain no trace of `114/16033`.
+- **Worst rows:** DWKK-102058 / 102060 / 102056 / 102057 (Brunschwig Metallic Modern) live ~$89.93 vs true MAP ~$5,347–5,906.
+- **Healthy control:** 24/25 random active DWKK products with CORRECT mirror mfr_sku sit exactly at MAP — the July MAP repricing itself worked; only the wrong-join rows are broken.
+
+## THE ASK
+
+Approve repricing the **425 affected ACTIVE DWKK products' main (non-Sample) variant to `correct_price` (true MAP = authoritative WHLS × 1.5)** from the CSV, via Shopify Admin GraphQL `productVariantsBulkUpdate` (API 2024-10, `designer-laboratory-sandbox.myshopify.com`). **PG mirror untouched** — it resyncs from Shopify (Shopify write is the authoritative customer-facing one).
+
+### Batch plan
+- 50 products/batch, grouped per product (one `productVariantsBulkUpdate` per product), ≥90s gap between batches, throttle-aware retry on 429/5xx.
+- Per-variant pre-write guard (same pattern as `kravet-reprice-apply.js`): re-fetch live price; write only when live == CSV `wrong_map_likely_live` (±1¢). Drifted rows are logged + skipped, never blind-written. Already-at-true-MAP rows skip (idempotent).
+- Sample variants ($4.25) NEVER touched. Product status NEVER touched.
+- Variant GIDs resolvable via `kravet_dwkk_variant_map` (April-21 snapshot — GIDs usable, prices stale) with a live re-fetch confirming the SKU.
+
+### Rollback plan
+- The CSV records the current (wrong) live price per row (`wrong_map_likely_live`). A reverse pass over the same CSV restores every price exactly. Run log (per-row from→to + verify readback) written to the repo and committed.
+
+### Verification plan
+- Post-write: re-run the live spot-check script on 25 random rows from the CSV — all 25 must equal true MAP exactly (readback from Shopify, not the mirror).
+- Next mirror sync + `dw-map-auditor` daily run act as the standing canary.
+
+## Also flagged (follow-up, NOT in this write)
+
+- **Residual risk: 167 of the 593 mismatched mirror rows have no authoritative MAP for one or both SKUs** (computed live against `kravet_authoritative_pricing`; the session estimate was ~168). Those products need the same fix once pricing exists — follow-up worklist, not in this batch.
+- The corrupt mirror `mfr_sku` column itself (593 rows) still needs correction to `global.Item` — separate reversible pass, proposed after this reprice lands so we fix money first.
+- `reprice-restore-kravet.js` also force-reactivated archived products; whether any of the 425 should actually be ARCHIVED (genuinely discontinued) is a follow-up cross-check against `disco_items`.
+
+## Officer sign-off — vp-dw-commerce
+
+**APPROVE.** Reasoning: (1) 360 products under MAP is a live Kravet MAP-compliance exposure — Kravet enforces MAP and this is our highest-risk vendor relationship; (2) the fix targets prices to the standing authoritative source (`kravet_authoritative_pricing`, MAP = WHLS × 1.5) keyed by the verified ground-truth SKU (`global.Item`), not the corrupt column; (3) fully reversible (CSV records every current price), guarded (live-price pre-check per variant), idempotent, and verified post-write; (4) the healthy control shows the pricing pipeline is correct for non-corrupt rows, so this converges the catalog rather than churning it. Risk of NOT acting: continued MAP violation on 360 SKUs + ~$142.6k/order-cycle margin leak + four products selling at $89.93 that should be ~$5,300+.
+
+**Awaiting Steve's approval before any Shopify write.**
+
+## Contrarian-gate addendum (2026-07-15, post-red-team)
+
+A 5-critic contrarian panel reviewed this package (verdict FIX FIRST). Its findings and resolutions:
+
+1. **"593 count unverifiable / format-diff noise" — REFUTED on data.** Re-verified on the local mirror: 15,585 ACTIVE DWKK rows, 5,842 with `global.Item`, 593 raw mismatches, **593/593 survive punctuation normalization**, and **0/425 CSV rows are dash-vs-dot artifacts** (the CSV requires BOTH SKUs to exist in `kravet_authoritative_pricing` with different MAPs, which structurally excludes format variants of the same SKU). Independent of the mirror entirely: 12/15 random live-store fetches priced exactly at the wrong-join SKU's MAP.
+2. **global.MAP metafield conflict — ACCEPTED, disclosed here.** Products carry a stale `global.MAP` metafield (e.g. Zina Moire: 261) that pre-dates the April-2026 Kravet price adjustment; the April sheet (`new_map`, e.g. 274.05) supersedes it per the price-source priority (explicit newer sheet > stale metafield stamp). RECOMMENDED: the fix run also refreshes `global.MAP` to the April value on the 425 products in the same pass, so the three sources (live price, metafield, authoritative table) agree afterward.
+3. **Sheet staleness — ACCEPTED, pre-flight added.** The April-2026 sheet (loaded 2026-06-12) is the newest pricing we hold. PRE-FLIGHT before executing: run /kravet-price-watch once to confirm no newer Kravet price-adjustment email arrived since; if a newer sheet exists, load it first and regenerate the CSV.
+4. **Tiering (contrarian's dissent, adopted as an option).** If Steve prefers a staged rollout: Tier 1 = the 360 UNDER-MAP rows (live compliance exposure, includes the catastrophic $89.93-vs-$5,347 Brunschwig Metallic rows) immediately; Tier 2 = the 65 over-MAP rows after Tier-1 verification passes.

← 507f071 ROOT-CAUSE: DWKK wrong-join MAP defect — kravet_catalog dw_s  ·  back to Kravet Wrongjoin Reprice 2026 07  ·  auto-save: 2026-07-15T16:08:29 (2 files) — apply-reprice.js 17d8e27 →