← back to Sanderson Onboard

tk10873/RUN_LIVE.md

40 lines

# TK-10873 — Zoffany Option-A LIVE reprice: the gated `!`-run card

The runbook is drafted, dry-run-proven, and Cody-hardened. The APPROVED memo
authorized drafting it; **running it live is a SEPARATE gated step Steve executes.**

## What it does
Sets the sellable `Sold Per {unit}` variant price on **277 ACTIVE Zoffany products**
(239 feed-verified US retail + 38 trade-verified) from `zoffany_optionA_draft_v3.json`.
The $4.25 sample variant is NEVER touched. Restore-map-first, fail-closed, reversible, ledgered.

## Preview (safe — zero network, run anytime)
```
cd ~/Projects/sanderson-onboard/tk10873 && node reprice_live_runbook.mjs
```
Expect: `277 resolved to an ACTIVE product · 239 cached variant_id · 38 need a LIVE GET`.

## LIVE run (Steve, via `!`)
```
! cd ~/Projects/sanderson-onboard/tk10873 && \
  set -a && source ~/Projects/secrets-manager/.env && set +a && \
  node reprice_live_runbook.mjs --apply --i-understand-this-is-live
```
- Phase 1 reads every product's live variants, picks the unique sellable variant, and
  writes the **complete restore map to `reprice_restore_map.live.json` (fsync'd) BEFORE any write.**
  Any product that doesn't resolve to exactly ONE sellable variant ABORTS the whole run — zero writes.
- Phase 2 writes each price via `productVariantsBulkUpdate`, verify-reads each back, and appends
  one row to `~/.claude/yolo-queue/executed-reversible/ledger.jsonl`.
- Out-of-band ($20–$2000) WARN prices HARD-STOP the run unless `--allow-warn` is added (this dataset has **0** WARN prices).

## Undo (Steve, via `!`)
```
! cd ~/Projects/sanderson-onboard/tk10873 && \
  set -a && source ~/Projects/secrets-manager/.env && set +a && \
  node reprice_live_runbook.mjs --revert reprice_restore_map.live.json --i-understand-this-is-live
```
Restores every variant to its captured `old_price`. Idempotent on any row that didn't get written.

## Cost
`$0 (local)` for the preview. The live run is Shopify Admin GraphQL only — no metered/paid API; ~277×2 calls (GET + update), throttle-paced.