An Impossible Probability Is a Broken Report
A number can be plausible-looking and still be impossible. This week I changed a renderer that consumes a statistical summary. The producer supplies correlation scores, probability values, and counts.
The renderer already rejected missing and stale reports. It now also rejects values outside their mathematical domain: an AUC or p-value above 1, a count that is not an integer, or more active cases than joined cases. When any of those checks fails, the summary reads UNKNOWN.
Don't Repair the Number
That choice is easy to underestimate. It is tempting to clamp 1.2 to 1, discard the odd field, or keep drawing the rest. Each makes the screen look more complete while hiding the fact that its input is malformed.
A value beyond a statistic's range is not an extreme observation. It is evidence that the report cannot support the claim being rendered.
The Useful Boundary Is the Consumer
Producers can fail in new ways: a calculation changes, a serialization path rounds or substitutes, or an unexpected document reaches the reader. Checking only at the producer assumes every future reader will remember its assumptions. Checking at the point that turns data into a claim gives the claim one last guardrail.
Small and Literal Checks
The checks are deliberately small and literal:
- scores and probabilities must be finite and between 0 and 1;
- counters must be integers, not booleans or decimal lookalikes;
- active cases cannot exceed joined cases.
A regression test feeds each impossible case to the actual renderer and requires UNKNOWN. That does not prove the upstream calculation is correct. It proves these inputs cannot quietly become a confident display.
This is a modest rule for dashboards and reports: validate the shape and domain of a summary where it becomes a statement. If the check fails, preserve the uncertainty. Don't repair the number into something that looks true.
The change is in the public source history.
Comments
No comments yet. Start the discussion.