[object Object]

← back to Designer Wallcoverings

cadence-hourly: export PATH so launchd's minimal PATH can find node (Osborne bug)

a17ab8933d02a4bdca1441fcda27848488f4b109 · 2026-06-18 10:48:03 -0700 · SteveStudio2

Bare 'node' calls (budget grant + cadence-import --activate) failed under launchd's
minimal PATH; line 27's '|| echo' masked it → uploader would silently activate 0
products the moment the kill-switch lifts. Caught by launchd preflight linter 2026-06-18,
fixed before re-enabling per Steve. Verified node/psql now resolve under simulated launchd spawn.

Files touched

Diff

commit a17ab8933d02a4bdca1441fcda27848488f4b109
Author: SteveStudio2 <steve@designerwallcoverings.com>
Date:   Thu Jun 18 10:48:03 2026 -0700

    cadence-hourly: export PATH so launchd's minimal PATH can find node (Osborne bug)
    
    Bare 'node' calls (budget grant + cadence-import --activate) failed under launchd's
    minimal PATH; line 27's '|| echo' masked it → uploader would silently activate 0
    products the moment the kill-switch lifts. Caught by launchd preflight linter 2026-06-18,
    fixed before re-enabling per Steve. Verified node/psql now resolve under simulated launchd spawn.
---
 shopify/scripts/cadence/run-cadence-hourly.sh | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/shopify/scripts/cadence/run-cadence-hourly.sh b/shopify/scripts/cadence/run-cadence-hourly.sh
index 9e457ffb..51a139ff 100755
--- a/shopify/scripts/cadence/run-cadence-hourly.sh
+++ b/shopify/scripts/cadence/run-cadence-hourly.sh
@@ -6,6 +6,12 @@
 # Resumable: the firm rotation cursor (data/cadence-cursor.json) advances each slot so all
 # eligible firms get coverage across the day; the staged backlog drains continuously.
 set -u
+# launchd runs jobs with a minimal PATH (/usr/bin:/bin:/usr/sbin:/sbin). `node` lives in
+# /usr/local/bin and psql in homebrew — neither is on that PATH. Without this export the bare
+# `node` calls below fail with "node: not found"; line ~27's `|| echo` masks it and the uploader
+# silently activates NOTHING. (Osborne-class bug; caught by the launchd preflight linter 2026-06-18,
+# fixed before re-enabling per Steve.)
+export PATH="/usr/local/bin:/opt/homebrew/bin:/opt/homebrew/opt/postgresql@14/bin:$PATH"
 SHOP="$HOME/Projects/Designer-Wallcoverings/shopify"
 BUDGET="$HOME/Projects/designerwallcoverings/scripts/variant-budget/budget.cjs"
 KILL="$HOME/.dw-fixer-stop"
@@ -31,7 +37,18 @@ if [ "$MAXP" -lt 1 ]; then echo "no upload budget this slot — exit clean"; exi
 
 cd "$SHOP" || { echo "FATAL: no $SHOP"; exit 1; }
 export $(grep -E "^SHOPIFY_ADMIN_TOKEN=" "$HOME/Projects/secrets-manager/.env" | xargs) 2>/dev/null
-node scripts/cadence/cadence-import.js --slot "$SLOT" --vendors 8 --skus 10 --max "$MAXP" --activate --commit
+OUT=$(node scripts/cadence/cadence-import.js --slot "$SLOT" --vendors 8 --skus 10 --max "$MAXP" --activate --commit 2>&1)
 RC=$?
+echo "$OUT"
 echo "cadence-import exit $RC  (3 = daily variant cap hit, resumes next slot)"
+
+# Slack update to the claude-steve channel — only when the run SUCCEEDED (created > 0), so
+# the channel gets a post each hour products actually land (not 0-create cap-skip slots).
+# Fail-quiet via slack-notify.sh (token lives on Kamatera prod; currently account_inactive
+# → posts no-op silently until Steve refreshes the Slack token).
+SUMMARY=$(printf '%s' "$OUT" | grep -oE 'CREATED [0-9]+ \([^)]*\), linked-existing [0-9]+ \([^)]*\), failed [0-9]+' | tail -1)
+CREATED=$(printf '%s' "$SUMMARY" | grep -oE '^CREATED [0-9]+' | grep -oE '[0-9]+')
+if [ "${CREATED:-0}" -gt 0 ]; then
+  bash "$(dirname "$0")/slack-notify.sh" "📦 DW all-day uploader · slot ${SLOT} $(date '+%a %H:%M') — ${SUMMARY}" || true
+fi
 echo "═══════ done $TS ═══════"

← 2471c4c0 Lift Innovations from cadence DENY_VENDORS (Steve 2026-06-18  ·  back to Designer Wallcoverings  ·  launchd minimal-PATH fix sweep: export PATH so node/psql/jq 4ad8ba0d →