Skip to main content

Module drivers

Module drivers 

Source
Expand description

Drivers: MCP servers run as supervised child processes under a manifest the user approved (spec 3.2 §7.7).

ItemSpec
EffectClass, DriverState§7.7, §7.6
DriverManifest, DriverSandbox, DriverLifecycle, DriverAccess, load_manifests (feature drivers)§7.7
DriverStore, DriverRecord, DriverPark, DriverIsolation (feature drivers)§7.7, §9.3, §13 Q8, Q9
DriverProcessTree (feature drivers)§7.7, §10 W1, K-I5
DriverSupervisor, DriverSupervisorBuilder, DriverProposal, DriverView, StandingRulePins (feature drivers)§7.7, K-I13, K-I14
DriverPolicy (feature drivers)§7.7, K-I9, K-I14

A driver’s lifecycle:

  1. Mount. DriverSupervisor::propose shows what the person approves — the command line, the partitions, the effect classes, the sandbox and the secrets it names — and DriverSupervisor::mount records the approval (kernel.driver.mounted). Nothing runs before it (K-I13).
  2. Start. Lazily when a partition’s agent lists the driver’s tools, or at mount for lifecycle = "eager". The stdio launcher runs the server under the OS sandbox where an enforcer exists and records Unsandboxed { reason } otherwise, with an environment cleared to an allowlist and each secret:// reference minted by the credential broker into a file only the user can read. On Windows the server runs in a Job Object of its own, so ending the driver ends every process it started (spec 3.2 §10 W1). The first listing after approval pins each tool’s declaration digest.
  3. Supervise. The MCP manager’s status channel (spec 3.2 §10 T1) becomes KernelEvent::Driver events and kernel.driver.* records; a crash restarts with the manifest’s backoff.
  4. Stale. A tool whose declaration differs from its pin is stale: the harness’s standing rules pinned to the old declaration stop matching, DriverPolicy asks before every call of it, and the driver is NeedsReapproval (K-I14) until DriverSupervisor::reapprove pins the new declarations and carries the re-approving person’s rules forward.
  5. Park. A call the server answers with a question ends as a held call: the DriverPark is stored beside the approval as the run’s checkpoint, the run parks, and the decision — after any restart — dispatches the call again, which re-issues it with the answers (spec 3.2 §13 Q9).

Structs§

DriverAccess
What a sandboxed driver may reach besides the system’s read-only paths (spec 3.2 §7.7).
DriverManifest
An MCP server run as a supervised child process, as the user approved it (spec 3.2 §7.7).
DriverPark
A driver tool call parked on its server’s input request, persisted beside the approval that asks the person: the run’s checkpoint payload (spec 3.2 §7.7, §13 Q9).
DriverPolicy
Decides calls to driver tools by the approved manifests (spec 3.2 §7.7).
DriverProposal
What the person approving a mount sees (spec 3.2 §7.7): the command line, the partitions and the effect classes, with the sandbox, its access and the secrets the driver names.
DriverRecord
A mounted driver: the manifest the user approved, with what the kernel recorded since (spec 3.2 §7.7, §9.3, K-I13).
DriverSupervisor
The kernel’s supervisor of drivers: MCP servers run as child processes under the manifests the user approved (spec 3.2 §7.7).
DriverSupervisorBuilder
Builds a DriverSupervisor.
DriverView
A mounted driver and its current state, as GET /api/kernel/drivers lists it.

Enums§

DriverIsolation
How a driver’s process was isolated when it last started (spec 3.2 §7.7).
DriverLifecycle
When a driver’s process starts (spec 3.2 §7.7, the manifest’s lifecycle).
DriverProcessTree
What holds a driver’s process tree when it starts, so that ending the driver ends every process it started (spec 3.2 §7.7, §10 W1, K-I5).
DriverSandbox
How a driver’s process is isolated (spec 3.2 §7.7).
DriverState
A driver’s state on the event bus (spec 3.2 §7.6): its MCP server’s status, or NeedsReapproval once a tool’s declaration differs from the one pinned at approval.
EffectClass
What a driver tool does to the world, as its manifest declares it (spec 3.2 §7.7).

Constants§

DRIVER_SOURCE_PREFIX
The prefix of driver_source.
SECRET_SCHEME
The scheme of an environment value the credential broker resolves (spec 3.2 §7.7).

Traits§

DriverStore
The kernel’s store of mounted drivers and parked driver calls (spec 3.2 §7.7, §13 Q8).
StandingRulePins
Carries a person’s standing rules forward when a driver’s changed declarations are re-approved (spec 3.2 §7.7, K-I14).

Functions§

driver_of
The driver a ToolOrigin::source names, if it is a driver’s.
driver_source
The ToolOrigin::source of every tool driver id serves: driver:<id> (spec 3.2 §7.7).
load_dir
Reads every *.toml manifest in dir, in file-name order; an absent directory has none.
load_manifests
The manifests of the user’s drivers directory, each restricted by the workspace’s manifest of the same id (spec 3.2 §7.7: a project scope may only restrict).