Skip to main content

made_core/value_objects/
scoring_mode.rs

1//! [`ScoringMode`] — how a judge-aware scorer derived a proposal's score.
2//!
3//! The signal behind the scoring-mode-integrity metric. When an LLM judge
4//! is wired but a proposal's score still comes from the pass-fraction
5//! fallback, the judge silently did not score it — a misconfiguration the
6//! service keeps "working" through. Counting the two modes makes that
7//! visible.
8
9/// Which branch a judge-aware scoring policy took for one proposal.
10#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
11pub enum ScoringMode {
12    /// The judge's verdict was present and used as the score.
13    JudgeVerdict,
14    /// No judge verdict was present; the score fell back to the structural
15    /// pass-fraction.
16    UniformFallback,
17}
18
19impl ScoringMode {
20    /// Stable, low-cardinality label value for metrics exposition.
21    #[must_use]
22    pub const fn as_label(self) -> &'static str {
23        match self {
24            Self::JudgeVerdict => "judge_verdict",
25            Self::UniformFallback => "uniform_fallback",
26        }
27    }
28}
29
30#[cfg(test)]
31mod tests {
32    use super::*;
33
34    #[test]
35    fn labels_are_distinct_and_stable() {
36        assert_eq!(ScoringMode::JudgeVerdict.as_label(), "judge_verdict");
37        assert_eq!(ScoringMode::UniformFallback.as_label(), "uniform_fallback");
38    }
39}