Skip to content
Design21 min readUpdated 27 Oct 2026

12. RGP: the Reaktor Graph Protocol

The graph has many holders.

  • A graph authority commits the definitions of one consistency domain (Section 9).

  • Hosts on phones, edge isolates and servers admit releases and run activations under epochs (Section 9.5).

  • Tools, agents and people query the graph and propose patches (Section 19), and verifiers attest claims (Section 15).

  • Other authorities hold graphs of their own, for other partitions, environments, organisations or jurisdictions.

RGP, the Reaktor Graph Protocol, is how these parties exchange graph facts and changes. Its wire name is rgp/1, and it is part of RGL Core (Section 10.8).

Reaktor’s specification of the protocol for the current runtime [290] fixed its shape, assembled from protocols that had solved parts of the problem (Table 15):

  • one connection to many runtimes, with a session for each;

  • typed commands and events, in domains that are enabled one at a time;

  • list-then-watch cursors, in which a gap is an error;

  • filters evaluated where events are produced;

  • credit-based streams that never block the runtime they observe;

  • a write path that prepares a change before it executes it.

That specification has not been implemented, and it describes the current runtime’s graph. Its nodes, ports and binary edges are named by handles minted per session, its events are named after lifecycle callbacks, and its patches state whether they write a document, source code or a running system. This section re-founds the protocol on RG. Six changes follow from the model.

  1. Names. Elements are named by stable identifiers and revisions by digests, never by handles (Section 12.1).

  2. Reads are traversals. A query ships a traversal to the data. A subscription is a traversal maintained incrementally, whose messages are Z-set deltas, and an expired cursor is reconciled by digests rather than by reading everything again (Section 12.3 and Section 12.4).

  3. Each change goes to its own authority. Proposals and commits go to the graph authority, and releases go to hosts. Rows and external effects never cross RGP; only their receipts do (Section 12.5 and Section 12.6).

  4. Changes are sessions. Every exchange that changes something is a Session with an effect identity bound to the request digest, a deadline, and an Outcome that includes UNKNOWN. Rule W5 applies to the protocol itself.

  5. Every message is governed. Grants, the effect lattice and labels decide what each principal may send and receive, including the graph’s own metadata (A5, W11).

  6. Authorities federate through views, not routes. Authorities exchange signed views filtered by labels. Nothing is merged, and no call is routed between them (Section 12.8).

RGP is itself an RG scope (Figure 20). Its endpoints are components on places, its conversations are Sessions, its streams are Channels and its authority is Grants. The rules of Section 6.5 and the templates of Table 34 therefore apply to the protocol that maintains the graph.

Figure 20

Figure 20. RGP in its own notation. Its endpoints are components on places, its conversations are Sessions and its streams are Channels, each with its quality of service, and authority is a Grant. The release is one multiparty Session with every host that runs the region. Orange marks what the protocol must never get wrong: a view exported to an authority in another jurisdiction, which only replicates it, and the claim that a watch never leaves a silent gap, attested by the TLC model of Listing 28.

12.1 Parties, names and frames#

Parties#

Five kinds of party speak RGP:

  • a graph authority, which commits the definition layer of one consistency domain and keeps its revisions, change log, refs and proposals (Section 11);

  • a host, the runtime of a Place, which admits releases, runs activations and reports what runs;

  • a store, which commits data and appears in RGP only through its receipts;

  • a client: a workbench, a language server, CI, a verifier or an agent;

  • a peer authority, which holds another consistency domain.

Every party acts as a Principal, is authenticated when a connection opens, and holds grants per domain.

Names#

The kernel never lets a handle leave its process (Section 11). RGP therefore names elements, revisions, contracts, artefacts and activations as Definition 4 does: an element by its stable identifier, a revision by its digest h(G), a contract by its fingerprint 𝑓𝑝(c), an artefact by its digest, and an activation by its definition, place, key and epoch. Five identities stay apart: the definition, the contract fingerprint, the artefact digest, the configuration and the activation. Two builds with identical contracts and different bodies are therefore compatible and distinct. A build whose identity is unknown stays unknown, and its contract fingerprint never stands in for it. Lazy expansion keeps what handles were for. A read returns summaries (identifier, kind, name, digest and counts), and detail is fetched by identifier only for what a client shows. Identifiers survive a connection, so a client that reconnects refreshes what it holds instead of replacing it.

Frames#

