← back to Harlequin Sample Price Analysis

artifacts/CODY-GATE-CYCLE1.md

51 lines

# TK-10870 — Cody gate (cycle 1): 3 reproduced prerequisite blockers

Cody the Contrarian red-teamed the cycle-1 analysis. All three holes were REPRODUCED
against `dw_unified` (read-only) before being promoted here. These are elevated from
"open questions/footnotes" to **named prerequisite blockers** the reprice owner must clear
FIRST. Nothing below is fixed here (all fixes are GATED writes) — this is honest disclosure.

## Blocker A — `price_trade` provenance is unconfirmed (was open-Q #2)
`price_retail = round(price_trade / 0.65 / 0.85, 2)` holds to the cent on all 732 priced
rows (verified: 25 distinct raw ratios 1.80991–1.81000, all match the formula). **But that
only proves retail was computed FROM trade — not that `price_trade` is DW's net wholesale
cost.** If the S1 harvest captured Harlequin's *trade-portal "trade price"* (which may
already include a markdown off MSRP, not net cost), then applying 1.81× double-stacks
margin and every computed retail is wrong. The `discount_confirmed=true` yet
`vendor_discount_pct=0.00` contradiction, plus `vendor_registry.products_with_cost=0`
(written the same minute as the 732 costs), are symptoms of this. **Prerequisite:** confirm
`price_trade` against ONE real Harlequin invoice/net-cost line before calling any row
"repriceable."

## Blocker B — write-path SKU namespace mismatch (DWHA- vs DWHQ-)
`harlequin_catalog.dw_sku` uses **`DWHA-570xxx`**; the live `shopify_products.sku` uses
**`DWHQ-335xxx`**. They are disjoint. A reprice keyed on `dw_sku` (`WHERE sku = catalog.dw_sku`)
would match **nothing**. **Prerequisite:** the reprice write path must target the DWHQ Shopify
SKU (or the Shopify product GID), not the catalog's DWHA dw_sku.

## Blocker C — Cranes In Flight identity corruption (NEW — supersedes "1 clean cost gap")
Reproduced:
- `harlequin_catalog` rows DWHA-570137 (Emerald, $140) and DWHA-570138 (Marine, NULL cost)
  **share `shopify_product_id = 7787420680243`.**
- On Shopify, **two different products** — `DWHQ-335001` ("Cranes In Flight Blush") and
  `DWHQ-335002` ("Cranes In Flight Emerald") — **both carry `mfr_sku =
  cranes-in-flight-marine-haw0065-05`** (the Marine code). The pattern's mfr_sku↔product
  mapping is scrambled.

So the "Marine = 1 cost gap" framing is **operationally unsafe**: the $140 sibling candidate
is still a sound *number*, but there is no clean, unambiguous Shopify product to write it to
until the collision + mis-stamping are untangled. **Prerequisite:** de-collide the Cranes In
Flight product↔mfr_sku mapping before repricing/backfilling Marine.

## What still stands
- "COST=UNKNOWN for all rows" **is** stale — `price_trade` is populated 732/842. ✔
- The 1.81× formula arithmetic is correct to the cent. ✔
- 4 of 5 null-`dw_sku` are mirror sync-gaps (DWHQ SKUs exist ACTIVE). ✔
- The $140 Cranes/Marine value is a sound candidate (3/3 siblings agree) — but see Blocker C.

## Verdict carried forward
Directionally right, operationally unsafe. Hand off with A/B/C named. **Seed for next cycle:**
the Cranes In Flight `shopify_product_id` collision + mfr_sku mis-stamping (Blocker C) — the
highest-severity captured defect — gets read-only enumeration next (how many patterns are
affected fleet-wide?).