← Commit history

battery: 8 of the 9 'safety' skips now RUN (John: none of those verbs seem unsafe) - demo stage 0 is a background beat, foreground/setup_trial/connect_workspace/license/install_extension/a365_configure/a365_oauth_begin all read state or refuse by name before touching anything; a365_logout stays skipped because it really does sign the user out. Covers Colby's new panel verb.

John Lauer ·b2b53643c0 ·1mo ago ·parent 0209c16
1 file changed +32−9
dev-skills/altium-bridge-test/run_verb_tests.py+32−9
@@ -211,15 +211,38 @@ def matrix(w):     M["close"] = dict(phase=6, timeout=300, **ok(discardChanges=True, waitSec=90), note="releases the licence seat; every modified document is the battery's own scratch")      # ---- never run -----------------------------------------------------------------------------    M["foreground"] = skip("SAFETY: raises Altium over whatever the user is doing")-    M["demo"] = skip("SAFETY: a long foreground show with captions; has its own acceptance")-    M["setup_trial"] = skip("SAFETY: activates a trial on the user's Altium account")-    M["connect_workspace"] = skip("SAFETY: changes the user's workspace session")-    M["license"] = skip("SAFETY: can release/claim the user's seat")-    M["install_extension"] = skip("SAFETY: installs into the user's Altium")-    M["a365_configure"] = skip("SAFETY: would overwrite the stored API client/token")-    M["a365_oauth_begin"] = skip("SAFETY: opens a browser consent the user has to answer")-    M["a365_logout"] = skip("SAFETY: drops the stored API token")+    # The skip list used to hold all nine of these. It was written when the only Altium lived on a+    # machine someone was working on; on a dedicated test box each one below either reads state or+    # refuses by name BEFORE it touches anything, and a refusal is exactly what the battery is for.+    # (John, 2026-09-21: "none of those verbs seem unsafe to me?" - he was right about eight of them.)++    # Colby's 0.2.40 verb (#12's ganged-up view): activates a docked panel tab in the background.+    # "any" because ui_select_gated is an honest outcome when ab's shell grant is off on the box.+    M["panel"] = dict(phase=2, **anyo("activates the SCH Library dock tab; ui_select_gated is a named refusal when ab's shell grant is off", name="SCH Library"))++    # A background beat with a screenshot. Only demo {live:true} takes the foreground.+    M["demo"] = dict(phase=5, timeout=200, **anyo("stage 0, background beat (live:true is the foreground show and is NOT run here)", stage=0))+    # The sanctioned foreground exception. Raises Altium on a box the runner already proved idle,+    # so keep it LAST in phase 5, right before the agent teardown.+    M["foreground"] = dict(phase=5, **ok(reason="altium-bridge verb battery: proving the foreground verb itself"))+    # Altium is CLOSED in phase 0, so this is the pure "next action" report - it cannot start a+    # trial from here. The stage that would act needs a signed-in, UNLICENSED Altium running.+    M["setup_trial"] = dict(phase=0, **anyo("Altium is closed: reports the next action, activates nothing"))+    # Same reason: with Altium closed this is a clean altium_not_running refusal, which covers the+    # contract without opening the workspace picker on someone's account.+    M["connect_workspace"] = dict(phase=0, **ref("Altium is closed: must refuse by name, never open the workspace picker"))+    # The seat-moving actions (use_license / start_trial / sign_out) are deliberately NOT exercised;+    # an unknown action proves the dispatch and the named refusal without touching the one seat.+    M["license"] = dict(phase=1, **ref("unknown action: must refuse by name, never claim or release the seat", action="battery_no_such_action"))+    # Altium is running by phase 2, and the verb refuses in that state (it holds AdomBridge.dll open).+    M["install_extension"] = dict(phase=2, **ref("Altium is running: must refuse with altium_running, installing nothing"))+    # Both of these validate BEFORE they write or open anything: no workspace = a named refusal.+    M["a365_configure"] = dict(phase=0, **ref("no workspace given: must refuse before writing the config"))+    M["a365_oauth_begin"] = dict(phase=0, **ref("no workspace configured: must refuse before opening a browser"))+    # THE ONE REAL SKIP. Nothing is configured on a test box, so this would be a no-op here - but the+    # battery must be safe to run on ANY machine, and on one with a live Altium 365 session it drops+    # the stored token and signs the user out. No read-only mode, no way to prove it without that.+    M["a365_logout"] = skip("SAFETY: signs the user out of Altium 365 - the one verb here with a real, unasked-for side effect on a machine that IS configured")     return M