pub struct CandidateRecord {
pub candidate: Candidate,
pub status: CandidateStatus,
pub evaluation: Option<CandidateEvaluation>,
pub promotion: Option<PromotionReceipt>,
pub rollback: Option<RollbackReceipt>,
}Expand description
A candidate and its lifecycle state: the store row both server
backends persist. Transitions go through the apply_* methods, which
enforce the state machine (created → evaluated → promoted → rolled
back) and refuse everything else as a typed error — the store trusts
what the gate admitted, exactly as the memory store trusts the write
gate.
Fields§
§candidate: CandidateThe candidate itself (immutable).
status: CandidateStatusWhere it is in its lifecycle.
evaluation: Option<CandidateEvaluation>The journaled evaluation (set on evaluate; replaced on re-evaluation — a new dataset version is a new evaluation).
promotion: Option<PromotionReceipt>The journaled promotion receipt (set on promote).
rollback: Option<RollbackReceipt>The journaled rollback receipt (set on rollback).
Implementations§
Source§impl CandidateRecord
impl CandidateRecord
Sourcepub fn candidate_id(&self) -> &CandidateId
pub fn candidate_id(&self) -> &CandidateId
The candidate’s id.
Sourcepub fn apply_evaluation(
&mut self,
evaluation: CandidateEvaluation,
) -> Result<(), LearnError>
pub fn apply_evaluation( &mut self, evaluation: CandidateEvaluation, ) -> Result<(), LearnError>
Record an evaluation: created → evaluated, or evaluated → evaluated for re-evaluation (a new dataset version is a new
evaluation; the effect key names both). Refused from promoted
and rolled_back: re-evaluating a settled candidate reads as a
new distillation, and the model keeps that honest by requiring
one.
Sourcepub fn apply_promotion(
&mut self,
receipt: PromotionReceipt,
) -> Result<(), LearnError>
pub fn apply_promotion( &mut self, receipt: PromotionReceipt, ) -> Result<(), LearnError>
Record a promotion: evaluated → promoted. The gate
(admit_promotion) must already have cleared — this method
enforces the state machine, not the evidence bar.
Sourcepub fn apply_rollback(
&mut self,
receipt: RollbackReceipt,
) -> Result<(), LearnError>
pub fn apply_rollback( &mut self, receipt: RollbackReceipt, ) -> Result<(), LearnError>
Record a rollback: promoted → rolled_back.
Trait Implementations§
Source§impl Clone for CandidateRecord
impl Clone for CandidateRecord
Source§fn clone(&self) -> CandidateRecord
fn clone(&self) -> CandidateRecord
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more