A frame is a FlexBuffers map with sorted keys (Listing 16 and Listing 12). It names its message type by the fingerprint of that type’s contract, and it names the conversation it belongs to. A frame that changes anything also carries an effect identity. The payload is decoded by position when both ends hold the same fingerprint, and by key when the sender’s contract is compatible with the receiver’s (Section 6). Otherwise the frame is refused; it is never decoded by position against a fingerprint it does not match. Bulk payloads (slices, deltas and batches of observations) are column chunks in the kernel’s layout, so a receiver maps them without parsing. Patches, releases, claims and exported views are signed over their canonical bytes [32]; other frames rely on the integrity of the carrier. An unknown optional field passes through, and an unknown required field refuses the frame, as rule T4 says of facets.

12.2 Domains#

Table 14 lists the domains. Each conversation is a connection of Σstd, with a family, a quality of service and an effect class from the lattice of Section 6.4, and each domain is granted separately. Reading never implies watching, watching never implies reading payloads, and nothing implies changing. The six domains of the earlier specification survive in the table:

  • its mesh domain is Connect;

  • its graph and revision domains are Query and Watch;

  • its wire domain and its domain for values become runtime facts and labelled samples in Observe;

  • its edit domain is Change.

Release, Assure and Federate are new.

Table 14. The domains of RGP. Each conversation is a connection of Σstd, with an effect class from the lattice of Section 6.4, and each domain is granted separately.
Domain Messages As a connection of Σstd Effect class Rules
Connect hello, attach, detach Session, duplex read authentication; grants per domain; limits stated at hello
Query describe, resolve, traverse Session call read labels filter before encoding; coverage on every answer
Watch subscribe, delta, reset, reconcile Session stream with credits; deltas in order, replayed from a cursor live read never blocks the producer; every gap visible
Change propose, check, approve, commit, lookup Session call; effect identity keyed with the request digest; outcome includes UNKNOWN non-production write no self-approval (A5); read set checked at commit
Release offer, admit, activate, retire, lookup multiparty durable Session with the hosts the join of the release’s effects each host decides admission; stores enforce fences
Observe runtime facts, receipts, profiles, samples fan-out Channel, at least once, ordered per key, bounded retention live read a sample needs a grant for its label (W11)
Assure status, attest Session call non-production write verifiers are principals (A5)
Federate export, delta, reconcile, revoke Channel of signed view deltas; a Session to reconcile read a grant per peer and view; labels checked by the exporter
Table 15. What RGP takes from earlier protocols, and what it changes.
Protocol What RGP takes What RGP changes
Chrome DevTools Protocol [332] domains enabled one at a time; one connection, with a session per target targets are authorities and hosts; message types are named by contract fingerprints
Language Server Protocol [245] capabilities negotiated at the start; partial results for long answers the server knows a system, not one language
Debug Adapter Protocol [244] lazy expansion: a reference is a promise of detail references are stable identifiers, not handles that die with the session
Kubernetes watch [339] list, then watch from a version; an expired version is an error; bookmarks keep idle cursors alive snapshots and watches are integrals and differences of Z-sets; an expired cursor is reconciled by digests
Reactive Streams [286] demand signalled by credits a producer out of credit merges deltas by addition
Git, Dynamo [90, 334] negotiation and anti-entropy over Merkle digests the digests are those of the containment forest
OpenTelemetry [275] resource identity: service, version and instance observations are joined to elements, not to names
The Update Framework [305] signed metadata with roles, thresholds, expiry and rotation patches, claims and exported views are signed, as releases are
DStar, Fabric [226, 364] labels checked where data leaves a machine; nodes that trust one another differently the graph’s own metadata is labelled, and views are filtered before export
Model Context Protocol [18] tools for agents each tool is one RGP operation under the agent’s grants

12.3 Reading: traversals at the data#

A read is a traversal evaluated where the graph lives.

  • describe returns a restriction view (Proposition 2) at a stated revision. The view holds the elements of a scope to a given depth and layer, and their ancestors, so that the forest condition holds. At the edge of the slice are stubs, which give only an identifier, a kind and a digest. A slice is therefore an open graph whose boundary is its stubs, and a client assembles a larger picture by gluing slices along shared identifiers, the composition of Section 7.

  • traverse ships a traversal θ=(σ,V,μ,⊕,υ,β) (Definition 8) to the authority or the host, which evaluates it there. Erlang’s tracing filters events where they are produced, and the earlier specification adopted that idea for its selectors. RGP generalises it from a filter to any traversal, as a traversal over a dataset is compiled to the store that holds it (Section 8.3).

  • The budget β replaces ad hoc limits. Every answer carries its coverage claim: the revision, the scopes visited, what the budget excluded, what labels withheld and which boundaries were opaque.

  • A read across consistency domains is evaluated at a revision vector, one revision per domain, as in Definition 10. A monotone traversal needs no coordination. A non-monotone one needs a consistent cut, and without one the answer is UNKNOWN (Proposition 8).

