Integration Model
The integration model defines how applications, services, devices, and existing protocols interact with the Spook Systems substrate. It is designed so that applications remain simple at the surface while the daemon provides deterministic shared-state underneath. Synchronisation, conflict resolution, ordering, and recovery are not implemented by applications — they are properties of the substrate.
The core principle is that applications do not coordinate with each other. They coordinate with the daemon, and the daemon coordinates with everything else.
Architectural Overview
The integration model is structured around three cooperating layers:
- Application Layer — reads and writes state; contains no synchronisation logic.
- Language Bindings & Protocol Wrappers — translate application intent into deterministic operations.
- Central Daemon — executes ETCP, ESTP, QSCS, and QN semantics.
This separation allows incremental adoption without rewriting existing systems.
The Daemon
The daemon is the central runtime responsible for all deterministic behaviour. It manages:
- Pair creation and lifecycle
- HalfPair state machines
- Collapse engines
- Delta generation and application
- QRegister and QGroup correlation
- QDomain routing and QRoute selection
- Timers, heartbeats, and failure detection
- Reconnection, decoherence, and deterministic re-entanglement
- WASM execution for browser-based HalfPairs
Stateless at Rest
The daemon does not store persistent state in memory. All durable state lives in StateBlocks, QStateVectors, and QRegister histories. This allows the daemon to restart cleanly without losing correlation or requiring replay storms.
Transport-Agnostic
The daemon communicates over Unix sockets, named pipes, secure WebSocket tunnels, and embedded device bridges. Transport does not affect semantics.
Language Bindings
Bindings expose a minimal, deterministic API. They do not implement protocol logic; they simply send commands to the daemon and surface state changes.
Binding Philosophy
Bindings are intentionally thin: no retries, no caching, no conflict resolution, no local state machines. All complexity lives in the daemon.
Protocol Wrappers
Protocol wrappers allow existing systems to adopt deterministic shared-state without rewriting their logic. They sit between the application and the daemon.
Integration Patterns
There are three primary integration patterns, each suited to different environments.
Browser Integration
Browser runtimes host HalfPairs inside WebAssembly. They communicate with the daemon through secure WebSocket tunnels, local relay processes, or embedded device bridges.
Browser HalfPairs behave identically to native HalfPairs: same state machine, same collapse semantics, same delta rules, same decoherence and re-entanglement.
This enables deterministic shared-state in web apps, PWAs, collaborative editors, and spatial computing environments.
Identity and Authentication
Identity is part of the deterministic substrate, not an application-level concern.
Deployment Models
The integration model supports multiple deployment topologies without changing semantics:
Operational Model
The system is designed to be operationally simple.
Everything else is deterministic.