← back to Designerwallcoverings
scripts/anna-french-rolls/run-af-build.sh
26 lines
#!/bin/bash
# Anna French roll/yard resume — drains the remaining clean Size-option products
# (af-build-plan.jsonl) under Shopify's daily variant cap. Idempotent + resumable
# via out/af-build-done.txt: once the 145 remaining are built, this no-ops (todo=0).
# Scheduled 5:30am daily so it gets first dibs on the variant cap, BEFORE the
# 6:15am sample-split run. Hard-skips the 116 Title-option products (separate path).
# Self-terminating: safe to leave loaded; remove the plist once todo hits 0.
set -euo pipefail
cd /Users/macstudio3/Projects/designerwallcoverings
# BURST LOCKDOWN (2026-06-23, vp-dw-commerce): af-build.js adds variants via productVariantsBulkCreate
# with NO budget.cjs gate and NO kill-switch, and is scheduled to grab "first dibs on the variant cap"
# — a ledger-bypassing pattern that can starve the metered cadence (the same failure mode as the
# Jun-22 Tres Tintas burst). Per Steve's HARD rule only the metered 18/hr cadence (budget.cjs) may
# create products/variants on the shared 864/day cap. This guard aborts EVEN A MANUAL run. The
# budget-AWARE Anna French path (af-noroll-resume, which uses budget.cjs take/refund) is unaffected.
# To re-arm (Steve-gated): `rm scripts/anna-french-rolls/.DISARMED-BURST`, OR retrofit budget.cjs.
if [ -f "scripts/anna-french-rolls/.DISARMED-BURST" ]; then
echo "$(date '+%Y-%m-%d %H:%M:%S') BURST DISARMED (.DISARMED-BURST present) — only the metered cadence may create variants. Skipping." >&2
exit 0
fi
export ROLL_CAP="${ROLL_CAP:-400}"
TS="$(date '+%Y-%m-%d %H:%M:%S')"
echo "=== af-build resume $TS (ROLL_CAP=$ROLL_CAP) ==="
/opt/homebrew/bin/node scripts/anna-french-rolls/af-build.js
echo "=== af-build resume done $TS ==="