Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/spark-rsi-mv/blob/main/src/measure/claims.rs # spark-rsi-mv Native Rust recursive self-improvement engine with paired bootstrap evaluation and cryptographic ledger Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `spark-rsi-mv / src / measure / claims.rs` 28 lines ยท 1174 bytes Raw Blame History 1 //! Claim policy: which proposals need a measured diagnosis before they may be promoted. 2 3 use crate::models::ProposalKind; 4 5 /// An Optimization proposal, or any proposal while `require_latency_improvement` is on, claims a 6 /// performance gain and so needs a measured diagnosis. Other kinds proceed on structural ranking. 7 pub fn requires_measured_diagnosis(kind: &ProposalKind, require_latency_improvement: bool) -> bool { 8 require_latency_improvement || *kind == ProposalKind::Optimization 9 } 10 11 /// `diagnosis_measured` is true only when the top-ranked stage's latency is measured. 12 pub fn check_claim( 13 kind: &ProposalKind, 14 require_latency_improvement: bool, 15 diagnosis_measured: bool, 16 ) -> Result<(), String> { 17 if requires_measured_diagnosis(kind, require_latency_improvement) && !diagnosis_measured { 18 let why = if require_latency_improvement { 19 "require_latency_improvement is on" 20 } else { 21 "the proposal is an Optimization" 22 }; 23 return Err(format!( 24 "Claim refused before staging: {why}, but the top-ranked stage has no measured latency (unavailable diagnosis)" 25 )); 26 } 27 Ok(()) 28 }