PL-WOS-001-0 · File No. WOS/SYSTEM/01 · Pre-Release
Agent Operating Systems
WUNDEROS by Pentad Labs
The Agentic Operating System
A Minimal Viable Theory

Solomonoff (1964) proved that optimal compression of any computable sequence is equivalent to optimal prediction of it. Hutter and Schmidhuber extended the proof to agency: the optimal universal agent is a compressor that has learned the regularities of its environment.

Prediction is the load-bearing aspect of intelligence in this frame. Compression is the mechanism that makes prediction tractable.

Recursion is our preferred mechanism for compression. Bird-Meertens (1986) teaches that structural recursion over an inductive type is a fold (that is, a catamorphism) that collapses arbitrary-depth structure into a value via an algebra that retains only load-bearing information. The fold is the mechanism; the algebra is the choice. Well-chosen folds compress.

WunderOS is built on and for substrate-recursion. Every agent action, every classifier output, every plan execution writes back to the substrate with full provenance. These folds compress operational experience into a representation that subsequent agent-substrate interaction cycles consume as context. Cycle n's experience becomes n+1's compressed prediction surface.

The substrate gets smarter over operational time, not because the LLM does, but because the substrate’s compression of experience improves with each cycle.

Substrate-recursion is fold-shaped compression. Fold-shaped compression is intelligence-shaped behavior operationally. The substrate is the repository of accumulated intelligence. The LLM remains the workhorse for genuinely novel reasoning. Customer agents inherit both. Token consumption decreases. Reasoning quality improves. Critically, agentic reliability increases which increases realized business value. The loop closes.

Further consideration of these and related matters may be found in Pentad Labs Research Notes.

Software Platform

Theory is fine; running code is better. WunderOS combines agentic harness engineering, systems engineering, systolic-array compute, knowledge representation, and control theory with bare metal, HFT-grade latency, telecoms-grade concurrency primitives, durability, and traceabilty.

Autonomic systems are defined rigorously in the MAPE-K (Monitor, Plan, Analyze, Execute over shared Knowledge) reference model.

WunderOS is MAPE-K for enterprise agents: a platform where substrate-recursion makes the write path the structural through-line. In WunderOS, every assertion carries provenance; every classification carries lineage; and every plan execution writes back into knowledge with full audit-grade traces.

In WunderOS, customer agents run unchanged. Agentic frameworks issue native primitives unawares. WunderOS intercepts them invisibly, where it can provably improve upon them, answering them as syscalls. No LLM calls in any internal hot path. Agentic frameworks are the new userland.
Unification

One binary-vector substrate absorbs data streams that otherwise demand separate stores. All become Pentads; all participate in the same bind/bundle/resonate algebra.

  • Agent exhaust: observations, tool outputs, session logs.
  • Enterprise facts: RDBMS, ERP, CRM, HRIS. See §4 (Institutional).
  • Dense embeddings: what a vector database (HNSW, IVF-PQ) would hold.
  • Multimodal features: images, audio, via learned VSA projectors.
  • Case-based analogies: relational patterns, reasoning cases.
Principle

LLM Minimality. Every primary path is LLM-free. Frontier calls are a fallback, never the default. They decay as per-tenant small models distill from them. Each is opt-in, metered, and recorded in Lineage.

Core Operation

Single-hop resonance: ~100ns. Binding: ~200ns. Multi-hop CSR query and inference linear in beam width, not query depth—a 10-hop query costs the same as a 3-hop query. 16,384-bit binary vectors, AVX-512 Hamming distance. No GPU required.

1. A Closed Loop System▲ Contents

Mandate · Closed Loop Invariant · Subsystems · Three Axes
Mandate

WunderOS is an operating system for AI agents.

We began with Wunderblock, the agentic memory subsystem. A binary-vector substrate unifies vector and graph retrieval. Three properties distinguish it, none using an LLM in any path: deterministic retrieval and ingestion; deterministic governance and lineage; and deterministic associative memory via VSA/HDC.

Subsystems
Name Status Description
Agentic Memory Pre-Release Wunderblock. VSA substrate, six memory tiers, multi-hop ZRP inference. See §2–§4.
Native Agent Execution Internal Framework calls as syscall ABI. BEAM-native customer-agent runtime via Elixir-Volt / OpenBeam.
Agentic Planning In Progress zg-planner: HTN/CBR decomposition over Pentads, OWL-RL preconditions. Brass Loom executor and plan ledger landed; compensation on abort. See §7–§9.
Deterministic Runtime In Progress Simulated clocks, VOPR-style fuzzing, replayable sessions. Time is a first-class capability.
Invariant

