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