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/// Declared bodies on the OUTBOX delivery path — a fan-out member whose action
29/// carries a body is executed at the server, exactly as a plain statement's is
30/// (aion#193).
31pub mod declared_body_outbox;
32/// Which retained version's body a declared-command dispatch runs — the
33/// dispatching run's own, not the queue's.
34pub mod declared_body_selection;
35/// A server-run declared command's output, published onto the same transcript
36/// an agent step's is.
37pub(crate) mod declared_body_transcript;
38/// Server-side execution of a DECLARED command body (`runs command <name>`).
39mod declared_command_body;
40/// Whether the caller that started a delivery still wants it, named per caller
41/// so a dispatcher pass cannot silently borrow the outbox's claim check (#52).
42pub mod delivery_intent;
43/// The identity a worker-deployment record captures for the binary it names.
44pub mod deployed_binary;
45/// Activity completion handling and dispatch abstractions.
46pub mod dispatch;
47/// Task-envelope generation, idempotency keys, and completion fencing.
48pub mod envelope;
49/// gRPC half of the worker dead-man switch (#197): the transport liveness ping
50/// pushed down a worker's task stream, and the registry its answers correlate
51/// through.
52pub mod grpc_liveness;
53/// The gRPC arm of the delivery seam: push the task onto the worker's stream.
54pub mod grpc_task_delivery;
55/// Worker heartbeat and liveness tracking.
56pub mod heartbeat;
57/// Server-side mid-run intervention routing (NOI-6): capability gate + attempt
58/// owner resolution + push to the owning worker over a pluggable transport.
59pub mod intervention;
60/// The lease-record seam (WA-010 R3): the one call that turns a transport's
61/// accept into the durable `ActivityLeased` fact, on every transport and both
62/// dispatch paths.
63pub mod lease_record;
64/// Server half of the liminal connection dead-man switch: the liveness ping/pong
65/// wire pair and the probe that keeps a healthy idle connection's lease alive
66/// while making a dead one loud on both sides.
67#[cfg(feature = "liminal-transport")]
68pub mod liminal_liveness;
69/// The liminal arm of the delivery seam: push out on the worker's existing
70/// connection and block for the correlated reply.
71#[cfg(feature = "liminal-transport")]
72pub mod liminal_task_delivery;
73/// Cross-node outbox dispatch over the liminal bus (#13-0 spike, feature-gated).
74#[cfg(feature = "liminal-transport")]
75pub mod liminal_transport;
76/// The transport-neutral vocabulary the dead-man switch's transport halves
77/// share: why a ping failed, and which wire carried it.
78pub mod liveness;
79/// The outbox dead-letter path: retire the row, tell the workflow, record whether it was told.
80pub(crate) mod outbox_dead_letter;
81/// Server-side outbox completion delivery into live workflows.
82pub mod outbox_delivery;
83/// Non-replayed durable-outbox fan-out dispatcher (dormant unless commissioned).
84pub mod outbox_dispatcher;
85/// Live stale-claim outbox reconciler (dormant unless commissioned).
86pub mod outbox_reconciler;
87/// Operator-driven redrive of dead-lettered outbox rows, gated on workflow liveness and on
88/// whether the dead letter's failure was already judged.
89pub mod outbox_redrive;
90/// Terminal-workflow outbox settlement sweep for boot and shard adoption (#253).
91pub mod outbox_settle;
92/// Short-TTL per-namespace placement cache for the dispatcher (Control-Plane
93/// Phase 2, P2-P3).
94pub mod placement_cache;
95/// Unserved-queue honesty at the bridge seam (R1): the reason taxonomy,
96/// service policies, the two service clocks, and the queryable queue state.
97pub mod queue_service;
98/// Throttled per-namespace quota-state broadcaster for the ops-console live badge
99/// (Control-Plane Phase 2, P2-Q3).
100pub mod quota_broadcast;
101/// Short-TTL per-namespace concurrency-quota cache for the dispatcher's keyed
102/// backpressure (Control-Plane Phase 2, P2-Q2).
103pub mod quota_cache;
104/// Connected-worker registry and handles.
105pub mod registry;
106/// Managed-worker supervision (W-1..W-4): desired state in, contained OS
107/// processes out, with a status surface that is a join of the two.
108pub mod supervisor;
109/// One awaited call that hands a task to an already-chosen worker over
110/// whichever transport it registered on, with the deregistration decision
111/// carried as a type rather than inferred from a missing sender (#52).
112pub mod task_delivery;
113/// Transport-domain classification and re-dispatch budget for activities whose
114/// worker died before reporting a result.
115pub mod transport_loss;
116/// Server-side `{workspace_root}` expansion for declared action bodies (#139).
117pub mod workspace_root;
118
119pub use activity_cancel::{
120    CancelDelivery, CancelRequest, InFlightCancellation, cancel_in_flight_activities,
121};
122pub use admission_audit::AdmissionAudit;
123pub use attempt_progress::{AttemptProgress, attempt_progress};
124pub use backpressure::{Backpressure, OwnedShardFraction};
125pub use bridge::{OutboxDeliveryCallback, PendingActivities, WorkerActivityDispatcher};
126pub use declared_body::{
127    DeclaredBodies, DeclaredBodyLookup, DeclaredBodySource, DeclaredCommandDispatcher,
128    DeclaredCommandExecutor, DispatchingRun, EngineDeclaredBodies,
129};
130pub use declared_body_ambiguity::{DeclaringVersion, ambiguous_body_refusal};
131pub use declared_body_cancel::{DeclaredAttemptRegistration, DeclaredCommandAttempts};
132pub use declared_body_outbox::DeclaredBodyOutboxDispatch;
133pub use declared_body_selection::select_declared_body;
134pub use deployed_binary::{BinaryIdentityCaptureError, capture_binary_identity, lowercase_hex};
135pub use dispatch::{
136    ActivityCompletion, ActivityCompletionOutcome, ActivityCompletionSink, ActivityDispatcher,
137    ScheduledActivity, handle_activity_result,
138};
139pub use envelope::{CompletionFences, CompletionToken, idempotency_key};
140pub use grpc_liveness::{GrpcLivenessTarget, GrpcLivenessWaiters};
141pub use heartbeat::{
142    DispatchExclusion, HeartbeatSweeper, HeartbeatTracker, HeartbeatUpdate, InFlightActivity,
143    LostWorkerReport, TaskLiveness, sweep_interval,
144};
145pub use intervention::{AttemptKey, AttemptOwnerIndex, InterventionRouter, InterventionTransport};
146pub use lease_record::{
147    ActivityLeaseRecorder, EngineLeaseRecorder, LeaseHandoff, LeaseKey, LeaseRecordLedger,
148    LeaseRecorderSeam, attribution_for,
149};
150#[cfg(feature = "liminal-transport")]
151pub use liminal_liveness::{LivenessPing, LivenessPong, LivenessProbe, LivenessTarget};
152#[cfg(feature = "liminal-transport")]
153pub use liminal_transport::{
154    DispatchRequest, DispatchResponse, InterventionReply, InterventionRequest,
155    LiminalCompletionSource, LiminalConnectionNotifier, LiminalInterventionTransport,
156    LiminalWorkerDelivery, channel_for_row, dispatch_channel_name,
157};
158pub use outbox_delivery::ServerOutboxDeliveryCallback;
159pub use outbox_dispatcher::{
160    DeliveryGate, OutboxDispatcher, OutboxDispatcherConfig, OutboxRowDispatch, WorkerOutboxDispatch,
161};
162pub use outbox_reconciler::{OutboxReconciler, OutboxReconcilerConfig};
163pub use outbox_redrive::{RedriveRefused, list_dead_letters, redrive_dead_lettered_row};
164pub use outbox_settle::settle_terminal_outbox_rows;
165pub use placement_cache::{
166    PlacementCache, WorkerSelection, preferred_node_order, worker_selection_for,
167};
168pub use queue_service::{
169    ActivityReachability, DeliveryRefusal, EngineQueueDeclarations, ExpiredClock, OpenActivity,
170    PoolCensus, QueueDeclaration, QueueDeclarationSource, QueueDeclarations, QueueServiceConfig,
171    QueueServiceOverride, QueueServicePolicy, QueueServiceReason, QueueServiceState,
172    ServiceAddress, UnavailableSummary, UnservedDispatch, UnservedKey, UnservedQueue,
173    WorkerUnavailable, open_activities_in_active_segment,
174};
175pub use quota_broadcast::QuotaBroadcaster;
176pub use quota_cache::QuotaCache;
177pub use registry::{
178    ConnectedWorkerRegistry, DispatchReservation, RegistrationOptions,
179    UNBOUNDED_SENDER_WORKER_CONCURRENCY, WorkerDelivery, WorkerHandle, WorkerId,
180    WorkerRegistration,
181};
182pub use supervisor::{
183    Convergence, FleetShutdownReport, ManagedExecutable, ManagedWorkerExit, ManagedWorkerReport,
184    ManagedWorkerState, ManagedWorkerStatus, SpawnedBinary, SupervisionError, SupervisionPolicy,
185    WorkerSupervisor,
186};
187pub use transport_loss::{
188    TRANSPORT_EXHAUSTED_REASON_PREFIX, TRANSPORT_LOSS_BUDGET_WINDOWS, TransportLossLedger,
189    TransportLossVerdict, WORKER_LOST_REASON_PREFIX, is_transport_domain_reason,
190    worker_lost_detail,
191};
192pub use workspace_root::{
193    ExpandedCommand, WORKSPACE_ROOT_PLACEHOLDER, WorkspaceRoot, WorkspaceRootError,
194};