AgentIdentity, mob
membership, spawn, lifecycle, wiring, flows, comms, coordination, and machine
authority. MobKit owns application-facing composition around that substrate:
startup, host desired-state providers, module routing and delivery, operational
policy, MobKit persistence projections, gateway and SDK transport, console
timeline projection, and operator UX.
Design principles
- One upstream runtime authority - MobKit invokes Meerkat mob operations; it does not become a second authority for membership, lifecycle, wiring, or session truth.
- Data at process boundaries - module and gateway communication uses typed serialized messages. In-process Rust hosts may use typed traits and builders without inventing a second wire contract.
- Projection, not authority - console rows, timelines, identity views,
and MobKit continuity records reflect runtime and host desired state. Their
persistence does not turn them into a shadow
MobMachine. - Deliberate gateway profiles - Rust library embedding, SDK-facing
rpc_gateway, and console/adminmobkit_gatewayshare a composition root but intentionally expose different authorities. - Fail closed - persistent storage slots, module capabilities, auth, access control, and signed remote contacts refuse missing authority instead of silently weakening the deployment.
High-level architecture
Gateway profiles
The binaries can both show a console, but that does not make them substitutes.
An SDK host launches
rpc_gateway. A console/admin deployment that does not
need the SDK callback plane uses mobkit_gateway.
Crate structure
The core Rust crate is organized around explicit boundary modules:identity_first/ directory is a host continuity layer, not the owner of
mob identity. It keys desired roster records, leases, and persistence bridges
by Meerkat AgentIdentity, then materializes or resumes members through
meerkat-mob.
Module boundary
The module boundary layer provides two communication paths:MCP path (core modules)
Core modules expose MCP tools. The boundary callscall_module_mcp_tool_json with a tool name and arguments, receives a JSON response, and parses it into the expected type.
Gating evaluation is an in-process runtime authority, not an MCP module tool.
The identity-scoped agent-memory APIs are also separate from this three-tool
module boundary.
This module-facing memory path is separate from MobKit’s identity-scoped agent
memory record layer under
memory/. The bundled hot record store is SQLite
with deterministic recall and staged write validation. Elephant is an optional
deeper backend, not the definition of all MobKit memory.
Subprocess path (custom modules)
For a generic custom module, the supervisor starts the configured process and reads its first stdout line. The line must be a valid normalized JSON event before the startup timeout. This one-shot boundary does not write a request to the module’s stdin.Event transport
The event transport merges two event sources: Events are ordered bytimestamp_ms, then event_id, then source. The tie
break is deterministic but does not give either source family priority.
Supervisor design
The supervisor distinguishes generic JSON-line subprocesses from MCP module probes:
These transitions describe startup supervision, not a claim that MobKit owns
Meerkat member lifecycle. Mob member state changes still go through the
Meerkat mob runtime.
HTTP composition
The runtime merges several Axum route families into one HTTP server:
Routers are merged into a single
axum::Router served on the configured port.
The runtime-mounted Flow Editor shares console authentication and applies its
own author/deploy access requirements. The standalone mobkit_flow_editor
binary has no access controller, while the dispatcher still keeps host deploy
sinks fail-closed unless explicitly granted.
Dependencies
External crates
Meerkat crates
Storage and persistence projections
MobKitStorageLayout is the single MobKit path authority. A
MobKitStorageProvider wraps or accompanies Meerkat’s realm storage provider
and opens the realm-wide MobKit stores for continuity, lease fencing, event
log, console timeline, metadata, blobs, agent memory, and schedule state.
Those stores are MobKit-owned projections and operational records; canonical
Meerkat session and mob state stay upstream.
Every persistent slot carries a DurabilityDeclaration. Startup must resolve
it to a durable backend, an explicitly declared ephemeral choice, or an error.
There is no silent in-memory fallback for persistent mode. Use the live-safe
mobkit/storage/doctor operation for diagnosis. Mutating migration and pruning
run offline through mobkit_gateway storage-migrate and storage-prune.
Security model
- Upstream machine authority - Meerkat admits mob identity, lifecycle, wiring, and session transitions. MobKit policy cannot bypass those machines.
- Trusted modules - only modules declared in trusted MobKit configuration are loaded.
- Authentication - JWT/OIDC validation and allowlists decide who reaches protected console surfaces.
- Optional ABAC - when enabled,
AccessControlleris deny-by-default with deny-overrides across console REST, JSON-RPC, and SSE. Admins are an explicit bypass and enabling without an admin set is rejected. - Non-ambient console credentials - mutation routes expect bearer tokens or explicit SSE/bootstrap tokens. Cookie-based hosts must add origin and CSRF protection.
- Signed remote contacts - TCP/UDS peers require real Ed25519 public keys; in-process wiring is authorized through the runtime identity map.
- Forged resolution detection - delivery validates routing resolutions against trusted store state.
- Rate limiting - delivery applies configured per-route fixed-window limits.
See also
- Modules — module configuration
- Unified runtime guide — bootstrap details
- Decisions — policy enforcement
- Meerkat architecture — the upstream agent and mob runtime
