feat(captcha): add automatic solver cascade (MAT-141)

Merged
MP
4mo ago
+3550-184

Summary

Adds the MAT-141 automatic CAPTCHA solver cascade: local OCR, AntiCaptcha, and an assisted browser window, with configurable ordering and a manual fallback.

Changes

  • add a configurable OCR → AntiCaptcha → browser cascade and persist every solver attempt and outcome in captcha_log
  • add a typed, bounded Tesseract broker with trusted system paths, fixed arguments, timeout/process-group cleanup, and no generic subprocess access
  • keep the AntiCaptcha API key exclusively in the OS keyring and redact secrets/solutions from persisted state and debug output
  • add the dedicated Tauri CAPTCHA browser window, solver controls/status in the CAPTCHA settings, and EN/FR copy
  • publish and register vortex-mod-captcha-ocr, vortex-mod-captcha-anticaptcha, and vortex-mod-captcha-browser v1.0.0 using release SHA256SUMS
  • add plugin CI ABI smoke coverage for the three solver contracts

Security notes

  • Tesseract execution is restricted to trusted absolute paths and an exact official-plugin provenance grant.
  • Plugin input/output, image data, subprocess output, API keys, and persisted solver metadata are bounded or redacted.
  • AntiCaptcha credentials are never written to TOML or SQLite.

Verification

  • cargo fmt --check
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo test --workspace — 1,783 unit tests and 4 integration tests passed; 5 environment/format-dependent tests ignored
  • npm run lint
  • npm run typecheck
  • npm test — 741 tests passed
  • npm run build
  • full pre-commit and pre-push gates, including cargo-deny and knip
  • all three plugin main/tag workflows green; downloaded release bundles pass sha256sum --check SHA256SUMS

Plugin releases

Related Issues

Linear: MAT-141

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • CI/CD or tooling changes

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • cargo fmt and oxlint pass
  • cargo clippy -- -D warnings is clean
  • Tests pass (cargo test + npm test)
  • I have added tests that prove my fix/feature works
  • I have updated CHANGELOG.md under [Unreleased]

Screenshots (if applicable)

Not included: the feature is covered by component tests and the generated Tauri capability schema.


Summary by cubic

Adds the MAT-141 automatic CAPTCHA solver cascade (OCR → AntiCaptcha → assisted browser) with a manual fallback, capability‑scoped windows, and per‑solver attempt history to reduce interruptions while keeping subprocess access locked down.

  • New Features

    • Configurable OCR → vortex-mod-captcha-anticaptcha → vortex-mod-captcha-browser cascade via captcha_solver_order; per‑solver attempts (outcome, timing) persisted to captcha_log and shown in the CAPTCHA view.
    • Typed Tesseract host broker for vortex-mod-captcha-ocr: trusted absolute paths, fixed args, strict caps/limits; capability only for the verified OCR plugin.
    • Dedicated assisted browser window with the minimal captcha-browser capability and per‑window command ACL; Tauri permissions split into main-window-commands and captcha-browser-commands.
    • AntiCaptcha API key stored only in the OS keyring with set/delete/status commands in Settings.
    • CI/registry: ABI checks for required exports (including get_balance for vortex-mod-captcha-anticaptcha), plugins registered with release SHA256SUMS, and a Windows Tesseract regression that must run exactly once.
  • Bug Fixes

    • Fixed Windows Tesseract broker fixture to exit successfully after emitting its simulated OCR solution; CI now enforces it runs once.
    • Assisted CAPTCHA windows close directly from terminal command flows.
    • Further tightened solver boundaries with capped IPC/WASM payloads and cleared inherited Tesseract paths.

Summary by CodeRabbit

  • New Features
    • Added an automatic CAPTCHA solver cascade with configurable OCR → AntiCaptcha → browser ordering.
    • Added per-solver attempt tracking and display in CAPTCHA details.
    • Added AntiCaptcha API key status, save/delete, and persisted configuration.
    • Added a dedicated human-assisted CAPTCHA browser window flow and solver ordering UI.
    • Added new official CAPTCHA solver plugins to the registry.
  • Bug Fixes
    • Hardened CAPTCHA solving with bounded IO/payloads and safer solver cascade cancellation while preserving full solver audit.
    • Improved CAPTCHA browser window closing and tightened plugin capability/export validation.
  • Documentation
    • Updated unreleased changelog and updated CAPTCHA UI translations for cascade, outcomes, solver attempts, and AntiCaptcha key management.