How nerdsane/temper works
1. Repository shape
This is a Rust-first monorepo for the Temper kernel plus supporting SDKs, UI, reference apps, and generated WASM modules. The center of gravity is the crates/temper-* workspace; everything else is either app content (os-apps, reference-apps), developer tooling (scripts, .claude, docs), or client-side surfaces (packages/temper-sdk-ts, ui/observe).
2. Core product boundary
Temper is a verified runtime for agent-built systems. The key boundary is between:
• specification: what the system is allowed to do
• runtime: what actually executes
• governance: what requires human approval
• observation: what was done and why
The README’s “Specs → Verify → Deploy” flow is the architectural spine.
3. Specification and type system
crates/temper-spec is the front door for domain definitions. It parses I/O Automata specs (*.ioa.toml) plus CSDL schemas (*.csdl.xml) and compiles them into an internal state-machine model. This is the canonical source for behavior, entity types, transitions, and cross-invariants, and it drives both verification and runtime generation.
4. Verification pipeline
crates/temper-verify enforces the contract before deployment through a four-stage cascade: symbolic checks, model checking, deterministic simulation testing, and property-based testing. This is where specs are proven sane, reachable, and robust against randomized or fault-injected execution. The result gates what can be deployed to the live system.
5. Execution runtime
crates/temper-runtime is the generic actor/runtime layer: actors, mailboxes, persistence hooks, scheduling, supervision, and system/tenant isolation. crates/temper-jit sits beside it to build and hot-swap transition tables, so the runtime can keep running while the compiled behavior changes. This is the “live machine” that executes verified transitions.
6. Server/kernel layer
crates/temper-server is the main HTTP kernel. It exposes the API surface, OData endpoints, routing, request context, entity dispatch, idempotency, and trigger handling. It also owns most of the platform-specific application logic: entity actors, state management, projection/query paths, webhook delivery, secrets, blob handling, and workflow tracing.
7. Data access and storage backends
The server is storage-abstracted through backend crates:
• crates/temper-store-postgres for the canonical Postgres platform store
• crates/temper-store-turso for Turso/libSQL
• crates/temper-store-redis for distributed mailbox/cache concerns
• crates/temper-store-sim for deterministic in-memory simulation
This makes “live storage,” “simulation,” and “test” variants interchangeable at the platform boundary. Postgres appears to be the primary production persistence path.
8. Authorization and governance
crates/temper-authz implements Cedar-based policy evaluation. The server uses this to decide whether an action is allowed for a given principal/resource/context. Denied requests become pending decisions, and the CLI’s temper decide flow turns human approvals into hot-loaded policy updates. That means governance is not external paperwork; it is part of the runtime control plane.
9. WASM integration boundary
crates/temper-wasm and crates/temper-wasm-sdk define the sandbox for untrusted or user-authored integration logic. WASM modules run with host functions, telemetry, streaming support, and bounded resource budgets. The server’s state-dispatch and trigger subsystems invoke these modules inline or as background work, which is how app-specific behavior is plugged into the verified core without giving it direct access to the kernel.
10. Query and API shape
crates/temper-odata handles OData path/query parsing, $filter, $select, and related read semantics. It is the typed query boundary exposed to clients and SDKs. crates/temper-sdk and packages/temper-sdk-ts are thin client facades over that HTTP/OData surface, while the server enforces authz and projection rules underneath.
11. Observability and evolution
crates/temper-observe and the server’s observe/* modules provide tracing, metrics, wide events, and trajectory capture. crates/temper-evolution stores and analyzes evolution records and feedback loops. This makes runtime behavior auditable and also feeds the platform’s self-improvement workflows, especially in the directed-evolution app and related OS apps.
12. Operator and integration surfaces
crates/temper-cli is the main operator entrypoint for serving, verifying, deciding, initializing, installing, and bridging MCP. crates/temper-mcp exposes a stdio bridge for agent clients. ui/observe is the human-facing observability console. crates/temper-platform and the os-apps/* directories contain higher-level packaged applications built on the kernel, showing how the platform composes into full products.
13. End-to-end flow to draw
A useful architecture diagram should show: spec authoring and app packages feed verification; verification gates deploy into the runtime; runtime executes transitions and WASM triggers; the server exposes typed OData/HTTP APIs; authz sits in front of mutation and sensitive reads; storage persists state/events/projections; observe captures traces and evolution records; CLI/MCP/SDKs are the external entrypoints.
14. Important structural constraint
The repo is intentionally split so that behavioral truth lives in specs, execution lives in runtime/server, and policy lives in Cedar—not in ad hoc application code. That separation is the main architectural boundary, and most crates exist to preserve it while still allowing hot reload, simulation, and agent-driven extension.
Main entry points: temper-server Server · temper-spec Spec · temper-cli CLI · temper-wasm WASM
Components 23
Core kernel
Spec, verification, runtime, server, and extensibility boundary.
- Spec · Parses IOA and CSDL into the canonical automaton/model used as behavioral truth.
crates/temper-spec - Verify · Runs symbolic checks, model checking, simulation, and property-based tests before deployment.
crates/temper-verify - Runtime · Generic actor system with mailboxes, persistence hooks, scheduling, and supervision.
crates/temper-runtime - JIT · Builds and swaps compiled transition tables while the runtime stays live.
crates/temper-jit - Server · Main API kernel for routing, entity dispatch, state management, triggers, projections, blobs, and workflow execution.
crates/temper-server - OData · Parses typed read paths and query semantics such as filter and select.
crates/temper-odata - WASM · Runs untrusted integration logic with host functions, telemetry, streaming, and bounded resources.
crates/temper-wasm - WASM SDK · Host-facing SDK for WASM modules to access context, streaming, and host APIs.
crates/temper-wasm-sdk - Observe · Tracing, metrics, wide events, trajectory capture, and observability storage helpers.
crates/temper-observe - Evolution · Stores and analyzes evolution records, insights, and feedback loops.
crates/temper-evolution
Storage & policy
Persistence backends and authorization/governance.
- Authz · Evaluates authorization and supports governance decisions and policy generation.
crates/temper-authz - Postgres store · Primary production persistence path for platform state, events, projections, and metadata.
crates/temper-store-postgres - Turso store · Alternative storage backend for platform persistence and query paths.
crates/temper-store-turso - Redis store · Distributed mailbox and cache support for runtime coordination.
crates/temper-store-redis - Sim store · In-memory simulation backend for deterministic testing and verification flows.
crates/temper-store-sim
Clients & UX
Operator, SDK, and human-facing surfaces.
- CLI · Serves, verifies, decides, initializes, installs, and bridges MCP for operators.
crates/temper-cli - MCP · Agent-facing stdio bridge into the Temper runtime and control plane.
crates/temper-mcp - Rust SDK · Rust client for Temper HTTP and OData surfaces.
crates/temper-sdk - TS SDK · TypeScript client for the Temper API surface.
packages/temper-sdk-ts - Observe UI · Human-facing observability and governance console.
ui/observe
Apps & examples
Packaged Temper apps and reference systems built on the kernel.
- OS apps · Temper-native application packages built on the kernel and specs.
os-apps - Reference apps · Example applications demonstrating Temper patterns and integrations.
reference-apps
Tooling & modules
Build, integration, and standalone WASM/module artifacts.
- WASM modules · Standalone compiled WASM artifacts used by apps and experiments.
wasm-modules
Connections 30
- Spec → Verify: compile+prove · Specs are parsed and verified before deployment.
- Verify → Runtime: gate deploy · Verified behavior is allowed into the live runtime.
- Spec → Server: model input · The server consumes canonical spec/model definitions.
- Spec → JIT: compile tables · Specs drive transition-table generation for hot swapping.
- JIT → Runtime: swap behavior · Compiled behavior is loaded without stopping the runtime.
- Runtime → Server: execute actors · The server hosts entity actors and runtime-driven workflows.
- Server → OData: serve reads · Read/query semantics are exposed through OData paths.
- Server → Authz: authorize actions · Sensitive reads and mutations are policy-checked.
- Server → WASM: dispatch triggers · State transitions and triggers invoke WASM modules.
- WASM → WASM SDK: guest host api · Modules depend on the sandbox SDK for host interaction.
- Server → Postgres store: persist live state · Primary persistence path for production data.
- Server → Turso store: alt backend · Secondary storage backend for compatible deployments.
- Server → Redis store: mailboxes/cache · Redis supports distributed coordination concerns.
- Server → Sim store: simulate · Deterministic simulation uses the in-memory backend.
- Server → Observe: emit traces · Runtime activity is captured for observability.
- Server → Evolution: record feedback · Evolution data and insights are materialized from runtime activity.
- CLI → Verify: run verify · Operators can invoke verification from the CLI.
- CLI → Server: serve kernel · CLI boots and manages the kernel process.
- CLI → Authz: decide · Human decisions update governance state and policies.
- CLI → MCP: bridge agents · CLI exposes an MCP bridge for agent clients.
- Rust SDK → Server: http client · Rust SDK consumes the server API surface.
- TS SDK → Server: api client · TypeScript SDK targets the same HTTP/OData surface.
- Observe UI → Server: inspect system · The web console reads from the platform API and observability feeds.
- OS apps → Spec: define apps · Packaged applications contribute their own specs and policies.
- OS apps → WASM: ship modules · OS apps include app-specific WASM modules.
- Reference apps → Spec: demonstrate · Reference systems provide example specs and patterns.
- Reference apps → Server: exercise kernel · Reference apps run through the server/runtime stack.
- WASM modules → WASM: execute in sandbox · Standalone modules are loaded by the WASM engine.
- Observe → Observe UI: visualize · Observability data is presented in the UI console.
- Evolution → OS apps: drive loops · Evolution records inform higher-level OS app workflows.