Skip to main content

aion_server/worker/
mod.rs

1//! Module declarations.
2
3/// Asking the workers holding a cancelled run's activities to stop (#233).
4pub mod activity_cancel;
5/// Whether a contract refusal is new information, and therefore worth saying.
6pub mod admission_audit;
7/// Reading one attempt's volatile worker progress note, with typed absence.
8pub mod attempt_progress;
9/// Built-in agent workers the SERVER stands up because a deployed document
10/// declared one, rather than because an operator typed a worker command.
11pub mod auto_provision;
12/// Per-tenant keyed backpressure at the outbox claim (Control-Plane Phase 2,
13/// P2-Q2).
14pub mod backpressure;
15/// Bridge from engine activity dispatch to connected workers.
16pub mod bridge;
17/// Worker contract admission shared by every registration transport.
18pub mod contracts;
19/// Server-side execution of declared action bodies (no worker required).
20pub mod declared_body;
21/// The refusal, and the followable remedy, for retained versions that declare
22/// different bodies for one action.
23pub mod declared_body_ambiguity;
24/// Stopping the declared bodies this server is executing: the registry that
25/// makes a running server-executed attempt visible, and the signal that reaches
26/// its process group.
27pub mod declared_body_cancel;
28/// Which retained version's body a declared-command dispatch runs — the
29/// dispatching run's own, not the queue's.
30pub mod declared_body_selection;
31/// A server-run declared command's output, published onto the same transcript
32/// an agent step's is.
33pub(crate) mod declared_body_transcript;
34/// Server-side execution of a DECLARED command body (`runs command <name>`).
35mod declared_command_body;
36/// The identity a worker-deployment record captures for the binary it names.
37pub mod deployed_binary;
38/// Activity completion handling and dispatch abstractions.
39pub mod dispatch;
40/// Task-envelope generation, idempotency keys, and completion fencing.
41pub mod envelope;
42/// gRPC half of the worker dead-man switch (#197): the transport liveness ping
43/// pushed down a worker's task stream, and the registry its answers correlate
44/// through.
45pub mod grpc_liveness;
46/// Worker heartbeat and liveness tracking.
47pub mod heartbeat;
48/// Server-side mid-run intervention routing (NOI-6): capability gate + attempt
49/// owner resolution + push to the owning worker over a pluggable transport.
50pub mod intervention;
51/// Server half of the liminal connection dead-man switch: the liveness ping/pong
52/// wire pair and the probe that keeps a healthy idle connection's lease alive
53/// while making a dead one loud on both sides.
54#[cfg(feature = "liminal-transport")]
55pub mod liminal_liveness;
56/// Cross-node outbox dispatch over the liminal bus (#13-0 spike, feature-gated).
57#[cfg(feature = "liminal-transport")]
58pub mod liminal_transport;
59/// The transport-neutral vocabulary the dead-man switch's transport halves
60/// share: why a ping failed, and which wire carried it.
61pub mod liveness;
62/// The outbox dead-letter path: retire the row, tell the workflow, record whether it was told.
63pub(crate) mod outbox_dead_letter;
64/// Server-side outbox completion delivery into live workflows.
65pub mod outbox_delivery;
66/// Non-replayed durable-outbox fan-out dispatcher (dormant unless commissioned).
67pub mod outbox_dispatcher;
68/// Live stale-claim outbox reconciler (dormant unless commissioned).
69pub mod outbox_reconciler;
70/// Operator-driven redrive of dead-lettered outbox rows, gated on workflow liveness and on
71/// whether the dead letter's failure was already judged.
72pub mod outbox_redrive;
73/// Terminal-workflow outbox settlement sweep for boot and shard adoption (#253).
74pub mod outbox_settle;
75/// Short-TTL per-namespace placement cache for the dispatcher (Control-Plane
76/// Phase 2, P2-P3).
77pub mod placement_cache;
78/// Unserved-queue honesty at the bridge seam (R1): the four-way taxonomy,
79/// service policies, the two service clocks, and the queryable queue state.
80pub mod queue_service;
81/// Throttled per-namespace quota-state broadcaster for the ops-console live badge
82/// (Control-Plane Phase 2, P2-Q3).
83pub mod quota_broadcast;
84/// Short-TTL per-namespace concurrency-quota cache for the dispatcher's keyed
85/// backpressure (Control-Plane Phase 2, P2-Q2).
86pub mod quota_cache;
87/// Connected-worker registry and handles.
88pub mod registry;
89/// Managed-worker supervision (W-1..W-4): desired state in, contained OS
90/// processes out, with a status surface that is a join of the two.
91pub mod supervisor;
92/// Transport-domain classification and re-dispatch budget for activities whose
93/// worker died before reporting a result.
94pub mod transport_loss;
95/// Server-side `{workspace_root}` expansion for declared action bodies (#139).
96pub mod workspace_root;
97
98pub use activity_cancel::{
99    CancelDelivery, CancelRequest, InFlightCancellation, cancel_in_flight_activities,
100};
101pub use admission_audit::AdmissionAudit;
102pub use attempt_progress::{AttemptProgress, attempt_progress};
103pub use backpressure::{Backpressure, OwnedShardFraction};
104pub use bridge::{OutboxDeliveryCallback, PendingActivities, WorkerActivityDispatcher};
105pub use declared_body::{
106    DeclaredBodies, DeclaredBodyLookup, DeclaredBodySource, DeclaredCommandDispatcher,
107    DispatchingRun, EngineDeclaredBodies,
108};
109pub use declared_body_ambiguity::{DeclaringVersion, ambiguous_body_refusal};
110pub use declared_body_cancel::{DeclaredAttemptRegistration, DeclaredCommandAttempts};
111pub use declared_body_selection::select_declared_body;
112pub use deployed_binary::{BinaryIdentityCaptureError, capture_binary_identity, lowercase_hex};
113pub use dispatch::{
114    ActivityCompletion, ActivityCompletionOutcome, ActivityCompletionSink, ActivityDispatcher,
115    ScheduledActivity, handle_activity_result,
116};
117pub use envelope::{CompletionFences, CompletionToken, idempotency_key};
118pub use grpc_liveness::{GrpcLivenessTarget, GrpcLivenessWaiters};
119pub use heartbeat::{
120    HeartbeatSweeper, HeartbeatTracker, HeartbeatUpdate, InFlightActivity, LostWorkerReport,
121    TaskLiveness, sweep_interval,
122};
123pub use intervention::{AttemptKey, AttemptOwnerIndex, InterventionRouter, InterventionTransport};
124#[cfg(feature = "liminal-transport")]
125pub use liminal_liveness::{LivenessPing, LivenessPong, LivenessProbe, LivenessTarget};
126#[cfg(feature = "liminal-transport")]
127pub use liminal_transport::{
128    DispatchRequest, DispatchResponse, InterventionReply, InterventionRequest,
129    LiminalCompletionSource, LiminalConnectionNotifier, LiminalInterventionTransport,
130    LiminalWorkerDelivery, RegistryLiminalDispatch, channel_for_row, dispatch_channel_name,
131};
132pub use outbox_delivery::ServerOutboxDeliveryCallback;
133pub use outbox_dispatcher::{
134    DeliveryGate, OutboxDispatcher, OutboxDispatcherConfig, OutboxRowDispatch, WorkerOutboxDispatch,
135};
136pub use outbox_reconciler::{OutboxReconciler, OutboxReconcilerConfig};
137pub use outbox_redrive::{RedriveRefused, list_dead_letters, redrive_dead_lettered_row};
138pub use outbox_settle::settle_terminal_outbox_rows;
139pub use placement_cache::{
140    PlacementCache, WorkerSelection, preferred_node_order, worker_selection_for,
141};
142pub use queue_service::{
143    ActivityReachability, DeliveryRefusal, EngineQueueDeclarations, ExpiredClock, OpenActivity,
144    PoolCensus, QueueDeclaration, QueueDeclarationSource, QueueDeclarations, QueueServiceConfig,
145    QueueServiceOverride, QueueServicePolicy, QueueServiceReason, QueueServiceState,
146    ServiceAddress, UnavailableSummary, UnservedDispatch, UnservedKey, UnservedQueue,
147    WorkerUnavailable, open_activities_in_active_segment,
148};
149pub use quota_broadcast::QuotaBroadcaster;
150pub use quota_cache::QuotaCache;
151pub use registry::{
152    ConnectedWorkerRegistry, WorkerDelivery, WorkerHandle, WorkerId, WorkerRegistration,
153};
154pub use supervisor::{
155    Convergence, FleetShutdownReport, ManagedExecutable, ManagedWorkerExit, ManagedWorkerReport,
156    ManagedWorkerState, ManagedWorkerStatus, SpawnedBinary, SupervisionError, SupervisionPolicy,
157    WorkerSupervisor,
158};
159pub use transport_loss::{
160    TRANSPORT_EXHAUSTED_REASON_PREFIX, TRANSPORT_LOSS_BUDGET_WINDOWS, TransportLossLedger,
161    TransportLossVerdict, WORKER_LOST_REASON_PREFIX, is_transport_domain_reason,
162    worker_lost_detail,
163};
164pub use workspace_root::{
165    ExpandedCommand, WORKSPACE_ROOT_PLACEHOLDER, WorkspaceRoot, WorkspaceRootError,
166};