Files
ruv 8d10e1aa8c feat(browser): #2041 ADR-122 Phase 1 MCP + Phase 2 causal recovery
Phase 1 MCP tool surface (5 new tools):
- browser/sign-trajectory — seal a BrowserTrajectory into Ed25519 envelope
- browser/verify-trajectory — verify with optional trust-list filtering
- browser/plan-replay — dry-run replay with mutations (no browser exec)
- browser/build-replay-delta — detect action/outcome drift between runs
- browser/generate-witness-key — bootstrap a fresh Ed25519 keypair

Phase 2 (beyond-SOTA wedge: causal-graph self-healing selectors):
- domain/causal-recovery.ts — SelectorBreakEvent + CausalRiskAnnotation types
- infrastructure/causal-recovery-store.ts — in-memory + JSON-on-disk store
  + classifyBreak() taxonomy: not-found/not-visible/not-enabled/detached/
    ref-stale/timeout/navigation-during-action/unknown
  + parseUrl() for origin/path isolation in the graph
- application/causal-recovery-service.ts — reportBreak / annotateSnapshot
  / decorateTree / explain (prior breaks + alternative locator suggestions)
- 18 new tests: classification, URL parsing, risk scoring (0→N breaks),
  snapshot annotation, cross-origin isolation, explain with role+name
  fuzzy-match, listBreaks

165/165 tests passing (was 147; +18 for Phase 2). Build + typecheck clean.

Beyond SOTA: no other web agent (Surfer-H, Browser Use, Stagehand, Operator,
Skyvern) surfaces WHY a selector broke — they retry silently. AgentDB-backed
swap is a single-file change (IBreakStore interface).

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-05-18 19:28:31 -04:00
..