sim_lib_music_serial/evidence.rs
1//! Search receipts and public outcomes for serial-row extraction.
2
3use sim_lib_discrete_search::SearchReceipt;
4
5use crate::RankedSerialHypothesis;
6
7/// Search evidence returned alongside every extraction result.
8#[derive(Clone, Debug, PartialEq, Eq)]
9pub struct ExtractionEvidence {
10 /// Exact bounded-search receipt from the generic discrete owner.
11 pub search: SearchReceipt,
12 /// Stable description of the source attack groups considered.
13 pub source_summary: Vec<String>,
14}
15
16/// Public extraction result.
17#[derive(Clone, Debug, PartialEq, Eq)]
18pub enum ExtractionOutcome {
19 /// Exactly one strongest hypothesis survived and the search exhausted.
20 Complete {
21 /// Selected hypothesis.
22 hypothesis: Box<RankedSerialHypothesis>,
23 /// Ranked alternatives, including `hypothesis` as the first entry.
24 ranked: Vec<RankedSerialHypothesis>,
25 /// Search evidence.
26 evidence: ExtractionEvidence,
27 },
28 /// Multiple plausible hypotheses remain after a complete bounded run.
29 Ambiguous {
30 /// Ranked hypotheses in stable ascending order.
31 ranked: Vec<RankedSerialHypothesis>,
32 /// Search evidence.
33 evidence: ExtractionEvidence,
34 },
35 /// The generic search control stopped the run before exhaustion.
36 BudgetExhausted {
37 /// Ranked hypotheses found before the bound stopped the run.
38 ranked: Vec<RankedSerialHypothesis>,
39 /// Search evidence.
40 evidence: ExtractionEvidence,
41 },
42}