The earlier specification’s revision domain needs no messages of its own. Comparing two revisions is the graph diff of Section 9. Asking which live consumers still bind a contract that only an old generation provides is a traversal over runtime facts, and an empty answer is what permits retiring that generation.

12.4 Watching: deltas, cursors and reconciliation#

A subscription is a traversal maintained incrementally. The change log already records each commit as a Z-set of inserted and removed rows (Section 11). For a subscribed view V=θ(G), the producer evaluates the incremental form of Proposition 7 and sends each change of the view as a Z-set delta ΔV. The subscriber integrates: its copy of the view is the sum of the deltas it has applied. Kubernetes’ list-then-watch [339] thus becomes DBSP’s integration of differences [46]. A snapshot is the integral up to a cursor, and a watch is the stream of differences after it. Four rules keep a watch truthful.

  1. A delta names the cursor it starts from. A cursor is a position in one producer’s log under one epoch. For definitions it is an authority and a revision; for runtime facts it is a host, an epoch and a sequence number. A delta carries the cursor it starts from and the cursor it ends at. The subscriber applies a delta only if it starts at the subscriber’s own cursor. Any other delta marks the subscription stale, and the subscriber asks for a reset.

  2. The producer never waits, and it merges by addition. Credits bound what is in flight, as in Reactive Streams [286]. Z-sets form a group, so deltas compose by addition. A producer that runs out of credit stops sending. Later it sends one delta, from the subscriber’s cursor to its own head, that is the sum of the deltas it held back. Nothing is lost, and the merged delta is never larger than the change it describes. Keeping only the latest message is correct for a signal of state, and wrong for deltas, which are differences. Streams that are not views, such as raw samples, may drop under pressure. The next frame then starts at a later cursor, so the gap is visible.

  3. A cursor includes the epoch. A host’s sequence numbers start again when the host restarts. A cursor from another epoch, or one older than what the log retains [208], is answered with a reset rather than with deltas.

  4. A reset reconciles. For a view that is a restriction of the containment forest, the subscriber sends the digests of the scopes it holds. The producer descends the Merkle forest of Definition 4 and returns only the subtrees whose digests differ, as Dynamo’s anti-entropy and Git’s negotiation do [90, 334]. The cost grows with the size of the difference times the depth of the forest, not with the size of the graph. Any other view is re-evaluated at the head and sent whole.

Listing 28 (Appendix C.1) models the first three rules. Its producer commits, sends single or merged deltas while it has credit and drops them when it has none; the connection can be lost, and the producer can restart under a new epoch. Its invariant, Truthful, says that the subscriber’s copy is always the producer’s state at some cursor of one epoch: possibly old, never wrong. TLC finds that it holds over 2,676 states and that removing any one rule breaks it (Table 34). Without the check of the starting cursor, a dropped delta vanishes in six steps. With cursors that omit the epoch, a subscriber that resumes after a restart mixes two epochs in eleven steps. Merging by keeping the latest delta loses a change in five.

contract  uint    0x3b9e51c4, fingerprint of the Delta schema
conv      uint    7, a watch of routes.reachable at ref main
coverage  map     { excluded: 0, opaque: 1, withheld: 2 }
from      blob    cursor: authority workspace, revision r41
kind      uint    5 (Delta)
rows      vector  Z-set of view rows
  [0]     map     { elem: blob16, value: true, weight: 1 }
  [1]     map     { elem: blob16, value: true, weight: -1 }
to        blob    cursor: authority workspace, revision r42

Listing 12.

A delta of a watched view as an rgp/1 frame: a FlexBuffers map with sorted keys.

12.5 Changing the graph#

The four kinds of change in Section 9 have four authorities, and RGP sends each to its own. Definition commits go to the graph authority, and activations go to hosts. Executors perform data transactions and external effects against stores and providers, and RGP carries only their receipts. Rows never travel in RGP, because rows are not in the graph. Erasing a user’s data is a data plan with a receipt from every store (P10 in Section 16), not a message to the authority.

Proposals#

A proposal carries a patch, its base revision, its read set and its author (Section 9). The authority answers check with typed data:

  • the findings of 𝖶𝖥𝗌𝗍𝖺𝗍𝗂𝖼, computed incrementally by Proposition 9;

  • the graph diff, ranked by risk;

  • the claims that the patch would make stale;

  • the open proposals with which it commutes (Theorem 10).

