← back to Harlequin Sample Price Analysis
artifacts/TK-10981-JUNK-MFRSKU-PLAN.md
46 lines
# TK-10981 — junk `mfr_sku` repair plan
Read-only verification: 2026-08-30 23:38 PDT. Database: local `dw_unified`.
## Verified scope
| corruption class | rows | active |
|---|---:|---:|
| literal `TRUE` | 3,675 | 83 |
| leaked `SANCAR` | 184 | 171 |
| leaked `OSBORNE` | 56 | 44 |
| leaked `YORK` | 55 | 43 |
| leaked `INNOVATIONS` | 52 | 50 |
| **total** | **4,022** | **391** |
The `TRUE` cohort spans ten vendors: Fentucci 2,070; Retro Walls 946; Fentucci Fabrics
367; Innovations USA 129; Mind the Gap 110; DW Home 41; Designer Wallcoverings 5;
Phillipe Romano 3; Designers Guild 3; DW Bespoke Studio 1.
## Important correction
The earlier “3,674/3,675 recoverable” statement meant that an internal Shopify/DW SKU is
present. It does **not** prove that the real manufacturer SKU is recoverable. Never copy
`sku` or `dw_sku` into `mfr_sku` merely to fill the field.
Exact `shopify_product_id` joins against the currently available vendor source tables recover
only 13 unique Innovations rows. Fentucci, Fentucci Naturals, and Mind the Gap yielded zero
exact product-ID matches for this cohort. Retro Walls has no clearly corresponding source table.
## Conservative repair contract
1. Export all 4,022 rows to an immutable restore map containing `id`, `shopify_id`, `handle`,
`vendor`, `sku`, `dw_sku`, prior `mfr_sku`, and `status` before any update.
2. Recover a manufacturer SKU only where a source table has exactly one row for the same
`shopify_product_id`, the source value is nonblank/nonjunk, and no conflicting source value
exists. Current proven recovery count: 13.
3. Set all remaining known-junk values to `NULL`. Unknown is honest; a fabricated internal SKU
is not.
4. Use an explicit `id` allowlist generated by the read-only plan—never a loose vendor-wide update.
5. Run in one transaction with before-count assertions (`4,022` total and `391` active), capture
`UPDATE ... RETURNING`, and abort on any count drift.
6. Post-verify: zero rows remain with the five known junk tokens; row count/status/sku/dw_sku are
unchanged; only `mfr_sku` changed; restore map covers every changed ID.
No database or Shopify mutation was performed in this cycle.