From 571d7e87b036c47989e29098248263f627d97b14 Mon Sep 17 00:00:00 2001 From: sylph-decoder Date: Mon, 31 Aug 2026 01:14:53 +0000 Subject: [PATCH] tools: let the submenu sweep's self-test be checked without starting a run Verifying it previously meant launching the script, which then waits ~150 s for a main menu and opens x11grab captures -- so the question "did the self-test pass?" could not be answered without disturbing whatever else was using the display. That is how a check-the-tool step turned into competing load during a measurement once already. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01Wuu56cE8vJGTBtn1ppsk8v --- tools/re-capture/submenu_focus_sweep.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/re-capture/submenu_focus_sweep.py b/tools/re-capture/submenu_focus_sweep.py index 20ccbf44..f8300e7b 100644 --- a/tools/re-capture/submenu_focus_sweep.py +++ b/tools/re-capture/submenu_focus_sweep.py @@ -144,6 +144,12 @@ def _self_test(): print("── decision-rule self-test ──", flush=True) _self_test() +# Verifiable WITHOUT starting a run. Without this the only way to check the +# self-test was to launch the script, which then proceeds to wait ~150 s for a +# main menu and opens x11grab captures -- so "did my self-test pass?" could not be +# answered without disturbing whatever else was using the display. +if "--selftest-only" in sys.argv: + sys.exit(0) MAIN = wait_until(lambda a: main_menu_item(ring_row(img(a))) is not None and 250 <= glyph(a) <= 420, "the main menu", 150)