An approval is a message from a second principal, because no principal approves its own proposal (A5). commit moves a ref if the base is still current or no predicate in the read set has changed. Otherwise it fails with the conflicting proposal and a witness, never with a silent last write.

Outcomes#

A commit is an effectful Session, so its outcome has four cases (W5). Its effect identity binds the digest of the request. A retry with the same identity returns the recorded outcome, and reusing the identity with a different digest is a rejection [219]. A client whose call times out holds UNKNOWN and calls lookup. The authority then either returns the recorded outcome or records the identity as refused, so that a delayed copy of the request cannot commit afterwards. Only then may the client conclude that nothing happened. This is the effect-identity template of Table 34, applied to the protocol itself. Listing 13 shows a client.

Edit ownership#

The earlier specification made every patch state its write target: a document, source code or a running system. The reason was that the next build erases an edit to structure derived from source. In RG each scope declares its edit owner, so the authority decides instead.

  • A patch to a source-owned scope is accepted only as the output of elaboration, and it carries the source revision it was elaborated from as a Derives assertion. Any other edit to such a scope goes to a source adapter, which proposes a change to the source under the lens laws of Section 9.

  • A graph-owned scope accepts patches directly.

  • A running system never changes because of a patch. It changes only when a host admits a release.

  • Presentation state (layout, folds and comments) has no invariants. It travels as CRDT operations outside commits [310].

val rgp = connect(authority("workspace"), principal = agent("planner"))
val routes = rgp.watch(reachable, at = ref("main"), credit = 64)
launch { routes.deltas.collect { delta -> table += delta } }

val proposal = rgp.propose(addAuth)
val approved = rgp.awaitApproval(proposal, by = role("reviewer"))
val effect = EffectId.fresh()
when (val outcome = rgp.commit(approved, effect)) {
    is Outcome.Success  -> rgp.offer(release(region("chat"), outcome.value))
    is Outcome.Rejected -> report(outcome.findings)
    is Outcome.Failure  -> retryLater(outcome)
    is Outcome.Unknown  -> rgp.lookup(effect)
}

Listing 13.

A client of RGP that watches a view and commits a patch (proposed API). The traversal is that of Listing 9 and the patch that of Listing 4.

12.6 Releasing to hosts#

The release domain carries the protocol of Section 9.5.

  • offer delivers a signed release with its update-framework metadata [305].

  • The host evaluates the admission predicate itself, because admission is decided where it is enforced, and it answers with a generation or with findings.

  • activate names a mode: next entry, or drain and swap.

  • retire fences the retired generation’s epoch at the stores that own its writes. The stores enforce the fence, and RGP carries their receipts.

  • A rollback is a new release under a new epoch.

Each of these is an effectful Session with an effect identity, so a host that goes offline during an activation answers lookup when it returns. Hosts that are often offline, such as phones, pull: releases wait on a durable channel that replays from an offset. Each host reports the generations it has admitted as runtime facts, so condition (ii) of Definition 10 is observed rather than assumed. The effect class of a release is the join of its contents’ effects. A release that contains an irreversible migration is therefore a data migration, and it needs a grant for one.

12.7 Observing and assuring#

Observations are joined to the graph by identity (Section 5.4). RGP carries four kinds of runtime fact:

  • activations and generations, whose lifecycle arrives as deltas on activation rows rather than as named callbacks;

  • the state of live connections: credit, stalls and outcomes, UNKNOWN included;

  • receipts of effects and of data plans;

  • profiles for the compiler (Section 10.7).

A stalled stream is reported as one. Otherwise a consumer that has stopped granting credit is invisible: no log line records it, and no snapshot shows it. RGP is not a telemetry pipeline. Spans and metrics go through OpenTelemetry to the observation sink [275], and RGP refers to them by identity and carries aggregates and samples.

Payloads and labels#

Descriptors are not payloads. A payload is labelled data, and a sample leaves its producer only along a flow that W11 admits: either the reader’s clearance dominates the label, or a declassifier on the path holds a grant for the purpose. Redaction is therefore a component in the graph, not a feature of the protocol. The graph’s own metadata is labelled too. The names and attributes of a scope can reveal a customer, an incident or a security control, and the graph as a whole is a map of the system (Section 19). Reads, watches and exports filter by the reader’s clearance before encoding. A withheld element becomes an opaque stub, which keeps a slice well formed and says only that something is there, and the coverage claim counts such stubs.

Evidence#

Verifiers submit evidence as Attests assertions with their artefacts. The status of a claim is a query, and admission reads it (Section 15).

12.8 Federation between authorities#

