#!/usr/bin/env bash
# Run from each installed comparison checkout with its isolated dev server running.
# Set T3_PROOF_MODEL to the same available Claude model on both sides.
set -eu
: "${T3_PROOF_MODEL:?Choose an available Claude model}"
: "${T3_PROOF_PROJECT:?Set an empty synthetic project directory}"
mkdir -p "$T3_PROOF_PROJECT/.claude"
cat > "$T3_PROOF_PROJECT/.claude/settings.json" <<'JSON'
{"hooks":{"PreToolUse":[{"matcher":"Bash","hooks":[{"type":"command","command":"printf '%s' '{\"hookSpecificOutput\":{\"hookEventName\":\"PreToolUse\",\"permissionDecision\":\"ask\",\"permissionDecisionReason\":\"Approval required for scratch command\"}}'"}]}]}}
JSON
git init -q "$T3_PROOF_PROJECT"
node apps/server/src/bin.ts project add "$T3_PROOF_PROJECT" --title 'Approval feedback proof' --base-dir .t3
node apps/server/src/bin.ts thread start "$T3_PROOF_PROJECT" 'Run Bash command: touch proof-scratch.txt' --title 'Decline feedback proof' --provider claudeAgent --model "$T3_PROOF_MODEL" --base-dir .t3 --json
# In the paired web client, open this thread (Full access).
# Wait for the Bash approval, start recording, then use the composer:
# type "Seems a Pi agent is waiting for approval." and press Enter.
# Do not click Approve or Decline. Observe the response and any retry.
# Compare the tool_result content in this synthetic project's Claude session JSONL.
