#!/usr/bin/env bash
# Run from either checkout, with its fresh dev server already running.
# Usage: bash reproduce.sh <scratch-git-project>
set -eu
project=$1
git init --quiet --initial-branch=main "$project"
git -C "$project" -c user.name=Evidence -c user.email=evidence@example.invalid commit --quiet --allow-empty -m 'Initial commit'
node apps/server/src/bin.ts project add "$project" --base-dir .t3
node apps/server/src/bin.ts thread start "$project" 'Remember codeword PELICAN for this conversation only. Use Bash to start exactly `sleep 150; echo BG-DONE` with run_in_background=true. Do not wait for it. Reply PELICAN ready after starting it. Do not write any files.' --title 'Fresh context background wake' --provider claudeAgent --model claude-haiku-5-5 --base-dir .t3 --json
# Open the returned thread in the paired web client. Use the browser sequence
# in reproduction.md. Do not wait 150 seconds before starting that sequence.
