nixfleet_state_machine/transitions/
converged.rs

1//! Transitions from `Converged`. Terminal for this rollout — the runtime
2//! creates a NEW `HostRolloutState` (a fresh record with a new `rollout_id`)
3//! when the channel opens its next rollout. The existing `Converged` record
4//! is read-only history from this point.
5//!
6//! All events return `IllegalForState`. The runtime layer logs + drops
7//! (late retransmits are idempotent at the wire layer via `(host, rollout,
8//! seq)` dedup; this branch is for events that arrive AFTER the record
9//! has reached Converged and shouldn't move it elsewhere).
10
11use chrono::{DateTime, Utc};
12use nixfleet_proto::RolloutPolicy;
13
14use crate::effect::Effect;
15use crate::error::TransitionError;
16use crate::event::Event;
17use crate::state::HostRolloutState;
18
19use super::illegal;
20
21pub(super) fn handle(
22    state: HostRolloutState,
23    event: Event,
24    _now: DateTime<Utc>,
25    _policy: &RolloutPolicy,
26) -> Result<(HostRolloutState, Vec<Effect>), TransitionError> {
27    Err(illegal(&state, &event))
28}