feat(causal): fidelity footer in render_summary

One unconditional footer line whenever there are results:
"note: impacts are lower bounds — undershoot grows with speedup pct;
rankings unaffected" — surfacing the RFC 007 Validation fidelity statement
where users actually look, instead of only in the RFC. Wording pinned by
the summary test.
This commit is contained in:
Claude (sandbox)
2026-07-13 11:11:20 +00:00
parent a4647f368a
commit a2d0b7af18
2 changed files with 15 additions and 0 deletions
+11
View File
@@ -582,6 +582,11 @@ mod inner {
/// each virtual speedup and the change relative to that site's own 0% /// each virtual speedup and the change relative to that site's own 0%
/// baseline. A near-zero column across speedups means: optimising this /// baseline. A near-zero column across speedups means: optimising this
/// site buys you nothing — the RFC's headline answer. /// site buys you nothing — the RFC's headline answer.
///
/// Ends with a one-line fidelity note (RFC 007 Validation): reported
/// impacts are conservative — the controller undershoots ideal injection
/// at high speedup pcts, so gains are lower bounds; site *rankings* are
/// unaffected.
pub fn render_summary(results: &[ExperimentResult]) -> String { pub fn render_summary(results: &[ExperimentResult]) -> String {
use std::fmt::Write; use std::fmt::Write;
let mut s = String::new(); let mut s = String::new();
@@ -612,6 +617,12 @@ mod inner {
} }
} }
} }
if !results.is_empty() {
let _ = writeln!(
s,
"note: impacts are lower bounds — undershoot grows with speedup pct; rankings unaffected"
);
}
s s
} }
+4
View File
@@ -330,6 +330,10 @@ fn controller_produces_report() {
let summary = smarm::causal::render_summary(&results); let summary = smarm::causal::render_summary(&results);
assert!(summary.contains("stage-x"), "summary: {summary}"); assert!(summary.contains("stage-x"), "summary: {summary}");
assert!(summary.contains("items"), "summary: {summary}"); assert!(summary.contains("items"), "summary: {summary}");
assert!(
summary.contains("impacts are lower bounds"),
"fidelity footer missing: {summary}"
);
let coz = smarm::causal::render_coz(&results); let coz = smarm::causal::render_coz(&results);
assert!(coz.contains("experiment\tselected=stage-x"), "coz: {coz}"); assert!(coz.contains("experiment\tselected=stage-x"), "coz: {coz}");