Skip to main content

clawft_kernel/workload_runtime/
mod.rs

1//! Workload runtime adapters (mesh-placement-09; ADR-099 section 5,
2//! ADR-100 sections 3-5).
3//!
4//! - [`types`]: the [`WorkloadRuntime`] trait (id, provides, admit, load,
5//!   start, stop, unload, status, control_mode, console) and its values.
6//! - [`native`]: unprivileged native process under `[console]` /
7//!   `[resources]` limits and rlimits ([`supervise`]), emitting
8//!   [`RunEvidence`].
9//! - [`container`]: Apple `container`, Docker / OrbStack and Podman,
10//!   running a one-binary image built locally from the verified artifact
11//!   over an operator-pinned base ([`container_cmd`]), fronted by an
12//!   ingest relay when the cog's loopback is not the node's
13//!   ([`container_relay`]).
14//! - [`seed`] / [`seed_ops`]: the `remote.api` adapter for a Cognitum Seed
15//!   (its own HTTP API; pinned store cogs only; pairing; governed,
16//!   backed-up firmware upgrade), over [`seed_http`].
17//! - [`infer`]: `infer.llamacpp`, `infer.mlx-lm` and `infer.ollama` for model
18//!   servers (ADR-101 section 4): adopt a running server, or manage one.
19//! - [`host_contract`]: `COG_CSI_BIND`, `COG_SENSOR_URL`,
20//!   `COGNITUM_COG_TOKEN`, `COGNITUM_COG_DATA_DIR`.
21//! - [`host`]: [`WorkloadHost`], which gates each transition and chains it
22//!   as a `workload.*` event.
23//!
24//! WASM adapters, when built, use `clawft-wasm-host` (ADR-099 decision 4);
25//! the kernel `wasm_runner` is not used for cogs.
26
27pub mod cog_spec;
28pub mod container;
29pub mod container_cmd;
30pub mod container_relay;
31pub mod evidence;
32pub mod fleet_inventory;
33pub mod fleet_mcp;
34pub mod host;
35pub mod host_contract;
36pub mod host_seed;
37pub mod infer;
38pub mod logical;
39pub mod native;
40pub mod seed;
41pub mod seed_bind;
42pub mod seed_client;
43pub mod seed_creds;
44pub mod seed_http;
45pub mod seed_ops;
46pub mod seed_tls;
47pub mod seed_types;
48pub mod supervise;
49pub mod types;
50
51#[cfg(test)]
52mod test_support;
53#[cfg(test)]
54mod tests_container;
55#[cfg(test)]
56mod tests_container_relay;
57#[cfg(test)]
58mod tests_fleet_inventory;
59#[cfg(test)]
60mod tests_host;
61#[cfg(test)]
62mod tests_live;
63#[cfg(test)]
64mod tests_native;
65#[cfg(test)]
66mod tests_wasmtime;
67#[cfg(test)]
68mod tests_seed;
69#[cfg(test)]
70mod tests_seed_bind;
71#[cfg(all(test, feature = "mesh", feature = "ecc", feature = "exochain", feature = "native"))]
72mod tests_seed_bind_v2;
73#[cfg(test)]
74mod tests_seed_host;
75#[cfg(test)]
76mod tests_seed_install;
77#[cfg(test)]
78mod tests_seed_ops;
79#[cfg(test)]
80mod tests_seed_pin;
81#[cfg(test)]
82mod tests_seed_transport;
83
84pub use cog_spec::{CogSpec, ConsoleLimits, Resources};
85pub use container::{ContainerRuntime, ContainerRuntimeConfig};
86pub use container_cmd::{CommandRunner, Engine, SystemRunner};
87pub use evidence::RunEvidence;
88pub use fleet_inventory::{
89    FleetCandidate, FleetCheck, FleetError, FleetInventory, FleetMcp, ReadOnlyFleet,
90};
91pub use fleet_mcp::{COGNITUM_MCP_URL, OAuthTokens};
92pub use host::{RUNTIME_CHAIN_SOURCE, WorkloadHost};
93pub use host_contract::HostContract;
94pub use infer::{
95    InferConfig, InferFlavor, InferMode, InferRuntime, InferenceSpec, ManagedConfig, RestartPolicy,
96};
97pub use logical::{
98    CAP_PROJECT_LOGICAL, ChildIdentity, ChildLauncher, ChildProbe, ChildRef, ChildSpec, LOGICAL_ID, LogicalRuntime,
99};
100pub use native::{NativeConfig, NativeRuntime};
101pub use seed::{SeedApiRuntime, SeedConfig, SeedPin};
102pub use seed_bind::{
103    BindError, BindRecord, Binding, SeedBinder, SignedBind, attest_seed_facts, seed_node_id, sign_bind,
104};
105#[cfg(all(feature = "mesh", feature = "ecc", feature = "exochain", feature = "native"))]
106pub use seed_bind::{StewardBind, UnbindOutcome, grant_fingerprint};
107pub use seed_creds::FileCredentials;
108pub use seed_http::{HttpSeedTransport, SeedCredentials, SeedTransport};
109pub use seed_ops::{SeedBackup, UpgradeOutcome};
110pub use types::{
111    Admission, ControlMode, InferencePayload, InstanceHandle, InstanceState, InstanceStatus,
112    LinkSecurity, Preemption, ProjectPayload, RunMode, RuntimeError, VerifiedWorkload, WorkloadConfig, WorkloadRuntime,
113    WorkloadSource,
114};