#!/usr/bin/env bash
set -euo pipefail
# Run once per revision from an isolated, installed checkout with its fresh dev server running.
# Start that server with: T3CODE_DEV_SEED=0 vp run dev
# Arguments: checkout synthetic-git-project output-parent
checkout=$1
project=$2
out=$3/$(date -u +%Y%m%dT%H%M%SZ)
mkdir -p "$out"
cd "$checkout"
node apps/server/src/bin.ts project add --base-dir .t3 --title 'Subagent trace proof' "$project"
node apps/server/src/bin.ts thread start --base-dir .t3 --provider codex --model gpt-6-luna --title 'Native subagent proof' "$project" "Use your spawn_agent tool to spawn exactly one subagent with the task 'Reply with the single word: pong. Do not run any commands or edit files.' Wait for it to finish, then tell me what it replied." --wait --json > "$out/turn.json"
# In the paired web client, open the launched thread by link, close thread details,
# record, send the identical prompt once more, and stop recording after the pong reply.
# Extract the server evidence with extract-evidence.py; it reads only this checkout's state.