WunderOS is a closed-loop system by construction. Every subsystem that touches memory, agents, policy, or retrieval is decomposed as plant + sensor + controller + actuator. Missing any element means the loop is open and the subsystem is incomplete. This is the structural difference that separates WunderOS from the LLM-wrapper plumbing shipped by other systems.

The LLM Bracket

LLMs are inherently open-loop: one-shot input → output. KV cache, attention patterns, and gradients are not formally observable. WunderOS does not reach inside them and does not claim internal observability of their workings.

Instead, every LLM interaction is wrapped in a closed loop at the I/O boundary. Trace events and vaccine assertions serve as the sensor; gateway policy, vaccine category match, and execution-harness checkpoints serve as the controller; WAL mutation, policy patch, and retry-replay-reject serve as the actuator.

Control Formalism

Ramadge-Wonham supervisory control (1989) is the dominant framework. LLM tokens, customer input, and clock ticks are uncontrollable events. Tool dispatch, memory commits, network egress, and vaccine-gated emission are controllable events. The supervisor observes event strings and prevents controllable events per specification.

RW guarantees a unique maximally permissive supervisor for any (plant, spec) pair: minimum necessary restriction, not an allowlist. Hybrid automata cover subsystems mixing discrete events with continuous state—memory decay, latency EMAs, bench trends. Classical PID does not apply.

Failure Modes

Control theory names the failures closed loops exhibit. Every new subsystem design bounds each.

  • Oscillation. Controllers fight over shared state. Obligation: convergence proof or bounded frequency.
  • Integral windup. Arrival outruns processing. Obligation: rate-limit, priority queue, or triage path.
  • Sensor saturation. Signal loses discrimination. Obligation: sensor diversity and recalibration.
  • Deadband. Thresholds hide drift below trigger. Obligation: prefer continuous sensors.
  • Drift. Open sub-loop silently accumulates error. Obligation: the loop closes.
  • Latency instability. Sensor lag induces overcorrection. Obligation: name the lag explicitly.
Corollary

Agent-facing UX is a supervisory grammar. Every tool gate, memory scope, HITL approval, vaccine manifest, and policy rule is a specification expression over the plant's controllable events. Harness engineering is supervisor-UX design.

Three Axes

Agent control has three axes, all grounded on the Pentad substrate. Datalog answers which facts are derivable; Wunderlog and ZRP evaluate. Supervisor answers which actions are permissible (see the closed-loop formalism above). Planner answers which actions are chosen by HTN synthesis with case-based retrieval over Pentads.

The three compose without impedance mismatch. They share one predicate vocabulary. An HTN method, a Datalog rule, and a supervisor specification are syntactically interchangeable views on one logic surface. A fourth axis is rarely the answer. Concerns that do not fit derivable / permissible / chosen are execution, observation, or storage; they belong elsewhere.

DATALOG What's derivable? Wunderlog · ZRP SUPERVISOR What's permissible? shield · contract PLANNER What's chosen? HTN · CBR
Figure 1-1. Three orthogonal axes of agent control · Composable because they share one predicate vocabulary
Part 1. The Memory Plane

2. Wunderblock▲ Contents

Agentic Memory Subsystem · Vector Symbolic Architecture · D=16,384
Subsystem

Wunderblock is the agentic-memory plane of WunderOS, and the first plane published here. A binary-vector substrate unifies vector and graph retrieval. Three properties distinguish it, none using an LLM in any path: deterministic retrieval and ingestion; deterministic governance and lineage; associative-memory semantic effects including similarity-preserving retrieval, holistic representation, and graceful degradation. This section covers the physics. §3 covers the Pentad cognitive primitive. §4 covers the six-tier memory model. The compute plane follows in §5. The wire interface lives in Part 3.

Encoding

All knowledge is encoded as 16,384-bit hypervectors using Binary Spatter Codes. Three operations are defined: binding (XOR), bundling (saturating addition), and search (Hamming distance). All other operations compose from these.

