Skip to main content

Crate magma_controller

Crate magma_controller 

Source
Expand description

magma-controller — complete operator-loop composition.

Wraps Reconciler + DriftPolicy + BudgetedReconciler + PlanStream + LifecycleState + Bundle + Metrics into ONE reusable controller. The “I want a complete operator” composition every reconciler kind plugs into.

Calling controller.reconcile(&config) runs the full loop:

  1. FSM Idle → Planning
  2. read_state (via budgeted reconciler)
  3. compute_plan + emit PlanComputed event + metrics
  4. classify drift against policy + emit DriftClassified event + metrics
  5. branch on ReconcileResult:
    • NoChange → FSM → Stable
    • Refused → FSM → Refused
    • HeldForApproval → FSM → Approving (caller drives further)
    • Applied → apply + emit ApplyOutcome event + metrics + FSM → Verifying → Stable
  6. build a tamper-evident magma-bundle
  7. return a typed ControllerOutcome carrying the bundle + final FSM state

Structs§

ControllerOutcome
Output of one reconcile(...) call. Wraps the typed ReconcileResult from magma-drift (no duplicate enum) plus the FSM lifecycle snapshot and the tamper-evident Bundle.
ReconcileController
The complete operator loop, parameterized by reconciler kind.

Enums§

ControllerError

Traits§

DynController
Erased ReconcileController surface, useful when storing many controllers of different kinds in one collection.