nixfleet_state_machine/transitions/reverted.rs
1//! Transitions from `Reverted`. Terminal until the channel halt is lifted
2//! by a new declared SHA (RFC-0005 ยง3). The runtime creates a fresh
3//! `HostRolloutState` when the next rollout opens for this channel; this
4//! record stays `Reverted` as history.
5//!
6//! All events return `IllegalForState`. Like `Converged`, this branch
7//! exists to catch late-arriving events that shouldn't undo the
8//! terminal state.
9
10use chrono::{DateTime, Utc};
11use nixfleet_proto::RolloutPolicy;
12
13use crate::effect::Effect;
14use crate::error::TransitionError;
15use crate::event::Event;
16use crate::state::HostRolloutState;
17
18use super::illegal;
19
20pub(super) fn handle(
21 state: HostRolloutState,
22 event: Event,
23 _now: DateTime<Utc>,
24 _policy: &RolloutPolicy,
25) -> Result<(HostRolloutState, Vec<Effect>), TransitionError> {
26 Err(illegal(&state, &event))
27}