#!/usr/bin/env bash
# Commands used for each side. Run from that side's installed T3 checkout.
# OpenCode 2.3.2 and openai/gpt-6-luna were used; enable that provider first.
set -eu
: "${EVIDENCE_WORKSPACE:?Set an empty synthetic git workspace}"
: "${EVIDENCE_HOME:?Set this checkout isolated T3 home}"
git init -q -b main "$EVIDENCE_WORKSPACE"
printf 'Synthetic background wait reproduction.\n' > "$EVIDENCE_WORKSPACE/README.md"
git -C "$EVIDENCE_WORKSPACE" add README.md
git -C "$EVIDENCE_WORKSPACE" -c user.name=Evidence -c user.email=evidence@example.invalid commit -qm 'Initial fixture'
# In a retained terminal: T3CODE_DEV_SEED=0 vp run dev
node apps/server/src/bin.ts project add "$EVIDENCE_WORKSPACE" --title 'Background wait demo' --base-dir "$EVIDENCE_HOME"
node apps/server/src/bin.ts thread start "$EVIDENCE_WORKSPACE" - --title 'Background wait race v2' --provider opencode --model openai/gpt-6-luna --json --base-dir "$EVIDENCE_HOME" < "$(dirname "$0")/prompt.txt"
# Open the returned thread in the paired web client and record through both shells.
# The same prompt was submitted on base and head using these CLI commands.
