Available on crate feature
harness-kernel only.Expand description
The agent kernel, the always-on form of the harness (spec 3.2 §8.2).
Everything adk-kernel exports: the Kernel supervisor and its
builder, the process table, wake sources, the event bus and the
control plane adk-rust up serves.
Available with feature: harness-kernel (included in enterprise and full)
§Example
use std::sync::Arc;
use adk_rust::kernel::{Kernel, KernelConfig, QueueClass};
let kernel = Kernel::builder()
.config(KernelConfig::default().with_app_name("ops"))
.run_store(Arc::new(adk_rust::InMemoryRunStore::new()))
.build()
.unwrap();
assert_eq!(kernel.config().queues, QueueClass::defaults());Modules§
- agenda
- The agenda: proactivity under control (spec 3.2 §7.5).
- agents
- Agents a person adds (spec 3.3 §5.7, §10 K7): by asking or by hand, kept by the kernel, hosted beside the primary agent, and changed, paused or removed from the web home and the terminal.
- audit
- Audit actions of the kernel (spec 3.2 §9.3).
- bus
- The event bus (spec 3.2 §7.6).
- channels
channels - The chat channel contract (spec 3.3 §5.3, §10 K1, §11 S-I5, S-I6, S-I10; feature
channels). - charter
charter - The site’s charter, its KPIs, its jobs’ earned autonomy and the signals the public
partition sends the back office (spec 3.5 §7.6, §7.10, §7.11, §7.21; feature
charter). - consolidation
- The consolidation tick (spec 3.2 §7.5, §13 Q1, Q12).
- control
- The control plane (spec 3.2 §7.11).
- drivers
- Drivers: MCP servers run as supervised child processes under a manifest the user approved (spec 3.2 §7.7).
- error
- The kernel’s error type (spec 3.2 §7.1).
- inventory
- What a kernel runs, and what it would silently not do (spec 3.2 §7.1, §7.4; #1278):
Kernel::inventory, logged when the kernel starts and served atGET /api/kernel/inventory. - kernel
- The supervisor (spec 3.2 §7.2).
- pairing
- Device pairing (spec 3.3 §10 K2, §11 S-I7): short-lived pairing codes, then scoped, expiring, revocable device tokens, stored hashed.
- partition
- Partitions (spec 3.2 §7.8): areas of a user’s life or an organisation’s teams kept apart, with work across them only through the coordinator and under approval.
- proc
proc /proc: the kernel’s self-observation (spec 3.2 §7.10, §13 Q4; featureproc).- process
- The process model (spec 3.2 §7.3).
- review
- The review the maintenance tick makes of what may have drifted (spec 3.2 §7.4, §9.1 permission drift).
- sched
- Queue classes (spec 3.2 §7.9).
- service
service - Service installation (spec 3.2 §7.12, §10 W3):
adk-rust upkept running by the platform’s service manager, as the user, logging to the kernel home and restarting on failure. - stores
- The kernel-owned stores and their backends (spec 3.2 §7.1, §7.3, §13 Q8).
- subagents
- Background sub-agents as kernel processes.
- vision
- Visual wake sources (spec 3.7 §7.10).
- wake
- Sleep and wake (spec 3.2 §7.4).
- watermark
- Cron watermarks: where each cron wake source left off, so the ticks it missed while no kernel watched replay once, per the schedule’s catch-up policy (spec 3.2 §7.4, §7.13).
Structs§
- Aged
Process - A process the review reports (spec 3.2 §7.4).
- Agenda
- The agenda of a kernel (spec 3.2 §7.5): proposals, approvals and the processes items
become.
Kernel::agendareturns it; cloning shares it. - Agenda
Answer - A person’s answer to a question item (
AgendaOrigin::is_question), recorded on the item when it closes (spec 3.2 §7.10). - Agenda
Filter - Which agenda items
AgendaStore::listreturns (spec 3.2 §7.5, §8.1adk-rust agenda list). An empty field matches everything. - Agenda
Handle - A handle on a kernel’s agenda that does not keep the kernel alive, bound when the kernel
is built (spec 3.2 §7.5, §10 HK1): the harness’s
propose_followuptool exists before the kernel that hosts it. - Agenda
Item - One item of the agenda (spec 3.2 §7.5).
- Approval
Wake Source - Wakes on decided approvals (spec 3.2 §7.4): an
ApprovalNotifierregistered onStoreApprovalService::with_notifierwhose decisions it publishes as wake events keyedkeys::approval. - Audit
Sink - Writes the events that are audit records to the signed audit log (spec 3.2 §7.6, §9.3),
kind
Other(KERNEL_AUDIT_KIND)with thekernel.*actions ofcrate::audit. - Consolidation
Tick - The consolidation tick of one partition (spec 3.2 §7.5, §13 Q1, Q12).
- Cron
Wake Source - A cron wake source over
adk_agent::ambient::CronTrigger(spec 3.2 §7.4); keyskeys::cron. - Crossing
- One request reaching from one partition into another (spec 3.2 §7.8).
- Crossing
Filter - Which crossing records
PartitionStore::crossingsreturns. An empty field matches everything. - Crossing
Record - One entry of the crossing ledger (spec 3.2 §7.8, §9.3): who crossed where, when, in which run, and what happened. It holds a digest of the crossing fingerprint, never the call’s arguments.
- Crossing
Tool - A tool of another partition offered to the coordinator (spec 3.2 §7.8): a driver’s tool,
or a tool reading another partition’s sessions, named
<to>__<tool>and governed as a crossing by the coordinator’sPartitionPolicy, with which it registers itself. - Event
Bus - The kernel’s event bus (spec 3.2 §7.6).
- Event
Filter - Which
KernelEvents a sink delivers, by kind (spec 3.2 §7.6). - Event
Record - A numbered
KernelEventas the bus delivers it (spec 3.2 §7.6). - Event
Subscriber - A subscription to the
EventBus(spec 3.2 §7.6). - File
Wake Source - A file-change wake source over
adk_agent::ambient::FileWatchTrigger(spec 3.2 §7.4); keyskeys::file, reading the modification time when the event arrives. - Goal
Progress - Where a goal process stands (spec 3.2 §7.3, §10 HK3): iteration of max, spend, duration, and the last check’s exit code and output tail.
- InMemory
Agenda Store - An
AgendaStorein process memory, for tests and a kernel with no durable store (spec 3.2 §7.5). Its items end with the process. - InMemory
Cron Watermark Store - A
CronWatermarkStorein process memory, for tests and a kernel with no durable store (spec 3.2 §7.4). Its cursors end with the process, so a restarted kernel over it sees no tick it missed. - InMemory
Partition Store - A
PartitionStorein process memory, for tests and a kernel with no durable store (spec 3.2 §7.8). Its records end with the process. - InMemory
Process Store - A
ProcessStorein process memory, for tests and a kernel with no durable store (spec 3.2 §7.3). Its rows end with the process. - 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.
- Kernel
Wake Executor - Executes
kernel.wakeruns on the maintenance worker: decodes theWakeEventa webhook or queue delivery carried and routes it (spec 3.2 §7.4). - Partition
- A partition (spec 3.2 §7.8): a policy class plus a memory scope plus a driver set, run by
its own
HarnessAgentbuilt withdefault_mode. - Partition
Id - Names a partition:
work,home, a team (spec 3.2 §7.8). - Partition
Policy - The policy of one partition’s harness (spec 3.2 §7.8, K-I15): a
ToolPolicythat decides the calls of its crossing tools and lets every other call through, so it composes with the harness policy throughStrictestPolicyand never loosens it (K-I6). - Partitions
- The partition table and its crossings (spec 3.2 §7.8): reads and changes partitions
with
kernel.partition.createdandkernel.partition.changedrecords, builds each partition’sPartitionPolicy, and keeps the crossing ledger the policy and the crossing tools write and the run’s approvals are read from. Cloning shares it. - PlanRef
- The plan an agent proposed with its follow-up (spec 3.2 §7.5, spec 3.1 §7.11): the
steps as the harness writes them, each a spec 3.1
PlanStepin JSON, and their digest. The kernel stores them without reading them (§6 D-1). - Proactivity
Policy - The proactivity limits of a partition (spec 3.2 §7.5, §9.1 runaway proactivity).
- Process
- A process as
psshows it: the run, the kernel’s side table and the live view (spec 3.2 §7.3). - Process
Filter - Which processes
pslists (spec 3.2 §7.3, §8.1adk-rust ps [--partition P] [--state S]). - Process
Handle - A handle on a running kernel’s processes that does not keep the kernel alive, given to
a
ProgressSourcebyProgressSource::attach(spec 3.2 §7.3). - Process
Meta - The kernel-owned side table of one process, keyed by run id (spec 3.2 §7.3, §6 D-2).
- Process
Spec - What
ProcessTable::spawnrecords beside the run it enqueues (spec 3.2 §7.3). - Process
Table - The process table: a view over
DurableRunStoreplus the kernel’sProcessStore(spec 3.2 §7.3). - Process
View - A process’s live aggregates (spec 3.2 §7.3, §7.10, §13 Q4): what
psandtopshow, computed by sum and count over the kernel’s records. Spend is in micro-USD, asSpendLedgercounts it; the kernel attributes each charge to the run that made it and keeps daily totals per process (ProcessStore::spend). - Quiet
Hours - A daily local-time window in which proactive and maintenance processes never start (spec 3.2 §7.5, §7.9, K-I11); interactive and approval-woken runs always may.
- Quotas
- A partition’s quotas (spec 3.2 §7.9): enforced at admission, they bound each partition
within a queue so none starves another (§13 Q2).
Noneleaves a quota unlimited. - Recurring
Crossing - A crossing that keeps happening (spec 3.2 §7.8): what the maintenance process reports, with partition membership as the remedy, never a waiver.
- Review
Report - One partition’s review (spec 3.2 §7.4, §9.1): what is older than its review period.
- RuleAge
- When a standing rule was granted and whether it expires, as the review reads it (spec 3.2 §9.1).
- RunFinished
Wake Source - Wakes on finished processes (spec 3.2 §7.4): fed by the worker’s S1
on_finishhook, it publishes each finished run as a wake event keyedkeys::run_finished. - RunNow
- What
Kernel::run_nowqueued. - RunUsage
- What a session’s runs have used so far, as the hosted agent counts it (spec 3.2 §7.3,
§7.10): model calls, tool calls, cost in micro-USD, total tokens and the usage per
UsageUnit(BudgetTracker::units). - Source
Watermark - The cursor of one cron source in a
CronWatermarkStore, as theadk_agent::ambient::TickWatermarkaCronWakeSourceor aCronTriggerkeeps (spec 3.2 §7.4). - Spend
Delta - Usage a process committed (spec 3.2 §7.6): the cost in micro-USD as
SpendLedgercounts it, the model calls and tokens a run budget counts, and the usage perUsageUnit. - Sqlite
Agenda Store sqlite - An
AgendaStorein SQLite (spec 3.2 §7.1, §7.5, featuresqlite). - Sqlite
Cron Watermark Store sqlite - A
CronWatermarkStorein SQLite (spec 3.2 §7.4, featuresqlite). - Sqlite
Partition Store sqlite - A
PartitionStorein SQLite (spec 3.2 §7.1, §7.8, featuresqlite). - Sqlite
Process Store sqlite - A
ProcessStorein SQLite (spec 3.2 §7.1, featuresqlite). - Stale
Rule - A standing rule the review asks to renew (spec 3.2 §9.1).
- Steering
- A message a running process holds for its agent’s next safe point (spec 3.3 §6 “steer”):
what
Kernel::steeranswers. - Subagent
Handle - A handle on a kernel’s sub-agent host that does not keep the kernel alive, bound when
the kernel is built with it: an agent’s sub-agent tools exist before the kernel that
hosts the agent. Until bound, and after the kernel is gone, every operation fails with
subagent.unavailable. - Tick
Inputs - What the tick gate reads (spec 3.2 §7.5): a partition’s
TickMaterialwith the kernel’s view of it. - Tick
Material - What a partition holds for a consolidation tick, as its
Consolidatorreports it (spec 3.2 §7.5). - Tick
Outcome - What one tick did, in counts, and what it proposes (spec 3.2 §7.5).
- Tick
Proposal - A follow-up a tick proposes; the kernel files it as an
AgendaOrigin::Consolidationitem, which a person approves in every mode (K-I23). - TickRun
- One tick a
Consolidatorruns (spec 3.2 §7.5). - Tick
Spend - What the consolidation ticks of a partition spent today (spec 3.2 §7.5): what
budget_shareis measured against. - Trigger
- A standing wake that starts a new process each time it fires, when no sleeping process matched (spec 3.2 §7.4 step 3): a sleeper consumes the event, a trigger is the fallback.
- Usage
Totals - What a process or a partition used over a span of UTC days (
ProcessStore::usage). - Vision
Wake Source - A
WakeSourcefor one camera, screen or browser stream (spec 3.7 §7.10): eachVisualWakepublished becomes aWakeEventnamed after the stream and keyedkeys::vision, whichWake::Queue { source }matches. - Visual
Frame - The frame a visual wake names: its place in the stream, the digest of its encoded bytes, its size, and the artifact it is kept as.
- Visual
Region - One region of a visual wake: its box in source pixels, label, score and track.
- Visual
Wake - A watch condition that passed on a stream, as the kernel takes it: the condition, what happened, the track with its label and score, the frame, and the regions that met the condition in it, the track’s first.
- Wake
Event - One wake delivered by a
WakeSource(spec 3.2 §7.4). - Wake
Reason - Why a process woke, as its next turn is told (spec 3.2 §7.4 step 3): the event’s source,
key and time, and its payload as compact JSON cut to
WAKE_PAYLOAD_LIMITbytes. - Wake
Reason Hooks - Gives each woken turn its
WakeReason(spec 3.2 §7.4 step 5): theWorkerHooks::wake_inputof aDurableWorkerwhose runs aWakeRouterwakes. AKernelregisters the same lookup on its own workers; this is for a worker composed without one. - Wake
Router - The wake matcher (spec 3.2 §7.4 steps 2–3): routes each
WakeEventto the sleeping processes andTriggers it matches. - WakeSet
- The conditions that wake a sleeping process: any one of them (spec 3.2 §7.4).
- Webhook
Sink webhooks - Delivers the kernel’s events to an HTTP endpoint as signed webhooks (spec 3.2 §7.6).
- Worker
Health - One worker’s health (spec 3.2 §7.2).
Enums§
- Agenda
Origin - Who proposed an
AgendaItem(spec 3.2 §7.5). - Agenda
State - Where an
AgendaItemstands (spec 3.2 §7.5). - Agenda
State Kind - The kind of an
AgendaState, without its payload: what anAgendaFilterselects and anAgendaStore::transitioncompares (spec 3.2 §7.5). - Cross
Partition - Whether a partition takes part in crossings (spec 3.2 §7.8).
- Crossing
Access - Whether a crossing only reads (spec 3.2 §7.8, §13 Q3).
- Crossing
Outcome - What happened to a crossing (spec 3.2 §9.3
kernel.partition.crossing). - Crossing
Resource - What a crossing reaches (spec 3.2 §7.8): the resource class of its fingerprint.
- Crossing
Route - How a crossing tool’s call names what it reaches (spec 3.2 §7.8).
- Crossing
Run - The run an approved read holds for (spec 3.2 §13 Q3): a durable run, across the invocations that resume it, or one invocation outside a durable run.
- Event
Kind - The kind of a
KernelEvent, named as itstypefield serializes it (spec 3.2 §7.6). - Expiry
Action - What happens when a
WakeSetexpires before any wake fires (spec 3.2 §7.4). - Kernel
Error - What went wrong in the kernel (spec 3.2 §7.1).
- Kernel
Event - A change in the kernel (spec 3.2 §7.6).
- Kernel
State - Where the kernel is in its lifecycle (spec 3.2 §7.2).
- Partition
Mode - A partition’s default mode (spec 3.2 §7.8): what its agents may do without asking.
- Proactive
Approval - How agenda proposals are approved (spec 3.2 §7.5).
- Process
Kind - What kind of work a process is (spec 3.2 §7.3).
- Proposal
Outcome - What
Agenda::proposedid with a proposal (spec 3.2 §7.5). - Queue
Class - A priority class: the run-store queue a process waits in and the worker that claims it (spec 3.2 §7.9).
- RunNow
Target - What
Kernel::run_nowruns now. - Spend
Scope - Whose spend
ProcessStore::spendsums (spec 3.2 §7.3, §7.10). - Suspension
- Why a process is parked by a suspension rather than a wake set (spec 3.2 §7.3).
- Tick
Admission - The tick gate’s decision (spec 3.2 §7.5).
- Wake
- One condition that wakes a sleeping process (spec 3.2 §7.4).
- Wake
Outcome - What one routed
WakeEventdid to one process (spec 3.2 §7.4, §9.3kernel.wake). - Wake
Overlap - What a standing wake’s firing does while a process it started is unfinished — queued,
running, or waiting (on a person, a sleep, a freeze or admission) — (spec 3.2 §7.4,
§7.9). A
Triggerand a managed wake set take one;skipis the default.
Constants§
- AGENDA_
TOOL_ NAME - The approval-inbox tool name of agenda proposals (spec 3.2 §7.5): an Ask partition’s
proposal waits in the inbox as an
ApprovalRequestwith thistool_name, the item asargs_redactedandallowed_actions = [Approve, Edit, Reject]. - COALESCED_
LABEL - The label on the row of a trigger’s process waiting to start that counts the firings
that joined it (
WakeOutcome::Coalesced), as a decimal number;adk-rust psshows it. - CONSOLIDATION_
LABEL - The label a tick’s process carries, with the value
consolidation(spec 3.2 §7.5). - CONSOLIDATION_
TARGET - The workflow a consolidation tick runs as (spec 3.2 §7.5): a
Maintenancedurable run on themaintenancequeue. - CROSSING_
PARTITION_ ARG - The argument naming the target partition of a crossing tool whose
CrossingRouteisArgument. - DEFAULT_
EVENT_ CAPACITY - How many events a subscriber may fall behind before it skips ahead.
- KERNEL_
WAKE_ TARGET - The target of a
kernel.wakerun: a webhook or queue delivery the maintenance worker turns into a routed wake (spec 3.2 §7.4). - RUN_
NOW_ SOURCE - The source of the wake
Kernel::run_nowsubmits. - SKIPPED_
LABEL - The label on the row of a trigger’s unfinished process that counts the firings its
WakeOverlap::Skipskipped while it ran, as a decimal number;adk-rust psshows it. - SUBAGENT_
LABEL - The label of a sub-agent’s processes that holds its id.
- SUBAGENT_
NAME_ LABEL - The label of a sub-agent’s processes that holds its name.
- SUBAGENT_
NOTICE_ SOURCE - The source of the processes that tell a parent about its sub-agent:
triggered:subagent. - VISION_
PAYLOAD_ KIND - The
kindof every visual wake payload. - WAKE_
PAYLOAD_ LIMIT - The most bytes of a wake’s payload, as compact JSON, a
WakeReasonkeeps (spec 3.2 §7.4). Thekernel.wakerun keeps the whole payload.
Traits§
- Agenda
Store - The kernel’s store of agenda items (spec 3.2 §7.5, §13 Q8), on every backend the
ProcessStorehas. - Consolidator
- The memory a consolidation tick works on (spec 3.2 §7.5, §6 D-1): the kernel reads no
harness type, so the harness implements this for a partition
(
adk_harness::Harness::consolidator) and registers it withKernelBuilder::consolidator. - Cron
Watermark Store - Where each cron wake source left off (spec 3.2 §7.4, §7.13): the instant through which its ticks are accounted for, by source name.
- Event
Sink - A destination for kernel events (spec 3.2 §7.6): the SSE stream, a channel notifier, an outbound webhook, the audit log.
- Observation
Audience - Whom a partition’s observations are put to, and where a confirmed one is remembered
(spec 3.2 §7.10, spec 3.1 §7.15): the kernel reads no harness type, so the harness
implements this over its long-term memory (
adk_harness::Harness::observation_audience) and registers it withKernelBuilder::observation_audience. - Partition
Store - The partition table and the crossing ledger (spec 3.2 §7.8, §13 Q8), on every backend
ProcessStorehas:InMemoryPartitionStore,SqlitePartitionStore,PostgresPartitionStoreandRedisPartitionStore, with one conformance suite (partition_store_conformance_tests!, featureconformance). - Process
Store - The kernel’s side table of process metadata, keyed by run id (spec 3.2 §7.3, §6 D-2).
- Progress
Source - Reports what only the hosted agent knows about a process: a goal’s progress, the loop guard’s verdict and the session’s usage (spec 3.2 §7.3, §10 HK3).
- Standing
Rule Source - Reads the standing rules the review checks (spec 3.2 §9.1): the harness implements it
over its rule store and
Harness::kernelregisters it (KernelBuilder::standing_rules). - Wake
Source - A source of wake events: an adapter over
adk_agent::ambient::EventSourcewhere one exists (spec 3.2 §7.4).
Functions§
- admit_
tick - Whether
tickadmits a consolidation tick oninputs(spec 3.2 §7.5, §13 Q1), and with what budget. - kernel_
wake_ run - Builds the
kernel.wakerun a webhook or queue delivery enqueues: targetKERNEL_WAKE_TARGETon the maintenance queue, keyed byevent.key, with the event as input, acting as aServicesubject (spec 3.2 §7.4). - queue_
wake_ ingress - Builds the ingress that turns each message of
sourceinto akernel.wakerun keyedkeys::queue(spec 3.2 §7.4); the kernel runs it withQueueIngress::run. - vision_
payload - The payload of
wakefrom the streamsource, as compact JSON withinWAKE_PAYLOAD_LIMITbytes:kind(vision),source,session,condition,event,label,score,track,frames,frame(index,capturedAt,digest,width,height,artifact),regions(eachbox,label,score,track) andmoreRegions, the count of regions left out. - webhook_
wake_ hook webhooks - Builds the webhook hook served at
/hooks/{name}whose verified deliveries becomekernel.wakeruns keyedkeys::webhookby the ingress (spec 3.2 §7.4, featurewebhooks). Register it withWebhookIngress::with_hook.
Type Aliases§
- Result
- Result of a fallible kernel operation (spec 3.2 §7.1).