Skip to content

RFC 0001 — The app is the runtime ​

  • Status: Accepted for v0.1
  • Date: 2026-12-01
  • Supersedes: nothing

Context ​

Coding agents can now produce large amounts of software, but they verify it the way a sighted person verifies a room through a keyhole: screenshot, click, screenshot. Browser automation gives an agent perception and actuation. It does not give it the product.

The agent that wrote RevenueChart still cannot answer: what is this component for, what state is it in, which request feeds it, why did it stay in a loading state, and which file should change. It can only guess from pixels and an accessibility tree.

Veya is an Agent Development Environment: an environment where agents can understand, experience, evaluate and improve the software they build. This RFC fixes the shape of the first version of that environment.

Problem ​

Three gaps, in the order they block a working loop:

  1. Intent. What was this screen supposed to do? A screenshot carries no intent.
  2. Diagnosis. Which component, which request, which state transition, which source line produced the observed failure?
  3. Verification. After a fix, did the product actually change behaviour?

Layer-1 tools (agent-browser, agent-desktop, DevTools MCP) close none of these, because they observe an application from outside it.

Decision ​

The desktop app is the runtime. Not a console that drives someone else's browser: the app's own Chromium is where the product under development runs, and the app owns the evidence, the agent interface and the evaluation surface.

Concretely, apps/desktop hosts four things in one process:

  • A product window — a BrowserWindow that loads the URL under development.
  • A white-box channel — @veya/runtime injected by @veya/vite-plugin, reporting components, state, interactions, network, errors and diagnostics over a WebSocket.
  • A black-box channel — Chrome DevTools Protocol over webContents.debugger, for screenshots, DOM geometry, accessibility names, viewport emulation, console and network, on any page, instrumented or not.
  • An MCP endpoint — POST http://127.0.0.1:7317/mcp, using Streamable HTTP, started with the app so an agent finds the interface already there.

The app also hosts the hub that joins both channels into one session, writes the evidence store, and evaluates the deterministic signals.

veya (the CLI) is a client of a running app. Nothing in the product path works without the app, and every entry point says so plainly instead of hanging.

Why this shape ​

  • One source of truth for the session. Human and agent look at the same page and the same evidence. No two-browser skew, no "works in my Playwright profile".
  • The browser is already there. Electron ships Chromium. A managed external browser would add a download, a version axis and a profile story for a product that only needs to render localhost during development.
  • CDP is the real interface. webContents.debugger speaks the protocol directly: screenshots, node geometry, accessibility tree, emulation, input dispatch. No wrapper library needs to stay compatible with an Electron release.
  • MCP belongs to the process that owns state. An agent that connects over HTTP sees every session the app has, including the one a human is driving right now.

Rejected alternatives ​

AlternativeWhy not
Managed Chromium via PlaywrightRequires a browser download the environment blocks; adds a second process and a second session store for no product gain.
System Chrome via channel: 'chrome'Couples the product to a user-installed browser and its version; the app stops being the environment.
Chromium forkLong-term maintenance cost before the loop is even proven.
Pure CDP without a runtime SDKBlack-box only: no component identity, no business state, no source mapping, no semantic actions. Those are the product.
Runtime SDK without CDPWhite-box only: no screenshot, no geometry, no accessibility names, nothing for uninstrumented pages.

Consequences ​

  • The app must be running for CLI, MCP and the evaluation loop. This is a feature: a single, inspectable environment.
  • Instrumentation is development-only. Production builds never carry @veya/*.
  • Only Vite + React apps get the white-box channel in v0.1; any other page degrades to black-box and is marked channel.runtime = false in its snapshot.
  • Opening DevTools on the product window steals the CDP session. The app reports cdp.detached, degrades to whatever the runtime still provides, and reattaches with backoff.
  • No Fast Refresh: Vite+ inlines Vite, so @vitejs/plugin-react has no vite package to resolve against, and @veya/vite-plugin must stay self-contained. The cost is a full reload on save, which is acceptable for v0.1.

Out of scope for v0.1 ​

Scene DSL, fault injection, exploration, LLM visual or UX judges, desktop and mobile runtimes, packaged .app distribution. See docs/roadmap.md.

Released under the Apache-2.0 License.