Skip to content

fix(clearance): confirm extension keepalive before observation - #202

Merged
ChechiDev merged 2 commits into
mainfrom
fix/sw-keepalive-confirmation-gate
Sep 13, 2026
Merged

ChechiDev merged 2 commits into
mainfrom
fix/sw-keepalive-confirmation-gate

Conversation

@ChechiDev

Copy link
Copy Markdown
Owner

Summary

  • Adds sw_keepalive_confirmed gate immediately after extension_config_inject, before target navigation
  • Gate reaches the extension SW via CDP and verifies swKeepalive alarm exists using chrome.alarms.get()
  • If SW is unreachable or alarm is missing, run blocks at the new gate with sanitized evidence — no longer wastes the full 300s observation window
  • Evidence is sanitized: only sw_keepalive_alarm_present (bool/None) and sw_keepalive_alarm_error_type (str on failure)

Motivation

Real smoke on v0.47.6 blocked at clearance_observed with extension_diagnostic: unavailable / no SW target found. The swKeepalive alarm (added in v0.47.6) may not be created before observation begins. This gate surfaces that failure fast.

Changes

  • infrastructure/browser/pydoll_engine.py — async read_extension_alarm(alarm_name) (CDP, argument as value — no injection risk; per-step timeout 2s)
  • cli/real_clearance_composition.py — make_sw_keepalive_checker(engine, loop) factory (10s outer timeout)
  • cli/smoke_clearance_real.py — GATE_SW_KEEPALIVE_CONFIRMED gate (PASS/BLOCKED/unreachable paths)
  • cli/main.py — factory wired into harness.run() on --real-clearance path
  • 13 new unit tests covering all paths; 4 review lenses APPROVED after fixes

Test plan

  • All 13 new unit tests pass (TestReadExtensionAlarm, TestMakeSwKeepaliveChecker, TestSwKeepaliveConfirmedGate)
  • Full unit suite passes
  • Ruff + flake8 clean
  • No real smoke executed

Closes #201

@ChechiDev ChechiDev added the type:bug Bug fix label Sep 13, 2026
@ChechiDev
ChechiDev merged commit f0dc573 into main Sep 13, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:bug Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(clearance): confirm extension keepalive before observation

1 participant