Expand description
The supervisor (spec 3.2 §7.2).
A Kernel composes the background machinery adk-rust serve already builds (§6 D-9)
and adds a worker per queue class, the scheduler, the wake sources, the process table,
the event bus and the control plane:
| Kernel part | Built from |
|---|---|
| Workers | One DurableWorker per QueueClass, each with KernelConfig::worker_config: on_governance_refusal: Park (§10 S3), the class’s poll interval, the S1 WorkerHooks turned into KernelEvents, and the targets registered with KernelBuilder::agent (the harness runner as adk-rust and harness.goal), on KernelConfig::clock |
| Scheduler | DurableScheduler::new(schedules, runs).with_governance(..).with_clock(..), ticking every KernelConfig::scheduler_tick on KernelConfig::clock |
| Wake sources | KernelBuilder::wake_source, KernelBuilder::trigger and KernelBuilder::queue_ingress, routed by the WakeRouter (§7.4) |
| Approvals | StoreApprovalService::with_run_store, so a decision wakes the parked run; the service’s tick on the kernel’s clock for expiries |
| Kill switch | KernelConfig::governance: GovernanceControl::mirrored with a 250 ms poll on multi-replica (KernelConfig::mirrored_governance, K-I8) |
| Control plane | ControlPlane over KernelConfig::control (§7.11) |
/proc (feature proc) | KernelBuilder::ledger: a sink on the bus writes every event’s ledger row; the hosted runtime’s ProgressSource gets the ledger at start; with proc-baselines the maintenance tick enqueues the daily kernel.proc pass, and KernelBuilder::observation_audience puts a partition’s observations to a person as agenda questions (§7.10) |
Lifecycle: pause shuts each worker’s claim loop down and lets running
processes finish their attempt; drain suspends running processes at
their next checkpoint through S1’s suspend path, then shuts the loops down, and on
timeout aborts them so their leases lapse; stop also stops drivers and
closes the control plane. A SIGTERM is drain(30 s) then stop
(shutdown_on_signal). Nothing is lost on a hard kill:
leases expire and another claim resumes from the checkpoint.
freeze calls GovernanceControl::freeze_recorded; parking is the
worker’s (§10 S3), so every replica’s worker parks its own running processes
Waiting with ParkReason::Frozen as its mirrored control observes the freeze.
unfreeze calls unfreeze_recorded and wakes exactly the
freeze-parked processes (K-I21). The kernel registers itself as the
GovernanceController’s FreezeDelegate (§10 S4), so POST /api/admin/freeze parks.
Structs§
- Kernel
- The resident supervisor (spec 3.2 §7.2). Cloning shares the kernel.
- Kernel
Builder - Builds a
Kernel(spec 3.2 §7.2). - Kernel
Config - How the kernel runs (spec 3.2 §7.2).
- Kernel
Health - The kernel’s health (spec 3.2 §7.2): per worker, scheduler lag and store latency.
- RunNow
- What
Kernel::run_nowqueued. - Steering
- A message a running process holds for its agent’s next safe point (spec 3.3 §6 “steer”):
what
Kernel::steeranswers. - Worker
Health - One worker’s health (spec 3.2 §7.2).
Enums§
- Kernel
State - Where the kernel is in its lifecycle (spec 3.2 §7.2).
- RunNow
Target - What
Kernel::run_nowruns now.