Components
  • VSA/HDC: Binary Spatter Codes (BSC), D=16,384.
  • Codebook: BLAKE3 hash → deterministic binary vector.
  • Query: ZRP beam-search, multi-hop, K-scaling.
  • Temporal: MTL+ metric operators over bounded intervals (Once, Historically, Prev, Since, Next, Eventually, Always).
  • Storage: 4KB WaxRows, 128KB WaxBanks, O_DIRECT via io_uring.
  • Concurrency: Lockless SWMR, CAS loops, no OS mutexes.
Query Model

The VSA locates the neighborhood; classical methods extract individuals. Superposition serves as an index, not an answer format.

3. The Pentad▲ Contents

Subject · Predicate · Object · Context · Lineage
Primitive Unit

The primitive unit is the Pentad: (Subject, Predicate, Object, Context, Lineage).

SPO defines the graph edge. Context scopes it temporally, spatially, or situationally. Lineage records provenance: agent signature, source document, derivation chain. Binding order is non-commutative; bind(O, bind(P, S)) and bind(S, bind(P, O)) produce distinct vectors.

PENTAD(7)               WunderOS Cognitive Substrate                PENTAD(7)

NAME
       pentad — five-slot cognitive fact primitive

SYNOPSIS
       bind(L, bind(C, bind(O, bind(P, S))))

DESCRIPTION
       The primitive unit of Wunderblock, the memory subsystem
       of WunderOS. Each component
       is a 16,384-bit binary vector (Groove) encoded via BLAKE3.

       S, P, O    Graph skeleton. Topology. What connects to what,
                 in which way. Non-commutative.

       C         Context. Temporal, spatial, or situational scope.

       L         Lineage. Agent signature, source doc, derivation.

OPERATORS
       XOR       Binding. Reversible. Non-commutative under PathHD.
       MAJ       Bundling. Saturating addition. Superposition.
       HAMMING   Similarity. One SIMD cycle. O(1) resonance.

INVARIANTS
       • SPO is the graph edge. [C,L] are aspect modifiers.
       • The (P,O) fingerprint in sys_id ignores C and L.
       • ZRP peels L, then C, then extracts O via Aspect-O.
       • Novelty/dedup operates on SPO core, not full fact.

SEE ALSO
       zrp(7), waxrow(5), honeycomb(7), lexicon(3)

HISTORY
       First described in PL-WOS-001-0. Based on work by
       Kanerva (1988), Plate (2003), Gayler (2004).

Pentad Labs                      2026-04-21                      PENTAD(7)
Figure 3-1. Pentad binding structure · See zrp(7), waxrow(5)

4. Memory Tiers▲ Contents

Six tiers · Different physics per tier · Fact flow
Tier Model

Facts flow through six memory tiers. Each tier has different retention, query physics, and storage characteristics.

Compliance (Ring-0)
Working
Episodic
Procedural
Semantic
Institutional
Figure 4-1. Compliance encompasses all tiers · Institutional feeds in orthogonally
Tier Specs
Tier Description
Working 16 banks × 31 facts, i8 accumulators. Novelty-gated. Transient.
Episodic 4KB WaxRows, O_DIRECT NVMe. ULID, provenance DAG, (P,O) fingerprint.
Semantic Immutable WaxBanks. Tier-1 axioms. Noise recovery oracle.
Procedural Goal-sequence bindings × 1024. Exponential-decay. Shadow Agent habits.
Institutional Systems of record compiled to Pentads. Demand fetch primary, bulk sync cold start.
Compliance Policy vectors. Gram-Schmidt nullification. Amplitude overdrive. Pre-LLM.
Query Physics

Single-hop similarity uses Honeycomb resonance probes. Multi-hop inference uses ZRP beam-search with Datalog evaluation. Query patterns and K values differ per tier.

Part 2. The Compute Plane

5. The Compute Plane▲ Contents

Herzschlag · Grafiklog · GraphBLAS-aligned semi-ring kernels
Plane

Wunderblock answers what is memorialized. Herzschlag answers what is computable over it—the second plane of WunderOS, and the second published here. Memory without compute is an archive; the loop closes only when the substrate runs analysis over its own contents without surfacing them first. This internal analysis is the quilting point at which the substrate reads itself to defer its own termination.

Herzschlag

