Skip to main content

aurum_core/runtime/
mod.rs

1//! Runtime lifecycle, concurrency, and resource governance (JOE-1573).
2//!
3//! Modules:
4//! - [`op_context`] — per-operation cancel/deadline/progress
5//! - [`governor`] — process/engine admission permits and overload policy
6//! - [`singleflight`] — per-key load coalescing
7//! - [`registry`] — weighted model residency and eviction
8//! - [`lifecycle`] — Running → ShuttingDown → Stopped (for FFI / process)
9//!
10//! ## Profiles
11//!
12//! [`GovernorConfig::default`] is a conservative desktop profile. Use
13//! [`GovernorConfig::mobile`] or [`GovernorConfig::server`] for known deployments.
14//! Process-global defaults live on [`ResourceGovernor::process_global`] for
15//! convenience constructors only. **Engine-bound** remote providers must use the
16//! engine-local governor from [`crate::provider_platform::ProviderBuildContext`]
17//! (JOE-1975) so concurrent engines do not share remote admission.
18
19pub mod governor;
20pub mod lifecycle;
21pub mod op_context;
22pub mod registry;
23pub mod singleflight;
24
25pub use governor::{GovernorConfig, GovernorStats, PermitKind, ResourceGovernor, ResourcePermit};
26pub use lifecycle::{AdmissionError, Lifecycle, LifecycleState, OpAdmission, ShutdownError};
27pub use op_context::{OpContext, OpProgress, ProgressSink};
28pub use registry::{
29    ModelRegistry, RegistryConfig, RegistryEntry, RegistryPin, RegistrySnapshot, ResidencyWeight,
30};
31pub use singleflight::{BeginLoad, LeaderGuard, LoadKey, Singleflight};