made_core/value_objects/validation_mode.rs
1//! [`ValidationMode`] — how strictly a council decision honours its
2//! configured [`OutputContract`].
3
4use serde::{Deserialize, Serialize};
5
6/// How the [`RunCouncilDecision`](crate::value_objects) RPC treats
7/// validator failures when picking a winner.
8#[derive(Debug, Clone, Copy, Eq, PartialEq, Serialize, Deserialize, Default)]
9pub enum ValidationMode {
10 /// Reject the deliberation if no candidate proposal satisfies the
11 /// contract. Surfaces `DomainError::NoValidProposal` to the
12 /// caller. This is the default and mirrors the historical
13 /// [`Deliberation::pick_winner`] semantics when an
14 /// [`OutputContract`] is configured.
15 #[default]
16 Strict,
17 /// Always return the top-ranked candidate as the winner, even if
18 /// it fails validation. The response carries a `passed=false`
19 /// outcome and per-candidate validator reports so the caller can
20 /// reason about the failure without losing the proposal.
21 Warn,
22}