Architecture

Distributed systems still rely on coordination models that treat state as something reconstructed after the fact. Every service invents its own rules for synchronisation, conflict resolution, recovery, and failure.

The Spook Systems architecture introduces a deterministic shared-state substrate built from four cooperating protocols. Each layer is independently novel. Together they form a unified model for deterministic state evolution from point-to-point Pairs up to multi-register and multi-node correlation domains.


1. Protocol Family

The architecture is structured as a layered protocol stack:

QN Deterministic multi-node correlation across distributed domains Layer 4 QSCS Multi-register correlation, entanglement-group semantics Layer 3 ESTP Delta transmission, collapse, decoherence, state machines Layer 2 ETCP Identity, pair formation, link management, conformance Layer 1 TCP / QUIC / WebSocket / custom transport Correlation Transport

ETCP and ESTP form the transport substrate. QSCS and QN extend the model to multi-register and multi-node scenarios.


2. ETCP — Identity and Conformance Layer

ETCP provides the structural and identity primitives required for deterministic shared-state synchronisation. It defines how endpoints identify themselves, form Pairs, and maintain link-level conformance.

Identity Primitives

EndpointID globally unique node PairID unique state register HalfPairID per-endpoint Pair StateID monotonic committed Pair formation · Session management · Heartbeat · Failure detection Transport-agnostic — treats the link as a conduit, not a source of semantics

3. ESTP — Deterministic Shared-State Synchronisation

ESTP builds on ETCP to provide deterministic state evolution between two correlated HalfPairs. It defines how state is represented, how mutations are encoded, and how deterministic convergence is guaranteed.

Core Concepts

StateBlock Candidate Delta Collapse Decoherence Re-entangle Deltas are idempotent, order-preserving, and apply in constant time regardless of StateBlock size

HalfPair Lifecycle

Each HalfPair follows a deterministic state machine. Every transition has a defined trigger and a defined outcome.

Created pair established Entangled local mutation remote mutation Superposed (local) Superposed (remote) Superposed (dual) collapse invoked Collapsing timeout resolve violation Decohered Committed Failed next cycle

Collapse Semantics

Collapse resolves pending mutations into a single committed StateBlock. CollapseRules are deterministic, total, and side-effect-free.

Collapse Modes Lazy on observation Eager immediate Collapse Rules LWW last writer Merge CRDT-style Custom user function Consistency Modes Causal default · low latency Strong always agree Eventual converge later

Decoherence and Re-Entanglement

When correlation is lost, the HalfPair enters Decohered. On reconnection, deterministic re-entanglement reconciles divergent histories using minimal deltas, not full state transfer.

Decohered diverged reconnect Link ETCP Exchange StateBlocks Order Candidates Entangled minimal Δ only No full-state transfer · No replay · Deterministic reconciliation

4. QSCS — Multi-Register Deterministic Correlation

QSCS extends ESTP from 1:1 Pairs to deterministic multi‑register correlation. It introduces QStateRegisters and QGroups, enabling multiple registers to evolve through shared collapse events and commit to the same sequence of QStateVectors, all without modifying the underlying transport.

QGroup — Entanglement Group QRegister₁ QStateVector QRegister₂ QStateVector QRegister₃ QStateVector QRegisterₙ QStateVector Shared collapse · Deterministic QDelta across all registers All QRegisters commit to the same sequence of QStateVectors

5. QN — Deterministic Multi-Node Correlation

QN extends QSCS to the network layer. It provides deterministic multi-node correlation across distributed systems, clusters, and regions. QN does not transmit quantum information; it coordinates the classical register structures that align with quantum processes.

QNode A QDomain · QRoute QNetClock QNode B QDomain · QRoute QNetClock QNode C QDomain · QRoute QNetClock QNetΔ QNetΔ QNode D Partitioned evolves locally rejoins via QNetΔ Deterministic multi-node recovery without replay storms or full-state resync Partition → local evolution → QNetRejoin → minimal QNetDelta → alignment restored

6. Full Layered Architecture

Application Layer User-facing APIs, developer SDKs, wrappers QN — Correlated Register Domain (multi‑node deterministic coordination) Multi-node correlation, QRoutes, QNetDelta, QNetCollapse QSCS — Quantum-State Correlation Substrate Multi-register correlation, QGroups, QDomains, QDelta ESTP — Entangled State Transmission Protocol State machines, delta transmission, collapse, decoherence ETCP — Entangled Transmission Conformance Protocol Identity, pair formation, link management, conformance Transport Layer — TCP / QUIC / WebSocket / custom

7. Runtime Architecture

The system is implemented as a single-daemon, multi-Pair, single-socket architecture:

Central Daemon PairManager CollapseEngine DeltaEngine StateGraph MessageBus QRegister Unix socket / named pipe Language Bindings C Rust Go Python JS Java Swift C# Browser Runtime WebAssembly HalfPairs in browser Protocol Wrappers SMB · LDAP · SSH · HTTP · MQTT · CoAP · SQL

8. Key Components

ComponentLayerResponsibility
PairManagerETCP/ESTPCreates, tracks, and disposes entangled Pairs
HalfPairESTPLocal Pair representation; StateBlock, Candidates, state machine
CollapseEngineESTPDeterministic collapse resolution
DeltaEngineESTPMinimal delta generation and application
StateGraphESTPLifecycle state machine
CouplingRegistryETCPCorrelation constraints
MessageBusETCPDelta framing and delivery
QRegister / QGroup / QDomainQSCS/QNMulti-register and multi-node structures
QRouteQNDeterministic routing
DaemonRuntimeCentral process managing all protocol layers

9. Design Decisions

Lazy collapse by default Causal consistency default Minimal deterministic deltas Many Pairs per endpoint Timeout-based decoherence Transport-agnostic Single-daemon runtime Browser via WebAssembly Plug-in adoption model

These decisions prioritise determinism, simplicity, and predictable behaviour under failure.


10. Hybrid Classical-Quantum Applicability

The architecture's structural properties—isolated registers, deterministic transitions, minimal deltas, and strict causal ordering—align naturally with hybrid classical‑quantum workflows. ESTP and ETCP provide the deterministic classical control substrate, while QSCS and QN extend this model to multi‑register and multi‑node coordination. QSCS and QN operate entirely on classical register structures associated with quantum‑adjacent workflows; they do not transmit, manipulate, or depend on quantum information.


11. Architectural Summary

The Spook Systems protocol family forms a unified deterministic synchronisation substrate spanning point-to-point Pairs, multi-register entanglement groups, and multi-node correlation domains.

Deterministic state transitions Minimal Deltas constant time Causal Order no global locks First-Class decoherence Transport independent Multi-Register multi-node

It introduces deterministic shared-state as a transport-layer primitive — a foundation for the next generation of distributed systems.