The promise of reactivity in Observable Notebooks is that you don't need to worry about executing the cells, they recompute themselves intelligently when code changes, minimizing state churn and letting the user focus on the code. In this brief report we describe the invariants this implies: Determinism, Incremental Computation, and the situations in which the Observable Runtime breaks them.
While Observable fails complete soundness, we find that islands of soundness can be formed, and breaking some rules enables common patterns for application development. We conclude that repairing the Observable Runtime is probably not possible with a JavaScript based language, but that is a pragmatic choice for ecosystem compatibility. There is a door of opportunity open for a sound core interfacing with an unsound imperative shell, still within the Observable Runtime programming model.
Tom Larkworthy · Winter Substrates 2026, London · 2026-11-09
Observable Notebooks are a web coding platform with an innovative MIT licensed reactive runtime applied to coding. Several projects have built upon its runtime [Larkworthy 2025] [Observable 2025] [Observable 2024] [Posit 2022]. The reactive runtime consists of reactive variables on a DAG that recompute when an ancestor changes, allowing fluid partial recomputation that minimizes state churn when compared to restarting a program.
The programming model is related to spreadsheet programming, functional reactive programming [Elliott & Hudak 1997] and live programming [Tanimoto 2013]. One specific claim is that you don't need to worry about rerunning cells manually like in a Jupyter notebook, nor be concerned about the order you run them in. The cells recompute in topological order and therefore remove that cognitive overhead from the programmer.
In this report we look at whether the claim holds up in general, and show several areas where it breaks down.
Two invariants for reactive programming:
What they would buy:
The Observable runtime gives neither (D) nor (I) for the programs we write.
A simple model of dataflow is a graph G between cells V connected by dependency edges E.
G=(V,E), with an edge u→v when u is an input of v.
Invariant 0: the computation graph is a DAG. This is enforced by the runtime, which rejects cycles with a RuntimeError("circular definition") (runtime.js:147-152 in @observablehq/runtime@6.0.0).
Cells are named functions of their declared inputs, holding a current value: C=(name,definition,value).
A cell is hermetic when its value is a pure function of its declared inputs. Ancestors, anc(v) are the transitive inputs of the cell v, the support is supp(v)=anc(v)∪{v}, and desc(c) are the downstream cells (descendants).
A cell can change a value that is not downstream of it by writing into a shared reference. For example, a parent initialises list = [], a test checks isEmpty(list), and another cell does list.push("p").
Observable propagates only downstream. When the writer is edited, readers elsewhere keep values a fresh run would not produce, so property (I) is lost.
Rerunning the reader is not enough either: the old write remains in the shared object.
In graph terms the write is an edge that is not in G. We call those hidden edges H. A mutation of an input points back up the graph, so G is a DAG and G∪H is not.
Problem 1 assumed the pusher runs first. A parent initialises list = []. A test checks isEmpty(list). Another cell does list.push("p"). Should the test pass?
The test and the list mutation are siblings, and the ordering of execution is not determined by the topological sort. Therefore the test may or may not pass depending on the order of execution. This kind of problem can be fixed by artificially forcing an execution order.
A1: a stable order can be induced (e.g. order by label). Under A1 a synchronous program has one result, so (D) holds. This is an issue in the current Runtime but trivially fixable. Assume A1 from here on.
The real Observable Runtime has this problem because siblings are queued in the order of their parent's Set of outputs, and the queue is a stack (queue.pop(), runtime.js:141). A redefined cell is added to the end of the Set and so runs first, but on page reload cells are added in the order they are displayed on the page, so siblings run in reverse page order.
The Observable Runtime is interoperable with DOM APIs, which is a key building block for custom UIs. But the DOM itself is also a side channel for hidden edges.
If we cannot stop cells writing into shared objects, can we at least work out what to rerun after an edit? Bayes-Ball [Shachter 1998] answers a similar question for belief networks: a ball moves through the graph, and a rule at each node says whether it passes, bounces or stops. We start the ball at the cell that just changed.
By default the ball always moves down declared edges (the Observable Runtime's existing invalidation algorithm). Our new algorithm moves up only through a shared mutable reference: a cell that mutates its input sends the ball up to the cell that created the object, and from there downward to every descendant cell.
To restore sound incremental computation (I), we rerun from the topmost shared cells the ball bounced through: the creators of the shared objects. Rerunning a creator reruns all of its children, and one of them may dirty a different shared object (08), so the lift repeats until nothing changes. In 08 one round fixed the first fixture but not the second; iterating until nothing changed matched a fresh run on both.
The algorithm was inspired by Bayes-Ball's (local rules, linear traversal, reachability as the computation) but the rules are different, so we call it the mutation ball.
The ball needs every cell labelled mutated and shared or not. Unfortunately, computing whether something is mutated requires following potentially aliased references, which cannot be decided statically in JavaScript. So the mutation ball algorithm remains a thought experiment that cannot be realized on the Observable Runtime in general.
Recording writes at run time, with a Proxy on each input, would give real labels for the run observed but it does not generalize to Map, Set, #private or DOM fields.
Hardened JavaScript (SES) [Agoric 2024] can prevent access to names outside a cell's scope (e.g. window) but does not help with mutation of references passed to the cell as dependencies.
So we see no practical general repair of (I) for Observable Runtime programs as they are written.
Hermetic cells can be built by construction instead of detected through analysis.
Copying on every input (structuredClone) prevents back-edges, at the price of a copy per edge per recompute (and not all things can be copied). It is an intriguing choice as it is the algorithm used for message passing to concurrent WebWorker runtimes [WHATWG], which also lack DOM access and other sources of hidden edges. Using structuredClone between cells could both help prove hermeticity and unblock multi-core processing on the Observable Runtime.
Alternatively a different authoring language could be used with statically verifiable properties.
There is an idiom in functional programming: functional core, imperative shell [Bernhardt 2012] keeps effects in a thin outer layer in order to build effectful systems like databases whilst retaining pure functional inner code. In a dataflow graph we could perhaps opt into an immutable core and have the unsound DOM and networking machinery located in a disconnected region.
We want two things from a reactive runtime: deterministic dataflow (D) and sound incremental computation (I). The Observable runtime gives neither. Cells write into shared objects, which reaches cells that are not downstream, and the runtime only propagates downstream (Problem 1). Siblings run in an order the graph does not fix, so the same program can give different answers (Problem 2) although a stable stored order (A1) can fix this.
A hypothetical mutation ball algorithm describes what a sound repair must rerun. Its rules are simple, but it needs to know which values are shared and mutated, which doesn't seem calculable when the runtime language is JavaScript. We see no practical general repair.
The unsoundness is not an accident. The hidden edges in our corpus are counters, stores, logs and DOM nodes: the imperative shell of real applications. What might be possible is an opt-in boundary, a functional core where hermeticity is known by construction. JavaScript's structuredClone seems promising, as that function can be used to pass values to an isolate like a WebWorker with hermeticity built into the environment.