FA-6271 / Statistics / Open access
Binary precision rational · case 01
Recall denominator replaces predicted-positive count.
ROOT CAUSE
Recall denominator replaces predicted-positive count.
VERIFIED REPAIR
Apply the specified mathematical contract directly, preserving all terms and boundary cases: return str(Fraction(tp,tp+fp)) if tp+fp else None
Unsuccessful approach: Inverting the ratio permits precision above one.
Case contract
Integer finite observations and equal lengths for paired samples. Counts and weights are nonnegative. Rational results use reduced Fraction strings. Empty or undefined statistics return None where shown. tp,fp,fn are nonnegative counts; undefined zero-denominator precision returns None. Exact operational definition: str(Fraction(tp,tp+fp)) if tp+fp else None
Why this case matters
Small exact fixtures expose this error without platform timing, external services, or probabilistic observations. Statistical estimators results depend on the stated convention.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR
N = 1
observations = []
def solve(tp, fp, fn):
return str(Fraction(tp,tp+fn)) if tp+fn else None
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (3, 1, 2)', solve(*(3, 1, 2)), '3/4')
check('fixture 2: (0, 2, 1)', solve(*(0, 2, 1)), '0')
check('fixture 3: (0, 0, 2)', solve(*(0, 0, 2)), None)
check('fixture 4: (5, 0, 1)', solve(*(5, 0, 1)), '1')
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| fixture 1: (3, 1, 2) | 3/5 | 3/4 | Failed |
| fixture 2: (0, 2, 1) | 0 | 0 | Passed |
| fixture 3: (0, 0, 2) | 0 | None | Failed |
| fixture 4: (5, 0, 1) | 5/6 | 1 | Failed |
SHA-256 / d7fcdfd886f5ddb76c5cda717b7fde26ae94f96a2d7c4ebf154bc7a8375e2f8a
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR
N = 1
observations = []
def solve(tp, fp, fn):
return str(Fraction(tp+fp,tp)) if tp else None
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (3, 1, 2)', solve(*(3, 1, 2)), '3/4')
check('fixture 2: (0, 2, 1)', solve(*(0, 2, 1)), '0')
check('fixture 3: (0, 0, 2)', solve(*(0, 0, 2)), None)
check('fixture 4: (5, 0, 1)', solve(*(5, 0, 1)), '1')
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| fixture 1: (3, 1, 2) | 4/3 | 3/4 | Failed |
| fixture 2: (0, 2, 1) | None | 0 | Failed |
| fixture 3: (0, 0, 2) | None | None | Passed |
| fixture 4: (5, 0, 1) | 1 | 1 | Passed |
SHA-256 / 7034f6fbf1a1ca3c5352619e0611f4fc674e3f7621f7128f2e3fb7373e2198c0
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR
N = 1
observations = []
def solve(tp, fp, fn):
return str(Fraction(tp,tp+fp)) if tp+fp else None
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (3, 1, 2)', solve(*(3, 1, 2)), '3/4')
check('fixture 2: (0, 2, 1)', solve(*(0, 2, 1)), '0')
check('fixture 3: (0, 0, 2)', solve(*(0, 0, 2)), None)
check('fixture 4: (5, 0, 1)', solve(*(5, 0, 1)), '1')
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| fixture 1: (3, 1, 2) | 3/4 | 3/4 | Passed |
| fixture 2: (0, 2, 1) | 0 | 0 | Passed |
| fixture 3: (0, 0, 2) | None | None | Passed |
| fixture 4: (5, 0, 1) | 1 | 1 | Passed |
SHA-256 / db7a82282b4231f4a91847ebb6d58cfc1f5474563e23a111d860b363c7463f03
Verification & scope
This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.
Observations recorded using Python 3.12.14 at 2026-09-29T14:37:59.558543+00:00.
Case digest / b42a0eb8243299a6276a69d755a2d0521868d7deb58b88945fee183dc32b879c