pub struct BucketStats {
pub bucket: String,
pub count: usize,
pub passed: usize,
pub pass_rate: f64,
pub advice: String,
pub advice_status: AdviceStatus,
}Expand description
Per-bucket calibration statistics.
Token economy (1.0.78): advice is skipped when empty — the
advice_status enum carries the same signal in a more compact form
for the well_calibrated / sample_too_small / unknown_label cases.
Fields§
§bucket: StringBucket label (e.g. “low”, “medium”, “high”, “critical”).
count: usizeTotal observations assigned to this bucket.
passed: usizeObservations that passed (predictor was right).
pass_rate: f64Pass rate as a fraction in [0.0, 1.0]. NaN when count == 0 (guard before use). Rounded to 4 decimal places.
advice: StringPlain-English advisory drawn from the gap between bucket label semantics and observed pass rate. Empty string when the bucket appears well-calibrated — skipped in serialization for that case (advice_status carries the signal).
advice_status: AdviceStatusWhy advice looks the way it does. Field-eval refinement
(1.0.73 AcmeProj run): an empty advice string had three
possible meanings — well-calibrated, sample-too-small,
or unknown-label — and consumers couldn’t tell which from
the JSON alone. This explicit status lets downstream tools
gate alerting / dashboards without re-deriving the
classification from count + bucket semantics.