← back to Harlequin Sample Price Analysis
TK-10870 cycle2: size the corruption class + draft consolidated gated memo
515ebd5d255bbc1dbb959fb0e7e58402026079b0 · 2026-08-30 10:13:17 -0700 · Steve Abrams
- Harlequin: 1 product-id collision (Cranes/haw0065) + 3 mis-stamped mfr codes (8 skus) — bounded
- fleet-wide honest breakdown: 6271 shared mfr_skus but dominated by junk-value leakage
('TRUE'=3671 skus, vendor-names) + pattern-level sharing — NOT 6271 Cranes-style corruptions
- isJunkMfrSku() pure helper + test (15 tests pass)
- CORRUPTION-SIZING-CYCLE2.md + pending-approval memo (4 gated actions APPROVE/REVISE/BLOCK)
- read-only; nothing executed
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Files touched
A artifacts/CORRUPTION-SIZING-CYCLE2.mdA data/loop-ledger.jsonlM scripts/pricing.mjsM tests/pricing.test.mjs
Diff
commit 515ebd5d255bbc1dbb959fb0e7e58402026079b0
Author: Steve Abrams <steve@designerwallcoverings.com>
Date: Sun Aug 30 10:13:17 2026 -0700
TK-10870 cycle2: size the corruption class + draft consolidated gated memo
- Harlequin: 1 product-id collision (Cranes/haw0065) + 3 mis-stamped mfr codes (8 skus) — bounded
- fleet-wide honest breakdown: 6271 shared mfr_skus but dominated by junk-value leakage
('TRUE'=3671 skus, vendor-names) + pattern-level sharing — NOT 6271 Cranes-style corruptions
- isJunkMfrSku() pure helper + test (15 tests pass)
- CORRUPTION-SIZING-CYCLE2.md + pending-approval memo (4 gated actions APPROVE/REVISE/BLOCK)
- read-only; nothing executed
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---
artifacts/CORRUPTION-SIZING-CYCLE2.md | 36 +++++++++++++++++++++++++++++++++++
data/loop-ledger.jsonl | 1 +
scripts/pricing.mjs | 12 ++++++++++++
tests/pricing.test.mjs | 8 ++++++++
4 files changed, 57 insertions(+)
diff --git a/artifacts/CORRUPTION-SIZING-CYCLE2.md b/artifacts/CORRUPTION-SIZING-CYCLE2.md
new file mode 100644
index 0000000..0215dfa
--- /dev/null
+++ b/artifacts/CORRUPTION-SIZING-CYCLE2.md
@@ -0,0 +1,36 @@
+# TK-10870 cycle 2 — sizing the identity-corruption class (read-only)
+
+Steve's chosen next action ("size the corruption first"). All read-only. **No writes.**
+
+## In-scope (Harlequin) — BOUNDED
+- **`shopify_product_id` collisions in `harlequin_catalog`: exactly 1** — the Cranes In Flight
+ pattern (haw0065): 2 catalog rows (Emerald 570137 + Marine 570138) share product_id
+ `7787420680243`; 1 of them is on_shopify. No other Harlequin pattern collides.
+- **`mfr_sku` mis-stamping in Harlequin `shopify_products`: 3 mfr_skus across 8 distinct DWHQ
+ skus** (of 83 Harlequin rows) — includes the Marine code stamped on DWHQ-335001 (“Blush”) +
+ DWHQ-335002 (“Emerald”).
+
+**Impact on the reprice:** exclude the **Cranes In Flight (haw0065) family** and the other 2
+mis-stamped mfr codes from any Harlequin price draft. The remaining priced rows are unaffected
+by this collision class.
+
+## Out-of-scope side-finding (FLEET-WIDE) — surfaced honestly, NOT acted on
+`shopify_products` has **6,271 mfr_skus shared across 18,156 distinct skus**. This is a MIX,
+not 6,271 Cranes-style corruptions:
+
+| class | count | nature |
+| --- | ---: | --- |
+| same-title groups | 654 | likely legit re-lists (same product, 2 handles) |
+| diff-title groups | 5,617 | SUSPECT — but dominated by the two junk classes below |
+| junk mfr_sku value | — | `'TRUE'` alone = 3,671 skus / 10 vendors (a boolean leaked into mfr_sku); vendor names leaked as mfr_sku: `'York'`, `'SANCAR'`, `'Osborne'`, `'Innovations'` |
+| pattern-level code | — | e.g. Scalamandre `wp81388m` (24 colorways), Nina Campbell `NCW4186` — one pattern code across colorways, often by-design |
+
+**Honest read:** the fleet-wide number is driven by (1) garbage values in `mfr_sku`
+(`TRUE`/vendor-names) and (2) pattern-level code sharing — genuinely different from the
+Cranes product_id collision. It is a real data-quality issue but a **separate class** and
+**out of TK-10870's Harlequin scope**. Recommend a NEW ticket to triage the junk-`mfr_sku`
+leakage (the `'TRUE'` = 3,671-sku bug is the highest-value target).
+
+## Verification note
+`isJunkMfrSku()` (pure, tested) encodes the boolean/null-ish junk detection used above.
+Counts reproducible via the read-only SQL in this repo's cycle-2 ticket log.
diff --git a/data/loop-ledger.jsonl b/data/loop-ledger.jsonl
new file mode 100644
index 0000000..b9d8889
--- /dev/null
+++ b/data/loop-ledger.jsonl
@@ -0,0 +1 @@
+{"cycle":1,"ts":"2026-08-30","ticket":"TK-10870","landed":["read-only resolution of 2 original blockers","sibling-cost inference lib+tests (14 pass)","Cody gate: 3 reproduced prerequisite blockers","Steve ruling: price_trade IS DW net cost (Blocker A resolved)","memory codified"],"commits":["d5bc8ad","ff71dd7","fb1b229","34902d9"],"gated_held":["Shopify reprice write","dw_sku backfill","Cranes-In-Flight de-collision"],"cody_verdict":"directionally right, operationally unsafe -> A/B/C named","final_dtd":"HOLD-FOR-STEVE (write gated); analysis correct+de-risked","empirical_gate":"node --test 14/14 pass + harness re-ran (no web UI)","seed_next":"read-only fleet-wide sizing of shopify_product_id collision + mfr_sku mis-stamping (Cranes In Flight haw0065 class)"}
diff --git a/scripts/pricing.mjs b/scripts/pricing.mjs
index d8c96f7..028e894 100644
--- a/scripts/pricing.mjs
+++ b/scripts/pricing.mjs
@@ -104,6 +104,18 @@ export function patternKeyFromMfrSku(mfrSku) {
return m ? m[1] : String(mfrSku).toLowerCase();
}
+/**
+ * Detect an obviously-junk mfr_sku value (a boolean literal or a null-ish token leaked
+ * into the manufacturer-SKU field). Used to characterise the fleet-wide shared-mfr_sku
+ * class honestly — a shared 'TRUE'/'York' value is junk-leakage, NOT a Cranes-style
+ * product-identity collision. Pure; case-insensitive.
+ */
+export function isJunkMfrSku(v) {
+ if (v == null) return true;
+ const s = String(v).trim().toLowerCase();
+ return s === '' || ['true', 'false', 'null', 'none', 'n/a', 'na', '-', '#ref!', '0'].includes(s);
+}
+
/**
* Read-only sibling-cost CANDIDATE inference.
* Given all rows of a pattern's colorways, when the target row's cost is missing,
diff --git a/tests/pricing.test.mjs b/tests/pricing.test.mjs
index f17602b..7729e6a 100644
--- a/tests/pricing.test.mjs
+++ b/tests/pricing.test.mjs
@@ -11,6 +11,7 @@ import {
roundCents,
patternKeyFromMfrSku,
inferSiblingCostCandidate,
+ isJunkMfrSku,
SAMPLE_PRICE,
RETAIL_PLACEHOLDER,
} from '../scripts/pricing.mjs';
@@ -128,6 +129,13 @@ test('inferSiblingCostCandidate is NOT confident with a lone or disagreeing sibl
assert.equal(inferSiblingCostCandidate(lone, 'y-haw2-02').confident, false); // only 1 sibling
});
+test('isJunkMfrSku flags leaked booleans and null-ish tokens, not real codes', () => {
+ for (const j of ['TRUE', 'false', 'null', 'N/A', '-', '', ' ', null, undefined, '#REF!'])
+ assert.equal(isJunkMfrSku(j), true, `expected junk: ${j}`);
+ for (const real of ['haw0065-05', 'wp81388m', 'NCW4186', 'cranes-in-flight-marine-haw0065-05'])
+ assert.equal(isJunkMfrSku(real), false, `expected real: ${real}`);
+});
+
test('constants are the DW canonical values', () => {
assert.equal(SAMPLE_PRICE, 4.25);
assert.equal(RETAIL_PLACEHOLDER, 150.0);
← 34902d9 TK-10870: record Steve's ruling — price_trade IS DW net cost
·
back to Harlequin Sample Price Analysis
·
TK-10870 cycle2 Cody fixes: correct mis-stamp count 3/8->2/4 201a10e →