1#![deny(warnings)]
2#![allow(missing_docs)]
3#![deny(unsafe_code)]
4#![doc = "Definition of Done: Type-safe, deterministic autonomous substrate"]
5
6pub mod autonomic;
31pub mod binding_completeness;
32pub mod contract;
33pub mod decision;
34pub mod decision_closure;
35pub mod doctrine;
36pub mod error;
37pub mod invariant;
38pub mod kernel;
39pub mod observation;
40pub mod receipt;
41pub mod replay;
42pub mod tenant;
43pub mod timing;
44
45pub use autonomic::mape_k::{
47 AnalysisPhase, ExecutionPhase, MAPEKLoop, ObservationPhase, PlanningPhase,
48};
49pub use contract::{Contract, ContractId, ContractVersion, Ontology};
50pub use decision::{Decision, DecisionId, DecisionStore};
51pub use doctrine::DoctrineCompliance;
52pub use error::{DoDError, DoDResult};
53pub use invariant::{Invariant, InvariantChecker, InvariantId};
54pub use kernel::{Kernel, KernelAction, KernelDecision};
55pub use observation::{Observation, ObservationId, ObservationSchema, ObservationType};
56pub use receipt::{Receipt, ReceiptId, ReceiptStore};
57pub use tenant::{TenantContext, TenantId, TenantIsolation};
58pub use timing::{TimingEnforcer, TimingGuarantee, TimingMeasurement};
59
60pub mod constants {
62 pub const KERNEL_MAX_TIME_MS: u64 = 8;
64
65 pub const MAX_OBSERVATION_SIZE: usize = 1024 * 1024; pub const MAX_SCHEMA_DEPTH: usize = 256;
70
71 pub const MAX_FANOUT: usize = 1024;
73
74 pub const MAX_PROMOTION_RATE_PER_HOUR: usize = 100;
76
77 pub mod proof_thresholds {
79 pub const WEAK_PROOF: u8 = 30;
81 pub const STANDARD_PROOF: u8 = 50;
83 pub const STRONG_PROOF: u8 = 70;
85 pub const CRITICAL_PROOF: u8 = 80;
87 }
88}
89
90#[cfg(test)]
91mod tests {
92 use super::*;
93
94 #[test]
95 fn test_constants_consistency() {
96 assert!(
98 constants::proof_thresholds::WEAK_PROOF < constants::proof_thresholds::STANDARD_PROOF
99 );
100 assert!(
101 constants::proof_thresholds::STANDARD_PROOF < constants::proof_thresholds::STRONG_PROOF
102 );
103 assert!(
104 constants::proof_thresholds::STRONG_PROOF < constants::proof_thresholds::CRITICAL_PROOF
105 );
106 }
107}