#!/usr/bin/env bash
set -euo pipefail
# Run from the app checkout after its isolated development server is ready.
# Arguments: isolated T3 home, empty synthetic workspace directory.
proof_home=$1
proof_workspace=$2
mkdir -p "$proof_workspace"
touch "$proof_workspace/README.md"
git -C "$proof_workspace" init --quiet --initial-branch=main
git -C "$proof_workspace" add --all
git -C "$proof_workspace" -c user.name=Scenario -c user.email=scenario@example.invalid commit --quiet --message 'Initial commit'
node apps/server/src/bin.ts project add "$proof_workspace" --title demo --base-dir "$proof_home"
node apps/server/src/bin.ts thread start "$proof_workspace" Ready --title 'Stalled command' --provider devReplay --model multi-turn --wait --json --base-dir "$proof_home"
