#!/usr/bin/env bash
set -euo pipefail
# Run from either evidence checkout after vp i.
# MODEL_ID is supplied privately. Configure an enabled opencode provider with the
# isolated OpenCode 2.2.7 binary before starting T3CODE_DEV_SEED=0 vp run dev.
: "${MODEL_ID:?Supply the provider model privately}"
: "${EVIDENCE_HOME:?Supply a fresh synthetic workspace parent}"
: "${RUN_OUTPUT:?Supply a new output directory for this run}"
mkdir -p "$RUN_OUTPUT" "$EVIDENCE_HOME/chart-demo"
git init --quiet --initial-branch=main "$EVIDENCE_HOME/chart-demo"
git -C "$EVIDENCE_HOME/chart-demo" -c user.name=Evidence -c user.email=evidence@example.invalid commit --allow-empty --quiet -m 'Initial commit'
node apps/server/src/bin.ts project add "$EVIDENCE_HOME/chart-demo" --title 'Chart demo' --base-dir .t3
node apps/server/src/bin.ts thread start "$EVIDENCE_HOME/chart-demo" 'Build a tiny HTML bar chart (3 bars, inline SVG, no libraries) and publish it with your T3 html_render tool (title "Repro chart", height 200). Then reply with one short sentence confirming publication.' --provider opencode --model "$MODEL_ID" --title 'HTML page reproduction' --base-dir .t3 --wait --json > "$RUN_OUTPUT/turn.json"
# Browser steps on both commits:
# Pair using the dev startup link. Open HTML page reproduction.
# 1280x800 viewport, light theme. Close Thread details; expand the Agent prompt.
# Take screenshots 550ms apart until pixel-identical, then retain the still.
# Record Thread actions > Delete > Confirm.
# Run inspect.py before and after deletion, with the threadId from turn.json.
# Public screenshots mask only the model selector; videos omit the composer.
