Skip to main content

Module workload_runtime

Module workload_runtime 

Source
Expand description

Workload runtime adapters (mesh-placement-09; ADR-099 section 5, ADR-100 sections 3-5).

  • types: the WorkloadRuntime trait (id, provides, admit, load, start, stop, unload, status, control_mode, console) and its values.
  • native: unprivileged native process under [console] / [resources] limits and rlimits (supervise), emitting RunEvidence.
  • container: Apple container, Docker / OrbStack and Podman, running a one-binary image built locally from the verified artifact over an operator-pinned base (container_cmd), fronted by an ingest relay when the cog’s loopback is not the node’s (container_relay).
  • seed / seed_ops: the remote.api adapter for a Cognitum Seed (its own HTTP API; pinned store cogs only; pairing; governed, backed-up firmware upgrade), over seed_http.
  • infer: infer.llamacpp, infer.mlx-lm and infer.ollama for model servers (ADR-101 section 4): adopt a running server, or manage one.
  • host_contract: COG_CSI_BIND, COG_SENSOR_URL, COGNITUM_COG_TOKEN, COGNITUM_COG_DATA_DIR.
  • host: WorkloadHost, which gates each transition and chains it as a workload.* event.

WASM adapters, when built, use clawft-wasm-host (ADR-099 decision 4); the kernel wasm_runner is not used for cogs.

Re-exports§

pub use cog_spec::CogSpec;
pub use cog_spec::ConsoleLimits;
pub use cog_spec::Resources;
pub use container::ContainerRuntime;
pub use container::ContainerRuntimeConfig;
pub use container_cmd::CommandRunner;
pub use container_cmd::Engine;
pub use container_cmd::SystemRunner;
pub use evidence::RunEvidence;
pub use fleet_inventory::FleetCandidate;
pub use fleet_inventory::FleetCheck;
pub use fleet_inventory::FleetError;
pub use fleet_inventory::FleetInventory;
pub use fleet_inventory::FleetMcp;
pub use fleet_inventory::ReadOnlyFleet;
pub use fleet_mcp::COGNITUM_MCP_URL;
pub use fleet_mcp::OAuthTokens;
pub use host::RUNTIME_CHAIN_SOURCE;
pub use host::WorkloadHost;
pub use host_contract::HostContract;
pub use infer::InferConfig;
pub use infer::InferFlavor;
pub use infer::InferMode;
pub use infer::InferRuntime;
pub use infer::InferenceSpec;
pub use infer::ManagedConfig;
pub use infer::RestartPolicy;
pub use logical::CAP_PROJECT_LOGICAL;
pub use logical::ChildIdentity;
pub use logical::ChildLauncher;
pub use logical::ChildProbe;
pub use logical::ChildRef;
pub use logical::ChildSpec;
pub use logical::LOGICAL_ID;
pub use logical::LogicalRuntime;
pub use native::NativeConfig;
pub use native::NativeRuntime;
pub use seed::SeedApiRuntime;
pub use seed::SeedConfig;
pub use seed::SeedPin;
pub use seed_bind::BindError;
pub use seed_bind::BindRecord;
pub use seed_bind::Binding;
pub use seed_bind::SeedBinder;
pub use seed_bind::SignedBind;
pub use seed_bind::attest_seed_facts;
pub use seed_bind::seed_node_id;
pub use seed_bind::sign_bind;
pub use seed_bind::StewardBind;
pub use seed_bind::UnbindOutcome;
pub use seed_bind::grant_fingerprint;
pub use seed_creds::FileCredentials;
pub use seed_http::HttpSeedTransport;
pub use seed_http::SeedCredentials;
pub use seed_http::SeedTransport;
pub use seed_ops::SeedBackup;
pub use seed_ops::UpgradeOutcome;
pub use types::Admission;
pub use types::ControlMode;
pub use types::InferencePayload;
pub use types::InstanceHandle;
pub use types::InstanceState;
pub use types::InstanceStatus;
pub use types::LinkSecurity;
pub use types::Preemption;
pub use types::ProjectPayload;
pub use types::RunMode;
pub use types::RuntimeError;
pub use types::VerifiedWorkload;
pub use types::WorkloadConfig;
pub use types::WorkloadRuntime;
pub use types::WorkloadSource;

Modules§

cog_spec
The parts of a cog’s cog.toml the runtime enforces (ADR-100 sections 2-4): [console] limits, [resources] and the [config] CLI surface, plus building a VerifiedWorkload from a verified package.
container
Container adapters: Apple container, Docker / OrbStack and Podman (ADR-100 section 3). This is the real start path for cog workloads; the simulated start in crate::container::ContainerManager remains for service-registry tests only.
container_cmd
Container engine command lines (pure; unit-tested without an engine).
container_relay
In-container ingest relay (ADR-100 section 4).
evidence
Run evidence: what an instance did, captured under its output limit.
fleet_inventory
Read-only inventory of Cognitum cloud-registered Seeds (card mesh-placement-23; fleet-compat.md sections 1b, 2(b2)).
fleet_mcp
MCP-over-HTTP transport for super::fleet_inventory: the Cognitum cloud MCP (POST https://api.cognitum.one/v1/mcp, streamable HTTP, OAuth bearer). Live use is owner-run: no test or agent calls the real cloud. Tests run against a local stub that speaks the same JSON-RPC.
host
WorkloadHost: gates every adapter transition through governance and chains what the adapter did (ADR-099 sections 4 and 5).
host_contract
Host contract common to every cog runtime (ADR-100 section 4): COG_CSI_BIND, COG_SENSOR_URL, a per-instance COGNITUM_COG_TOKEN and COGNITUM_COG_DATA_DIR.
host_seed
Governed Seed operations outside the cog lifecycle: firmware upgrade and writes_gated recovery, each gated as workload.install with kind seed-firmware and chained with the backup summary.
infer
Inference-server adapters (card mesh-placement-18; ADR-101 section 4).
logical
The logical adapter: a per-project child kernel as a workload (ADR-103 A6, Phase 2 package G).
native
Native-process adapter (ADR-100 section 3): the verified binary is written under the adapter’s data root and run unprivileged under [console] / [resources] limits by super::supervise.
seed
remote.api adapter for a Cognitum Seed (ADR-100 section 5, option b): drives the Seed’s own HTTP API instead of running WeftOS on it.
seed_bind
Fleet identity binding for Cognitum Seeds (card mesh-placement-22; ADR-100 section 5; docs/research/mesh-placement/fleet-compat.md section 2c).
seed_client
Seed HTTP calls shared by the adapter and the Seed operations (super::seed_ops): authenticated requests, the installed list and per-cog start / stop.
seed_creds
Persistent operator secret store for per-Seed tokens.
seed_http
HTTP transport and credential storage for the Cognitum Seed adapter.
seed_ops
Seed operations outside the cog lifecycle: pairing and firmware upgrade.
seed_tls
TLS trust for the Cognitum Seed transport.
seed_types
Seed adapter configuration, operator pins and response helpers.
supervise
cog-runner-style process supervision (ADR-100 section 3): a cleared environment, rlimits applied in the child before exec, an unprivileged user, a wall-clock cap, capped output capture, and terminate-then-kill.
types
The WorkloadRuntime trait and the values that cross it (ADR-099 section 5).