[object Object]

← back to Builds Nightly

builds-nightly pipeline: CNCP wins -> ElevenLabs voice -> HyperFrames video, per-day (works end-to-end)

8601a053545f4b10feb0662c80e5011e665a7b17 · 2026-07-22 22:19:03 -0700 · Steve Abrams

Files touched

Diff

commit 8601a053545f4b10feb0662c80e5011e665a7b17
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Wed Jul 22 22:19:03 2026 -0700

    builds-nightly pipeline: CNCP wins -> ElevenLabs voice -> HyperFrames video, per-day (works end-to-end)
---
 build-day.sh | 22 ++++++++++++++--------
 1 file changed, 14 insertions(+), 8 deletions(-)

diff --git a/build-day.sh b/build-day.sh
old mode 100644
new mode 100755
index fd86478..2936e6a
--- a/build-day.sh
+++ b/build-day.sh
@@ -19,22 +19,28 @@ log() { printf '[%s] %s\n' "$(date +%H:%M:%S)" "$*" >&2; }
 mkdir -p "$WORK/assets" "$OUT"
 
 # 1) Wins for the day → JSON. Zero wins → skip (no video for an empty day).
-log "pulling CNCP wins for $DAY…"
+log "pulling CNCP wins for $DAY..."
 node "$SELF/lib/wins-for-day.mjs" "$DAY" > "$WORK/day.json"
 COUNT=$(python3 -c "import json;print(json.load(open('$WORK/day.json'))['count'])")
-if [[ "$COUNT" -eq 0 ]]; then log "no wins on $DAY — skipping"; echo "SKIP:$DAY:no-wins"; exit 0; fi
+if [[ "$COUNT" -eq 0 ]]; then log "no wins on $DAY - skipping"; echo "SKIP:$DAY:no-wins"; exit 0; fi
 log "$COUNT wins."
 
-# 2) Narration → ElevenLabs cloned voice MP3.  (~\$0.11/video — shown per Steve's cost rule)
+# 2) Narration → ElevenLabs cloned voice MP3.  (~\$0.11/video - shown per Steve's cost rule)
 ELEVENLABS_API_KEY="${ELEVENLABS_API_KEY:-$(grep -E '^ELEVENLABS_API_KEY=' "$HOME/Projects/secrets-manager/.env" 2>/dev/null | head -1 | cut -d= -f2- | tr -d '"')}"
 [[ -n "$ELEVENLABS_API_KEY" ]] || { echo "ELEVENLABS_API_KEY missing" >&2; exit 3; }
 VOICE_ID="$(python3 -c "import json;d=json.load(open('$HOME/.claude/skills/clone-voice/active.json'));print((d.get('engines',{}).get('elevenlabs',{}) or {}).get('voice_id',''))")"
 [[ -n "$VOICE_ID" ]] || { echo "no ElevenLabs voice_id" >&2; exit 3; }
 NARR=$(python3 -c "import json;print(json.load(open('$WORK/day.json'))['narration'])")
-log "TTS via ElevenLabs (voice ${VOICE_ID:0:6}…)  ~\$0.11"
+log "TTS via ElevenLabs (voice ${VOICE_ID:0:6}...)  ~\$0.11"
+python3 - "$WORK/day.json" "$WORK/payload.json" <<'PY'
+import json, sys
+d = json.load(open(sys.argv[1]))
+json.dump({'text': d['narration'], 'model_id': 'eleven_turbo_v2_5',
+           'voice_settings': {'stability': 0.5, 'similarity_boost': 0.8}}, open(sys.argv[2], 'w'))
+PY
 curl -sS -X POST "https://api.elevenlabs.io/v1/text-to-speech/${VOICE_ID}?output_format=mp3_44100_128" \
   -H "xi-api-key: $ELEVENLABS_API_KEY" -H "Content-Type: application/json" \
-  -d "$(python3 -c "import json,sys;print(json.dumps({'text':json.load(open('$WORK/day.json'))['narration'],'model_id':'eleven_turbo_v2_5','voice_settings':{'stability':0.5,'similarity_boost':0.8}}))")" \
+  -d @"$WORK/payload.json" \
   -o "$WORK/assets/narration.mp3"
 [[ -s "$WORK/assets/narration.mp3" ]] || { echo "TTS produced no audio" >&2; head -c 300 "$WORK/assets/narration.mp3" >&2; exit 4; }
 # log to the cost ledger if present
@@ -59,8 +65,8 @@ cat > "$WORK/package.json" <<'JSON'
 JSON
 
 # 4) Render → MP4.
-log "rendering via HyperFrames (bundled Chrome)…"
-( cd "$WORK" && npx --yes "$HF_VER" render >/tmp/hf-render-$DAY.log 2>&1 ) || { echo "render failed — see /tmp/hf-render-$DAY.log" >&2; tail -20 /tmp/hf-render-$DAY.log >&2; exit 5; }
+log "rendering via HyperFrames (bundled Chrome)..."
+( cd "$WORK" && npx --yes "$HF_VER" render >/tmp/hf-render-$DAY.log 2>&1 ) || { echo "render failed - see /tmp/hf-render-$DAY.log" >&2; tail -20 /tmp/hf-render-$DAY.log >&2; exit 5; }
 MP4="$(ls -t "$WORK"/renders/*.mp4 2>/dev/null | head -1)"
 [[ -s "$MP4" ]] || { echo "no mp4 produced" >&2; exit 5; }
 FINAL="$OUT/$DAY.mp4"; cp "$MP4" "$FINAL"
@@ -69,7 +75,7 @@ log "mp4 ready: $FINAL (${SIZE}MB)"
 
 # 5) Deploy to builds.aa /nightly + refresh manifest.
 if [[ "$DEPLOY" -eq 1 ]]; then
-  log "deploying to builds.agentabrams.com/nightly…"
+  log "deploying to builds.agentabrams.com/nightly..."
   ssh "$REMOTE" "mkdir -p $REMOTE_DIR"
   scp -q "$FINAL" "$REMOTE:$REMOTE_DIR/$DAY.mp4"
   TITLE=$(python3 -c "import json;d=json.load(open('$WORK/day.json'));print(d['dateLabel'])")

← 84b3c47 auto-save: 2026-07-22T22:17:02 (4 files) — .gitignore build-  ·  back to Builds Nightly  ·  add backfill.sh + nightly launchd cron (23:50 daily) a5e9638 →