#!/usr/bin/env bash
# Run once from each checkout after starting its fresh dev server.
# CLAUDE_CONFIG_DIR must point at an isolated Claude config containing your
# provider credentials and user-scoped MCP configuration described below.
set -eu
: "${PROOF_PROJECT:?Set PROOF_PROJECT to an empty synthetic project directory}"
node apps/server/src/bin.ts project add --base-dir .t3 --title 'MCP sign-in proof' "$PROOF_PROJECT"
node apps/server/src/bin.ts thread start --base-dir .t3 --title 'MCP sign-in after idle resume' --provider claudeAgent --model claude-haiku-5-5 --wait --json "$PROOF_PROJECT" 'Reply with just the word ok.'
# Open the resulting thread in the paired web UI. Hide the sidebar and thread
# details to exclude host identity. Start a recording, then use the composer:
# 1. Reply with just the word two.
# 2. Confirm two appears and there is still exactly one Sign in notice.
# 3. Leave the thread idle >=160 seconds (default release is 120 seconds).
#    Confirm the specific Claude child process has exited before resuming.
# 4. Reply with just the word three.
# 5. Capture the completed conversation. Base has 2 notices; head has 1.
# Both sides: default light theme, Chromium viewport 1280x800, fresh DB,
# T3CODE_DEV_SEED=0; no source changes or shortened idle timers.
