adk_kernel/managed/mod.rs
1//! The managed form of the kernel (spec 3.2 §7.13, §10 M1; feature `managed`).
2//!
3//! The kernel hosts a user's or a team's agents on their own infrastructure; the managed
4//! runtime (`adk-managed`) hosts tenants. They share the durable stores and the harness:
5//!
6//! | Item | What it is |
7//! |---|---|
8//! | [`KernelDef`] | Partitions and their coordinator, driver manifests, the proactivity policy and wake sets, as a block under the [`KERNEL_DEF_METADATA_KEY`] metadata key of a `ManagedAgentDef`, beside the harness's `adk.harness` |
9//! | [`TenantKernel`] | One kernel over one tenant's `ManagedStores`: the tenant's definitions as targets, their wake sets as triggers, their proactivity policy, the tenant's approval service waking parked processes |
10//! | [`KernelResolver`] | The `AgentResolver` the tenant's runtime is built with: it hosts each definition carrying a kernel block on the tenant's kernel |
11//! | [`PartitionAgentResolver`], [`PartitionHost`] | One agent per partition a definition declares — one harness per partition — over the tenant's partition table (spec 3.2 §7.8) |
12//! | [`ManagedKernels`] | A host's tenants, one kernel each, refusing a tenant whose stores another holds |
13//! | [`DRIVER_MOUNT_TOOL_NAME`] | The inbox tool name of a driver mount a definition asks for: a person approves it before the tenant's supervisor mounts it (spec 3.2 §7.7) |
14//!
15//! A definition comes from a tenant, so its kernel block cannot widen what the operator
16//! allows: its agent is built by the operator's resolver, a driver is never unsandboxed and
17//! mounts only with a person's approval, a wake set never takes the queue a person's turn
18//! holds, and the consolidation tick is off unless the block turns it on (§13 Q1).
19//! `adk-managed` is Experimental, so this module is too.
20//!
21//! # Example
22//!
23//! ```rust
24//! use adk_kernel::Wake;
25//! use adk_kernel::managed::{KernelDef, KERNEL_DEF_METADATA_KEY, WakeSetDef};
26//! use adk_managed::types::{ManagedAgentDef, ModelRef};
27//!
28//! let def = KernelDef::new()
29//! .with_wake_set(WakeSetDef::new("orders", [Wake::Webhook { hook: "orders".into() }], "Triage the new orders."))
30//! .apply_to(ManagedAgentDef::new("triage", ModelRef::Shorthand("claude-sonnet-5-5".into())));
31//! let block = &def.metadata.as_ref().unwrap()[KERNEL_DEF_METADATA_KEY];
32//! assert!(block.contains(r#""hook":"orders""#));
33//! ```
34
35mod def;
36mod tenant;
37
38pub use def::{
39 CROSS_PARTITION_VALUES, DEFAULT_WAKE_USER, KERNEL_DEF_METADATA_KEY, KernelDef, PartitionDef,
40 WakeOverlap, WakeSetDef,
41};
42pub use tenant::{
43 DRIVER_MOUNT_TOOL_NAME, KernelResolver, ManagedKernels, PartitionAgentResolver, PartitionHost,
44 TenantKernel, TenantKernelBuilder,
45};