Commit Graph
3 Commits
Author SHA1 Message Date
ciregenz 1f74cc13de [eric] browser: general capture-replay write tier (site's own captured route, same-origin + gated, default off) 2026-07-14 23:47:17 -07:00
ciregenz d445543430 [eric] browser: wire BrowserApiWrite agent tool + robust Reddit write receipt 2026-07-14 23:27:39 -07:00
ciregenz 8bc7e479e8 [eric] browser: unified API-first write registry (site's own write API via borrowed session) + Reddit adapter
The general agent writes via UI puppeteering + the model loop (fire-rate ~50%, 13-52s); the deterministic alternative (cookie-borrow -> the site's OWN write API -> typed receipt) lived only in isolated MCP shims, and only Reddit's was genuinely API-first (X's shim is UI-driving). site_write_registry unifies it: has_api_write(domain,action) + api_write() route a write to a per-domain adapter (Reddit reuses reddit_writes, no fork), time it, and return a typed WriteResult (ok + the site's id/permalink receipt + latency); any failure becomes a typed ok=False so the agent falls back to the UI path, never a crash. A site with no adapter is a clean miss; adding one (X GraphQL, etc.) is one row. LIVE-VALIDATED end to end on Reddit through the registry: comment ok=True + reversible delete ok=True 196ms, verified [deleted] (deterministic, no captcha/DOM/selector, ~50-190x faster than UI). 6 unit tests (routing/receipt/fail-safe), linter clean, no import cycles. NOT yet wired as a browser-agent MCP tool (that path isn't live-testable on the wedged dev bench); receipt-string extraction returned 'ok' on the live run (write succeeded + verified reversible; id/permalink parse is a follow-up).
2026-07-14 19:51:53 -07:00