#!/usr/bin/env bash
# Run once per checkout after vp i and starting its fresh dev server with:
# T3CODE_DEV_SEED=0 T3CODE_ENVIRONMENT_LABEL='Pipe proof' vp run dev --no-seed --host 0.0.0.0
# Enable the OpenCode provider in this disposable server's settings.
# Install with vp run mobile:install android --session "$session".
# Run vp run dev:client --port 8081 from apps/mobile, pair the device, then open the returned thread.
set -euo pipefail
checkout="$1"
project="$2"
mkdir -p "$project"
printf 'export const pipeFileMarker = "a-pipe-b";\n' > "$project/a|b.ts"
git -C "$project" init -q
git -C "$project" add .
git -C "$project" -c user.name=Proof -c user.email=proof@example.invalid commit -qm 'Add pipe file' --allow-empty
cd "$checkout"
node apps/server/src/bin.ts project add "$project" --title 'Pipe file' --base-dir "$checkout/.t3"
node apps/server/src/bin.ts thread start "$project" 'Reply with exactly the following three-line Markdown table, no code fence and no other text:
| File | Status |
| --- | --- |
| `./a\|b.ts` | OK |' --title 'Pipe table' --provider opencode --model anthropic/claude-haiku-5-5 --wait --json --base-dir "$checkout/.t3"
# Capture the assistant table, then run on the same Pixel 9 in each checkout:
# agent-device record start "$capture_dir/tap.mp4" --session "$session"
# agent-device click 130 1944 --session "$session"
# agent-device snapshot -i --session "$session"
# agent-device record stop --session "$session"
# Base remains on the broken table; head opens a|b.ts with the marker content.