A large system has several graph authorities: partitions of one workspace, separate environments, organisations that share interfaces, and deployments in jurisdictions with their own providers and laws. RGP never merges these authorities and never routes calls between them. Each element has one owning authority, the authority of its consistency domain. Five rules govern the rest.

  1. Views, not copies. An authority exports a view: a restriction along a map of schemas, such as the boundary ports and contracts of the definition layer, filtered by the importer’s clearance and signed. Views commute with patches (Proposition 2), so the export of a patch is a patch of the view, and exports are incremental. The importer holds the view as a replica related to its source by Replicates, with the exporter as the authority. The importer cannot edit the replica, so it never becomes a second source of truth.

  2. References pin. A reference to a foreign element names its authority, its identifier and the revision of the view against which it was checked. When an export removes the element, the importer gets a finding at each reference, a typed hole, rather than a dangling pointer.

  3. Calls are declared. A call between authorities is a Session in both graphs. A gateway realizes it, each side admits the gateway, and each side’s grants cover it. Each authority checks the flows that leave it (W11) and the effects that enter it (A5). Comparing environments, such as staging with production, reads two views and routes nothing, so a laptop cannot appear to call production.

  4. Digests prove agreement. Elaboration is deterministic (Section 10), so two authorities that elaborate the same source revision hold equal digests for its definition regions. They can show that they run the same definitions by comparing root digests, without exchanging the definitions, the deployment or anything they have observed.

  5. Trust is per authority. Each authority has its own signing roots and its own cryptographic suites. A peer’s root is accepted through a Grant that names the views the peer may read and sets an expiry. A jurisdiction that mandates particular algorithms changes a suite, not the protocol.

Reads across authorities use revision vectors, and a non-monotone read needs a consistent cut across the authorities involved. DStar checks labels where data leaves a machine, and Fabric federates nodes that trust one another to different degrees [226, 364]. RGP applies the same discipline to the graph and its views.

Two jurisdictions#

Consider a product that operates in two jurisdictions whose providers and data rules differ, such as the reference stack and the Chinese cloud stack of Section 13.3. It runs one authority in each.

  • Both authorities elaborate the same source, so their definition digests agree. Only their Places and Realizes assertions differ (Section 13.1).

  • Contracts are exported in both directions, so a session between the two deployments is typed on both sides.

  • Runtime facts, observations and profiles stay with the authority where they arise, so profile-guided plans are made per authority (Section 10.7).

  • A transfer of personal data between the two is a declared session whose flows and grants each side checks. Claims about its legal basis are part of the evidence that admission requires.

12.9 Carriers, security and conformance#

Carriers#

RGP needs four properties from a carrier:

  • ordered streams with independent flow control, so that a slow subscription cannot block a command;

  • credits;

  • mutual authentication of principals;

  • integrity.

Within a process, RGP runs over an FFI trunk, such as JSI next to a Hermes engine. Between processes and machines it runs over WebSocket or QUIC streams [177]. For hosts that are often offline it runs over a durable channel with replay. A carrier realizes RGP’s own sessions and channels, so it is admitted by rule (Real) and condition A2 like any other binding.

Security#

Authentication happens at hello, and a client without a principal sees nothing. Grants are per domain and per scope, the default is deny, and reads count as effects (A5). The rate and budget attributes of a grant bound what a client may ask for. Agents reach RGP through tools of the Model Context Protocol that map one to one onto its operations (Section 19). An agent’s authority is therefore exactly its grants, and labels bound what untrusted input can make it do. Every effectful exchange leaves a receipt that names the principal, the effect identity, the request digest and the outcome.

Conformance#

The RGL Core conformance suite (Section 10.8) covers RGP with frame vectors for every message type, transcripts of conversations with their expected outcomes, and the TLA+ templates of Table 34. A conforming endpoint:

  • names elements only by identifier;

  • answers every read with coverage, and evaluates traversals before encoding;

  • never blocks a runtime on a subscriber;

  • starts every delta at a cursor, and resets on a mismatch;

  • never decodes by position across fingerprints;

  • refuses patches to source-owned scopes that elaboration did not produce;

  • answers UNKNOWN rather than guessing, and refuses self-approval;

  • filters by label before encoding, and never routes between authorities.

One test checks the identity model with two builds and no infrastructure: builds with identical contracts and different bodies must be reported as compatible and distinct.

What RGP is not#

RGP is not a telemetry pipeline, a data API, a transport for application sessions or a consensus protocol. Application calls use their own realizations, and RGP carries their descriptions and observations. Rows stay in stores. Each authority commits its own domain, and a change that spans authorities is a plan executed with receipts (Section 9).