#!/usr/bin/env bash
set -eu
# Arguments: checkout, fresh synthetic workspace. Start the checkout's dev server first
# with T3CODE_DEV_SEED=0 vp run dev, and install its dependencies with vp i.
checkout=$1
workspace=$2
mkdir -p "$workspace"
git init -q "$workspace"
git -C "$workspace" -c user.name=Evidence -c user.email=evidence@example.invalid commit --allow-empty -qm 'Initial workspace'
cd "$checkout"
node apps/server/src/bin.ts project add --base-dir .t3 --title 'Rollback proof' "$workspace"
node apps/server/src/bin.ts thread start --base-dir .t3 --provider codex --model gpt-6-astra --title 'Codex rollback proof' "$workspace" 'Reply with just READY' --json
