#!/usr/bin/env bash
# Seed the real T3 server with the same synthetic Pi project used in the captures.
# Usage: bash reproduce.sh CHECKOUT NEW_PROJECT_DIRECTORY
# Start CHECKOUT with T3CODE_DEV_SEED=0 vp run dev first; Pi must be authenticated.
set -euo pipefail
checkout=$(realpath "$1")
project=$2
artifacts=$(cd "$(dirname "$0")" && pwd)
mkdir -p "$project/.pi/extensions"
cp "$artifacts/selection-proof.ts" "$project/.pi/extensions/selection-proof.ts"
git -C "$project" init -q
cd "$checkout"
python3 - <<'PY'
import json
p='.t3/userdata/settings.json'
d=json.load(open(p))
d.setdefault('providerInstances', {})['pi'] = {
  'driver':'pi', 'enabled':True,
  'config':{'enabled':True, 'binaryPath':'pi', 'launchArgs':'--approve --no-mcp', 'customModels':[]}
}
open(p,'w').write(json.dumps(d,indent=2))
PY
node apps/server/src/bin.ts project add --base-dir .t3 --title 'Pi model selection proof' "$project"
node apps/server/src/bin.ts thread start --base-dir .t3 --provider pi --model openai/gpt-5.6-luna --title 'Native model and thinking restoration' "$project" 'Reply only: ready.' --json
cat <<'STEPS'
Open the returned thread in the web app (pair with that server first).
Use a 1280x800 viewport, light theme. Hide the thread details panel.
1. Open the 5.6 Luna model picker and explicitly select Low thinking. Close the picker.
2. Send: Baseline: reply only ready. Wait for completion.
3. Send /proof-switch-model (Enter accepts autocomplete; Enter again submits).
   Observe EXTENSION SWITCHED MODEL: native model=openai/gpt-6-luna; thinking=low.
4. Send: After model switch: reply only ready. Wait for completion and capture.
   Base: ACTUAL PROMPT SETTINGS shows gpt-6-luna; head: gpt-5.6-luna.
   The T3 picker still shows 5.6 Luna Low on both sides.
5. Send /proof-switch-thinking (accept autocomplete, submit).
   Observe EXTENSION SWITCHED THINKING with thinking=high.
6. Send: After thinking-only switch: reply only ready. Wait for completion and capture.
   Base: ACTUAL PROMPT SETTINGS shows gpt-6-luna / high; head: gpt-5.6-luna / low.
Keep the explicit selection unchanged throughout. Record steps 1-6 on each commit.
The status is emitted by the extension using ctx.model and pi.getThinkingLevel()
in before_agent_start, not inferred from an LLM response. Real provider turns reply ready.
The thinking extension changes only thinking; the base retains its prior model drift.
STEPS
