#!/usr/bin/env bash
set -euo pipefail
: "${PROOF_SESSION:?}" "${PROOF_OUTPUT:?}"
mkdir -p "$PROOF_OUTPUT"
# In each build, open the CLI-seeded Claude thread and expand its Agent message.
# It contains exactly one link: the namespaced skill.
agent-device record start "$PROOF_OUTPUT/interaction-raw.mp4" --session "$PROOF_SESSION" --hide-touches
agent-device longpress 'role=link' --session "$PROOF_SESSION" --settle
agent-device screenshot "$PROOF_OUTPUT/menu-1.png" --session "$PROOF_SESSION"
sleep 0.5
agent-device screenshot "$PROOF_OUTPUT/menu-2.png" --session "$PROOF_SESSION"
compare -metric AE "$PROOF_OUTPUT/menu-1.png" "$PROOF_OUTPUT/menu-2.png" null:
agent-device record stop --session "$PROOF_SESSION"
# Dismiss the menu by tapping outside; capture the expanded message in the same way.
# Public images are crops containing the complete chip or menu, excluding metadata.
# Public videos combine a chip crop and menu crop, masking the menu region until open.
