#!/usr/bin/env bash
# Synthetic data only. Run once in each separate checkout, with its dev server running.
# Usage: bash seed.sh CHECKOUT FIXTURE_DIR SYNTHETIC_PROJECT
# FIXTURE_DIR must contain the executable named copilot shipped alongside this script.
set -euo pipefail
checkout=$1
fixture_dir=$2
project=$3
cd "$checkout"
mkdir -p "$project"
run_dir="$fixture_dir/run-$(date -u +%Y%m%dT%H%M%S)-$$"
mkdir -p "$run_dir"
python3 - "$fixture_dir/copilot" <<'PY'
import json, sys
p='.t3/userdata/settings.json'
d=json.load(open(p))
d.setdefault('providerInstances',{})['evidence']={'driver':'acpRegistry','displayName':'ACP evidence','config':{'source':'local','commandPath':sys.argv[1],'customModels':['auto']}}
json.dump(d,open(p,'w'),indent=2)
PY
node apps/server/src/bin.ts project add --base-dir .t3 --title 'Resume evidence' "$project"
node apps/server/src/bin.ts thread start --base-dir .t3 --provider evidence --model auto --title 'Resume history' "$project" 'Complete two inspections using native tasks.' --json --wait > "$run_dir/first-turn.json"
cat "$run_dir/first-turn.json"
# Stop the dev server with Ctrl-C in its retained terminal session after completion.
# Restart with T3CODE_DEV_SEED=0 vp run dev to release the ACP process without changing history.
# Open the returned thread in the browser, then run capture-driver.js with the T3 tool host.
