← back to Dw Validator Debug TK11314
auto-data-snapshot: 2026-08-23T07:00:05 (1 data files) — DW-Agents/vendor-command-center/cost-backfill-2026-08-22-APPLY.sql
dba5103a8fee8c8744cf332ea9706e4c68065ed8 · 2026-08-23 07:00:17 -0700 · auto-commit-fleet
Files touched
M DW-Agents/vendor-command-center/cost-backfill-2026-08-22-APPLY.sql
Diff
commit dba5103a8fee8c8744cf332ea9706e4c68065ed8
Author: auto-commit-fleet <steve@designerwallcoverings.com>
Date: Sun Aug 23 07:00:17 2026 -0700
auto-data-snapshot: 2026-08-23T07:00:05 (1 data files) — DW-Agents/vendor-command-center/cost-backfill-2026-08-22-APPLY.sql
---
.../cost-backfill-2026-08-22-APPLY.sql | 27 +++++++++++++---------
1 file changed, 16 insertions(+), 11 deletions(-)
diff --git a/DW-Agents/vendor-command-center/cost-backfill-2026-08-22-APPLY.sql b/DW-Agents/vendor-command-center/cost-backfill-2026-08-22-APPLY.sql
index 4be27638..13e494bb 100644
--- a/DW-Agents/vendor-command-center/cost-backfill-2026-08-22-APPLY.sql
+++ b/DW-Agents/vendor-command-center/cost-backfill-2026-08-22-APPLY.sql
@@ -7,18 +7,23 @@ CREATE TABLE cost_backfill_restore_20260822 AS
SELECT shopify_id, cost_price AS old_cost_price, cost_source AS old_cost_source
FROM shopify_products WHERE status='ACTIVE' AND (cost_price IS NULL OR cost_price::numeric=0);
-WITH ka AS (SELECT upper(regexp_replace(mfr_sku::text,'[^A-Za-z0-9]','','g')) k, max(new_whls) whls
- FROM kravet_authoritative_pricing WHERE new_whls IS NOT NULL AND new_whls>0 GROUP BY 1)
+-- Cody-gate v2 (yoloforever cycle 2, 2026-08-23): the cycle-1 VENDOR ALLOW-LIST was an
+-- OVERCORRECTION and is REMOVED. The Phillipe Romano / Caroline Cecil matches are EXACT
+-- full-SKU (legit Cowtan/Kravet-family SKUs: 107/10048.CS.0, CCP-2346.16.0, BW45007.6.0…),
+-- not false collisions. The real risk is NORMALIZED-ONLY collisions (e.g. PR '488-410'
+-- normalizes to the same key as Kravet '4884.1.0'). Fix = EXACT raw-SKU match (100%
+-- collision-proof — an exact SKU match cannot be a false collision).
+-- 1a. EXACT-match authoritative (SAFE, ships now):
UPDATE shopify_products sp
-SET cost_price=ka.whls, cost_source='kravet_authoritative_pricing.new_whls backfill 2026-08-22'
-FROM ka WHERE sp.status='ACTIVE' AND (sp.cost_price IS NULL OR sp.cost_price::numeric=0)
- AND ka.k=upper(regexp_replace(sp.mfr_sku::text,'[^A-Za-z0-9]','','g'))
- -- Cody-gate 2026-08-22: allow-list to Kravet/Cowtan family ONLY (excludes ~81
- -- coincidental non-family normalized matches: Phillipe Romano, Caroline Cecil, etc.)
- AND sp.vendor ILIKE ANY(ARRAY['%kravet%','%lee jofa%','%brunschwig%','%baker%','%groundworks%',
- '%cole%son%','%clarke%clarke%','%clarke and clarke%','%mulberry%','%threads%','%andrew martin%',
- '%gaston%daniela%','%donghia%','%anna french%','%cowtan%','%colefax%','%nicolette%','%aerin%',
- '%barclay%','%thom filicia%','%winfield thybony%']);
+SET cost_price=k.whls, cost_source='kravet_authoritative_pricing.new_whls (exact) backfill 2026-08-23'
+FROM (SELECT mfr_sku, max(new_whls) whls FROM kravet_authoritative_pricing WHERE new_whls>0 GROUP BY 1) k
+WHERE sp.status='ACTIVE' AND (sp.cost_price IS NULL OR sp.cost_price::numeric=0)
+ AND sp.mfr_sku = k.mfr_sku;
+-- 1b. FOLLOW-UP (cycle 3, verification currently API-blocked): decorated-vendor recovery
+-- for shopify SKUs that carry DW suffixes the source lacks (e.g. Clarke 'W0114/03.CAC.0'
+-- vs source 'W0114/03', ~3.5k). Needs a STRUCTURE-PRESERVING suffix-strip (strip only
+-- trailing .CAC.0/.CS.0/.<color>.0), NOT the lossy all-punctuation normalization that
+-- caused the 488-410 collision. DISABLED until the false-collision sweep is measured.
WITH jd AS (SELECT upper(regexp_replace(mfr_sku::text,'[^A-Za-z0-9]','','g')) k, max(our_cost_yd) cost
FROM justin_david_pricing_2026 WHERE our_cost_yd IS NOT NULL AND our_cost_yd>0 GROUP BY 1)
← d330c965 auto-data-snapshot: 2026-08-23T06:27:08 (1 data files) — dat
·
back to Dw Validator Debug TK11314
·
auto-data-snapshot: 2026-08-23T09:07:20 (1 data files) — DW- 6ee95a3f →