#![cfg_attr(feature = "strict-docs", warn(missing_docs))]
#![cfg_attr(not(feature = "strict-docs"), allow(missing_docs))]
#![warn(clippy::all)]
pub mod allocator;
pub mod config;
pub mod fabrics;
pub mod invariants;
pub mod runtime_core;
pub mod scheduler;
pub mod telemetry;
pub mod temporal;
pub mod types;
pub use runtime_core::{
ContinuityProof, CouplingHandle, MapleRuntime, ResonatorHandle, ResonatorIdentitySpec,
ResonatorSpec, ScheduleHandle,
};
pub use types::{
AttentionBudget, AttentionBudgetSpec, AttentionClass, Commitment, CommitmentContent,
CommitmentStatus, Coupling, CouplingParams, CouplingPersistence, CouplingScope, LocalTimestamp,
PresenceConfig, PresenceState, ResonatorId, ResonatorProfile, SymmetryType, TemporalAnchor,
};
pub use invariants::{ArchitecturalInvariant, InvariantViolation};
pub use types::{
AttentionError, BootstrapError, CommitmentError, CouplingError, PresenceError,
RegistrationError, ResumeError, SchedulingError, ShutdownError, TemporalError,
};
#[cfg(test)]
mod tests {
use super::*;
#[tokio::test]
async fn test_runtime_bootstrap() {
let config = config::RuntimeConfig::default();
let runtime = MapleRuntime::bootstrap(config).await;
assert!(runtime.is_ok());
}
#[tokio::test]
async fn test_resonator_registration() {
let config = config::RuntimeConfig::default();
let runtime = MapleRuntime::bootstrap(config).await.unwrap();
let spec = ResonatorSpec::default();
let result = runtime.register_resonator(spec).await;
assert!(result.is_ok());
}
#[tokio::test]
async fn test_mapleverse_config() {
let config = config::mapleverse_runtime_config();
let runtime = MapleRuntime::bootstrap(config).await;
assert!(runtime.is_ok());
}
#[tokio::test]
async fn test_finalverse_config() {
let config = config::finalverse_runtime_config();
let runtime = MapleRuntime::bootstrap(config).await;
assert!(runtime.is_ok());
}
#[tokio::test]
async fn test_ibank_config() {
let config = config::ibank_runtime_config();
let runtime = MapleRuntime::bootstrap(config).await;
assert!(runtime.is_ok());
}
#[tokio::test]
async fn test_presence_signaling() {
let config = config::RuntimeConfig::default();
let runtime = MapleRuntime::bootstrap(config).await.unwrap();
let spec = ResonatorSpec::default();
let resonator = runtime.register_resonator(spec).await.unwrap();
let presence = PresenceState::new();
let result = resonator.signal_presence(presence).await;
assert!(result.is_ok(), "Presence signaling failed: {:?}", result);
let result = resonator.signal_presence(PresenceState::new()).await;
assert!(matches!(result, Err(PresenceError::RateLimitExceeded)));
}
#[tokio::test]
async fn test_shutdown() {
let config = config::RuntimeConfig::default();
let runtime = MapleRuntime::bootstrap(config).await.unwrap();
let result = runtime.shutdown().await;
assert!(result.is_ok());
}
}