fix(captcha): make English matcher additive - #2721
Conversation
|
@alectimison-maker is attempting to deploy a commit to the esokullu's projects Team on Vercel. A member of the Team first needs to authorize it. |
0b6fe79 to
a529cc5
Compare
There was a problem hiding this comment.
Pull request overview
Consolidates CAPTCHA label matching and makes English text additive to language-neutral widget/frame evidence.
Changes:
- Centralizes and injects the English CAPTCHA matcher.
- Removes generic verification-failure matching.
- Extends token-based clearance and adds parity/regression coverage.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| test/run.js | Adds matcher, gate-state, token, and parity tests. |
| src/chrome/src/agent/captcha-gate.js | Defines the canonical matcher. |
| src/firefox/src/agent/captcha-gate.js | Mirrors canonical matcher handling. |
| src/chrome/src/agent/captcha-frame-runtime.js | Accepts injected matcher options. |
| src/firefox/src/agent/captcha-frame-runtime.js | Mirrors runtime matcher injection. |
| src/chrome/src/agent/captcha-solver.js | Supplies matcher options during detection. |
| src/firefox/src/agent/captcha-solver.js | Supplies matcher options to serialized detection. |
| src/chrome/src/agent/agent.js | Updates CAPTCHA gate transitions. |
| src/firefox/src/agent/agent.js | Mirrors gate-transition updates. |
Suppressed comments (2)
src/chrome/src/agent/agent.js:4418
- A candidate identity does not necessarily back this gate: the state stores the selected candidate even when
candidateNotCorrelatedis true. Treating that unrelated identity as direct evidence means a complete read can no longer clear an English-only passkey/application dialog after it disappears, leaving the manual gate stuck until navigation. Exclude explicitly uncorrelated candidates from additive evidence.
src/firefox/src/agent/agent.js:3853 - A candidate identity does not necessarily back this gate: the state stores the selected candidate even when
candidateNotCorrelatedis true. Treating that unrelated identity as direct evidence means a complete read can no longer clear an English-only passkey/application dialog after it disappears, leaving the manual gate stuck until navigation. Exclude explicitly uncorrelated candidates from additive evidence.
const directCaptchaEvidence = !!activeGate?.captchaCandidateIdentity
|| activeGate?.publicGate?.languageNeutralFrameTrigger === true;
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Addressed the Copilot review in |
Summary
allowGenericFailurepath that promoted unrelated application failures such as email verification errors to CAPTCHA evidenceWhy
#505 identified multiple independent copies of the English matcher across the accessibility-tree, preflight, and frame-detection paths. Those copies could drift, and the active-gate-only generic-failure mode let unrelated renamed dialogs affect CAPTCHA routing.
This PR keeps the English matcher as a useful positive fallback for unrecognized or in-house challenges. It does not add a multilingual phrase table and does not include full-page Cloudflare managed-challenge detection.
This is the planned follow-up to #2720. The branch now includes current
mainat18c2d652; the conflict resolution preserves #2720 token/frame authority, uses a full read-only preflight for manual completion, and does not restore legacy read-inference flags.Verification
node test/run.js— 1579 passed, 0 failednpm run test:toolbar-guard— 33/33 passednpm run test:security— 60/60 passedPart of #505.