use crate::enums::FiberState;
use crate::enums::QuantumLevel;
use crate::enums::VerificationDomain;
use crate::Primitives;
pub trait EulerCascade<P: Primitives> {
fn phase_parameter(&self) -> &P::String;
fn stage_count(&self) -> P::NonNegativeInteger;
fn convergence_angle(&self) -> &P::String;
}
pub trait PhaseRotationScheduler<P: Primitives> {
fn rotation_schedule(&self) -> &P::String;
fn base_angle(&self) -> &P::String;
}
pub trait TargetConvergenceAngle<P: Primitives> {
fn target_angle(&self) -> &P::String;
}
pub trait PhaseGateAttestation<P: Primitives> {
type CascadeStage: CascadeStage<P>;
fn gate_stage(&self) -> &Self::CascadeStage;
fn gate_expected_phase(&self) -> &P::String;
fn gate_result(&self) -> P::Boolean;
}
pub trait ComplexConjugateRollback<P: Primitives> {
type CascadeStage: CascadeStage<P>;
fn rollback_target(&self) -> &Self::CascadeStage;
}
pub trait CascadeStage<P: Primitives> {
fn stage_index(&self) -> P::NonNegativeInteger;
fn stage_name(&self) -> &P::String;
fn expected_phase(&self) -> &P::String;
type StatePredicate: crate::kernel::predicate::StatePredicate<P>;
fn entry_guard(&self) -> &Self::StatePredicate;
fn exit_guard(&self) -> &Self::StatePredicate;
type Effect: crate::kernel::effect::Effect<P>;
fn stage_effect(&self) -> &Self::Effect;
}
pub trait CascadeState<P: Primitives> {
type CascadeStage: CascadeStage<P>;
fn current_stage(&self) -> &Self::CascadeStage;
fn phase_angle(&self) -> &P::String;
fn pinned_mask(&self) -> &P::String;
fn free_count(&self) -> P::NonNegativeInteger;
fn fiber_state(&self) -> FiberState;
}
pub trait CascadeTransitionRule<P: Primitives> {
type GuardedTransition: crate::kernel::predicate::GuardedTransition<P>;
fn transition_guard(&self) -> &Self::GuardedTransition;
fn transition_effect(&self) -> &P::String;
fn transition_advance(&self) -> P::Boolean;
}
pub trait Epoch<P: Primitives> {
fn epoch_index(&self) -> P::NonNegativeInteger;
}
pub trait EpochBoundary<P: Primitives> {
fn epoch_boundary_type(&self) -> &P::String;
fn preserved_saturation(&self) -> P::Boolean;
}
pub trait PredicateExpression<P: Primitives> {
fn predicate_field(&self) -> &P::String;
fn predicate_operator(&self) -> &P::String;
fn predicate_value(&self) -> &P::String;
}
pub trait GuardExpression<P: Primitives> {
type PredicateExpression: PredicateExpression<P>;
fn guard_predicates(&self) -> &[Self::PredicateExpression];
}
pub trait TransitionEffect<P: Primitives> {
type PropertyBind: PropertyBind<P>;
fn effect_bindings(&self) -> &[Self::PropertyBind];
}
pub trait PropertyBind<P: Primitives> {
fn bind_target(&self) -> &P::String;
fn bind_value(&self) -> &P::String;
}
pub trait StageAdvance<P: Primitives> {
type CascadeStage: CascadeStage<P>;
fn advance_from(&self) -> &Self::CascadeStage;
fn advance_to(&self) -> &Self::CascadeStage;
}
pub trait ServiceWindow<P: Primitives> {
fn window_size(&self) -> P::NonNegativeInteger;
fn window_offset(&self) -> P::NonNegativeInteger;
fn base_context_ref(&self) -> &P::String;
}
pub trait CascadeTransaction<P: Primitives> {
fn transaction_policy(&self) -> &P::String;
fn transaction_outcome(&self) -> &P::String;
fn transaction_scope(&self) -> &P::String;
fn transaction_status(&self) -> &P::String;
}
pub trait PipelineSuccess<P: Primitives> {
fn saturation_reached(&self) -> P::Boolean;
fn final_saturation(&self) -> &P::String;
}
pub trait PipelineFailureReason<P: Primitives> {
fn failure_kind(&self) -> &P::String;
fn failure_stage(&self) -> &P::String;
}
pub trait PreflightCheck<P: Primitives> {
fn preflight_kind(&self) -> &P::String;
fn preflight_result(&self) -> &P::String;
fn preflight_order(&self) -> P::NonNegativeInteger;
}
pub trait FeasibilityResult<P: Primitives> {
fn feasibility_kind(&self) -> &P::String;
fn feasibility_witness(&self) -> &P::String;
fn infeasibility_kind(&self) -> &P::String;
}
pub trait LeaseState<P: Primitives> {
fn lease_phase(&self) -> &P::String;
}
pub trait ManagedLease<P: Primitives> {
fn managed_lease_id(&self) -> &P::String;
type LeaseState: LeaseState<P>;
fn lease_lifecycle(&self) -> &Self::LeaseState;
fn expiry_epoch(&self) -> P::NonNegativeInteger;
fn lease_budget(&self) -> P::NonNegativeInteger;
}
pub trait LeaseCheckpoint<P: Primitives> {
fn checkpoint_epoch(&self) -> P::NonNegativeInteger;
type CascadeState: CascadeState<P>;
fn checkpoint_state(&self) -> &Self::CascadeState;
fn lease_remaining_budget(&self) -> P::NonNegativeInteger;
}
pub trait BackPressureSignal<P: Primitives> {
fn pressure_level(&self) -> &P::String;
fn pressure_threshold(&self) -> &P::String;
fn source_stage(&self) -> &P::String;
fn target_stage(&self) -> &P::String;
}
pub trait DeferredQuerySet<P: Primitives> {
fn deferred_count(&self) -> P::NonNegativeInteger;
fn deferral_epoch(&self) -> P::NonNegativeInteger;
fn deferral_reason(&self) -> &P::String;
}
pub trait SubleaseTransfer<P: Primitives> {
fn source_lease_ref(&self) -> &P::String;
fn target_lease_ref(&self) -> &P::String;
fn transferred_budget(&self) -> P::NonNegativeInteger;
fn transfer_completed(&self) -> P::Boolean;
}
pub trait ComparisonPredicate<P: Primitives>: PredicateExpression<P> {
fn comparison_field(&self) -> &P::String;
fn comparison_operator(&self) -> &P::String;
fn comparison_value(&self) -> &P::String;
}
pub trait ConjunctionPredicate<P: Primitives>: PredicateExpression<P> {
fn conjuncts_count(&self) -> usize;
fn conjuncts_at(&self, index: usize) -> &P::String;
}
pub trait DisjunctionPredicate<P: Primitives>: PredicateExpression<P> {
fn disjuncts_count(&self) -> usize;
fn disjuncts_at(&self, index: usize) -> &P::String;
}
pub trait NegationPredicate<P: Primitives>: PredicateExpression<P> {
fn negated_predicate(&self) -> &P::String;
}
pub trait MembershipPredicate<P: Primitives>: PredicateExpression<P> {
fn membership_set(&self) -> &P::String;
fn membership_element(&self) -> &P::String;
}
pub trait SaturationPredicate<P: Primitives>: PredicateExpression<P> {
fn saturation_threshold(&self) -> &P::String;
}
pub trait FiberCoveragePredicate<P: Primitives>: PredicateExpression<P> {
fn coverage_target(&self) -> &P::String;
}
pub trait EqualsPredicate<P: Primitives>: PredicateExpression<P> {
fn equality_left(&self) -> &P::String;
fn equality_right(&self) -> &P::String;
}
pub trait NonNullPredicate<P: Primitives>: PredicateExpression<P> {
fn non_null_field(&self) -> &P::String;
}
pub trait QuerySubtypePredicate<P: Primitives>: PredicateExpression<P> {
fn query_type_ref(&self) -> &P::String;
}
pub trait CompileUnit<P: Primitives> {
type Term: crate::kernel::schema::Term<P>;
fn root_term(&self) -> &Self::Term;
fn unit_quantum_level(&self) -> QuantumLevel;
fn target_domains(&self) -> &[VerificationDomain];
fn thermodynamic_budget(&self) -> P::Decimal;
type Address: crate::kernel::address::Address<P>;
fn unit_address(&self) -> &Self::Address;
}
pub mod stage_initialization {
pub const EXPECTED_PHASE: &str = "Ω⁰";
pub const STAGE_INDEX: i64 = 0;
pub const STAGE_NAME: &str = "Initialization";
}
pub mod stage_declare {
pub const EXPECTED_PHASE: &str = "Ω¹";
pub const STAGE_INDEX: i64 = 1;
pub const STAGE_NAME: &str = "Declare";
}
pub mod stage_factorize {
pub const EXPECTED_PHASE: &str = "Ω²";
pub const STAGE_INDEX: i64 = 2;
pub const STAGE_NAME: &str = "Factorize";
}
pub mod stage_resolve {
pub const EXPECTED_PHASE: &str = "Ω³";
pub const STAGE_INDEX: i64 = 3;
pub const STAGE_NAME: &str = "Resolve";
}
pub mod stage_attest {
pub const EXPECTED_PHASE: &str = "Ω⁴";
pub const STAGE_INDEX: i64 = 4;
pub const STAGE_NAME: &str = "Attest";
}
pub mod stage_extract {
pub const EXPECTED_PHASE: &str = "Ω⁵";
pub const STAGE_INDEX: i64 = 5;
pub const STAGE_NAME: &str = "Extract";
}
pub mod stage_convergence {
pub const EXPECTED_PHASE: &str = "π";
pub const STAGE_INDEX: i64 = 6;
pub const STAGE_NAME: &str = "Convergence";
}
pub mod gate_initialization {
pub const GATE_EXPECTED_PHASE: &str = "Ω⁰";
pub const GATE_RESULT: bool = true;
pub const GATE_STAGE: &str = "https://uor.foundation/cascade/stage_initialization";
}
pub mod gate_declare {
pub const GATE_EXPECTED_PHASE: &str = "Ω¹";
pub const GATE_RESULT: bool = true;
pub const GATE_STAGE: &str = "https://uor.foundation/cascade/stage_declare";
}
pub mod gate_factorize {
pub const GATE_EXPECTED_PHASE: &str = "Ω²";
pub const GATE_RESULT: bool = true;
pub const GATE_STAGE: &str = "https://uor.foundation/cascade/stage_factorize";
}
pub mod gate_resolve {
pub const GATE_EXPECTED_PHASE: &str = "Ω³";
pub const GATE_RESULT: bool = true;
pub const GATE_STAGE: &str = "https://uor.foundation/cascade/stage_resolve";
}
pub mod gate_attest {
pub const GATE_EXPECTED_PHASE: &str = "Ω⁴";
pub const GATE_RESULT: bool = true;
pub const GATE_STAGE: &str = "https://uor.foundation/cascade/stage_attest";
}
pub mod gate_extract {
pub const GATE_EXPECTED_PHASE: &str = "Ω⁵";
pub const GATE_RESULT: bool = true;
pub const GATE_STAGE: &str = "https://uor.foundation/cascade/stage_extract";
}
pub mod euler_cascade_instance {
pub const CONVERGENCE_ANGLE: &str = "π";
pub const PHASE_PARAMETER: &str = "e^{iπ/6}";
pub const STAGE_COUNT: i64 = 6;
}
pub mod phase_schedule {
pub const BASE_ANGLE: &str = "π/6";
pub const ROTATION_SCHEDULE: &str = "Ω⁰, Ω¹, Ω², Ω³, Ω⁴, Ω⁵";
}
pub mod convergence_target {
pub const TARGET_ANGLE: &str = "π";
}
pub mod conjugate_rollback {
pub const ROLLBACK_TARGET: &str = "https://uor.foundation/cascade/stage_initialization";
}
pub mod dispatch_miss {
pub const FAILURE_KIND: &str = "DispatchMiss";
}
pub mod grounding_failure {
pub const FAILURE_KIND: &str = "GroundingFailure";
}
pub mod convergence_stall {
pub const FAILURE_KIND: &str = "ConvergenceStall";
}
pub mod contradiction_detected {
pub const FAILURE_KIND: &str = "ContradictionDetected";
}
pub mod coherence_violation {
pub const FAILURE_KIND: &str = "CoherenceViolation";
}
pub mod full_saturation_success {
pub const SATURATION_REACHED: bool = true;
}
pub mod feasibility_check {
pub const PREFLIGHT_KIND: &str = "Feasibility";
pub const PREFLIGHT_ORDER: i64 = 1;
}
pub mod dispatch_coverage_check {
pub const PREFLIGHT_KIND: &str = "DispatchCoverage";
pub const PREFLIGHT_ORDER: i64 = 2;
}
pub mod package_coherence_check {
pub const PREFLIGHT_KIND: &str = "PackageCoherence";
pub const PREFLIGHT_ORDER: i64 = 3;
}
pub mod default_service_window {
pub const WINDOW_OFFSET: i64 = 0;
pub const WINDOW_SIZE: i64 = 3;
}
pub mod advance_init_to_declare {
pub const ADVANCE_FROM: &str = "https://uor.foundation/cascade/stage_initialization";
pub const ADVANCE_TO: &str = "https://uor.foundation/cascade/stage_declare";
}
pub mod atomic_transaction {
pub const TRANSACTION_POLICY: &str = "AllOrNothing";
}
pub mod empty_guard {}
pub mod identity_effect {}
pub mod true_predicate {
pub const PREDICATE_FIELD: &str = "*";
pub const PREDICATE_OPERATOR: &str = "true";
pub const PREDICATE_VALUE: &str = "*";
}
pub mod noop_bind {
pub const BIND_TARGET: &str = "none";
pub const BIND_VALUE: &str = "unchanged";
}
pub mod pending {
pub const LEASE_PHASE: &str = "Pending";
}
pub mod active {
pub const LEASE_PHASE: &str = "Active";
}
pub mod released {
pub const LEASE_PHASE: &str = "Released";
}
pub mod expired {
pub const LEASE_PHASE: &str = "Expired";
}
pub mod suspended {
pub const LEASE_PHASE: &str = "Suspended";
}
pub mod feasibility_witness {
pub const FEASIBILITY_KIND: &str = "Feasible";
}
pub mod infeasibility_witness {
pub const FEASIBILITY_KIND: &str = "Infeasible";
pub const FEASIBILITY_WITNESS: &str = "obstruction detected";
}
pub mod preflight_timing {
pub const PREFLIGHT_KIND: &str = "Timing";
pub const PREFLIGHT_ORDER: i64 = 4;
}
pub mod runtime_timing {
pub const PREFLIGHT_KIND: &str = "RuntimeTiming";
pub const PREFLIGHT_ORDER: i64 = 5;
}
pub mod budget_solvency_check {
pub const PREFLIGHT_KIND: &str = "BudgetSolvency";
pub const PREFLIGHT_ORDER: i64 = 0;
}
pub mod back_pressure_default {
pub const PRESSURE_LEVEL: &str = "Medium";
pub const PRESSURE_THRESHOLD: &str = "0.75";
}