Elements
The closed set of eight semantic primitives forming the entire OKEngine backend model.
Forty backend concerns collapse into eight semantic primitives. An element earns its place only with irreducible physics.
Closed primitive set
There is no ninth element. Every backend capability belongs to one of the eight elements. New infrastructure creates a protocol driver or plugin, preserving a small mental model.
Elements define the model.
Plugins extend the model's capabilities.
Drivers connect the model to infrastructure.
Providers and Recipes choose where that infrastructure runs.The Structural Anatomy
Every backend concern is mapped across three conceptual tiers:
| Tier | Question Answered | Definition & Scope |
|---|---|---|
| Elements | What is the thing? | The 8 closed primitives representing irreducible backend physics. |
| Capabilities | What can it do? | Explicit facets, triggers, and execution mechanics within each element. |
| Composition | What happens when they cooperate? | Emergent system properties (Realtime, Live Queries, Multi-Tenancy, Agents). |
The Eight Primitives
Flow
Behavior — on(Trigger) → Effects via fx. Unified endpoints, jobs, consumers, and durable sagas.
Signal
Data in motion — once, broadcast, and live with mandatory delivery physics.
Store
Data at rest — SQL, KV, files with image transforms, and search behind one handle.
Clock
Time — schedules, intervals, durable sleep, and deterministic time travel.
Gate
Permission to act — auth, tenancy, ABAC/RBAC, and rate limits at the trigger.
Vault
Protected knowledge — fail-loud secret contracts, dynamic config, and redacted values.
Channel
Reaching humans — email, SMS, WhatsApp, and push with built-in consent.
AI
Reaching machine intelligence — models, prompts, agents, and MCP tool boundaries.
See How They Compose
The closed elements compose into full backend capabilities:
| Composition Target | Formula | How It Works |
|---|---|---|
| Realtime | Store + Gate + Signal + Flow → Live Query | CDC changes re-checked against Gate RLS, streamed as SSE |
| Security | Gate + Store/RLS + Tenant + fx → Secure runtime | Tenant-isolated queries with least-privilege capability |
| Agents | MCP + Gate + OAuth + Flow → Agent-ready backend | Declared Flows exposed on :6535 behind auth confirmation |
| Operations | Manifest + Effects + Runs → Inspectable backend | Inferred effects feed Console (:6533) and wide-event logs |