#!/usr/bin/env bash
set -euo pipefail
# Run this from a directory containing the uploaded bridge-fixture.js and capture.py.
# Requires agent-browser 0.40.0, Chromium, Python Pillow, ffmpeg, vp, and git.
# The original capture.py uses this scratch directory and named browser sessions.
mkdir -p /tmp/issue-lead-4812-r2/evidence-capture
# Copy the two downloaded scripts into the directory above before running this file.
git -C /home/ubuntu/t3code worktree add /home/ubuntu/wt/issue-4812-cap-before 867112cda0
git -C /home/ubuntu/t3code worktree add /home/ubuntu/wt/issue-4812-cap-after 18361cdf37
(cd /home/ubuntu/wt/issue-4812-cap-before && vp install)
(cd /home/ubuntu/wt/issue-4812-cap-after && vp install)
# Start each command in its own retained terminal, and record its PID:
# T3CODE_DEV_SEED=0 vp run dev
# Read each [dev-runner] line. The requested checkout paths yielded web ports 8386 / 6471.
# Do not set VITE_HTTP_URL or VITE_WS_URL. Never use the live T3 database.
# Start one new named agent-browser session per side using the shared init script:
# agent-browser --session issue4812-before --init-script /tmp/issue-lead-4812-r2/evidence-capture/bridge-fixture.js open '<printed before pairing URL>'
# agent-browser --session issue4812-after --init-script /tmp/issue-lead-4812-r2/evidence-capture/bridge-fixture.js open '<printed after pairing URL>'
# Pairing remains in web mode. A subsequent reload at /#/ enters desktop-renderer mode.
# On each side click New thread once if /#/ opens the default persisted empty thread.
# No message is sent and no provider runs. The fresh server's default project is named server.
# Locate agent-browser at capture.py's AB path or update that constant to the installed binary.
# Then run:
# python3 /tmp/issue-lead-4812-r2/evidence-capture/capture.py R1 R2
# For just the narrow variants: CAPTURE_WIDTH=390 python3 .../capture.py R1 R2
# Run make-diffs.py on each timestamped result directory.
# Close the two named browser sessions, stop your captured server PIDs, and remove both worktrees.
