fix(cua-driver): make macOS browser prepare language independent - #3140
Open
loonghao wants to merge 4 commits into
Open
fix(cua-driver): make macOS browser prepare language independent#3140loonghao wants to merge 4 commits into
loonghao wants to merge 4 commits into
Conversation
3 tasks
loonghao
marked this pull request as ready for review
August 13, 2026 12:57
loonghao
marked this pull request as draft
August 13, 2026 15:45
loonghao
marked this pull request as ready for review
August 14, 2026 00:52
This was referenced Sep 10, 2026
injaneity
added a commit
that referenced
this pull request
Sep 10, 2026
* chore(cua-driver): begin exact consent-label lifecycle regression Refs #3705. Reuse the existing public browser_prepare lifecycle test for native red before changing semantic matching. Related localization contributions #3409 and #3140 remain separate. * fix(cua-driver): deduplicate repeated native consent labels Normalize identical AX text fields once so an English Allow/Cancel title repeated in the description remains an exact semantic match. Distinct text still combines, and sheet ownership, action capability, uniqueness, and ambiguity checks remain unchanged. Refs #3705.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Refs #3139
Why
Localized browser chrome cannot be covered safely by a finite language list. The macOS adapter now treats AX text as opaque Unicode display data and selects controls from role, supported action, ancestry, focus, geometry, native/renderer ownership, uniqueness, and exact postconditions.
A same-PID sibling window is not part of the authorization grant. Earlier revisions enumerated all visible titled windows owned by the browser process while looking for the consent sheet. That could let a structurally valid sheet in another Chrome window satisfy the matcher. This revision removes that expansion and requires fresh AXWindow ownership both while choosing the action and immediately before AXPress.
Setup contract
Address and search barConsent contract
browser_binding_staleif it movedLanguage-independent and wrong-window coverage
Tests cover composed/decomposed Latin text, Devanagari, Thai, Hebrew, Arabic, Persian, Japanese, Korean, Chinese, Armenian, Georgian, Ethiopic, bidi isolates, emoji/ZWJ, empty setup labels, missing consent text, mirrored RTL geometry, duplicate controls, exact URL/topology checks, same-PID sibling surfaces, and a structurally valid consent sheet owned by the wrong window. No language detection, translation, normalization, or locale allowlist is used.
Validation
HEAD candidate:
bc04d830642cb935fcbf154ba44d6407835732b0cargo fmt --all -- --checkactionlint .github/workflows/ci-cua-driver-contract-clients.ymlgit diff --checkplatform-macosconsent matcher testsProve macOS browser consent stays exact-window and language-independent: https://github.com/loonghao/cua/actions/runs/31717340440Text file busy (os error 26); the failed-job rerun passed, so the exact-SHA workflow is now fully greenRemaining draft evidence
Safety invariants