A systolic, SIMD-accelerated compute core in Zig. GraphBLAS-shaped kernels—semi-ring matrix–vector and matrix–matrix products (mxv, mxm, spmm) over CSR adjacency—run as BEAM-managed resource pools: lockless, cache-aligned, no GPU. The semi-ring selects the computation: Boolean for reachability, min-plus (tropical) for shortest paths, arithmetic for rank, and so on. One kernel surface, many algorithms. The GPU's objet petit a without the power bill.

Grafiklog

The graph-analytics surface on Herzschlag. Classical graph algorithms—reachability (BFS, SSSP, connected components, transitive closure), rank and centrality (PageRank, Laplacian), order and cycles—alongside hypergraph-native operations (dual, line graph, k-skeleton, k-core) that the Pentad's five-ary structure requires and a binary graph cannot express without lossy projection. Reached from Wunderlog as a graph atom: no separate API, no separate store.

Conformance

For every operation with a GraphBLAS-shape equivalent, Grafiklog output matches SuiteSparse row by row, checked continuously against an independent oracle. Substrate's VOPR-like determinism guarantees hold here as in Wunderblock memory: same graph, same query, same result.

6. Standing Queries▲ Contents

∇ Shadow Lease · Incremental evaluation · Conformal bound
The Lease

An agent does not ask the same question twice. It registers the question once and is told when the answer changes. A shadow lease is a registered standing query with three operations: register and receive a handle, read the current folded view, revoke. The query is a full Wunderlog query, not a smaller subscription language. Any join, recursion, temporal bound, or similarity match a one-shot query expresses, a lease expresses, since standing is an orthogonal modifier over the same planner. The narrow fixed-shape probe the substrate already had is the degenerate case, folded in unchanged.

Cost of the Change

A lease compiles to an incremental circuit over signed multisets, in the manner of DBSP. Each operator consumes a change and produces a change, so the work on each write tracks the size of the change, not the size of the answer. A retraction is a write of negative weight and propagates by the same arithmetic as an assertion. The join probes key-indexed traces rather than scanning; recursion feeds its own output back as a delayed input and re-evaluates only the layers a change reaches.

Determinism

Every change and every read carries the substrate epoch it reflects, the logical clock of §1, so a standing query is replayed exactly rather than merely re-observed. The circuit is clean-room Gleam. Correct behavior is defined by an offline conformance oracle that generates frozen change-stream fixtures and is never linked or shipped, the same discipline the compute plane uses against SuiteSparse (§5).

Approximate Operators

Similarity and optimal-transport matches are approximate and carry a false-negative risk: a missed match is a lease that never fires and a failure no one sees. A calibrated correctness layer bounds it. Each result is tagged fast-probabilistic or exact-certified, and an online gate, calibrated to the lease's recall target, decides which results escalate to the exact matcher. A compliance lease sets recall to one, every result escalates, and the deterministic path is the limiting case of the same mechanism.

Status

The exact-relational core is implemented and tested: the lease API, the change-stream representation, the circuit with join, distinct, and recursion, the conformance oracle, and the calibrated layer on the fixed-shape lease. The approximate operators rest on the vector primitive (PLRN-001) and the structured-memory certification path and are in progress. The architecture is ADR-048; a fuller treatment is in PLRN-010.

Part 3. The Runtime

7. The Planner▲ Contents

zg-planner · HTN decomposition · Case retrieval · OWL-RL preconditions
Subsystem

Wunderblock answers what is memorialized; Herzschlag answers what is computable; the planner answers what is chosen—the third axis of §1, given here at the altitude of the memory plane. The planner is zg-planner. It runs over the Pentad substrate rather than beside it: plans are facts, methods are facts, preconditions are queries. The planner keeps no store of its own.

HTN Decomposition

A goal is reduced by recursive method application. A method names a task, the subtasks it expands to, and the conditions under which it applies. Decomposition proceeds top-down until every leaf is a primitive action the executor can actuate. Methods are stored as Pentads in the procedural tier and carried in a durable, write-ahead-logged per-agent method store. The architecture is fixed in ADR-025 and ADR-026.

Case Retrieval

Method selection is associative, not enumerative. A goal vector resonates against the method index and returns candidate methods by Hamming proximity in one SIMD pass—the same physics the memory plane uses for recall. The index supplies the candidates; the precondition oracle filters them.

Preconditions are Queries

