Architecture Overview
The engine is a layered system organized around a single FROZEN δ-CRDT core, wrapped by an ingress gate stack, a durable LSM tier, a replication mesh, and operator/developer surfaces.
Layered package architecture
CRDT core pkg/sync
The δ-CRDT engine: sharded lock-free HAMT, Lamport dot minting, FROZEN merge-union Join, IBLT/strata set reconciliation, EBR + hazard-pointer reclamation, wire-integrity seam. The write/read hot path everything else builds on.
Storage & durability internal/database · pkg/durability
Off-heap jemalloc-backed SkipListArena MemTable, async L0 flush to per-entity Arrow IPC, L0→L1 compaction with tri-temporal dominance pruning, bitemporal Resolver (AsOf/Range) + read-your-writes LiveSource, WAL + bounded snapshot recovery.
Mesh & replication pkg/mesh · pkg/clock · pkg/admission
TLS 1.3 peer gossip, anti-entropy sweep (oversend / batched / stratified), JSON-over-mTLS control port. pkg/clock is the Byzantine HLC physical-bound cap (first ingress gate, sub-µs). pkg/admission is the per-peer Sybil-burst token bucket.
Receive & transport pkg/receive · pkg/transport
Length-prefix frame reassembly, gate-stack composition (the first production caller of Join), edge-triggered epoll ingress, eBPF SK_REUSEPORT steering, TLS 1.3 mTLS with SIGHUP rotation, zero-copy egress boundary.
Identity & crypto pkg/identity · pkg/crypto · internal/crypto · pkg/authorization
ZIP-215 Ed25519 verify gate, origin→pubkey Directory, hedged EdDSA signer, ML-DSA-65 preview, dev-mesh x509 CA, zero-GC PII masking, Cedar ABAC latency experiment.
Attribution & telemetry pkg/attribution · internal/telemetry · pkg/metrics
Relay-provenance envelopes + batch/digest dispatch, 19 zero-GC sharded LongAdder counters, Prometheus registry + TelemetryBridge (SSoT-grows-auto).
Network, spatial, capnp internal/network · internal/transport · internal/spatial · api/capnp
EPOLLET Cap’n Proto ingestion server, jittered-backoff HTTP client + bounded lock-free pool, SHA-256-prefix-sharded S3 uploader, memfd SPSC H3 ring + EpochBatcher, generated capnp wire bindings.
Chaos internal/chaos
Semantic Byzantine injector, in-memory VirtualNet partition fabric, engine-side WAL, supervisor/worker process-crash survival — the verification layer proving the hardest invariants.
Operator / developer / evidence cmd/sovereign-node · sdk/sovereign · examples · pkg/codec120 · pkg/durability120 · pkg/pqecobench
The production binary, the client SDK, examples, and the bench-only evidence tracks (codec byte-cost, durability CDFs, ML-DSA-65 PQ economics).
The joints where the laws compound
The architecture's seams are where the physical laws compound into guarantees:
- receive → CRDT apply → HAMT → WAL → compaction — the
Receiveris the first production caller of the FROZENJoin; a corrupt element is rejected by the wire-integrity seam beforeJoin, so it never partial-applies earlier batch elements. Accepted elements flow into the sharded root CAS, retired nodes reclaim through EBR, the WAL records the mutation for crash recovery, and the MemTable flushes asynchronously to the durable tier where compaction eventually prunes. - gossip → mesh → clock — the
GossiperdrivesAntiEntropySweepover thePeerSet; the clock cap (IngressHLCScalarCap) sits at the transport seam before the Ed25519 verify, so a Byzantine far-future frame is dropped before it can brick the receiver's Lamport clock. - identity → attribution → mesh —
identity.DirectoryresolvesoriginNodeID → pubkey(the FROZEN wire carries no pubkey, forcing out-of-band resolution);attribution.RelayEnvelopebinds each relay hop with a forward-secure chain a relay cannot splice;Gossiper.InsertLocalEventsroutes local writes throughbridge.PutLocal(WAL fsync) — neverengine.InsertLocaldirectly. - telemetry → metrics → control port — the hot path writes to 19 zero-GC LongAdder counters without plumbing an OTel Meter;
TelemetryBridgeprojects them onto cumulativesupremum_*Prometheus series on/metricswith zero bridge code edits when a new counter is added.
Continue
- Core Architecture & Design → — the deep dive into the CRDT core, storage, mesh, and the end-to-end data flow.
- Design Rationale → — the five physical laws.
- Key Features & Specialties → — every specialty, with its file.