Runtime vision for intelligent agents.
Coding agents read source and run tests. lensd puts them inside the running program, where they can watch it execute, change one condition, and test their explanations against what happens.
The question
An agent today learns about software from source, documentation, terminal output and tests. How much more capable does it become when it can observe and manipulate the system it is building while that system runs?
More runtime data does not help by itself. An agent given everything a process does will drown in it. What helps is knowing what to measure or change next, and what the result supports. We model the agent as an experimenter choosing lenses and interventions over a partially observed process.
Here ℓt selects a lens, ut selects an authorised intervention, and the transition may depend on nondeterminism the agent did not record. The research question follows: under a fixed budget, which next observation or intervention best separates the explanations that remain?
What it changes
We hold runtime vision to four measures. We believe an agent that can see the program run improves considerably on each of them, and every study we run tests one part of that belief.
- Speed
- How long the agent takes. A record from the right place replaces rounds of reading source, adding log lines and rerunning.
- Cost
- What the work consumes. Evidence arrives bounded by a budget, so looking costs a known amount and the search it replaces costs more.
- Correctness
- Whether the new behaviour works. Evidence drawn from many activations shows what holds in practice, which the source does not state and one probe does not reveal.
- Regression
- Whether the old behaviour survives. Knowing which components share state tells the agent what else a change can reach before it makes it.
- How each measure is defined Research
- Runtime vision and runtime evidence Definitions
From observer to experimenter
A debugger shows a person what happened. An agent needs something stricter: a way to turn a guess into a test it can run, read and be wrong about.
- 01
Observe
Place a lens on the part of execution that could tell two explanations apart.
- 02
Hypothesise
State what each explanation predicts before looking at the result.
- 03
Intervene
Change one condition in the running program and leave everything else alone.
- 04
Evaluate
Keep the explanations the comparison supports and discard the rest.
lensd began by reading the run. The next step is writing to it. With write actions an agent can make a dependency fail on demand, call a handler without touching the interface, and reproduce a bug whose database writes and emails are recorded and never sent. An explanation stops being inferred and becomes something the agent tested.
- Write actions Technology
Techniques
Access to the runtime is the capability. The methods built on it are the contribution: fifteen techniques in four families, each with a stated problem, a method and what it establishes.
- Exploration Latent invariants, runtime correlation and counterfactual runs turn execution into structure an agent can reason over.
- Diagnosis Experiment selection and causal bisection reach a root cause in close to the fewest runs.
- Verification Observed verification, unhappy-path stubs and runtime induction replace "the tests pass" with what the program did.
- Entering the runtime Fenced reproduction and direct invocation let an agent act inside a running application with the consequences contained.
Research notes work through three of them with figures you can play.
Where it runs
An agent working with lensd places its own lenses and captures data from the running application, without a person setting anything up. Capture covers the mainstream runtimes: JavaScript and TypeScript on Node.js, Deno, Bun and Electron, along with Python, Go, Java and the JVM, native binaries and browser pages. It is currently distributed as part of Hyperset. The technology page gives the specifications.