A method's preconditions are decided by Sajak, an OWL-2 RL closure computed over the Datalog axis. The planner does not hard-code applicability; it asks whether a precondition is derivable from current memory under the ontology, then admits or rejects the method. The logic surface of §1 is load-bearing in planning, not adjacent to it.

Status

The decomposer, the durable method store, and the Sajak precondition closure are implemented and tested; the architecture is ratified (ADR-025, ADR-026). The live path from a customer agent's goal through decomposition to a committed plan is in implementation. The plan, once committed, is run by the Loom.

8. The Loom▲ Contents

Shadow Agents · Plan Ledger · Saga Rollback
Shadow & Customer Agents

Every customer-owned agent (CA) runs paired with a WunderOS-native, supevistory Shadow Agent. The Shadow Agent observes the customer agent's events, evaluates each step against contract, and gates emission. Shadow Agents are the productized supervisor axis: deterministic, CPU-focused, Erlang BEAM-back concurrency, resilience. The Ramadge-Wonham specification surface from §1 is exposed as a runtime peer, not buried in the harness; supervisory logic ships, deploys, and versions like any other artifact.

The Supremal

Each Shadow Agent enforces a Supremal: the synthesized supervisor for its contract. The Supremal is the supremal element of the policy lattice in RW theory; the unique maximally permissive supervisor for a given (plant, spec). Minimum restriction, never more nor less. Specs are written in Wunderlog and versioned like code; static synthesis of a fresh Supremal on change is specified in ADR-032. The aim is audit-grade, verifiable supervisors rather than hand-coded gates.

Plan Ledger

Plans are not transient. The planner emits steps as Pentads [(precondition, action, postcondition, compensating action, lineage)] and appends them to the plan ledger, an ordered durable record. Agents do not act from in-context plans. They act from committed ledger entries. Execution is replayable; pauses are resumable; the planner / executor split is clean. The planner writes. The executor reads. The ledger is the contract.

Saga Rollback

When a step's contract fails (Shadow Agent veto, tool error, vaccine trigger), the executor enacts the failed step's compensating action and aborts the invocation under a durable, write-ahead-logged decision. Multi-step unwinding—walking the ledger backward to compensate every prior committed step until the plan reaches a known consistent state—is specified as Sagenbaum (ADR-063). Forward and rollback are one primitive seen from opposite directions; the ledger is the axis of symmetry.

PLAN LEDGER SAGA ROLLBACK SHADOW AGENT contract observer s1 s2 s3 s4 c3 c2 c1
Figure 8-1. Forward execution commits steps to the plan ledger under Shadow Agent oversight · Contract failure at s4 enacts compensation; multi-step unwind to a consistent state is the Sagenbaum design (ADR-063)

9. Compensation▲ Contents

Sagenbaum · Two layers · Per-tenant executor
Two Layers

The Loom (§8) enacts rollback; this is the architecture under it. A compensation is the inverse of a forward action, and a saga runs compensations in reverse on failure. WunderOS splits the saga in two. A per-agent coordinator, inside the Shadow Agent, formulates each forward action with its inverse, because that formulation needs the agent's intent and exists only while the agent is live. A per-tenant executor, on the dispatcher bus, holds the inverses and fires them. The executor outlives any one agent, because a compensation timer runs for hours to weeks while a Shadow Agent hibernates and is torn down on disconnect.

Held Until Commit

A step's compensation is held until the whole plan commits, not discarded when its own step succeeds, because a later step's failure must still be able to undo this one. The held compensations form a tree that unwinds last-in-first-out on failure and retires all at once only on a terminal success. Commit is a property of the plan, not of a step.

Triggers are Leases

A compensation fires when a condition becomes true, and the condition is a standing lease (§6) over a temporal expression, pushed from the write path rather than polled. A deadline is a lease over a clock predicate that becomes true at expiry, so a timer weeks out and a tool call milliseconds out are one mechanism. A supervisory verdict that blocks an action already past the boundary is itself a trigger, so the customer needs no rollback logic of its own.

The Ledger is Never Edited

A compensation does not delete what it undoes. An immutable forward log records what was committed; a separate working memory is where compensations take effect, and it is reconstructable from the log. A compensation references, by address, the action it reverses, which is what makes it auditable, in the manner of audit-grade provenance (PLRN-006). Eviction is reframed the same way: discarding a fact under pressure is a forward action, and re-ingesting it from the log is its compensation.

