FA-6371 / Discrete calculus / Open access
Trapezoidal integral unit grid · case 01
Every sample receives a full interval weight, including both endpoints.
ROOT CAUSE
Every sample receives a full interval weight, including both endpoints.
VERIFIED REPAIR
Apply the specified mathematical contract directly, preserving all terms and boundary cases: return str(sum((Fraction(a+b,2) for a,b in zip(values,values[1:])),Fraction()))
Unsuccessful approach: A left rectangle rule omits the right endpoint averaging.
Case contract
Integer sample values and compatible sample-array lengths. Rational results are reduced Fraction strings; spacing is positive unless explicitly stated otherwise. Trapezoidal integral unit grid. Exact operational definition: str(sum((Fraction(a+b,2) for a,b in zip(values,values[1:])),Fraction()))
Why this case matters
Small exact fixtures expose this error without platform timing, external services, or probabilistic observations. Discrete calculus 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(values):
return str(sum(values))
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([0, 1, 2],)', solve(*([0, 1, 2],)), '2')
check('fixture 2: ([3, 3],)', solve(*([3, 3],)), '3')
check('fixture 3: ([5],)', solve(*([5],)), '0')
check('fixture 4: ([],)', solve(*([],)), '0')
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: ([0, 1, 2],) | 3 | 2 | Failed |
| fixture 2: ([3, 3],) | 6 | 3 | Failed |
| fixture 3: ([5],) | 5 | 0 | Failed |
| fixture 4: ([],) | 0 | 0 | Passed |
SHA-256 / 8560df9d02b7a4d7ece173756f151e84ac1665638e5a38fc9caf1fb397f0b9f1
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(values):
return str(sum(values[:-1]))
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([0, 1, 2],)', solve(*([0, 1, 2],)), '2')
check('fixture 2: ([3, 3],)', solve(*([3, 3],)), '3')
check('fixture 3: ([5],)', solve(*([5],)), '0')
check('fixture 4: ([],)', solve(*([],)), '0')
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: ([0, 1, 2],) | 1 | 2 | Failed |
| fixture 2: ([3, 3],) | 3 | 3 | Passed |
| fixture 3: ([5],) | 0 | 0 | Passed |
| fixture 4: ([],) | 0 | 0 | Passed |
SHA-256 / 47c154aa6e47c1be94b3281a1ddc6dc07d31d1a317320c32776b15db51bbb758
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(values):
return str(sum((Fraction(a+b,2) for a,b in zip(values,values[1:])),Fraction()))
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([0, 1, 2],)', solve(*([0, 1, 2],)), '2')
check('fixture 2: ([3, 3],)', solve(*([3, 3],)), '3')
check('fixture 3: ([5],)', solve(*([5],)), '0')
check('fixture 4: ([],)', solve(*([],)), '0')
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: ([0, 1, 2],) | 2 | 2 | Passed |
| fixture 2: ([3, 3],) | 3 | 3 | Passed |
| fixture 3: ([5],) | 0 | 0 | Passed |
| fixture 4: ([],) | 0 | 0 | Passed |
SHA-256 / 27ade3b852026b62779e8da7f59ef0f4f2442d4eb857ab9d7f56ff31bbaf1563
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:38:01.002172+00:00.
Case digest / 99e9d350fd836ad33507f597424f69a4c84af0c7c0d82696c20a2e5dcf2a0701