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