#!/usr/bin/env bash
set -euo pipefail
side="$1"
case "$side" in before) repo=/home/ubuntu/wt/pr-27954-before;; after) repo=/home/ubuntu/wt/pr-27954;; *) exit 2;; esac
run="/tmp/lead-27954-r1/evidence-capture-2/run-$(date -u +%Y%m%dT%H%M%S)-$side-all"
mkdir -p "$run"
cat > "$run/prompt.txt" <<'EOF'
Use exactly two parallel tool calls in ONE assistant message, no other calls. First Bash (set timeout=600000): python3 -c 'import os,time; exec("while not os.path.exists(\"/tmp/lead-27954-r1/evidence-capture-2/workspace/release-native\"): time.sleep(0.1)")' && convert -size 320x200 xc:teal /tmp/lead-27954-r1/evidence-capture-2/workspace/native.png
Second Read: /tmp/lead-27954-r1/evidence-capture-2/workspace/native.png
The PNG is deliberately absent; Bash will create it after an external gate. Do not retry Read. Wait for both tools, then reply only Done.
EOF
cd "$repo"
node apps/server/src/bin.ts thread start /tmp/lead-27954-r1/evidence-capture-2/workspace - --provider claudeAgent --model claude-haiku-5-5 --title 'Read image lifecycle' --base-dir "/tmp/lead-27954-r1/evidence-capture-2/$side-home" --json < "$run/prompt.txt" > "$run/start.json"
printf '%s\n' "$run"
cat "$run/start.json"
