← back to Hollywood Price 2026
executor: strip stale Needs-Price on already-priced (196), add price on sample-only (599); canary verified live vs Momentum (Skelton=Skylines $48.29 exact)
45f522b8673f7a3fa135920413c3e7514db4a39e · 2026-07-12 08:35:54 -0700 · Steve Abrams
Files touched
A __pycache__/price.cpython-314.pycA ledger/priced_correct.csvM price.py
Diff
commit 45f522b8673f7a3fa135920413c3e7514db4a39e
Author: Steve Abrams <steve@designerwallcoverings.com>
Date: Sun Jul 12 08:35:54 2026 -0700
executor: strip stale Needs-Price on already-priced (196), add price on sample-only (599); canary verified live vs Momentum (Skelton=Skylines $48.29 exact)
---
__pycache__/price.cpython-314.pyc | Bin 0 -> 10401 bytes
ledger/priced_correct.csv | 12 ++++++++++++
price.py | 23 +++++++++++++++++++----
3 files changed, 31 insertions(+), 4 deletions(-)
diff --git a/__pycache__/price.cpython-314.pyc b/__pycache__/price.cpython-314.pyc
new file mode 100644
index 0000000..eb27edd
Binary files /dev/null and b/__pycache__/price.cpython-314.pyc differ
diff --git a/ledger/priced_correct.csv b/ledger/priced_correct.csv
new file mode 100644
index 0000000..06095a6
--- /dev/null
+++ b/ledger/priced_correct.csv
@@ -0,0 +1,12 @@
+ts,product_id,dw_sku,uom,hw,sellable_sku,variant_id,status
+2026-07-12T08:31:57,1497182666864,Divinity,YD,50.39,,,SKIP:already-has-sellable
+2026-07-12T08:31:57,1497182830704,Divinity,YD,50.39,,,SKIP:already-has-sellable
+2026-07-12T08:31:57,1497182961776,Divinity,YD,50.39,,,SKIP:already-has-sellable
+2026-07-12T08:31:58,1497183060080,Divinity,YD,50.39,,,SKIP:already-has-sellable
+2026-07-12T08:31:58,1497183223920,Divinity,YD,50.39,,,SKIP:already-has-sellable
+2026-07-12T08:34:24,1497182666864,Divinity,YD,50.39,XP3-68067-Yard,gid://shopify/ProductVariant/44502459383859,OK:tag-stripped
+2026-07-12T08:34:25,1497182830704,Divinity,YD,50.39,XP3-68069-Yard,gid://shopify/ProductVariant/44502459416627,OK:tag-stripped
+2026-07-12T08:34:26,1497182961776,Divinity,YD,50.39,XP3-68070-Yard,gid://shopify/ProductVariant/44502459449395,OK:tag-stripped
+2026-07-12T08:34:27,1497183060080,Divinity,YD,50.39,XP3-68071-Yard,gid://shopify/ProductVariant/44502459482163,OK:tag-stripped
+2026-07-12T08:34:28,1497183223920,Divinity,YD,50.39,XP3-68072-Yard,gid://shopify/ProductVariant/44502459514931,OK:tag-stripped
+2026-07-12T08:35:18,1499168997488,Skylines,YD,48.29,XPY-48393-Yard,gid://shopify/ProductVariant/44525112786995,OK
diff --git a/price.py b/price.py
index bd33a6b..ec3b46b 100644
--- a/price.py
+++ b/price.py
@@ -24,7 +24,7 @@ UNIT = { # feed uom -> (option value label, sku suffix)
Q_PROD = """query($id:ID!){ product(id:$id){ id legacyResourceId title status handle tags
options{ id name position values }
- variants(first:30){ edges{ node{ id title sku selectedOptions{name value} } } } } }"""
+ variants(first:30){ edges{ node{ id title sku price selectedOptions{name value} } } } } }"""
M_OPT_RENAME = """mutation($pid:ID!,$oid:ID!,$name:String!){
productOptionUpdate(productId:$pid, option:{id:$oid, name:$name}){ userErrors{ field message } } }"""
M_VAR_CREATE = """mutation($pid:ID!,$variants:[ProductVariantsBulkInput!]!){
@@ -77,8 +77,23 @@ def process(r, verbose=False):
if not node:
log([ts, pid, dw, uom, hw, "", "", "SKIP:not-found"]); return "SKIP:not-found"
gid = node["id"]
- if has_sellable(node):
- log([ts, pid, dw, uom, hw, "", "", "SKIP:already-has-sellable"]); return "SKIP:already-has-sellable"
+ # Already priced? The Needs-Price tag is often STALE (product already has a
+ # correct Sold-Per-Yard variant). If the existing price matches hw, just strip
+ # the stale tag; if it DIFFERS, flag it (never silently overwrite a real price).
+ existing = None
+ for e in node["variants"]["edges"]:
+ n2 = e["node"]; sk = (n2["sku"] or "")
+ if n2["title"] != "Sample" and not sk.lower().endswith("-sample"):
+ existing = n2; break
+ if existing:
+ try:
+ same = abs(float(existing["price"]) - hw) < 0.5
+ except Exception:
+ same = False
+ if same:
+ gql(M_TAGSRM, {"id": gid, "tags": ["Needs-Price"]})
+ log([ts, pid, dw, uom, hw, existing["sku"], existing["id"], "OK:tag-stripped"]); return "OK:tag-stripped"
+ log([ts, pid, dw, uom, hw, existing["sku"], existing["id"], f"FLAG:price-mismatch:{existing['price']}vs{hw}"]); return "FLAG:price-mismatch"
sellable_sku = f"{r['sku_base']}-{suffix}"
# 1) rename option Title -> Size
@@ -125,7 +140,7 @@ if __name__ == "__main__":
todo = [r for r in rows if str(r["product_id"]) not in done][:n]
print(f"=== CANARY: pricing {len(todo)} ===")
for r in todo:
- print(f"\n--- {r['title'][:50]} ({r['uom']} @ ${r['hw']}) ---")
+ print(f"\n--- {r['title'][:50]} ({r['unit']} @ ${r['hw']}) ---")
print("RESULT:", process(r, verbose=True))
sys.exit(0)
todo = [r for r in rows if str(r["product_id"]) not in done]
← 02f38af CORRECT Hollywood pricing: verified staged join (mfr_sku/sku
·
back to Hollywood Price 2026
·
auto-save: 2026-07-12T08:47:12 (4 files) — ledger/priced_cor 9edba72 →