[object Object]

← back to Flock Fix Viewer

flock-combine: generalize identity from SRC twin (wire 1038/1039/69430)

15e48c754f8ecfe759dcc249ee66bf49405a6a9e · 2026-09-03 12:09:27 -0700 · Steve Abrams

TK-11122 follow-on: title/handle/roll-SKU now derive from the archived
source twin instead of hardcoded Sadie strings, so the combine works for
Maggie's Circles (1038/1039) and La Mayorca (XCD-69430). Dry-run verified;
Sadie 1045-1047 unaffected. Live --apply stays Steve-gated.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BkyWhErFtVhis8AShV5cjX

Files touched

Diff

commit 15e48c754f8ecfe759dcc249ee66bf49405a6a9e
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Thu Sep 3 12:09:27 2026 -0700

    flock-combine: generalize identity from SRC twin (wire 1038/1039/69430)
    
    TK-11122 follow-on: title/handle/roll-SKU now derive from the archived
    source twin instead of hardcoded Sadie strings, so the combine works for
    Maggie's Circles (1038/1039) and La Mayorca (XCD-69430). Dry-run verified;
    Sadie 1045-1047 unaffected. Live --apply stays Steve-gated.
    
    Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
    Claude-Session: https://claude.ai/code/session_01BkyWhErFtVhis8AShV5cjX
---
 apply-flock-combine.py | 27 ++++++++++++++++++---------
 1 file changed, 18 insertions(+), 9 deletions(-)

diff --git a/apply-flock-combine.py b/apply-flock-combine.py
index 5823612..9b46a29 100644
--- a/apply-flock-combine.py
+++ b/apply-flock-combine.py
@@ -17,6 +17,10 @@ MAP={
  "1045":(6785296007219,7862958030899),
  "1046":(6785296662579,7862955311155),
  "1047":(6785296990259,7862955868211),
+ # TK-11122 follow-on (2026-09-03): remaining combine-ready PR flock (archived priced roll twin + active sample survivor)
+ "1038":(6785294499891,7862957473843),   # maggies-circles FLOCK-1038 roll@190.99
+ "1039":(6785295056947,7862957834291),   # maggies-circles FLOCK-1039 roll@190.99
+ "69430":(1497223233648,7863155064883),  # la-mayorca XCD-69430 roll@175.13 (SRC also carries sample variant)
 }
 LOC=5795643504  # 15442 Ventura Blvd (primary)
 TMPL=6785295810611  # 1044 combined = channel template
@@ -24,7 +28,7 @@ TMPL=6785295810611  # 1044 combined = channel template
 cw=(sys.argv[1] if len(sys.argv)>1 else "").strip()
 APPLY="--apply" in sys.argv
 if cw not in MAP:
-    print("usage: apply-flock-combine.py <1045|1046|1047> [--apply]"); sys.exit(1)
+    print("usage: apply-flock-combine.py <1045|1046|1047|1038|1039|69430> [--apply]"); sys.exit(1)
 SRC,DST=MAP[cw]
 
 env=open(os.path.expanduser("~/Projects/secrets-manager/.env")).read()
@@ -46,18 +50,23 @@ def gql(q,v=None):
 
 src=call("GET",f"products/{SRC}.json")['product']
 dst=call("GET",f"products/{DST}.json")['product']
-roll_v=[v for v in src['variants'] if (v.get('sku') or '').upper()==f"FLOCK-{cw}"][0]
+roll_v=[v for v in src['variants'] if 'sample' not in (v.get('sku') or '').lower()][0]  # generic: non-sample roll variant of SRC
 samp_v=[v for v in dst['variants'] if 'sample' in (v.get('sku') or '').lower()][0]
 roll_opt=roll_v.get('option1') or 'Sold per single roll (20.5" x 5.5 yards)'
 roll_price=roll_v.get('price') or "190.99"
+roll_sku=roll_v.get('sku'); samp_sku=samp_v.get('sku')  # generic SKUs (Sadie=FLOCK-####, la-mayorca=XCD-69430)
+import re as _re
+_title=src.get('title') or 'Flocked Velvet Wallcovering'           # identity from SRC archived twin, NOT hardcoded Sadie
+_apos='['+chr(39)+chr(8217)+chr(96)+']'  # ' ’ ` -> dropped (Maggie's -> maggies)
+_handle=f"{_re.sub(r'-+','-',_re.sub(r'[^a-z0-9]+','-',_re.sub(_apos,'',_title.lower()))).strip('-')}-{cw}"
 
 tags=list(dict.fromkeys([t.strip() for t in src['tags'].split(',') if t.strip()]))
 tags=[t for t in tags if t.lower() not in ('display-exclude','memo sample')]
 if 'Phillipe Romano' not in tags: tags.append('Phillipe Romano')
 
 print(f"=== flock {cw}  SRC(archived rich)={SRC}  DST(active survivor)={DST}  APPLY={APPLY}")
-print(f"  will set DST title -> 'Sadie's Retro Block Flocked Velvet Wallcovering'")
-print(f"  handle -> sadies-retro-block-flocked-velvet-{cw}")
+print(f"  will set DST title -> {_title!r}")
+print(f"  handle -> {_handle}")
 print(f"  variants -> [ROLL {roll_v['sku']} ${roll_price} continue pos1] + [SAMPLE {samp_v['sku']} $4.25 deny pos2]")
 print(f"  body_html <- archived roll ({len(src.get('body_html') or '')} chars);  tags({len(tags)}) drop display-exclude/Memo Sample")
 print(f"  copy metafields <- archived roll (skip custom.has_sample); delete stale custom.sample_of; publish to 1044 channels")
@@ -69,21 +78,21 @@ open(os.path.expanduser(f"~/Projects/flock-fix-viewer/sadie-snapshots/{cw}-survi
 
 # A. product update
 payload={"product":{"id":DST,
-  "title":"Sadie's Retro Block Flocked Velvet Wallcovering",
-  "handle":f"sadies-retro-block-flocked-velvet-{cw}",
+  "title":_title,
+  "handle":_handle,
   "body_html":src.get('body_html') or dst.get('body_html'),
   "tags":", ".join(tags),
   "options":[{"name":"Size"}],
   "variants":[
-     {"option1":roll_opt,"sku":f"FLOCK-{cw}","price":str(roll_price),
+     {"option1":roll_opt,"sku":roll_sku,"price":str(roll_price),
       "inventory_policy":"continue","inventory_management":"shopify","weight":3,"weight_unit":"lb","position":1},
-     {"id":samp_v['id'],"option1":"Sample","sku":f"FLOCK-{cw}-sample","price":"4.25",
+     {"id":samp_v['id'],"option1":"Sample","sku":samp_sku,"price":"4.25",
       "inventory_policy":"deny","inventory_management":"shopify","position":2},
   ]}}
 print("\n[A] PUT product update…")
 res=call("PUT",f"products/{DST}.json",payload)['product']
 vs={v['sku']:v for v in res['variants']}
-roll=vs[f"FLOCK-{cw}"]; samp=vs[f"FLOCK-{cw}-sample"]
+roll=vs[roll_sku]; samp=vs[samp_sku]
 print("   variants:",[(v['sku'],v['option1'],v['price'],'pos'+str(v['position'])) for v in res['variants']])
 
 # B. inventory

← 49dfe0d Mark Shopify links as record drills  ·  back to Flock Fix Viewer  ·  auto-data-snapshot: 2026-09-03T13:07:42 (3 data files) — sad 66b6c5c →