Status

The design is adopted (ADR-063) and the reference implementation is landing in slices: the registration schema, the dispatcher protocol, the durable segment, trigger evaluation over leases, and the eviction reframe. The interim guarantee is best-effort compensation, decoupling rather than linearizability; provable deterministic rollback waits on the clock and simulation harness of §1. Cross-tenant triggers and a runtime limit on compensation cascades are open. A fuller treatment is in PLRN-011.

10. The Interface▲ Contents

Wunderlog · Natural Language Transducer · Datalog variant
Wunderlog

The native query language is Wunderlog, a Datalog variant optimized for LLM emission—agents produce well-formed queries without prompt engineering. A request body is a squirt: one or more scopes, each opened with WZ:: and closed with ETX; the squirt ends with EOT. Temporal operators map to MTL+ via Unicode glyphs with ASCII aliases.

N-ary Relations

Arity greater than 2 is supported by the ⟪⟫ role-binding operator in the O slot. K ≤ 5 produces resonance in the 0.37–0.50 range. K ≤ 10 is the practical ceiling. Higher arities require decomposition.

WUNDERLOG GRAMMAR                                  EBNF (v4 wire form)

<squirt>         ::= <scope>+ "EOT"
<scope>          ::= "WZ::" <tiers>? <modifier>? <item>* <end>
<end>            ::= "ETX" | "-30-"

<tiers>          ::= <tier_glyph>+ | "[" <tier_glyph>+ "]"
<tier_glyph>     ::= "ε" | "σ" | "ι" | "ω" | "λ" | "κ" | "Ω" | "⏚"

<item>           ::= <statement> | <squirt_block> | <rule>
<squirt_block>   ::= <label> "{" <tiers>? <modifier>? <statement>* "}"
<label>          ::= [a-z][a-zA-Z0-9_]*

<statement>      ::= <pattern> <modifier>?                  bare = read
                   | <action> <modifier>?
                   | <statement> <disj> <statement>

<action>         ::= <linda_op> "(" <pattern> ")"
<pattern>        ::= <pentad> | <temporal_expr>
<pentad>         ::= "(" <term> <term> <term> ")"
                   | "(" <term> <term> <term> <term> <term> ")"
<temporal_expr>  ::= <temporal> "(" <pentad> ")"

<rule>           ::= <atom> "(" <variable>+ ")" <arrow> <pentad>+
<arrow>          ::= "⇒" | ":-" | ":implies"

<modifier>       ::= "|>>" ("bindings" | "pentad" | "proof")

<linda_op>       ::= "⇑" | ":out"           write / emit
                   | "⇓" | ":in"            destructive read / consume
                   | "⊢" | ":rd"            non-destructive read
                   | "⊶" | ":retract"       retract a prior fact
                   | "⊸" | ":revise"        supersede a prior fact

<temporal>       ::= "♦" | ":once"          past: at some point
                   | "■" | ":historically"  past: always been true
                   | "●" | ":prev"          past: true at t-1
                   | "↤" | ":since"         past: A since B
                   | "○" | ":next"          future: t+1
                   | "◇" | ":eventually"    future: park until
                   | "□" | ":always"        future: forever

<disj>           ::= ";" | "∨"

<term>           ::= <atom> | <ns_atom> | <variable>
                   | <wildcard> | <string>
