#!/usr/bin/env bash
# Run from each commit's checkout after vp i, with its own fresh .t3 database.
# Start T3CODE_DEV_SEED=0 T3CODE_ENVIRONMENT_LABEL=Evidence vp run dev --no-seed
# in a retained terminal first, and pair a 1280x800 Chromium preview browser.
set -eu
project="$1"
node apps/server/src/bin.ts project add "$project" --title 'Read aloud proof' --base-dir .t3
node apps/server/src/bin.ts thread start "$project" 'Reply with exactly these two paragraphs, no quotes or extra text:

Press ⌘K and pick a file, and a menu opens.

🎉 A party for all, and a party for some!' --title 'Symbols and repeated words' --provider codex --model gpt-6-luna --wait --json --base-dir .t3
# Open the resulting thread by URL. Settings > Voice > Read aloud:
# choose local model on Evidence, download Kokoro, wait for Selected.
# Leave voice blank (default), speed 1x, language Auto; no word timing model.
# Close Settings and the thread details panel. Use the light theme.
# The VM lacks an emoji font. On both pages we loaded the same single-glyph
# Noto Color Emoji font for U+1F389; no message or playback data was changed.
# Evaluate observe-playback.js and observe-audio.js in the page, then start
# the preview recording and click the reply's actual Read aloud button.
# Let both paragraphs finish. Export proofLog and each proofStreams entry.
# Audio is fetched from the very same real synthesis URL used by each player.
# Mux each MP3 at its recorded performance.now offset into the screen recording.
# For synchronizing exported MP3 audio to the recording, also subscribe with
# the observer below and retain entries with audioTime:
# controller.subscribeHighlight(() => log({time:performance.now(),
#   audioTime:window.proofPlayer.currentTime,highlight:controller.getHighlight()}));
# Use time - audioTime*1000 to place the actual synthesis MP3 on the video clock.
