Skip to main content

aion_server/worker/
mod.rs

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