Skip to content
Design9 min readUpdated 27 Oct 2026

5. The Reaktor Graph

5.1 Elements#

Definition 1 (Reaktor graph). A Reaktor graph is a tuple G=(N,P,E,I,𝑜𝑤𝑛,𝑝𝑎𝑟,𝑠𝑐,𝑒𝑑𝑔𝑒,𝑒𝑛𝑑,𝑟𝑜𝑙𝑒,𝑜𝑟𝑑,𝑘𝑖𝑛𝑑,𝑎𝑡𝑡𝑟) where

  • N, P, E and I are finite, pairwise disjoint sets of nodes, ports, hyperedges and incidences, and X=N⊎P⊎E is the set of elements;

  • 𝑜𝑤𝑛:P→N is total: every port has exactly one owner;

  • 𝑝𝑎𝑟:N⇀N is partial and its graph is acyclic: nodes form a containment forest, and each containment link carries a slot label;

  • 𝑠𝑐:E→N⊎{⊤} gives each hyperedge the scope in which it is declared;

  • 𝑒𝑑𝑔𝑒:I→E, 𝑒𝑛𝑑:I→X, 𝑟𝑜𝑙𝑒:I→R and 𝑜𝑟𝑑:I→ℕ say that incidence i attaches element 𝑒𝑛𝑑(i) to hyperedge 𝑒𝑑𝑔𝑒(i) in role 𝑟𝑜𝑙𝑒(i) at position 𝑜𝑟𝑑(i), and (𝑒𝑑𝑔𝑒,𝑟𝑜𝑙𝑒,𝑜𝑟𝑑) is injective: no two incidences of one hyperedge occupy the same slot;

  • 𝑘𝑖𝑛𝑑:X→K assigns every element a kind and 𝑎𝑡𝑡𝑟 assigns typed attribute values.

Ownership, containment and scope together form one forest over X: ports hang under their owners, nodes under their parents, hyperedges under their scopes. This forest is the analogue of the place graph of a bigraph [247]. The incidences form its link structure. Unlike bigraph links, they are typed, role-labelled and ordered. An incidence may attach a hyperedge to any element, so an assertion can be about a hyperedge, as in ubergraphs [189]. The signature (Definition 2) restricts executable hyperedges to ports. A hyperedge with k participants costs k incidences and keeps its identity. A clique expansion would cost O(k2) binary edges and lose both the identity and the roles (Table 3).

As attributed C-sets#

Let 𝒮𝖱𝖦 be the finitely presented category with objects N, P, E, IN, IP, IE and C and generating arrows 𝑜𝑤𝑛:P→N; 𝑒𝑑𝑔𝑒s:Is→E and 𝑒𝑛𝑑s:Is→s for each sort s∈{N,P,E}; 𝑐ℎ𝑖𝑙𝑑,𝑝𝑎𝑟𝑒𝑛𝑡:C→N; and attribute arrows into value types. A Reaktor graph is an attributed C-set, i.e. a functor 𝒮𝖱𝖦→𝖲𝖾𝗍 with typed attributes, and a morphism of Reaktor graphs is a natural transformation that preserves attributes [280]. The conditions a C-set cannot state (the forest condition, slot injectivity, sort-dependent typing) become well-formedness axioms (Section 6.5). This presentation is what makes the kernel data-oriented: each object is a table and each arrow a column of foreign keys (Figure 6 and Section 11).

Figure 6

Figure 6. The schema 𝒮𝖱𝖦. A Reaktor graph is a functor from this category to 𝖲𝖾𝗍, with typed attributes (kinds, facets, roles, ordinals, contracts) attached to N, P, E and the incidence objects. In the kernel each object is a table and each arrow a column of foreign keys (Figure 19).

Proposition 1 (Adhesivity). The category 𝖱𝖦=𝖲𝖾𝗍𝒮𝖱𝖦 of structural Reaktor graphs is a presheaf topos, hence adhesive. For any type graph T, the category of T-typed graphs 𝖱𝖦/T≃𝖲𝖾𝗍∫T is again a presheaf topos, hence adhesive.

Every presheaf topos is adhesive [210], and a slice of a presheaf topos is equivalent to presheaves on the category of elements. The consequence is that double-pushout (DPO) rewriting of typed Reaktor graphs has the Local Church–Rosser, Parallelism and Concurrency theorems [102], which Section 9 uses for transactions and merges. Attribute values in rules are treated as in [42].

5.2 Signatures and typing#

Definition 2 (Signature). A signature Σ consists of

  • node kinds KN, each with a set of facets and a port signature (required and optional port kinds);

  • families KE, each with a class (connection or assertion), a role set Rk, multiplicities μk:Rk→ℕ×(ℕ∪{∞}), a polarity πk:Rk→{𝗈𝖿𝖿𝖾𝗋,𝗋𝖾𝗊𝗎𝗂𝗋𝖾,𝗇𝖾𝗎𝗍𝗋𝖺𝗅}, admissible participant sorts and layers per role, a protocol and a lattice Qk of quality-of-service levels;

  • port kinds KP⊆{(k,r)∣k∈KE,r∈Rk}: a port kind fixes the family and role in which the port participates.