<atom>           ::= ":" [a-zA-Z_][a-zA-Z0-9_]*          :alice, :knows
<ns_atom>        ::= <atom> ":" [a-zA-Z_][a-zA-Z0-9_]*   app:ships_to
<variable>       ::= "?" [a-zA-Z_][a-zA-Z0-9_]* | "?"   ? = anonymous
<wildcard>       ::= "_"
<string>         ::= '"' [^"]* '"'
<closure>        ::= <atom> "+" <integer>?              :knows+, :knows+3
Figure 10-1. Wunderlog v4 wire grammar (partial) · WZ:: opens scope, ETX closes (-30- human alias) · bare pentads are reads

11. The Handshake▲ Contents

Agent First Contact · Wire Protocol · Bootstrap Sequence
Protocol

WunderOS rejects JSON tool-calling envelopes. All HTTP requests carry Content-Type: application/x-datalog. The body is raw Wunderlog text. Authentication is Authorization: Bearer <token>. There is no REST resource model—every request is a Wunderlog statement evaluated against the bivectorspace.

Bootstrap

An agent begins by fetching the protocol primer from GET /agents.txt. After parsing, it completes the handshake by emitting a self-naming Pentad to POST /wunderlog:

Session Frame

A request body is a squirt—one or more scopes, each opened with WZ:: and closed with ETX; the squirt ends with EOT. The framing is telegraphic: -30- is the human-readable alias for ETX. A scope pins a copy-on-write snapshot of the named tiers for the duration of the scope.

  • ε episodic · σ semantic · ι institutional · ω working memory.
  • λ loom / procedural · κ compliance · Ω all tiers.
  • lineage ground (L-slot anchor).

Bare pentads (:S :P :O) are reads. / wrap writes and destructive consumes. Result modifier |>> selects bindings (default), pentad, or proof. Squirts are named lexical blocks: label { [tiers] |>> modifier … }.

POST /wunderlog HTTP/1.1
Host: api.pentad.ai
Authorization: Bearer sk-live-...
Content-Type: application/x-datalog

// Scope 1 — episodic + semantic. Writes, reads, nested squirt.
WZ::εσ
  ((:Agent_Procurement :status "online"))
  ((:Factory_1 app:ships_to :Warehouse_7))

  (:Factory_1 app:ships_to ?Dest) |>> pentad

  audit { σ |>> proof
    ((:User_Alice :has_role "Admin"))
  }
ETX   // -30- is the human alias

// Scope 2 — working memory. Prev-tick workflow check.
WZ::ω
  (:User_Bob :action "Payment")
  ((:User_Bob :action "View_Cart"))
ETX

// Scope 3 — episodic. Park on SSE, consume when Job_123 completes.
WZ::ε
  (((:Job_123 :status "Complete")))
ETX

// Rule (outside any scope): friends are knows-chains of length 2
friends(?X ?Y)  (?X :knows ?Z) (?Z :knows ?Y)

EOT   // end of transmission, release the line
Figure 11-1. Wunderlog on the wire (v4 wire vocabulary) · WZ::{tiers} opens a scope · ETX closes it (-30- is the human alias) · EOT ends the squirt
Operations
Glyph ASCII Operation
:out Write. Etches a Pentad or rule into the bivectorspace.
:rd Read. Non-destructive. Binds variables against matching facts.
:in Consume. Destructive read. Fact is removed on match.
:infer Infer. Transitive traversal up to H hops.
:explain Reflect. Returns fuzzy NL context for a complex fact.
:nl Cast. Projects unstructured text into the vectorspace via LSH.
:ns_bind Mutate. Invents a new namespace concept and expands the ontology.
Lifecycle

Emitted facts do not remain static. Working Memory holds active context in superposition. Sleep cycles crystallize stable patterns into Episodic. Repeated invariants promote to Semantic (immutable). Procedural bindings are revisable action-trigger rules evaluated by Shadow Agents.

Error Shapes

Failures return the operator. ↯(:syntax, :parse_failure) indicates malformed Wunderlog. ↯(:hardware, :hop_limit_exceeded) means the 32-hop traversal ceiling was hit. ↯(:semantics, :unbound) means the predicate is unknown—expand the ontology with and retry.

Transport

Responses are newline-delimited Wunderlog assertions, not JSON. HTTP POST for synchronous evaluation. SSE for parked forward-MTL queries ( / :eventually). WebSocket for persistent bidirectional streams. The wire format is identical in all cases.

12. Implementation▲ Contents

Zig + Gleam/BEAM · NIF bridge · All operations reduce to XOR, popcount, threshold
Cognitive Plane

Implemented in Zig. SIMD dispatch covers AVX-512, NEON, and scalar fallback. WaxBanks are page-aligned at 128KB—32 O_DIRECT pages. Storage uses O_DIRECT + io_uring for zero-copy NVMe access. Concurrency is lockless SWMR with CAS loops and atomic pointer swap over a 64-generation retired ring. Hot paths perform no heap allocation.

Control Plane

Implemented in Gleam on the BEAM. Provides HTTP gateway, actor supervision, AST parsing, query engine, and symbol-vector mapping. A NIF shared library bridges Gleam to Zig through Erlang’s C-ABI.