Skip to content

2 Architecture

2.1 Roles

RoleResponsibility
ClientSends requests to a Hub and receives responses and notifications. Holds one token, which the Hub maps to one Principal.
HubOwns every Device. Loads Device Files, runs Drivers, the Safety Kernel, the confirmation queue, routines and the audit log. Answers Clients over the transports in Transports.
Safety KernelEvaluates every command in a fixed order (Safety). Issues a Grant only for a command that passes every check.
DriverSpeaks one protocol. Reads values and, given a Grant, applies one channel value, one action or the safe state (Drivers).
DeviceThe hardware or bridged system. It is described by its Device File and is never reached except through its Driver.

2.2 The one-hub model

  1. One Hub process MUST own every Device it serves. Only the Hub opens hardware.
  2. Every Client is a thin client of the Hub. A Client MUST NOT open a Device directly.
  3. Every command, from any source, MUST be evaluated by the Hub's Safety Kernel. Sources include Clients, routines, the Hub's own watchdog and the stop command.
  4. A Driver MUST NOT change hardware except by consuming a Grant issued by that Hub's Safety Kernel.
  5. Two Hubs MUST NOT open the same Device at the same time. The reference Hub takes an exclusive lock file per device port.

Because one Hub sees every command, rate limits, interlocks across Devices and watchdog budgets hold no matter which Client sent a command.

The reference Hub also serves a REST API under /v1 for its dashboard and scripts. It calls the same Hub functions as the protocol, so behavior is identical. The REST API is not part of this specification.

2.3 One blocked and one granted command

The Device File for printer limits extruder_target to 260 degC and bed_target to 110 degC. A human named owner confirmed those limits on 2026-10-24. A print is running with the bed at 60 degC. An agent Client asks for a 300 degC nozzle and then for a 70 degC bed.

One blocked and one granted commandA client requests a nozzle temperature of 300 °C, and because the nozzle maximum is 260 °C the safety kernel blocks the request and the hub returns error -32010 LIMIT_EXCEEDED. The client then requests a bed temperature of 70 °C, every check passes, the kernel issues a single-use grant, the driver consumes the grant and sets the bed heater, and the hub returns a result.ClientHubSafety kernelDriverDevicehal/writenozzle 300 °Cevaluateblockedabove_maxerror -32010LIMIT_EXCEEDEDhal/writebed 70 °Cevaluatechecks pass,issue a Grantwrite bed_targetwith the Grantconsume itbed heaterto 70 °Cokdonedoneresultstatus done

The blocked command never reaches the Driver. The granted command reaches it exactly once, and the Grant cannot be used again.

2.4 MCP mapping

MCP stays the agent-facing interface. The reference MCP server maps its tools onto protocol methods.

MCP toolMethod
hub_statushal/initialize result
list_deviceshal/devices/list
describe_devicehal/devices/describe
readhal/read
read_manyhal/readMany
writehal/write
actionhal/action
dry_runhal/dryRun
plan_checkhal/planCheck
stop_allhal/stop
get_confirmation_statushal/confirmations/list
list_routineshal/routines/list
run_routine_dryhal/routines/dryRun
get_audit_loghal/audit/query

MCP tool results MUST carry the same error names, codes and messages as the protocol. Routine drafting, discovery and driver writer tools are MCP and REST only in this version.