The type graph T(Σ) is the Reaktor graph with one node per node kind, one port per port kind (owned by every node kind whose signature lists it), one hyperedge per family and one incidence per admissible (family, role, port kind) triple.

A typed Reaktor graph is a graph G with a morphism t:G→T(Σ), so every element is mapped to its kind and every incidence to its role slot. This is the standard typed-graph construction of algebraic graph transformation [102]. Two consequences follow. First, a hyperedge’s family and every participant’s role are determined by the kinds of the ports involved: in Reaktor’s design corpus, the family follows from the port profile in 95% of the connections whose ports imply one (Section 20.1). RG removes that redundancy rather than recording it twice. Second, the signature is open. A new domain kind is a new object of T(Σ) (a new table), in the way a Kubernetes custom resource or an MLIR dialect [218] extends a fixed core without changing the kernel.

5.3 Layers#

Definition 3 (Layers). Let ℒ={𝖲𝗋𝖼,𝖣𝖾𝖿,𝖣𝖾𝗉,𝖱𝗎𝗇,𝖮𝖻𝗌,𝖠𝗌𝗌}: source, definition, deployment, runtime, observation and assurance. A layered signature assigns each node kind a layer λ:KN→ℒ. Connection families are intra-layer: all participants of a connection lie in one layer. Assertion families declare the admissible layer of each role and may cross layers. For ℓ∈ℒ, let ∫Tℓ↪∫T be the full subcategory on the kinds and families of layer ℓ. The projection onto ℓ is the restriction functor πℓ=Δι:𝖲𝖾𝗍∫T→𝖲𝖾𝗍∫Tℓ.

Layers answer different questions about one system. The definition layer says what is intended at a revision. The source layer says which artefacts implement it. The deployment layer says where it may run and on which resources. The runtime layer says what is running now, with which epochs. The observation layer records what happened. The assurance layer says what is claimed and on what evidence. Reaktor’s design documents keep these statuses apart [293]. In RG they are fibres of one typed graph, and cross-layer facts are explicit assertions (Realizes, Places, Observes, Attests, Derives). In network-science terms [197, 323], RG is a heterogeneous, multiplex, multilayer hypergraph. Unlike the node-layer couplings of [197], a cross-layer relation in RG is a typed assertion with its own identity.

Proposition 2 (Views commute with patches). Restriction functors Δ preserve all limits and colimits. Hence the image under any layer projection, or any view obtained by restriction along a map of schemas, of a DPO derivation G⇐D⇒H is a DPO derivation of the projected rule: the view of a patched graph is the patched view.

Restriction has both a left and a right adjoint (left and right Kan extension), so it preserves pushouts and monomorphisms. This is the formal content of the design rule that a projection must never become a second source of truth. A view is a functor of the graph, not a copy, and the functorial data migrations Σ, Δ and Π [314] give a calculus for defining views and imports.

5.4 Identity, revision and activation#

Definition 4 (Identities). Every element x carries (i) a stable identifier 𝑖𝑑(x), declared in source or minted at creation, typed by sort, never reused, and preserved by every patch that preserves x; (ii) a content digest h(x), computed over the containment forest as a Merkle hash of x’s kind, attributes, the sorted digests of its children and its sorted incidence tuples. The revision digest is h(G)=h(⊤). A contract c additionally has a fingerprint 𝑓𝑝(c) over its normalised structural description. An activation is identified by (definition identifier, place, key, epoch), where the epoch is issued by the authority that owns the activation and increases monotonically.

Four rules follow from the design corpus and from the current runtime’s failures. Identifiers are never derived from labels, class names, memory addresses or construction order. A source-owned element gets its identifier from its declared name within its scope, and renaming it requires an alias, recorded as a Derives assertion. Equal fingerprints mean structurally identical contracts. Compatibility between different contracts is a separate, directional relation ⊑, so a newer server can serve an older client. Digests are canonical: permuting declarations does not change h(G), and layout never enters it. Merkle digests make every scope a content-addressed unit, as in Nix and Unison [60, 98]. This is what lets a pushed region name exactly what it replaces.

Table 3. Why a typed port hypergraph. The bipartite incidence graph (the Levi graph of a hypergraph [30]) is not a competitor: it is how RG is stored.
Representation collective relation typed ports and roles nesting cross-layer facts rewriting theory compositional semantics size of a k-party relation
Directed/property graph – labels – labels DPO – O(k2), identity lost
Tree (element tree, slot table) – – ✓ – – – not expressible
Port graph [108, 133] – ✓ ✓ – strategic – O(k2)
Bigraph [247] ✓ arity only ✓ – reactive ✓ O(k)
Open hypergraph [35] ✓ ✓ – – DPO ✓ O(k)
Current runtime – partial ✓ – – – not expressible
RG (this paper) ✓ ✓ ✓ ✓ DPO ✓ O(k), identity kept
Figure 7

Figure 7. Anatomy of a Reaktor graph. Ports are owned by nodes and drawn on their borders; polarity follows from the port kind. A hyperedge is an element whose incidences carry roles: one Channel joins a producer and two consumers without a clique of binary edges. The only incidence that leaves the scope passes through a boundary port, related to an inner port by Export. The scope is therefore an open graph that can be mounted wherever a compatible Session server exists. The Attests assertion takes a hyperedge as its subject.