Skip to content

Covered band: the dismiss step's dialog box is the proved covering window - #1759

Merged
abrichr merged 2 commits into
mainfrom
claude/covered-band-dialog-box
Nov 3, 2026
Merged

abrichr merged 2 commits into
mainfrom
claude/covered-band-dialog-box

Conversation

@abrichr

@abrichr abrichr commented Nov 3, 2026

Copy link
Copy Markdown
Member

Found on the live Windows lab run, after #1735, #1739 and #1740. The Patient Notes "Session notice" stop was reclassified as a covered band, and the scripted "OK" click passed the #1740 dismiss guard: the same window, and text that reads as a session notice. The patch then refused it: "no dialog was found around the click".

A new click admitted on the record check carries the dialog around it as its identity band. Until now that box came from two places:

  • an accessibility ancestor with a dialog role, or
  • a drawn-box search on the screenshot.

The Windows MessageBox matched neither.

The change. _dialog_band takes a proved_region. In covered-band mode, _new_click passes the region of the window that owned_window_over proved covers the band. That is the same window the click was already required to land in. The proved region is used before the ancestry and pixel search. The click must still lie inside it.

Outside covered-band mode nothing changes. In covered mode, a cover without a region was already refused earlier, by _cover_explains_cut, so there is no path without a proved window.

Evidence. The live run's result and README finding 10 are on claude/repair-windows-qualify (results/windows-uia-20261103-no-dialog-box.json). Nothing was written and the stop came before any save.

Tests. A new test shows a blank screen refused without a proved region, the proved box used when given, and a click outside the box refused.

@abrichr

abrichr commented Nov 3, 2026

Copy link
Copy Markdown
Member Author

Independent adversarial review: approved in round 2, no blockers.

Round 1 blocked the PR because its own new test failed: the test's OCR lines had no confidence, so identifier_text_from_lines dropped them. That is fixed. Round 1 also pointed out that the proved box could be stale if the dialog moved. The click is now refused when the window's region at click time differs from the one proved at the halt.

Round 2 findings:

  • The tests are meaningful. I ran HEAD's test file against main's source: 2 failed, 104 passed. The dialog-band test fails because main has no proved_region. The pixel search finds no dialog on the blank image, so only the proved region can produce the asserted box. The moved-dialog test fails with "DID NOT RAISE".
  • The real Windows case is not refused. _window_operation reports the candidate window's own DWM frame, which does not depend on the query box. A 1x1 probe and the band probe that return the same hwnd return the same region. The same holds on macOS (the sheet frame in window pixels).
  • No new fail-open. A malformed probe region compares unequal, so the step is refused.

Non-blockers for a follow-up:

  • The "region" in here guard skips the moved-dialog check when a probe reports no region. Only test fakes do that, but requiring the region whenever the cover has one would be stricter.
  • The message OCR uses the screenshot taken before the live probe. That small time-of-check gap predates this PR.
  • The macOS geometry was checked by reading the code only.

Tests: test_repair_covered_band.py 106 passed.

@abrichr
abrichr enabled auto-merge (squash) November 3, 2026 20:19
@abrichr
abrichr merged commit e077b67 into main Nov 3, 2026
45 checks passed
@abrichr
abrichr deleted the claude/covered-band-dialog-box branch November 3, 2026 22:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant