Skip to main content

clawft_kernel/workload_ctl/
mod.rs

1//! Placement control plane (ADR-099 sections 3 and 7; card
2//! mesh-placement-12): the pure engine (card 04) wired to the mesh.
3//!
4//! - [`facts`]: card 03's cached, verified [`NodeFacts`] as card 04's
5//!   `PlacementFacts` (liveness from membership or direct contact,
6//!   receiver-assigned trust tier, load from live state, measured `perf.*`).
7//! - [`cog_kind`]: the cog kind's requirements (ADR-100 section 2).
8//! - [`msg`]: the signed `workload.ctl` message set (nonce, expiry,
9//!   decision id; unknown methods denied).
10//! - [`session`]: the message set on the wire as `MeshIpcEnvelope` /
11//!   `MeshRequest`, with the artifact piece protocol (card 11) multiplexed
12//!   for fetch-before-load.
13//! - [`host_service`]: a node's `workload-host` (advertised through
14//!   `ServiceAdvertisement`), driving card 09's adapters under governance.
15//! - [`plane`] / [`plane_place`]: the controller: learn targets, decide,
16//!   chain, dispatch, retry the next candidate on refusal.
17//! - [`transport`]: mesh TCP (Noise XX) and in-process connections; the
18//!   in-process path serves this node's own host and Seed adapters on an
19//!   operator-assigned node id.
20//!
21//! [`NodeFacts`]: clawft_types::placement::NodeFacts
22
23pub mod cog_kind;
24pub mod facts;
25mod host_instances;
26pub mod host_licence;
27pub mod host_node_admin;
28pub mod host_revoke;
29pub mod host_service;
30pub mod host_supervise;
31pub mod lifecycle;
32pub mod msg;
33pub mod plane;
34pub mod plane_node_admin;
35pub mod plane_peers;
36pub mod plane_lifecycle;
37pub mod plane_place;
38mod plane_reschedule;
39mod plane_prepare;
40mod plane_reconcile;
41pub mod plane_seed;
42mod plane_state;
43pub use crate::refusal_budget;
44pub mod session;
45pub mod transport;
46
47#[cfg(test)]
48mod test_support;
49#[cfg(test)]
50mod tests_facts;
51#[cfg(test)]
52mod tests_flood;
53#[cfg(test)]
54mod tests_ingest;
55#[cfg(test)]
56mod tests_kind;
57#[cfg(test)]
58mod tests_kind_followups;
59#[cfg(test)]
60mod tests_life;
61#[cfg(test)]
62mod tests_life_fix;
63#[cfg(test)]
64mod tests_life_node;
65#[cfg(test)]
66mod tests_life_plane;
67#[cfg(test)]
68mod tests_life_revoke;
69#[cfg(test)]
70mod tests_link;
71#[cfg(test)]
72mod tests_peers;
73#[cfg(test)]
74mod tests_reconcile;
75#[cfg(test)]
76mod tests_revoke;
77#[cfg(test)]
78mod tests_seed;
79#[cfg(test)]
80mod tests_state;
81#[cfg(test)]
82mod tests_teardown;
83#[cfg(test)]
84mod tests_two_node;
85#[cfg(test)]
86mod tests_licence;
87#[cfg(test)]
88mod tests_node_admin;
89
90pub use cog_kind::cog_workload_spec;
91pub use facts::{LiveNodeFacts, engine_tier, governance_tier, liveness_of, placement_view};
92pub use host_node_admin::NodeAdmin;
93pub use host_revoke::ForcedTeardown;
94pub use host_supervise::Supervised;
95pub use lifecycle::{
96    InstanceLife, LifecyclePolicy, LifecycleState, RestartDecision, RestartPolicy, can_transition,
97};
98pub use host_service::{CtlConfig, FactsSource, HOST_CHAIN_SOURCE, WorkloadHostService};
99pub use msg::{
100    CtlRequest, CtlResponse, NonceGuard, Refusal, RefusalCode, SignedCtl, WORKLOAD_HOST_SERVICE,
101};
102pub use plane::{
103    CallFailure, PLANE_CHAIN_SOURCE, PlacementControlPlane, PlacementRecord, PlaneConfig,
104    PlaneError, TargetInfo,
105};
106pub use plane_peers::OperatorPeer;
107pub use plane_place::{Attempt, PlaceOrder, PlaceReport, render};
108pub use plane_seed::{SEED_ROUTE, StorePinOrder};
109pub use refusal_budget::RefusalBudget;
110pub use transport::{
111    CtlConnector, MAX_SESSIONS, MEM_SCHEME, MeshConnector, listen_tcp, serve_listener,
112    serve_listener_with,
113};