Sentinel
R-sentinelNormative guarantee
SENTINEL = absence-of-DATA, protocol-decidable; the concrete sentinel value is per-language (TS undefined/Rust None/Py sentinel)
Established by D16 · Scenarios: C-23
Public protocol specification
This view is generated from canonical protocol authority. Historical, draft, retired, superseded, duplicate, dangling, cyclic, or ambiguous revisions cannot enter it. 1 draft rule revision(s) remain omitted pending explicit activation review.
Topic
R-sentinelSENTINEL = absence-of-DATA, protocol-decidable; the concrete sentinel value is per-language (TS undefined/Rust None/Py sentinel)
Established by D16 · Scenarios: C-23
R-waveA wave starts from one host input to a state node (set, invalidate, complete, error), a batch commit, a node's ctx.down called after its function returned, or the snapshot a replace's new instance or a rewire's added dependencies bring, and runs to completion before the next request starts. Each ctx.down call is one array. An empty array is no output: nothing is sent for it and it starts no wave. A node's arrays reach each subscriber after its function returned, in order, all of them to one subscriber before the next. PENDING is sent only by the kernel, as the first message of each array that carries DATA, RESOLVED, INVALIDATE, COMPLETE or ERROR, whatever the receivers' policies; such an array marks the sender's dependents pending. RESOLVED is the kernel's too: node output containing PENDING or RESOLVED is rejected. Each pending mark is settled exactly once within its wave, by DATA, RESOLVED, INVALIDATE or a terminal; a node that was marked pending and sent nothing gets exactly one RESOLVED from the kernel, the only output the kernel adds. A node's function runs at most once per wave, after every dependency that was marked pending has settled, so a fan-in sees one consistent set of inputs. The kernel delivers every DATA unchanged and in order and never merges, drops, substitutes or reorders it. An array keeps its written order: a terminal is last, and an array is split at its last INVALIDATE, so what came before it is dropped and the INVALIDATE goes out as its own array. A quiet node consumes its input waves without being marked pending or sending anything, forwards an INVALIDATE at once under the auto policy, and publishes one invocation's output arrays together as one new wave. If auto COMPLETE ends that invocation, its function's arrays come first and the kernel's separate [COMPLETE] array comes last in that same later wave; no extra terminal is added if the function already ended its output.
Established by D830 · Scenarios: C-1, C-12, C-15, C-16, C-28, C-29, C-3, C-30, C-32, C-36, C-4, C-44, C-53, C-56, C-60
R-subscriptionsubscribe(sink, node) delivers one first array: START followed by the node's snapshot, which is the DATA values of the last array the node sent that carried any DATA, then its terminal if it has ended. A new dependent receives the snapshot as one input array on its first run. Which values a snapshot holds follows how the node's author grouped them into arrays, so values a node sends at once, as a source at its activation, belong in one array. Subscribing activates an inactive node (R-lifetime). When a replace gives a node a new instance, each of its sinks receives START and the new instance's snapshot again, also after a terminal of the old one. When a dependency is replaced by a new instance while its dependent stays active, the dependent's input is a new one: nothing the kernel held of the old instance remains, its terminal included. The dependent's function is told of the replacement in its next run. What the function recorded in its private state stays. START is sent only by the kernel, at subscribe and at a replace: node output containing START is rejected (R-failure). A computed node's retained values are cleared by an effective INVALIDATE and by deactivation; a state node keeps its values until INVALIDATE. A node may be given at construction an optional seed of retained values, a terminal, private state, the dependencies of its first lifetime and an opaque note, which it holds as if it had produced them; its first activation still runs its function, on those dependencies, which go back to the declared ones when that lifetime closes, and only that first run of the seeded instance receives the note. The dependencies a seed names may be made after its node; a request that would activate the node while one of them does not exist is refused and changes nothing.
Established by D827 · Scenarios: C-16, C-34, C-35, C-38, C-39, C-40, C-41, C-42, C-48, C-52, C-53, C-54, C-57, C-58, C-59
R-invalidationINVALIDATE is effective only at a node that retains a value. An effective INVALIDATE removes the node's retained values and its dependents' records of them, keeps its private state, and is forwarded to the node's dependents; at a node that retains no value it is dropped, so a cone, including a diamond, is invalidated once. What reaches a node is ruled by its INVALIDATE policy, auto or manual, default auto: under auto, an input's INVALIDATE invalidates the node without running its function; under manual, it is the function's input, and the node keeps its values and private state until its function clears them or sends INVALIDATE itself. Under auto, when another input brings DATA in the same wave, the INVALIDATE goes out first and what the function then sends after it, whatever order the two came in. Either way, what came before the INVALIDATE on that input is gone, and what came after it is ordinary input. It carries PENDING like a value (R-wave) and settles a pending mark. It comes from the host invalidating a state node, or from a node's own output; nothing sends it upstream.
Established by D824 · Scenarios: C-16, C-3, C-36, C-39, C-41, C-44, C-45, C-56
R-request-orderRequests made while a wave is being delivered (host inputs, subscribe, unsubscribe, replace, a node's rewire and a batch's commit), whether from a function, a sink callback or a cleanup, wait until the wave ends and then run in the order they were made. Requests that node functions make during one wave run in the order their nodes were created, each node's own in the order it made them. Among the wave's other requests they keep the places such requests were made at. batch(body) runs body at once, also during a wave, recording its host inputs and topology requests without delivering anything; when body returns, batch returns what body returned, its host inputs commit as one wave, and its topology requests then run in order. The commit is a request: during a wave it waits like the others, and a quiet node's synchronous invocation output staged in the body through a lifetime that closed before the commit is dropped. A ctx.down made after its function returned is an ordinary request, including inside a batch body: it runs after the commit in body request order, and a failed commit does not cancel it; its lifetime is checked when it runs. Only the quiet node's synchronous invocation output shares the commit's success or failure. A body that throws commits nothing and drops its requests. An async function body is refused before it runs; a body that returns a promise commits its synchronous part, and the host reporter is told that later writes are separate waves. A batch inside a batch body joins the outer one. set(id, value) writes a plain value as it is; given a function, set(id, fn) computes the value from the state's value when the write runs in request order, after every request made before it, and in a batch body from the writes staged before it (an INVALIDATE leaves it no value), at the commit. A function that returns the value it was given (Object.is) writes nothing; one that throws fails the write, and in a batch every write of the commit, while the body's topology and late-output requests still run. A commit validates all host-write targets before evaluating any updater; an ended host target refuses the whole commit without partial writes or updater calls, while output from a closed lifetime is dropped rather than treated as a host input. A function is written as a value only wrapped in another. replace(id, deps, fn, opts) closes the node's current instance and starts a new one under the same id and subscribers, as on a first activation, with the setup and recipe opts gives it, or none; the node's policies stay. ctx.rewire(deps) changes the node's own dependencies for its current lifetime and keeps the instance with its values, private state, function, lifetime and subscribers: kept dependencies keep their records, removed ones are released silently, and added ones are acquired; if any added dependency has a snapshot, the snapshots are given to the function as one input wave, and otherwise the function does not run. A dependency may be given more than once; each place is a connection of its own. At a rewire the k-th place a dependency has in the new list keeps the k-th connection held to it. A rewire is dropped if its lifetime has closed when it is asked for or when it runs, so a node that has ended is not rewired, and when the lifetime closes the dependencies go back to the declared ones (R-lifetime). There is no graph-level rewire; the host changes a node's definition with replace. Topology requests run only between waves. replace is refused for a state node, and replace and ctx.rewire for a dependency that is the node itself or depends on it through current or declared dependencies or through those a seed gives a first lifetime (R-subscription), since a closing lifetime puts the declared ones back. Creating a node is refused in the same way when a dependency it is given, or one its seed gives its first lifetime, depends on it, which only a seed that named it before it existed can bring about.
Established by D826 · Scenarios: C-11, C-28, C-29, C-30, C-31, C-32, C-33, C-34, C-35, C-37, C-38, C-40, C-43, C-44, C-47, C-50, C-51, C-53, C-54, C-55, C-58, C-59, C-6
Topic
R-node-thinA node is the thinnest primitive: its function, its declared dependencies and its wave state (dependency records, pending marks, retained values, terminal, subscribers, private state), with no inspection data. A bare node works at the kernel level but has no naming, find or describe; those are graph-layer.
Established by D797, D798 · No scenario linked yet
R-invocationA node's function has the shape (ctx) => void. For each dependency i, ctx.deps[i] gives the dependency's graph-registered id, the same id find and describe use; the arrays it delivered to this invocation, each as its DATA payloads in order (a RESOLVED array is empty), keeping array boundaries; its terminal in this invocation, if any; the latest value received from it, if any; and whether the dependency was replaced by a new instance since the function's last run (R-subscription). ctx also gives private state for the current lifetime (state.get, state.set), down for output, rewire for the node's own dependencies in this lifetime (R-request-order), the lifetime's abort signal, and on a seeded instance's first run the seed's note (R-subscription); under the manual INVALIDATE policy, ctx.deps[i] also says whether an INVALIDATE arrived on that input in this invocation (R-invalidation). ctx.down is the function's only output. An invocation may bring no new array from a dependency it reads, as in a wave of RESOLVED alone or one in which only another dependency changed, so a function must not take each run for new input. A function registers no cleanup; what must last for the lifetime is opened by the node's setup (R-lifetime). A running function is never reentered: every request it makes, including a write to one of its own upstream nodes, waits until the current wave ends (R-request-order), so such a write reaches the function in a later wave; ending a feedback loop of completed waves is the composition's concern. Dependency views are readable only during setup or function execution of the invocation that supplied that ctx. Reading ctx.deps or any property through a saved dependency view after that invocation returns is refused with "ctx.deps is only available during setup or function invocation"; a later invocation never reopens an old view. A language may prevent such a read statically rather than expose an expired-view API. Values or arrays already read during the call are ordinary captured data. This read scope does not shorten the lifetime of down, rewire, private state or signal.
Established by D819 · Scenarios: C-11, C-23, C-3, C-33, C-36, C-4, C-52, C-6
R-nodeA node has a stable id, a kind (state or node), its declared ordered dependencies and, for a computed node, its function. Three scopes nest: the node, under its id, keeps its subscribers and its policies for good; an instance, from the node's creation or a replace (R-request-order) until the next replace, has the dependencies, the function, the setup (R-lifetime), an optional recipe, the retained values and the terminal; a lifetime, one activation of an instance (R-lifetime), has the ctx, the private state, the signal and the cleanup. A node's current definition, its declared dependencies, its current instance's function, setup and recipe, and its policies, can be read; reading changes nothing. The kernel keeps the dependency list and the recipe as they were given: a change the host makes afterwards to its own list or recipe, or to a definition it read, changes neither the node nor what a capture writes. A recipe is an opaque description of how the instance was built, such as a checkpoint's { ref, config }; the kernel stores it and never reads it. A graph may be created to require a recipe on every computed instance. Creating or replacing a computed node without a recipe is then refused when it is asked for, and a refused replace leaves the current instance and its subscribers as they are (R-request-order). Asked for by a running function, the refusal is that request's failure: unhandled, the function's throw (R-failure). The kernel checks only that a recipe was given, so one no checkpoint could use passes. A node's status is derived from what it holds, not stored: cache is empty (no retained value), stale (a pending mark it received or sent in the current wave is unsettled) or ready; output is open, completed or errored; lifecycle is inactive, active or closing (its cleanup is running). The graph describes its topology as data: every node in creation order with its id, kind, dependencies and whether it is quiet.
Established by D823 · Scenarios: C-33, C-48, C-49, C-50, C-55
Topic
R-graph-surfaceA graph gives, besides its kernel requests, these reads and holds. find(id) gives the node with that id, or nothing; for a state node it gives the state, through which the host writes it; it activates nothing. describe() gives the topology as data (R-node): every node in creation order as { id, kind, deps, quiet }, and nothing else. kind is state or node; deps are the current dependencies, a ctx.rewire's included, while definition(id) gives the declared ones; a value, a status or an annotation is read from the node, not from describe. describe activates nothing and runs nothing. observe(ids, sink) subscribes sink to each node in ids as an ordinary subscriber (R-subscription, R-lifetime), so it activates a cold node and keeps it active, and hands sink each array a node delivers as { id, msgs }, in delivery order: the START array first, with PENDING prefixes and the kernel's RESOLVED included. There is no tier and no sequence number; observing a whole graph is observing every id describe gives. It returns the function that stops it, after which nothing more is handed on. retain(id) holds a node active as a subscriber that ignores what it receives, and returns the release; each retain is its own subscription. These are the graph layer's query, observation and hold methods; construction and kernel operations keep their own entries. Optional rendering, blueprint, profiling, topology groups, mount metadata and annotations belong to package modules exposed as ordinary functions taking a graph, not additional inspection methods on Graph. Consumers needing runtime status or values read describe and find and then the node. Edges are derived from dependencies, never a separately maintained topology truth.
Established by D808 · Scenarios: C-48, C-49
R-namingA local node id or name, topology group name, and mount path must not contain :: or start or end with :. Reject such an input before registration, mount mutation or checkpoint recipe execution. Check :: first and use error text name must not contain '::'; otherwise a leading or trailing colon uses name must not start or end with ':'. An internal single colon is allowed. Only an address assembled by traversing mounts contains ::; each :: enters another graph. Inside one graph, module-generated node and group paths use /, never . or -, between segments. Fixed generated segments and default module names use lower camelCase; the first generated scope, view or binding has no numeric suffix, and later instances append 1, 2 and so on (base, base1, base2). Keep the semantic words of existing names: remove only words repeated in the module prefix, without substituting new concepts. Change a module default only to match its public factory name or remove repetition within the default itself. A generated suffix names its role briefly without repeating words already in its module prefix; retain a qualifier only to distinguish two roles that would otherwise collide. Put caller-named entries beneath a distinct role namespace when they could collide with fixed module roles, as in bridge/edges/issues versus bridge/issues. Caller-supplied labels and keys are preserved except for these reserved-delimiter refusals; this rule does not require recasing them or changing anonymous core allocation, function names, recipe keys or payload identities. Corresponding roles of the same available module use identical generated names and group names across runtimes. Collection snapshot request nodes use /snapshotRequest; the default collection persistence scope is reactiveCollection/persistence. The snapshot outputs of agentic-memory retention, consolidation, context packing and knowledge-graph projection use /snapshot. Existing differences in node structure and unavailable modules remain explicit: shared probes assert each runtime's full inventory and compare corresponding roles, without adding dummy nodes. Old generated names have no aliases or migration map; checkpoint format markers are unchanged.
Established by D809 · Scenarios: C-49
Topic
R-graph-domainA graph is one single-thread concurrency domain: the unit of concurrency, not the bound of causal influence. Inside it, propagation is one synchronous wave at a time (R-wave), so a fan-in, a diamond included, runs once on a consistent set of its inputs. Each graph has its own wave, request queue and batch, and graphs share none of them: a request to one graph is never held by another graph's wave or batch, and a write to another graph inside a batch body is that graph's own request, not part of the batch's commit. Graphs may share a thread, a dispatcher's function table and worker pools. Disjoint waves in one graph do not run in parallel; compute parallelism is by pool callbacks whose results come back as later waves (R-wave), and true parallelism is by several graphs. A graph affects another only as a host of it, through host inputs or a node's late output in that graph; consistency across graphs is the bridge module's (R-bridge).
Established by D803 · Scenarios: C-1, C-47
R-failureA throw from a node's function becomes that node's ERROR, and everything the function sent in that run is dropped, an INVALIDATE under the manual policy included (R-invalidation). The ERROR's payload is the message of the error thrown, or the thrown value itself where a language can throw one that is not an error; a thrown value that cannot be an ERROR payload in that runtime gives the empty string as the payload. An invalid output array (START, PENDING or RESOLVED in node output, a terminal not last, an unknown type, a DATA or ERROR without the payload R-messages requires, a message with more than its type and, for a DATA or ERROR, its payload) throws from ctx.down; uncaught, that throw is the node's ERROR. A host write of such a DATA or ERROR writes nothing and fails: to its caller, or, given by an updater, as a throwing updater's write does (R-request-order). Any other failure goes to its caller or, when there is none, to the host reporter, and never into an unrelated node's messages. The host reporter is a callback; the kernel keeps no failure history.
Established by D824 · Scenarios: C-28, C-33, C-34, C-42, C-50, C-56
Topic
R-no-imperativeNo imperative side-channel triggers (event emitters, callbacks, setTimeout plus set) drive graph behavior. Coordination flows through messages along declared dependencies; a controller acts on its target only by writing a state node that the target declares as a dependency, so every control relation's effect is a drawable edge; which node writes that state is not drawn, and a write a function makes through the graph is not checked for feedback loops (writes declared on edges were considered on 2026-11-10 and left until a consumer needs them). Remove imperative paths when no caller depends on them.
Established by D797, D798 · Scenarios: C-26, C-42
R-primary-api-cleanValue-level sugar (derived, effect and the operators) takes and gives values: a function written with it never sees PENDING, RESOLVED or START, never writes a message, and never reads a dependency's policy. Arrays, terminals given as input, INVALIDATE under the manual policy and the policies belong to the ctx-level node (R-invocation). Which sugar a package offers, and its gate, are the package's (D797). A developer using value-level sugar never needs the protocol to start.
Established by D805 · No scenario linked yet
Topic
Topic
R-terminalsCOMPLETE and ERROR end the output of a node's current instance for good: nothing follows them in that instance, its function never runs again, and its lifetime closes (R-lifetime). Only a replace, a request and not a message, gives the node a new instance (R-node). Each kind has an auto or manual policy per node; both default to auto. Auto ERROR: a dependency's ERROR ends the node with that ERROR without running its function; an INVALIDATE that reached the node in that wave takes effect first, on whichever input and in whatever order the two came, whatever the INVALIDATE policy (R-invalidation). Auto COMPLETE: once every dependency has ended, the node completes after the run that sees the last terminal; a node with no dependencies never completes automatically. The kernel sends that COMPLETE as an array of its own after the arrays of that run, and adds none if the function already ended its output. Manual: the terminal is given to the function as input, and the node ends only when its function sends a terminal. The policies apply equally to terminals found in snapshots at a lifetime's first run. An ended node can still be subscribed, depended on, and added as a dependency by a rewire or a replace; its snapshot carries its last values and its terminal. A host input to an ended node is refused, and its own rewire is dropped, since its lifetime has closed. There is no resubscription: a part that must start again is an inner node that an owner replaces.
Established by D824 · Scenarios: C-15, C-17, C-31, C-34, C-35, C-36, C-38, C-40, C-43, C-44, C-45, C-53, C-56
R-lifetimeA node is active while it has a subscriber or a dependent that holds it; a computed node holds its dependencies while it is active and has not ended. Activating a computed node acquires its dependencies, activating them, then runs its function once on their snapshots; a state node has no function. A computed node may have a setup, which runs once per lifetime, just before its function's first run in it, with that run's ctx: what it sends is part of that run's output, a throw in it ends the node as a throw of the function does, and a function it returns is the lifetime's cleanup. The setup belongs to the instance, like the function: a replace gives the new instance its own, or none. A computed node's lifetime closes when it deactivates, after its last subscriber and holding dependent leave, or when it ends: closing aborts its signal, releases its dependencies, runs its cleanup, which may still read the private state, and then drops the private state, also when the node ends. Deactivation also drops, for a computed node that has not ended, its retained values; an ended node keeps its values, terminal and subscribers. Every ctx and cleanup belongs to exactly one lifetime, and so does a ctx.rewire: closing the lifetime puts back the declared dependencies. Output or a request made through a ctx whose lifetime has closed is dropped. A request a function makes through the graph itself, such as a replace of another node or a write, belongs to no lifetime and is the function's own to scope, for example by its lifetime's signal.
Established by D799 · Scenarios: C-11, C-31, C-33, C-34, C-37, C-38, C-4, C-41, C-43, C-48
Topic
R-pausePause is a node placed in the graph, not a node option. A pausable P is one node that sits after one input, with the manual INVALIDATE policy (R-invalidation), and depends on a lock state: a plain state node whose value is the set of held locks. A controller pauses by adding a lock and resumes by removing it, each a set of the lock state with a function (R-request-order), so the lock state is the only copy of the locks and two controllers acting in one wave do not lose each other's. While any lock is held, P sends no values and holds every array that arrives, in order and keeping its boundaries; when the last lock is released, P sends all held arrays in one wave, each as it arrived. An INVALIDATE reaching P passes at once and discards what P held before it; a terminal passes at once and discards what was held. In a wave that also changes the locks, the locks after the wave decide for the terminal: with none held, P sends what it held and then the terminal. While no lock is held, P forwards every occurrence unchanged. Placed before a node, P keeps values from the node while paused, and the node runs on resume on every array held since the last INVALIDATE; placed after a node, the node keeps computing and only its output is held. Several pausables may share one lock state, so one resume releases them in one wave. The locks live in the lock state, so they survive the pausable's deactivation and terminal. A source that must stop working declares the lock state as a dependency and starts or stops its own work in its function. Each pause or resume that changes the locks is a wave through P (one that changes nothing writes nothing), so downstream receives a PENDING settled by RESOLVED.
Established by D830 · Scenarios: C-30, C-31, C-46, C-60
R-demandDemand is a holder node placed after one input, with a demand state that its controller writes: each pull sets it, with a function, to a demand record with the next request number, taken from the state's value, and optional params. The holder is quiet (R-wave): between pulls it holds the arrays that arrived since the last INVALIDATE and sends nothing, not even PENDING. Each pull runs the holder's service function once, with the held arrays as its input and the pull's params, even when nothing arrived; what it sends goes out as a later wave, and it may send nothing. A service hands over what was held, so the next service sees only what came after. Several pulls in one wave, such as in one batch, are served once with the latest params. A pull made in a batch body is served after the commit, and a throwing body serves nothing. A pull at an inactive holder neither activates it nor is kept: on activation the holder serves only later pulls. An INVALIDATE of the demand state is no pull and discards nothing; a pull made after it is served. An INVALIDATE discards what was held and goes on to subscribers as the holder's output, a later wave like all of it (the holder has the manual INVALIDATE policy); the input's terminal ends the holder and discards what was held; deactivation discards it too. A later subscriber receives the last served value in its START, as for any retained value.
Established by D797, D831 · Scenarios: C-32, C-46
R-historyHistory is a node over one source whose value is the list of the last n waves in which the source sent DATA since the history node was activated, oldest first; n is a positive integer. Each entry is one such wave: the list of the source's arrays in that wave that carried DATA, in order, each as its DATA payloads in order, so the entry keeps how the wave was split into arrays. Equal values are included; an array without DATA is left out of its entry, and a wave without DATA is not an entry. On activation the list starts with one entry holding the source's snapshot as its one array. Each wave in which the source sends DATA makes the node send the new list once, unless the wave carries the source's ERROR, which ends the node with no list for that wave (the auto ERROR policy, R-terminals); a wave without DATA sends nothing. The list is the node's private state, and the node has the auto INVALIDATE policy (R-invalidation): an INVALIDATE from the source removes the node's value and keeps the list, so the next wave with DATA sends the list with its earlier entries; deactivation drops the list, and a checkpoint saves it. Arrays that came before an INVALIDATE in the same wave are not part of that wave's entry, and a wave left with no array is not an entry and sends no list. The source's terminal ends the history node. Ordinary nodes have no history option; their snapshot is their last array (R-subscription).
Established by D797, D812, D831 · Scenarios: C-45
R-checkpointA checkpoint is taken only at a wave boundary, when no wave is running and no batch body is open; otherwise capture is refused. Checkpoint reads what the kernel holds, through reads made for it (idle, private state, definition, retained values, a seed not yet run with and a replacement not yet told), and keeps no record of its own: capture(g) saves an ordinary graph and restore(checkpoint, registry) builds a new one. A checkpoint does not hold the recipe requirement (R-node); a host that wants it asks again at the restore. It saves the topology in creation order and, for each computed node, the recipe its current instance carries (R-node): a registered factory reference and a JSON configuration, never a function body, with the node's policies. A computed node whose instance carries no recipe is local-only, and capture is refused. A recipe's reference is a non-empty string; a recipe without one cannot be saved either: capture is refused with the missing-recipe reason, no reference after it. A factory is given its configuration, the graph being restored and the node's id, and a way to build another registered recipe, for one that takes another by reference; it gives the function and any setup. For each node a checkpoint saves the values of its last array and its terminal; for a computed node with a lifetime, also its private state, what it received from each dependency (the values of the dependency's last array and its terminal), and the dependencies of its current lifetime when a ctx.rewire changed them; a state has no lifetime, nor has an ended computed node (R-terminals), so of either only the values and terminal are saved, and a restore reads nothing else of what its record holds; a computed node that has no lifetime and has not ended is saved as holding nothing, and a restored node not activated since keeps its seed. A dependency that was replaced while the node stayed active, and of which the node's function has not been told (R-invocation), is saved as such; at the restored node's first activation it counts as changed, so the function runs once and is told. Values, terminal payloads, private state and recipe configurations must be JSON. Capture is refused for the first node in creation order that cannot be saved, and names it; where a node cannot be saved for more than one reason, the reason is what is not JSON. Restore builds a new graph with no subscribers, in checkpoint order except that a node's unbuilt declared dependencies are built just before it, in declared order and each in the same way, and runs no recipe function: a state gets its saved values as one array and then its terminal; a computed node gets its saved values, terminal, private state and lifetime dependencies as a construction seed (R-subscription) whose note holds what it had received, and an ended node stays ended with its dependencies. So a restored graph's creation order may differ from its original's. At a restored node's first activation its setup runs, as at every activation, so what it opened outside the graph is opened again; its recipe function runs once if a dependency no longer holds what the node had received, and otherwise does not run. The run gets only the changed dependencies as input: a changed value with its snapshot, an end alone without the values already received, and a dependency that now holds no value as holding none. A run that sends nothing keeps the saved value. Only the seeded instance's first run does this, so a later instance, such as a restart's renewal of an ended inner, runs as usual. Until its first activation a restored node receives no waves, so only the values and terminals then are compared: an INVALIDATE followed by a write of another value is seen as the write, one followed by a write of the value the node had received is not seen, and an INVALIDATE alone is seen as a dependency that holds no value, so the node's own value is not removed as an auto INVALIDATE would remove it; a host that must not lose an INVALIDATE subscribes before writing upstream. Checkpoint neither resumes nor re-issues late output in flight at capture. A node records work it must not lose in its private state, for its setup to open again. Elapsed time is not kept, so a reopened timer runs its full duration. A checkpoint holds no revision or version evidence; revision positions, where a host keeps them, are saved beside it, not in it. Restore reuses the saved ids: the kernel allocates no ids, so there is no allocation state to carry over, and a module that names inner nodes keeps what it needs for that in its private state, which is saved. A checkpoint that lacks what this rule saves, such as one written to an earlier format, is refused at restore rather than completed from its dependencies' saved values, as is one that holds a local-only node or names a recipe the registry lacks; restore names the node, and for a missing recipe its reference, and returns no graph. How a checkpoint is laid out and encoded, beyond being JSON, is each package's.
Established by D819 · Scenarios: C-38, C-39, C-45, C-46, C-47, C-49, C-50, C-51, C-52, C-53, C-54, C-55, C-57
R-bridgeA wire bridge carries edges from one graph, the sender, to another, the receiver, in edge groups. A group has a name and a fixed set of edge ids, declared on both sides; each names one node in the sender and one inbound node in the receiver. The group's outbound node in the sender depends on the group's edges, under manual COMPLETE, ERROR and INVALIDATE policies, and sends each cause as one DATA value, a frame; carrying frames to the receiver is the transport's. A run of the outbound node in which some edge brought input forms one cause, so a cause is one sender wave. It carries, for each edge that brought input, what the edge brought as the outbound node's ctx gives it: an INVALIDATE, then the arrays that carried DATA, in order, then its terminal. PENDING, RESOLVED and START are each kernel's own and do not cross. A session is one lifetime of the outbound node, named by an id its setup makes. Its causes are numbered from 1, and its first cause, from the first run, carries every edge's snapshot, with an INVALIDATE ahead of it for an edge without a value, one whose snapshot is its terminal alone included. DATA values and ERROR payloads cross as bytes, which the application encodes; any other value is a throw of the outbound node. In the receiver, frames arrive as the late output of a node with no dependencies whose setup opens the receiving end, so each frame is one wave, and the group's gate takes the frames that bear its name. Releasing a cause, the inbound node of each edge it carries sends that edge's arrays in that wave and every other inbound node sends nothing, so a fan-in over a group's inbound nodes, including a diamond split across graphs, runs once on the values of one sender wave. An inbound node's snapshot is what its edge last brought: the last released array of the edge that carried DATA, then its terminal, whichever frames carried them. The gate releases a session's causes in order and each at most once. A cause numbered at or below the last one taken is dropped; a cause past the next one is released, and the gap is reported; a frame of a new session starts the count again. A frame that names an undeclared edge, or carries arrays no node could send as its output (a kernel-only message, a terminal not last, or an array after a terminal in the same frame), is refused whole, and its number is taken. An inbound node that has ended takes nothing more: a later frame's arrays for its edge are skipped and the rest of the frame is released. The skip is reported only when those arrays do not end with a terminal, since then the sender's edge goes on while the receiver's has ended, which only a new group repairs; a new session's first cause repeats an ended edge's snapshot and terminal, which is not reported. Drops, gaps, refusals and such divergences are issues: values of the group's issues node in the receiver, never a terminal of an inbound node. The bridge sets no timer, keeps no wave open across graphs and sends nothing up either graph. Not covered: the transport and its ordering and delivery, including the envelope layer's acknowledgements and retries, and a session's frames arriving after a later session's; recovery after a crash beyond a new session's first cause, which cannot reopen an inbound node that has ended or bring it a value lost before its terminal; exactly-once delivery across sessions; flow control; several receivers of one group; authentication; atomicity across two groups; transactions across graphs; remote calls; edge sets that change; checkpoints of bridge nodes.
Established by D804 · Scenarios: C-1, C-1b
R-restartRestart is an owner node that faces downstream for good, with the part that may end and start again as an inner node at a fixed path under it. The inner depends on long-lived nodes outside the owner through ordinary dependencies, so nothing upstream is resubscribed. The owner holds those dependencies too, ahead of the inner, so an inner that ends, which releases its dependencies at once (R-lifetime), does not release them: an upstream stays active across attempts. The owner forwards the inner's values. Its terminals are manual (R-terminals), so the inner's COMPLETE or ERROR is input to the owner's policy, which either starts a new attempt or ends the owner with that terminal for good; while a restart is possible no terminal reaches downstream. A new attempt replaces the inner (replace, R-request-order): same id and subscribers, a fresh instance, so the topology description is unchanged and the inner's sinks receive START at each attempt. The policy has a number of rounds, how many times the inner may complete, and a retry policy that decides whether and after what delay an ERROR is retried, counted afresh in each round. A restart request from outside sets the owner's declared restart state, with a function, to the next request number and starts an attempt that counts toward neither. Each request is served once: at the owner's activation the state's current value counts as served, so a request made earlier, or while the owner was inactive, starts no attempt. An INVALIDATE of the restart state is no request and retracts nothing; a request made after it is served. A delayed retry belongs to the attempt that failed: it is dropped if the owner's lifetime closed, or another attempt started, meanwhile. A new attempt is a new instance of the inner's own definition. When the owner deactivates without having ended, an ended inner is renewed, and a pending retry's timer is cleared. While a retry waits, the owner's private state says so, so a checkpoint saves it. A restored owner whose state says a retry was waiting starts that retry's delay again in full at its first activation, in its setup, for the same attempt and without counting another failure, and when the delay ends the retry is made or dropped as any delayed retry is. A restored owner without that record starts no retry there: a failure of its inner at that activation is counted and retried as any other. No attempt is made when a fresh inner would end at once on its dependencies' snapshots (R-terminals): under its auto policies, when every dependency has ended or one has ended with ERROR; one ended dependency among open ones does not stop a restart. An owner that makes no attempt for that reason ends with its inner's terminal: at once, or, for a retry that waited, when its delay has passed.
Established by D830 · Scenarios: C-43, C-46, C-60