[object Object]

← back to Wallco Ai

overnight loop: extend to daytime (stop_hour=18, cap=140), stage-only

ca8e0ff1dedba49908a0eeb53b3fbc935cbb715e · 2026-06-01 07:02:58 -0700 · Steve Abrams

Files touched

Diff

commit ca8e0ff1dedba49908a0eeb53b3fbc935cbb715e
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Mon Jun 1 07:02:58 2026 -0700

    overnight loop: extend to daytime (stop_hour=18, cap=140), stage-only
---
 scripts/overnight-drunk-animals-loop.sh | 74 +++++++++++++++++++++++++++++++++
 1 file changed, 74 insertions(+)

diff --git a/scripts/overnight-drunk-animals-loop.sh b/scripts/overnight-drunk-animals-loop.sh
new file mode 100644
index 0000000..dab196d
--- /dev/null
+++ b/scripts/overnight-drunk-animals-loop.sh
@@ -0,0 +1,74 @@
+#!/bin/bash
+# ──────────────────────────────────────────────────────────────────────────────
+# Overnight autonomous drunk-animals generation loop — STAGE-ONLY (DTD fork B)
+#
+# Steve 2026-06-01: "run on yolo loop all night" + chose STAGE-ONLY.
+#   • DEFAULT gen-luxe spec only (NO --variant) — the rejected "bad designs" came
+#     from --variant-locked off-style templates; default-spec kills that mode.
+#   • --verify-subjects ON (composition + subject-presence gates).
+#   • Real Shopify natural-texture SKU grounds, color-targeted for spread.
+#   • NOTHING is shipped to prod and NOTHING goes live. Every design is staged
+#     (is_published=FALSE, tagged 'overnight-review') for Steve's morning review.
+#   • High-confidence (first-attempt gate-clean) ones ALSO get 'overnight-hc' so
+#     the morning triage can sort best-first.
+#   • Hard caps: MAX_TOTAL finished designs, stop at STOP_HOUR, kill-switch file.
+#
+# Kill switch:  touch ~/.wallco-overnight-stop
+# Log:          logs/overnight-gen-YYYYMMDD-HHMM.log
+# Morning:      SELECT id FROM all_designs WHERE 'overnight-review'=ANY(tags)
+#                 AND is_published=FALSE ORDER BY ('overnight-hc'=ANY(tags)) DESC, id;
+# ──────────────────────────────────────────────────────────────────────────────
+set -u
+cd "$HOME/Projects/wallco-ai" || exit 1
+mkdir -p logs
+LOG="logs/overnight-gen-$(date +%Y%m%d-%H%M).log"
+KILL="$HOME/.wallco-overnight-stop"
+
+STOP_HOUR=18       # stop when local hour >= STOP_HOUR (evening cutoff; daytime extend)
+MAX_TOTAL=140      # cap on finished designs generated today (bounds Gemini spend)
+
+SRCS=(54957 54959 54949 54953 41795 41838)
+TEXTURES=(grasscloth linen silk cork raffia mica sisal jute seagrass abaca hemp paperweave bamboo madagascar natural arrowroot)
+COLORS=(Blue Green Gold Brown Grey Red Pink Coral Beige Purple Orange)
+ANIMALS=(peacock giraffe elephant sloth fox flamingo toucan owl raccoon koala badger otter hippo zebra tiger lion hedgehog swan gecko chameleon turtle parrot cockatoo hummingbird stag rabbit squirrel bear crane heron rhino kangaroo llama camel pheasant deer capybara warthog meerkat lemur panda macaw beaver ostrich armadillo mongoose penguin seal bison goat duck platypus porcupine anteater moose walrus octopus boar wombat monkey)
+DRINKS=("a frothy stout" "a dirty martini" "a coupe of champagne" "a glass of red wine" "a whiskey tumbler" "a pint of lager" "a gin and tonic" "a snifter of brandy" "a mai tai" "a glass of port" "a mug of cider" "a mint julep" "a negroni" "a flute of prosecco" "a tankard of ale" "a rum punch" "an old fashioned" "a pisco sour" "a margarita" "an aperol spritz")
+
+total=0; hc_count=0
+echo "[$(date '+%F %T')] STAGE-ONLY loop START  cap=$MAX_TOTAL stop_hour=$STOP_HOUR (no prod, nothing goes live)" | tee -a "$LOG"
+
+while :; do
+  [ -f "$KILL" ] && { echo "[$(date '+%F %T')] KILL switch — stopping" | tee -a "$LOG"; break; }
+  H=$(date +%H); H=$((10#$H))
+  [ "$H" -ge "$STOP_HOUR" ] && { echo "[$(date '+%F %T')] reached stop hour $STOP_HOUR — stopping" | tee -a "$LOG"; break; }
+  [ "$total" -ge "$MAX_TOTAL" ] && { echo "[$(date '+%F %T')] hit MAX_TOTAL=$MAX_TOTAL — stopping" | tee -a "$LOG"; break; }
+
+  animal="${ANIMALS[$((RANDOM % ${#ANIMALS[@]}))]}"
+  tex="${TEXTURES[$((RANDOM % ${#TEXTURES[@]}))]}"
+  col="${COLORS[$((RANDOM % ${#COLORS[@]}))]}"
+  src="${SRCS[$((RANDOM % ${#SRCS[@]}))]}"
+  drink="${DRINKS[$((RANDOM % ${#DRINKS[@]}))]}"
+  motif="a drunken $animal with $drink"
+
+  echo "[$(date '+%F %T')] gen: $animal × $tex × $col" | tee -a "$LOG"
+  out=$(node scripts/gen-luxe.js "$src" "$motif" --texture-cat="$tex" --color-family="$col" --verify-subjects 2>&1)
+  echo "$out" >> "$LOG"
+  id=$(echo "$out" | grep -oE 'PG id: [0-9]+' | grep -oE '[0-9]+$' | head -1)
+  [ -z "$id" ] && { echo "[$(date '+%F %T')]   no PG id (skipped)" | tee -a "$LOG"; continue; }
+  total=$((total+1))
+
+  hc=0
+  if echo "$out" | grep -q 'composition: PASS' && echo "$out" | grep -q 'PRESENT' && ! echo "$out" | grep -q 'gate failed all'; then hc=1; hc_count=$((hc_count+1)); fi
+
+  # STAGE: gen-luxe inserts is_published=true; force it FALSE and tag for review.
+  if [ "$hc" -eq 1 ]; then TAGS="ARRAY['overnight-review','overnight-hc']::text[]"; else TAGS="ARRAY['overnight-review']::text[]"; fi
+  psql dw_unified -tAc "
+UPDATE all_designs SET is_published=FALSE, web_viewer=FALSE,
+  tags=(array_remove(array_remove(COALESCE(tags,ARRAY[]::text[]),'overnight-review'),'overnight-hc'))||$TAGS WHERE id=$id;
+UPDATE spoon_all_designs SET is_published=FALSE,
+  tags=(array_remove(array_remove(COALESCE(tags,ARRAY[]::text[]),'overnight-review'),'overnight-hc'))||$TAGS WHERE id=$id;" >> "$LOG" 2>&1
+  echo "[$(date '+%F %T')]   id=$id STAGED (hc=$hc)  total=$total hc=$hc_count" | tee -a "$LOG"
+done
+
+staged=$(psql dw_unified -tAc "SELECT count(*) FROM all_designs WHERE 'overnight-review'=ANY(tags) AND is_published=FALSE;" 2>/dev/null | tr -d ' ')
+echo "[$(date '+%F %T')] overnight loop END  generated=$total high_confidence=$hc_count total_review_queue=$staged" | tee -a "$LOG"
+echo "[$(date '+%F %T')] MORNING REVIEW QUEUE: SELECT id FROM all_designs WHERE 'overnight-review'=ANY(tags) AND is_published=FALSE ORDER BY ('overnight-hc'=ANY(tags)) DESC, id;" | tee -a "$LOG"

← 9f06ace rename Cactus Curator → Design Curator: /admin/design-curato  ·  back to Wallco Ai  ·  gen-luxe: psql helper ON_ERROR_STOP=1 so a half-applied mult fef1177 →