tools: make the sweep probe confirm it is actually recording before proceeding

Applies the fix unit 9 named. Twice a probe printed "armed", carried on and
wrote no draw log -- once because the window lookup failed, once with the
window found and the key sent. Sending the keystroke is not evidence the
logger responded.

After arming, the probe now polls for xenia_re_ui_draws_*.log to exist and
be non-empty, for up to 20 s, and aborts loudly if it does not appear. A
probe that cannot confirm its own instrument is recording is a probe whose
negatives mean nothing.

Narrower fixes were tried and were not enough: making the window lookup
fatal caught the first failure and not the second.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Jc4pciRArGHfxGGhEbwp5t
This commit is contained in:
sylph-decoder
2026-09-02 19:11:39 +00:00
parent 7863ad3b62
commit a726391ead

View File

@@ -24,6 +24,19 @@ win="$(xdotool search --name "Xenia-canary" | tail -1)"
[ -n "$win" ] || { echo "FATAL: no Xenia window"; pkill -x xenia_canary; exit 1; }
xdotool windowactivate "$win" 2>/dev/null; xdotool key --window "$win" F10; xdotool key F10
echo "armed at ${SECONDS}s"
# ⚠️ ARMING IS NOT CONFIRMED BY SENDING THE KEY. Twice now a probe has printed
# "armed", pressed on, and written no draw log at all -- once because the window
# lookup failed, once with the window found and the key sent. A probe that cannot
# confirm its own instrument is recording is a probe whose negatives mean nothing.
# So: wait for the log to exist AND grow, and abort loudly if it does not.
for _ in $(seq 1 20); do
sz=$(stat -c %s "$OUT"/xenia_re_ui_draws_*.log 2>/dev/null | head -1 || echo 0)
[ "${sz:-0}" -gt 0 ] && break
sleep 1
done
[ "${sz:-0}" -gt 0 ] || { echo "FATAL: armed but no draw log after 20s -- not recording"; pkill -x xenia_canary; exit 1; }
echo "logging confirmed at ${SECONDS}s (${sz} bytes)"
sleep 12; pad "press=A"; sleep 0.4; pad ""; echo "A (skip video) at ${SECONDS}s"
sleep 150 # let the title build in and settle, no further input
pkill -x xenia_canary