← back to Harlequin Sample Price Analysis
TK-10870 cycle4: read-only reprice PLAN + Cody fixes (30->27 repriceable, 3 sample-only)
7152046104a3d79b6d1c212eb206da20fd99e396 · 2026-08-30 13:37:01 -0700 · Steve Abrams
- built artifacts/REPRICE-PLAN.md + reprice-plan.json (read-only, from mirror, Cody-correct join)
- Cody caught: mirror variant_id points at the $4.25 Sample; 3 rows sample-only (no roll variant)
-> repriceable_now=27, needs_roll_variant=3, excluded=2 (27+3+2=32, test-enforced)
- variant-safety caveat: execution must enumerate variants LIVE, reprice roll only, never the Sample
- plan-integrity tests added; re-surfaced corrected gated memo v2 (v1 auto-filed to _resolved undecided)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Files touched
A artifacts/REPRICE-PLAN.mdM artifacts/reprice-plan.jsonM data/loop-ledger.jsonlA tests/plan.test.mjs
Diff
commit 7152046104a3d79b6d1c212eb206da20fd99e396
Author: Steve Abrams <steve@designerwallcoverings.com>
Date: Sun Aug 30 13:37:01 2026 -0700
TK-10870 cycle4: read-only reprice PLAN + Cody fixes (30->27 repriceable, 3 sample-only)
- built artifacts/REPRICE-PLAN.md + reprice-plan.json (read-only, from mirror, Cody-correct join)
- Cody caught: mirror variant_id points at the $4.25 Sample; 3 rows sample-only (no roll variant)
-> repriceable_now=27, needs_roll_variant=3, excluded=2 (27+3+2=32, test-enforced)
- variant-safety caveat: execution must enumerate variants LIVE, reprice roll only, never the Sample
- plan-integrity tests added; re-surfaced corrected gated memo v2 (v1 auto-filed to _resolved undecided)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---
artifacts/REPRICE-PLAN.md | 33 ++++++++++++++++++++++++++++
artifacts/reprice-plan.json | 2 +-
data/loop-ledger.jsonl | 1 +
tests/plan.test.mjs | 52 +++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 87 insertions(+), 1 deletion(-)
diff --git a/artifacts/REPRICE-PLAN.md b/artifacts/REPRICE-PLAN.md
new file mode 100644
index 0000000..8b91543
--- /dev/null
+++ b/artifacts/REPRICE-PLAN.md
@@ -0,0 +1,33 @@
+# TK-10870 — read-only reprice PLAN (for gated Action 1)
+
+Generated read-only from the `dw_unified` mirror. **Nothing here is executed — the write stays
+Steve-gated.** Machine-readable: `artifacts/reprice-plan.json`; validated by `tests/plan.test.mjs`.
+
+## Accounting (all 32 on-Shopify rows dispositioned — corrected after Cody gate)
+- **27 `reprice_now`** — have a roll variant + confirmed cost; target retail computed.
+- **3 `needs_roll_variant`** — DWHQ-335008 / 335013 / 335023 are **sample-only** (`has_product_variant=false`,
+ `variant_count=1`): no roll variant exists to reprice. Hold until a roll variant is created.
+- **2 `excluded`** — DWHQ-335002 (Cranes Marine: collision + cost-gap) and DWHQ-335024
+ (Demoiselle/Locronan mfr_sku mis-stamp collision).
+- `27 + 3 + 2 = 32` ✓ (test-enforced).
+
+## Target retail (verified)
+`target_retail = round(net_cost / 0.65 / 0.85, 2)` for all 27 — asserted against the formula by the
+plan test. Tiers: $208.14 (cost 115), $228.05 (126), $253.39 (140), $269.68 (149).
+
+## Identifiers & join key (Cody clarity)
+- **`dwhq_sku` IS the real Shopify write-target sku** (`shopify_products.sku`). The catalog `dw_sku`
+ is the disjoint `DWHA-570*` namespace — do NOT key the write on it.
+- Join catalog↔shopify on **`shopify_id = 'gid://shopify/Product/' || shopify_product_id`**, NOT `mfr_sku`.
+
+## Steps that are inherently LIVE (cannot be finished read-only)
+1. **Variant targeting.** The mirror's `variant_id`/`variant_sku` points at the **Sample** variant for
+ these products. Execution MUST call the Shopify Products API per product, enumerate variants, and
+ set the price on the **roll (non-`-Sample`) variant only** — never reprice by the mirror's variant_id,
+ and never touch the $4.25 Sample.
+2. **Current price** is NULL in the mirror — read the live roll-variant price first to build the restore-map.
+
+## Execution shape (for the gated owner)
+For each of the 27 `reprice_now` `shopify_product_id`s: read variants live → pick the roll variant →
+snapshot current price to a restore-map → set price = `target_retail`. Reversible via the restore-map.
+Customer-facing → **Steve-gated**. The 3 sample-only products need a roll variant before they can price.
diff --git a/artifacts/reprice-plan.json b/artifacts/reprice-plan.json
index e842d4a..b4c0707 100644
--- a/artifacts/reprice-plan.json
+++ b/artifacts/reprice-plan.json
@@ -1 +1 @@
-{"ticket" : "TK-10870", "generated_utc" : "2026-08-30T13:29:41.119682-07:00", "join_key" : "shopify_products.shopify_id = gid://shopify/Product/ || harlequin_catalog.shopify_product_id", "excluded" : {"collision_skus" : ["DWHQ-335001", "DWHQ-335002", "DWHQ-335003", "DWHQ-335024"], "cost_gap_mfr" : "cranes-in-flight-marine-haw0065-05"}, "caveats" : ["current_price is NULL in mirror — read live roll-variant price at execution", "target the ROLL/product variant, NOT the -Sample variant (samples stay $4.25)"], "rows" : [{"dwhq_sku" : "DWHQ-335000", "pattern" : "Amazilia", "color" : "Gooseberry", "shopify_product_id" : "7787420450867", "net_cost" : 140.00, "target_retail" : 253.39}, {"dwhq_sku" : "DWHQ-335004", "pattern" : "Demoiselle", "color" : "Kelly/First Light/Blush", "shopify_product_id" : "7787420909619", "net_cost" : 115.00, "target_retail" : 208.14}, {"dwhq_sku" : "DWHQ-335005", "pattern" : "Demoiselle", "color" : "Positano/First Light/Taupe", "shopify_product_id" : "7787421007923", "net_cost" : 115.00, "target_retail" : 208.14}, {"dwhq_sku" : "DWHQ-335006", "pattern" : "Demoiselle", "color" : "Seaglass/First Light/Sand", "shopify_product_id" : "7787421106227", "net_cost" : 115.00, "target_retail" : 208.14}, {"dwhq_sku" : "DWHQ-335007", "pattern" : "Epitome", "color" : "Copper/Sepia", "shopify_product_id" : "7787421204531", "net_cost" : 149.00, "target_retail" : 269.68}, {"dwhq_sku" : "DWHQ-335008-Sample", "pattern" : "Epitome", "color" : "Mint/Duck Egg/Smoke", "shopify_product_id" : "7787421335603", "net_cost" : 149.00, "target_retail" : 269.68}, {"dwhq_sku" : "DWHQ-335009", "pattern" : "Epitome", "color" : "Turquoise/Pea/Gilver", "shopify_product_id" : "7787421433907", "net_cost" : 149.00, "target_retail" : 269.68}, {"dwhq_sku" : "DWHQ-335010", "pattern" : "Fleur De Joie", "color" : "Chalk/Clover/Honey", "shopify_product_id" : "7787421499443", "net_cost" : 149.00, "target_retail" : 269.68}, {"dwhq_sku" : "DWHQ-335012", "pattern" : "Flores", "color" : "Clover/Kelly/Aqua", "shopify_product_id" : "7787421663283", "net_cost" : 149.00, "target_retail" : 269.68}, {"dwhq_sku" : "DWHQ-335013-Sample", "pattern" : "Flores", "color" : "Cornflower First Light Denim", "shopify_product_id" : "7787421761587", "net_cost" : 149.00, "target_retail" : 269.68}, {"dwhq_sku" : "DWHQ-335014", "pattern" : "Flores", "color" : "Rosewood/Baked Terracotta", "shopify_product_id" : "7787422515251", "net_cost" : 149.00, "target_retail" : 269.68}, {"dwhq_sku" : "DWHQ-335015", "pattern" : "Gardinum", "color" : "Chalk/Wedgwood/Gold", "shopify_product_id" : "7787422613555", "net_cost" : 149.00, "target_retail" : 269.68}, {"dwhq_sku" : "DWHQ-335016", "pattern" : "Houndstooth", "color" : "Black Earth/Soft Focus", "shopify_product_id" : "7787422744627", "net_cost" : 115.00, "target_retail" : 208.14}, {"dwhq_sku" : "DWHQ-335017", "pattern" : "Houndstooth", "color" : "First Light/Mist", "shopify_product_id" : "7787422842931", "net_cost" : 115.00, "target_retail" : 208.14}, {"dwhq_sku" : "DWHQ-335018", "pattern" : "Houndstooth", "color" : "Seaglass/Soft Focus", "shopify_product_id" : "7787422974003", "net_cost" : 115.00, "target_retail" : 208.14}, {"dwhq_sku" : "DWHQ-335019", "pattern" : "Houndstooth", "color" : "Taupe/Soft Focus", "shopify_product_id" : "7787423072307", "net_cost" : 115.00, "target_retail" : 208.14}, {"dwhq_sku" : "DWHQ-335020", "pattern" : "Kamanu", "color" : "Indigo/Pebble", "shopify_product_id" : "7787423170611", "net_cost" : 140.00, "target_retail" : 253.39}, {"dwhq_sku" : "DWHQ-335021", "pattern" : "Kamanu", "color" : "Mandarin/Fig", "shopify_product_id" : "7787423268915", "net_cost" : 140.00, "target_retail" : 253.39}, {"dwhq_sku" : "DWHQ-335023-Sample", "pattern" : "Flourish", "color" : "First Light/Nectar", "shopify_product_id" : "7787423498291", "net_cost" : 149.00, "target_retail" : 269.68}, {"dwhq_sku" : "DWHQ-335025", "pattern" : "Lotus", "color" : "Pearl/Pearl", "shopify_product_id" : "7787423793203", "net_cost" : 140.00, "target_retail" : 253.39}, {"dwhq_sku" : "DWHQ-335026", "pattern" : "Lotus", "color" : "curation", "shopify_product_id" : "7787423891507", "net_cost" : 140.00, "target_retail" : 253.39}, {"dwhq_sku" : "DWHQ-335027", "pattern" : "Lucielle", "color" : "Chalk/Linen", "shopify_product_id" : "7787423989811", "net_cost" : 126.00, "target_retail" : 228.05}, {"dwhq_sku" : "DWHQ-335028", "pattern" : "Lucielle", "color" : "Putty/Chalk", "shopify_product_id" : "7787424120883", "net_cost" : 126.00, "target_retail" : 228.05}, {"dwhq_sku" : "DWHQ-335029", "pattern" : "Mirabella", "color" : "Pebble", "shopify_product_id" : "7787424251955", "net_cost" : 115.00, "target_retail" : 208.14}, {"dwhq_sku" : "DWHQ-335030", "pattern" : "Mirabella", "color" : "Sky/Diffused Light", "shopify_product_id" : "7787424317491", "net_cost" : 115.00, "target_retail" : 208.14}, {"dwhq_sku" : "DWHQ-335031", "pattern" : "Salice", "color" : "Heather/Gilver", "shopify_product_id" : "7787424448563", "net_cost" : 115.00, "target_retail" : 208.14}, {"dwhq_sku" : "DWHQ-335032", "pattern" : "Salice", "color" : "Mint/Emerald", "shopify_product_id" : "7787424546867", "net_cost" : 115.00, "target_retail" : 208.14}, {"dwhq_sku" : "DWHQ-335033", "pattern" : "Salice", "color" : "Ochre/Sepia", "shopify_product_id" : "7787424677939", "net_cost" : 115.00, "target_retail" : 208.14}, {"dwhq_sku" : "DWHQ-335034", "pattern" : "Salice", "color" : "Rose/Navy", "shopify_product_id" : "7787424841779", "net_cost" : 115.00, "target_retail" : 208.14}, {"dwhq_sku" : "DWHQ-335035", "pattern" : "Salice", "color" : "Tangerine/Gilver", "shopify_product_id" : "7787424940083", "net_cost" : 115.00, "target_retail" : 208.14}]}
+{"ticket" : "TK-10870", "generated_utc" : "2026-08-30T13:35:22.640565-07:00", "join_key" : "shopify_products.shopify_id = gid://shopify/Product/ || harlequin_catalog.shopify_product_id", "sku_note" : "dwhq_sku is the REAL Shopify write-target sku (shopify_products.sku). The catalog dw_sku is the disjoint DWHA- namespace — do NOT key the write on it.", "excluded_from_32" : [{"sku" : "DWHQ-335002", "why" : "Cranes Marine: collision(shopify_product_id 7787420680243) + cost-gap(null price_trade)"}, {"sku" : "DWHQ-335024", "why" : "Demoiselle/Locronan mfr_sku mis-stamp collision"}], "caveats" : ["MIRROR variant_id/variant_sku points at the SAMPLE variant for these products — execution MUST enumerate each product variants LIVE via Shopify API and target the ROLL (non -Sample) variant; never reprice by the mirror variant_id", "current roll price is NULL in mirror — read live to build the restore-map", "3 rows are SAMPLE-ONLY (no roll variant): DWHQ-335008/335013/335023 — cannot be repriced until a roll variant is created; NOT in reprice_now"], "reprice_now" : [{"dwhq_sku" : "DWHQ-335000", "pattern" : "Amazilia", "color" : "Gooseberry", "shopify_product_id" : "7787420450867", "net_cost" : 140.00, "target_retail" : 253.39}, {"dwhq_sku" : "DWHQ-335004", "pattern" : "Demoiselle", "color" : "Kelly/First Light/Blush", "shopify_product_id" : "7787420909619", "net_cost" : 115.00, "target_retail" : 208.14}, {"dwhq_sku" : "DWHQ-335005", "pattern" : "Demoiselle", "color" : "Positano/First Light/Taupe", "shopify_product_id" : "7787421007923", "net_cost" : 115.00, "target_retail" : 208.14}, {"dwhq_sku" : "DWHQ-335006", "pattern" : "Demoiselle", "color" : "Seaglass/First Light/Sand", "shopify_product_id" : "7787421106227", "net_cost" : 115.00, "target_retail" : 208.14}, {"dwhq_sku" : "DWHQ-335007", "pattern" : "Epitome", "color" : "Copper/Sepia", "shopify_product_id" : "7787421204531", "net_cost" : 149.00, "target_retail" : 269.68}, {"dwhq_sku" : "DWHQ-335009", "pattern" : "Epitome", "color" : "Turquoise/Pea/Gilver", "shopify_product_id" : "7787421433907", "net_cost" : 149.00, "target_retail" : 269.68}, {"dwhq_sku" : "DWHQ-335010", "pattern" : "Fleur De Joie", "color" : "Chalk/Clover/Honey", "shopify_product_id" : "7787421499443", "net_cost" : 149.00, "target_retail" : 269.68}, {"dwhq_sku" : "DWHQ-335012", "pattern" : "Flores", "color" : "Clover/Kelly/Aqua", "shopify_product_id" : "7787421663283", "net_cost" : 149.00, "target_retail" : 269.68}, {"dwhq_sku" : "DWHQ-335014", "pattern" : "Flores", "color" : "Rosewood/Baked Terracotta", "shopify_product_id" : "7787422515251", "net_cost" : 149.00, "target_retail" : 269.68}, {"dwhq_sku" : "DWHQ-335015", "pattern" : "Gardinum", "color" : "Chalk/Wedgwood/Gold", "shopify_product_id" : "7787422613555", "net_cost" : 149.00, "target_retail" : 269.68}, {"dwhq_sku" : "DWHQ-335016", "pattern" : "Houndstooth", "color" : "Black Earth/Soft Focus", "shopify_product_id" : "7787422744627", "net_cost" : 115.00, "target_retail" : 208.14}, {"dwhq_sku" : "DWHQ-335017", "pattern" : "Houndstooth", "color" : "First Light/Mist", "shopify_product_id" : "7787422842931", "net_cost" : 115.00, "target_retail" : 208.14}, {"dwhq_sku" : "DWHQ-335018", "pattern" : "Houndstooth", "color" : "Seaglass/Soft Focus", "shopify_product_id" : "7787422974003", "net_cost" : 115.00, "target_retail" : 208.14}, {"dwhq_sku" : "DWHQ-335019", "pattern" : "Houndstooth", "color" : "Taupe/Soft Focus", "shopify_product_id" : "7787423072307", "net_cost" : 115.00, "target_retail" : 208.14}, {"dwhq_sku" : "DWHQ-335020", "pattern" : "Kamanu", "color" : "Indigo/Pebble", "shopify_product_id" : "7787423170611", "net_cost" : 140.00, "target_retail" : 253.39}, {"dwhq_sku" : "DWHQ-335021", "pattern" : "Kamanu", "color" : "Mandarin/Fig", "shopify_product_id" : "7787423268915", "net_cost" : 140.00, "target_retail" : 253.39}, {"dwhq_sku" : "DWHQ-335025", "pattern" : "Lotus", "color" : "Pearl/Pearl", "shopify_product_id" : "7787423793203", "net_cost" : 140.00, "target_retail" : 253.39}, {"dwhq_sku" : "DWHQ-335026", "pattern" : "Lotus", "color" : "curation", "shopify_product_id" : "7787423891507", "net_cost" : 140.00, "target_retail" : 253.39}, {"dwhq_sku" : "DWHQ-335027", "pattern" : "Lucielle", "color" : "Chalk/Linen", "shopify_product_id" : "7787423989811", "net_cost" : 126.00, "target_retail" : 228.05}, {"dwhq_sku" : "DWHQ-335028", "pattern" : "Lucielle", "color" : "Putty/Chalk", "shopify_product_id" : "7787424120883", "net_cost" : 126.00, "target_retail" : 228.05}, {"dwhq_sku" : "DWHQ-335029", "pattern" : "Mirabella", "color" : "Pebble", "shopify_product_id" : "7787424251955", "net_cost" : 115.00, "target_retail" : 208.14}, {"dwhq_sku" : "DWHQ-335030", "pattern" : "Mirabella", "color" : "Sky/Diffused Light", "shopify_product_id" : "7787424317491", "net_cost" : 115.00, "target_retail" : 208.14}, {"dwhq_sku" : "DWHQ-335031", "pattern" : "Salice", "color" : "Heather/Gilver", "shopify_product_id" : "7787424448563", "net_cost" : 115.00, "target_retail" : 208.14}, {"dwhq_sku" : "DWHQ-335032", "pattern" : "Salice", "color" : "Mint/Emerald", "shopify_product_id" : "7787424546867", "net_cost" : 115.00, "target_retail" : 208.14}, {"dwhq_sku" : "DWHQ-335033", "pattern" : "Salice", "color" : "Ochre/Sepia", "shopify_product_id" : "7787424677939", "net_cost" : 115.00, "target_retail" : 208.14}, {"dwhq_sku" : "DWHQ-335034", "pattern" : "Salice", "color" : "Rose/Navy", "shopify_product_id" : "7787424841779", "net_cost" : 115.00, "target_retail" : 208.14}, {"dwhq_sku" : "DWHQ-335035", "pattern" : "Salice", "color" : "Tangerine/Gilver", "shopify_product_id" : "7787424940083", "net_cost" : 115.00, "target_retail" : 208.14}], "needs_roll_variant" : ["DWHQ-335008-Sample", "DWHQ-335013-Sample", "DWHQ-335023-Sample"]}
diff --git a/data/loop-ledger.jsonl b/data/loop-ledger.jsonl
index a21fb65..c9791f3 100644
--- a/data/loop-ledger.jsonl
+++ b/data/loop-ledger.jsonl
@@ -1,3 +1,4 @@
{"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)"}
{"cycle":2,"ts":"2026-08-30","ticket":"TK-10870","landed":["sized corruption class read-only","Harlequin: 1 product-id collision + 2 mfr mis-stamps/4 skus (corrected from 3/8 after Cody)","fleet-wide honest breakdown (junk-dominated: TRUE=3671 Fentucci/RetroWalls, not Cranes-style)","isJunkMfrSku lib+test (15 pass)","drafted consolidated gated memo to pending-approval"],"cody_verdict":"real hole: missed Demoiselle/Locronan collision + wrong count 3/8->2/4 + join-key caveat; all reproduced+fixed","final_dtd":"HOLD-FOR-STEVE","empirical_gate":"node --test 15/15","gated_held":["reprice (excl Cranes+Demoiselle/Locronan, join on shopify_product_id)","dw_sku backfill 4 Houndstooth","reconcile 2 collisions","new ticket: fleet-wide junk mfr_sku"],"seed_next":"final read-only verification pass; TK-10870 safe analysis complete -> expect only-gated-remains -> idle-pause"}
{"cycle":3,"ts":"2026-08-30","ticket":"TK-10870","type":"verification+idle","result":"NO CHANGE vs cycle2 — tests 15/15, census 32/31/1/5, 732 has_cost, 1 productid collision, 2 mfr mis-stamps (Cranes + Demoiselle/Locronan) all identical","cody":"no new claims -> cycle-2 gate stands (skipped re-run, cost-conscious)","final_dtd":"HOLD-FOR-STEVE","decision":"IDLE — only gated work remains (4-action memo). PAUSING loop per stop condition; resume when Steve approves a memo item or adds work.","reschedule":"NONE (paused)"}
+{"cycle":4,"ts":"2026-08-30","ticket":"TK-10870","trigger":"Steve resume","landed":["built read-only reprice PLAN (artifacts/REPRICE-PLAN.md + reprice-plan.json)","plan-integrity tests (19->then 20 pass)","re-surfaced corrected gated memo v2 (v1 was auto-filed to _resolved unchecked/undecided)"],"cody":"3 holes: (1 VALID) sample-variant scope is all 30 not 3 + 3 sample-only rows -> repriceable is 27 not 30; (2 misread) DWHQ is real Shopify sku not fabricated; (3 misread) accounting closes 27+3+2=32. Valid one folded in.","final_dtd":"HOLD-FOR-STEVE","empirical_gate":"node --test","gated_held":["reprice 27 (v2 memo)","3 sample-only need roll variant","dw_sku backfill","reconcile collisions","fleet junk-mfr ticket"],"seed_next":"idle unless Steve approves v2 memo; loop pausing again (analysis+plan complete)"}
diff --git a/tests/plan.test.mjs b/tests/plan.test.mjs
new file mode 100644
index 0000000..f6c933c
--- /dev/null
+++ b/tests/plan.test.mjs
@@ -0,0 +1,52 @@
+// plan.test.mjs — data-integrity checks on the generated reprice plan.
+// Validates artifacts/reprice-plan.json against the pricing formula + exclusion rules.
+// Run: node --test (skips gracefully if the plan hasn't been generated yet).
+import { test } from 'node:test';
+import assert from 'node:assert/strict';
+import { readFileSync, existsSync } from 'node:fs';
+import { fileURLToPath } from 'node:url';
+import { dirname, join } from 'node:path';
+import { computeRetail } from '../scripts/pricing.mjs';
+
+const planPath = join(dirname(fileURLToPath(import.meta.url)), '..', 'artifacts', 'reprice-plan.json');
+const EXCLUDED = ['DWHQ-335001', 'DWHQ-335002', 'DWHQ-335003', 'DWHQ-335024'];
+
+test('reprice-plan.json exists and is well-formed', { skip: !existsSync(planPath) }, () => {
+ const p = JSON.parse(readFileSync(planPath, 'utf8'));
+ assert.equal(p.ticket, 'TK-10870');
+ assert.ok(Array.isArray(p.reprice_now) && p.reprice_now.length > 0);
+ assert.ok(Array.isArray(p.needs_roll_variant));
+});
+
+test('accounting closes: reprice_now + needs_roll_variant + excluded = 32 on_shopify', { skip: !existsSync(planPath) }, () => {
+ const p = JSON.parse(readFileSync(planPath, 'utf8'));
+ assert.equal(p.reprice_now.length + p.needs_roll_variant.length + p.excluded_from_32.length, 32);
+ assert.equal(p.reprice_now.length, 27);
+ assert.equal(p.needs_roll_variant.length, 3);
+});
+
+test('every reprice_now target_retail equals the DW formula from net_cost', { skip: !existsSync(planPath) }, () => {
+ const p = JSON.parse(readFileSync(planPath, 'utf8'));
+ for (const r of p.reprice_now) {
+ assert.equal(Number(r.target_retail), computeRetail(Number(r.net_cost)),
+ `${r.dwhq_sku}: target ${r.target_retail} != formula(${r.net_cost})`);
+ }
+});
+
+test('no excluded sku and no sample-only sku appears in reprice_now', { skip: !existsSync(planPath) }, () => {
+ const p = JSON.parse(readFileSync(planPath, 'utf8'));
+ const sampleOnly = new Set(p.needs_roll_variant);
+ for (const r of p.reprice_now) {
+ assert.ok(!EXCLUDED.includes(r.dwhq_sku), `excluded sku leaked: ${r.dwhq_sku}`);
+ assert.ok(!sampleOnly.has(r.dwhq_sku), `sample-only sku leaked: ${r.dwhq_sku}`);
+ assert.ok(!/-Sample$/.test(r.dwhq_sku), `reprice_now must not carry a -Sample sku: ${r.dwhq_sku}`);
+ }
+});
+
+test('plan carries the live-execution + variant-safety caveats', { skip: !existsSync(planPath) }, () => {
+ const p = JSON.parse(readFileSync(planPath, 'utf8'));
+ const blob = JSON.stringify(p.caveats).toLowerCase();
+ assert.ok(blob.includes('live'), 'missing live-enumeration caveat');
+ assert.ok(blob.includes('roll'), 'missing roll-variant caveat');
+ assert.ok(blob.includes('sample-only'), 'missing sample-only caveat');
+});
← aee6b5e auto-data-snapshot: 2026-08-30T13:27:48 (1 data files) — art
·
back to Harlequin Sample Price Analysis
·
cycle5: right-size the junk mfr_sku='TRUE' bug (adjacent fin 25bb6a3 →