Inspiration Modern web apps crash on unexpected null checks or bad inputs, causing lost carts, churn, and 3 AM on-call alerts. We asked: Why do biological systems heal wounds in real time, while web apps shatter at the first error? With the new W3C WebMCP standard, we realized we could embed an AI immune system directly inside browser memory to detect, diagnose, and repair broken code instantly. ⚙️ What It Does AutoFix.run is a self-healing frontend engine that fixes crashes in under 2 seconds with zero page reload: WebMCP Flight Recorder: Buffers user clicks, DOM mutations, and component stacks. Gemini Root-Cause Diagnosis: Dispatches crash dumps via WebMCP to synthesize surgical AST patches. AST Safety Auditor: Blocks prototype pollution, arbitrary network calls, and unsafe evaluations before execution. Zero-Downtime Hotpatching: Injects the verified fix straight into browser memory, preserving active user state and unfreezing the UI. Git PR Automation: Generates clean Git diffs and ready-to-merge GitHub pull requests. 🧗 Challenges We Faced Hotpatching Without State Loss: Swapping code in a running React bundle without refreshing the page or losing user inputs required careful in-memory prototype interception. Preventing Hallucinations: Constraining Gemini via strict JSON schemas and AST invariant assertions so it only produces surgical, runnable code fixes. High-Demand API Reliability: Built an adaptive circuit breaker that seamlessly cascades across Gemini flash models if an endpoint hits temporary 503 limits. 🏆 Accomplishments Achieved sub-1.8s Mean Time to Repair (MTTR) from crash to live heal. Demonstrated zero state loss across an authentic 2.7k★ React Calculator and an enterprise e-commerce checkout funnel. Native browser-level WebMCP implementation (window.navigator.modelContext) instead of an external chat wrapper. 📚 What We Learned WebMCP transforms the browser from a passive display into an active, intelligent host. Neuro-symbolic design wins: Combining LLM reasoning with deterministic AST security checks is essential for running generated code safely in production. Production web software no longer needs to be fragile—it can have its own immune system.
Log in or sign up for Devpost to join the conversation.