#![warn(missing_docs)]
#![warn(clippy::all)]
pub mod types;
pub mod runtime_core;
pub mod fabrics;
pub mod allocator;
pub mod invariants;
pub mod temporal;
pub mod scheduler;
pub mod config;
pub mod telemetry;
pub use runtime_core::{
MapleRuntime, ResonatorHandle, CouplingHandle, ScheduleHandle,
ResonatorSpec, ResonatorIdentitySpec, ContinuityProof,
};
pub use types::{
ResonatorId, ResonatorProfile, PresenceState, PresenceConfig,
Coupling, CouplingParams, CouplingScope, CouplingPersistence, SymmetryType,
AttentionBudget, AttentionBudgetSpec, AttentionClass,
Commitment, CommitmentContent, CommitmentStatus,
TemporalAnchor, LocalTimestamp,
};
pub use invariants::{ArchitecturalInvariant, InvariantViolation};
pub use types::{
BootstrapError, ShutdownError, RegistrationError, ResumeError,
PresenceError, CouplingError, AttentionError, CommitmentError,
SchedulingError, 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();
tokio::time::sleep(tokio::time::Duration::from_millis(1100)).await;
let presence = PresenceState::new();
let result = resonator.signal_presence(presence).await;
assert!(result.is_ok(), "Presence signaling failed: {:?}", result);
}
#[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());
}
}