browserrot: Node stealth sidecar + AI self-heal (M-B1..M-B3, LIVE-VM)

Extends the Phase A-tier-1 site-side rotation engine with an optional Node
browser-sidecar and a deterministic self-heal tier, all proven LIVE-VM against
the local lab change-password form. go-rod stays the default; the sidecar is a
swap-in Driver behind the same Session/Driver/Rotator interfaces — no spine
change, backup + verify-new-before-revoke-old + proof gates all apply unchanged.

M-B1 sidecar parity: internal/browserrot/sidecar/ (index.js JSON-RPC over stdio,
  patchright real-fingerprint Chromium, playwright-core fallback) + sidecar.go
  Driver/Session. A shared test harness runs go-rod and the sidecar through the
  identical live rotation proof.
M-B2 stealth: patchright removes navigator.webdriver; humanized input (Bezier
  mouse paths + per-key typing jitter, no ML trajectory generation per plan §5).
M-B3 self-heal: Healer interface + heal-retry fill/click/text wrappers; on a
  rotted selector, heal.js relocates the field from DOM structure ONLY (never a
  value) and the engine rewrites + persists the recipe (recipes.go RecipeBook)
  so the next run is Tier-1 again. Deterministic heuristic is the proven Tier-2;
  Stagehand LLM strategy is opt-in + UNPROVEN. Leak-check asserts no secret ever
  reaches a heal request (redacted IPC transcript).

Secret seam documented honestly: fill carries base64 secret bytes across exactly
one local stdio boundary, typed and wiped, never logged/persisted/sent to a
model. MFA/CAPTCHA still degrade to the human worklist (Hard Rule 5).

14 tests green, -race clean; lab/lab-provision-browserrot.sh proves both drivers.
M-B4 (first REAL self-owned site) deliberately NOT started — needs per-credential
authorization (safe-candidate ladder).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
leetcrypt
2026-07-20 08:51:28 -07:00
parent 8dbb2f21fd
commit c2f08d1a21
16 changed files with 1642 additions and 22 deletions
+19
View File
@@ -138,6 +138,25 @@ The 8 `LIVE-VM` claims are reproducible from a clean machine — see
rotate **fake** credentials in an **isolated** gopass store. Nothing there can
touch a real store or provider.
## Browser-based rotation (Phase A engine)
The site-side rotation engine ([`internal/browserrot`](internal/browserrot)) drives a
**real** headless Chromium end-to-end — no language model in the loop:
<div align="center">
<img src="docs/assets/demo.gif" alt="browserrot driving a real headless Chromium through a change-password flow" width="720">
</div>
RFC 8615 discovery (`/.well-known/change-password`) → inject the old + a freshly-minted
new password into the form over CDP → submit and read the success marker → **re-login to
prove the new secret authenticates** before the old one is trusted as revoked. Recorded
above against a **fake** credential on a **local throwaway** site — this is the engine's
`LIVE-VM` proof (reproduce with [`lab/lab-provision-browserrot.sh`](lab/lab-provision-browserrot.sh)).
A real-site selector table stays `UNPROVEN` until run against that site, and the engine
is deliberately **not** auto-wired into production `rotate`.
## Safety rules (this tool holds real credentials)
1. **Backup before rotate, always.** No rotation runs without a verified sealed