From a2d0b7af189069ce962e6ba72e828ca8831e9094 Mon Sep 17 00:00:00 2001 From: "Claude (sandbox)" Date: Mon, 13 Jul 2026 11:11:20 +0000 Subject: [PATCH] feat(causal): fidelity footer in render_summary MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- src/causal.rs | 11 +++++++++++ tests/causal.rs | 4 ++++ 2 files changed, 15 insertions(+) diff --git a/src/causal.rs b/src/causal.rs index b9a413e..751ed9b 100644 --- a/src/causal.rs +++ b/src/causal.rs @@ -582,6 +582,11 @@ mod inner { /// each virtual speedup and the change relative to that site's own 0% /// baseline. A near-zero column across speedups means: optimising this /// 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 { use std::fmt::Write; 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 } diff --git a/tests/causal.rs b/tests/causal.rs index 653700b..e857337 100644 --- a/tests/causal.rs +++ b/tests/causal.rs @@ -330,6 +330,10 @@ fn controller_produces_report() { let summary = smarm::causal::render_summary(&results); assert!(summary.contains("stage-x"), "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); assert!(coz.contains("experiment\tselected=stage-x"), "coz: {coz}");