#!/usr/bin/env bash
# Run on head with the PR detail open; SESSION names the leased device session.
set -euo pipefail
: "${SESSION:?Set the active agent-device session}"
: "${OUTPUT:?Set an evidence output directory}"
agent-device record start "$OUTPUT/explicit-squash.mp4" --session "$SESSION"
agent-device press 'label="Merge options"' --settle --session "$SESSION"
agent-device press 'text="Squash and merge"' --settle --session "$SESSION"
agent-device press 'role=group label="Squash and merge"' --settle --session "$SESSION"
# Inspect the confirmation: it must say using squash. Cancel; do not execute the merge.
agent-device press 'label="Cancel"' --settle --session "$SESSION"
agent-device record stop --session "$SESSION"
