FA-61336 / Bond day-count conventions / Open access
Deposit maturity with the end-to-end rule: the end-to-end maturity is the calendar month end · case 01
Maturities fall on weekends and holidays at month end.
ROOT CAUSE
The target is the calendar last day of the target month without business-day adjustment.
VERIFIED REPAIR
Mature on the last business day of the target month.
Unsuccessful approach: Stepping back only over weekends ignores month-end holidays.
Case contract
Inputs a start business day, tenor in months, holidays, principal and rate. If the start is the last business day of its month, maturity is the last business day of the target month; otherwise maturity is the start day clamped into the target month and adjusted modified following. Interest = principal*rate*days/360 rounded to 2. Return [maturity, interest].
Why this case matters
Bond accrual and pricing systems depend on exact day-count arithmetic; a single-day error changes settlement cash.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import datetime
N = 1
observations = []
def solve(start, tenor, holidays, principal, rate):
S = datetime.date(*start)
H = {datetime.date(*h) for h in holidays}
def biz(x):
return x.weekday() < 5 and x not in H
def mlen(y, m):
if m == 2:
return 29 if (y % 4 == 0 and y % 100 != 0) or y % 400 == 0 else 28
return 30 if m in (4, 6, 9, 11) else 31
def last_biz(y, m):
x = datetime.date(y, m, mlen(y, m))
while not biz(x):
x -= datetime.timedelta(days=1)
return x
def mf(x):
f = x
while not biz(f):
f += datetime.timedelta(days=1)
if f.month != x.month:
f = x
while not biz(f):
f -= datetime.timedelta(days=1)
return f
t = S.year * 12 + S.month - 1 + tenor
y, m = t // 12, t % 12 + 1
if S == last_biz(S.year, S.month):
M = datetime.date(y, m, mlen(y, m))
else:
M = mf(datetime.date(y, m, min(S.day, mlen(y, m))))
interest = round(principal * rate * (M - S).days / 360, 2)
return [[M.year, M.month, M.day], interest]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression end-end target 1', [[2024, 5, 31], 6, [[2024, 11, 30], [2024, 11, 28], [2024, 11, 27]], 1000000, 0.0125], [[2024, 11, 29], 6319.44]], ['regression end-end target 2', [[2022, 6, 30], 1, [[2022, 7, 29], [2022, 7, 27], [2022, 7, 29]], 250000, 0.053], [[2022, 7, 28], 1030.56]], ['partial repair probe 1', [[2019, 2, 28], 2, [[2019, 4, 30], [2019, 4, 26], [2019, 4, 26]], 1000000, 0.053], [[2019, 4, 29], 8833.33]], ['partial repair probe 2', [[2024, 12, 31], 3, [[2025, 3, 30], [2025, 3, 31]], 1000000, 0.053], [[2025, 3, 28], 12808.33]], ['normal control 1', [[2025, 3, 17], 2, [[2025, 5, 28], [2025, 5, 27]], 250000, 0.0425], [[2025, 5, 19], 1859.38]], ['normal control 2', [[2024, 3, 4], 2, [[2024, 5, 30], [2024, 5, 27], [2024, 5, 31]], 250000, 0.0125], [[2024, 5, 6], 546.88]], ['normal control 3', [[2023, 7, 7], 3, [[2023, 10, 29], [2023, 10, 30], [2023, 10, 28]], 1000000, 0.0425], [[2023, 10, 9], 11097.22]], ['normal control 4', [[2025, 5, 30], 1, [[2025, 6, 27]], 250000, 0.053], [[2025, 6, 30], 1140.97]]], [['regression end-end target 1', [[2025, 12, 31], 1, [], 1000000, 0.0125], [[2026, 1, 30], 1041.67]], ['regression end-end target 2', [[2019, 3, 29], 3, [[2019, 6, 27]], 1000000, 0.0425], [[2019, 6, 28], 10743.06]], ['partial repair probe 1', [[2029, 11, 30], 1, [[2029, 12, 31]], 250000, 0.0125], [[2029, 12, 28], 243.06]], ['partial repair probe 2', [[2030, 4, 30], 12, [[2031, 4, 27], [2031, 4, 30], [2031, 4, 27]], 1000000, 0.0125], [[2031, 4, 29], 12638.89]], ['normal control 1', [[2021, 5, 14], 3, [[2021, 8, 31]], 250000, 0.0425], [[2021, 8, 16], 2774.31]], ['normal control 2', [[2019, 2, 27], 2, [[2019, 4, 30], [2019, 4, 29]], 250000, 0.053], [[2019, 4, 26], 2134.72]], ['normal control 3', [[2024, 1, 31], 12, [[2025, 1, 29], [2025, 1, 29], [2025, 1, 30]], 1000000, 0.053], [[2025, 1, 31], 53883.33]], ['normal control 4', [[2027, 2, 26], 6, [[2027, 8, 29]], 250000, 0.053], [[2027, 8, 31], 6845.83]]], [['regression end-end target 1', [[2030, 3, 29], 1, [[2030, 4, 30], [2030, 4, 27], [2030, 4, 30]], 1000000, 0.0425], [[2030, 4, 29], 3659.72]], ['regression end-end target 2', [[2026, 4, 30], 1, [], 250000, 0.053], [[2026, 5, 29], 1067.36]], ['partial repair probe 1', [[2027, 7, 30], 3, [[2027, 10, 29], [2027, 10, 29]], 250000, 0.0425], [[2027, 10, 28], 2656.25]], ['partial repair probe 2', [[2025, 6, 30], 2, [[2025, 8, 31], [2025, 8, 29], [2025, 8, 31]], 250000, 0.0425], [[2025, 8, 28], 1741.32]], ['normal control 1', [[2030, 6, 17], 1, [], 250000, 0.0425], [[2030, 7, 17], 885.42]], ['normal control 2', [[2023, 7, 12], 1, [], 1000000, 0.0125], [[2023, 8, 14], 1145.83]], ['normal control 3', [[2021, 8, 16], 1, [[2021, 9, 26], [2021, 9, 29], [2021, 9, 26]], 1000000, 0.053], [[2021, 9, 16], 4563.89]], ['normal control 4', [[2027, 6, 17], 2, [[2027, 8, 28], [2027, 8, 27], [2027, 8, 29]], 250000, 0.0125], [[2027, 8, 17], 529.51]]], [['regression end-end target 1', [[2028, 3, 31], 6, [[2028, 9, 30], [2028, 9, 30], [2028, 9, 29]], 1000000, 0.0425], [[2028, 9, 28], 21368.06]], ['regression end-end target 2', [[2029, 8, 31], 6, [[2030, 2, 28]], 250000, 0.053], [[2030, 2, 27], 6625.0]], ['partial repair probe 1', [[2030, 10, 31], 3, [[2031, 1, 31], [2031, 1, 27], [2031, 1, 31]], 1000000, 0.0425], [[2031, 1, 30], 10743.06]], ['partial repair probe 2', [[2020, 11, 30], 2, [[2021, 1, 29], [2021, 1, 29], [2021, 1, 30]], 1000000, 0.0425], [[2021, 1, 28], 6965.28]], ['normal control 1', [[2024, 1, 15], 3, [], 250000, 0.0125], [[2024, 4, 15], 789.93]], ['normal control 2', [[2022, 10, 20], 6, [[2023, 4, 30], [2023, 4, 29]], 250000, 0.053], [[2023, 4, 20], 6698.61]], ['normal control 3', [[2027, 9, 21], 12, [[2028, 9, 26]], 250000, 0.053], [[2028, 9, 21], 13470.83]], ['normal control 4', [[2021, 3, 3], 12, [[2022, 3, 30], [2022, 3, 29], [2022, 3, 29]], 250000, 0.0425], [[2022, 3, 3], 10772.57]]], [['regression end-end target 1', [[2020, 12, 31], 1, [[2021, 1, 28], [2021, 1, 28], [2021, 1, 28]], 1000000, 0.0125], [[2021, 1, 29], 1006.94]], ['regression end-end target 2', [[2024, 4, 30], 2, [[2024, 6, 30], [2024, 6, 26], [2024, 6, 28]], 250000, 0.053], [[2024, 6, 27], 2134.72]], ['partial repair probe 1', [[2022, 7, 29], 3, [[2022, 10, 31], [2022, 10, 31], [2022, 10, 30]], 250000, 0.053], [[2022, 10, 28], 3349.31]], ['partial repair probe 2', [[2022, 2, 28], 1, [[2022, 3, 31], [2022, 3, 29]], 1000000, 0.0125], [[2022, 3, 30], 1041.67]], ['normal control 1', [[2020, 11, 10], 2, [[2021, 1, 27], [2021, 1, 28]], 1000000, 0.0425], [[2021, 1, 11], 7319.44]], ['normal control 2', [[2021, 5, 31], 1, [], 250000, 0.053], [[2021, 6, 30], 1104.17]], ['normal control 3', [[2029, 10, 22], 6, [], 1000000, 0.0125], [[2030, 4, 22], 6319.44]], ['normal control 4', [[2027, 4, 2], 2, [], 1000000, 0.0125], [[2027, 6, 2], 2118.06]]]]
for label, args, expected in fixtures[N-1]:
check(label, solve(*args), expected)
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 |
|---|---|---|---|
| regression end-end target 1 | [[2024, 11, 30], 6354.17] | [[2024, 11, 29], 6319.44] | Failed |
| regression end-end target 2 | [[2022, 7, 31], 1140.97] | [[2022, 7, 28], 1030.56] | Failed |
| partial repair probe 1 | [[2019, 4, 30], 8980.56] | [[2019, 4, 29], 8833.33] | Failed |
| partial repair probe 2 | [[2025, 3, 31], 13250.0] | [[2025, 3, 28], 12808.33] | Failed |
| normal control 1 | [[2025, 5, 19], 1859.38] | [[2025, 5, 19], 1859.38] | Passed |
| normal control 2 | [[2024, 5, 6], 546.88] | [[2024, 5, 6], 546.88] | Passed |
| normal control 3 | [[2023, 10, 9], 11097.22] | [[2023, 10, 9], 11097.22] | Passed |
| normal control 4 | [[2025, 6, 30], 1140.97] | [[2025, 6, 30], 1140.97] | Passed |
SHA-256 / f493b80e020840c9e638517ce001c6516970bb8577c42811f32b17a300fc2aad
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import datetime
N = 1
observations = []
def solve(start, tenor, holidays, principal, rate):
S = datetime.date(*start)
H = {datetime.date(*h) for h in holidays}
def biz(x):
return x.weekday() < 5 and x not in H
def mlen(y, m):
if m == 2:
return 29 if (y % 4 == 0 and y % 100 != 0) or y % 400 == 0 else 28
return 30 if m in (4, 6, 9, 11) else 31
def last_biz(y, m):
x = datetime.date(y, m, mlen(y, m))
while not biz(x):
x -= datetime.timedelta(days=1)
return x
def mf(x):
f = x
while not biz(f):
f += datetime.timedelta(days=1)
if f.month != x.month:
f = x
while not biz(f):
f -= datetime.timedelta(days=1)
return f
t = S.year * 12 + S.month - 1 + tenor
y, m = t // 12, t % 12 + 1
if S == last_biz(S.year, S.month):
M = datetime.date(y, m, mlen(y, m))
while M.weekday() >= 5:
M -= datetime.timedelta(days=1)
else:
M = mf(datetime.date(y, m, min(S.day, mlen(y, m))))
interest = round(principal * rate * (M - S).days / 360, 2)
return [[M.year, M.month, M.day], interest]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression end-end target 1', [[2024, 5, 31], 6, [[2024, 11, 30], [2024, 11, 28], [2024, 11, 27]], 1000000, 0.0125], [[2024, 11, 29], 6319.44]], ['regression end-end target 2', [[2022, 6, 30], 1, [[2022, 7, 29], [2022, 7, 27], [2022, 7, 29]], 250000, 0.053], [[2022, 7, 28], 1030.56]], ['partial repair probe 1', [[2019, 2, 28], 2, [[2019, 4, 30], [2019, 4, 26], [2019, 4, 26]], 1000000, 0.053], [[2019, 4, 29], 8833.33]], ['partial repair probe 2', [[2024, 12, 31], 3, [[2025, 3, 30], [2025, 3, 31]], 1000000, 0.053], [[2025, 3, 28], 12808.33]], ['normal control 1', [[2025, 3, 17], 2, [[2025, 5, 28], [2025, 5, 27]], 250000, 0.0425], [[2025, 5, 19], 1859.38]], ['normal control 2', [[2024, 3, 4], 2, [[2024, 5, 30], [2024, 5, 27], [2024, 5, 31]], 250000, 0.0125], [[2024, 5, 6], 546.88]], ['normal control 3', [[2023, 7, 7], 3, [[2023, 10, 29], [2023, 10, 30], [2023, 10, 28]], 1000000, 0.0425], [[2023, 10, 9], 11097.22]], ['normal control 4', [[2025, 5, 30], 1, [[2025, 6, 27]], 250000, 0.053], [[2025, 6, 30], 1140.97]]], [['regression end-end target 1', [[2025, 12, 31], 1, [], 1000000, 0.0125], [[2026, 1, 30], 1041.67]], ['regression end-end target 2', [[2019, 3, 29], 3, [[2019, 6, 27]], 1000000, 0.0425], [[2019, 6, 28], 10743.06]], ['partial repair probe 1', [[2029, 11, 30], 1, [[2029, 12, 31]], 250000, 0.0125], [[2029, 12, 28], 243.06]], ['partial repair probe 2', [[2030, 4, 30], 12, [[2031, 4, 27], [2031, 4, 30], [2031, 4, 27]], 1000000, 0.0125], [[2031, 4, 29], 12638.89]], ['normal control 1', [[2021, 5, 14], 3, [[2021, 8, 31]], 250000, 0.0425], [[2021, 8, 16], 2774.31]], ['normal control 2', [[2019, 2, 27], 2, [[2019, 4, 30], [2019, 4, 29]], 250000, 0.053], [[2019, 4, 26], 2134.72]], ['normal control 3', [[2024, 1, 31], 12, [[2025, 1, 29], [2025, 1, 29], [2025, 1, 30]], 1000000, 0.053], [[2025, 1, 31], 53883.33]], ['normal control 4', [[2027, 2, 26], 6, [[2027, 8, 29]], 250000, 0.053], [[2027, 8, 31], 6845.83]]], [['regression end-end target 1', [[2030, 3, 29], 1, [[2030, 4, 30], [2030, 4, 27], [2030, 4, 30]], 1000000, 0.0425], [[2030, 4, 29], 3659.72]], ['regression end-end target 2', [[2026, 4, 30], 1, [], 250000, 0.053], [[2026, 5, 29], 1067.36]], ['partial repair probe 1', [[2027, 7, 30], 3, [[2027, 10, 29], [2027, 10, 29]], 250000, 0.0425], [[2027, 10, 28], 2656.25]], ['partial repair probe 2', [[2025, 6, 30], 2, [[2025, 8, 31], [2025, 8, 29], [2025, 8, 31]], 250000, 0.0425], [[2025, 8, 28], 1741.32]], ['normal control 1', [[2030, 6, 17], 1, [], 250000, 0.0425], [[2030, 7, 17], 885.42]], ['normal control 2', [[2023, 7, 12], 1, [], 1000000, 0.0125], [[2023, 8, 14], 1145.83]], ['normal control 3', [[2021, 8, 16], 1, [[2021, 9, 26], [2021, 9, 29], [2021, 9, 26]], 1000000, 0.053], [[2021, 9, 16], 4563.89]], ['normal control 4', [[2027, 6, 17], 2, [[2027, 8, 28], [2027, 8, 27], [2027, 8, 29]], 250000, 0.0125], [[2027, 8, 17], 529.51]]], [['regression end-end target 1', [[2028, 3, 31], 6, [[2028, 9, 30], [2028, 9, 30], [2028, 9, 29]], 1000000, 0.0425], [[2028, 9, 28], 21368.06]], ['regression end-end target 2', [[2029, 8, 31], 6, [[2030, 2, 28]], 250000, 0.053], [[2030, 2, 27], 6625.0]], ['partial repair probe 1', [[2030, 10, 31], 3, [[2031, 1, 31], [2031, 1, 27], [2031, 1, 31]], 1000000, 0.0425], [[2031, 1, 30], 10743.06]], ['partial repair probe 2', [[2020, 11, 30], 2, [[2021, 1, 29], [2021, 1, 29], [2021, 1, 30]], 1000000, 0.0425], [[2021, 1, 28], 6965.28]], ['normal control 1', [[2024, 1, 15], 3, [], 250000, 0.0125], [[2024, 4, 15], 789.93]], ['normal control 2', [[2022, 10, 20], 6, [[2023, 4, 30], [2023, 4, 29]], 250000, 0.053], [[2023, 4, 20], 6698.61]], ['normal control 3', [[2027, 9, 21], 12, [[2028, 9, 26]], 250000, 0.053], [[2028, 9, 21], 13470.83]], ['normal control 4', [[2021, 3, 3], 12, [[2022, 3, 30], [2022, 3, 29], [2022, 3, 29]], 250000, 0.0425], [[2022, 3, 3], 10772.57]]], [['regression end-end target 1', [[2020, 12, 31], 1, [[2021, 1, 28], [2021, 1, 28], [2021, 1, 28]], 1000000, 0.0125], [[2021, 1, 29], 1006.94]], ['regression end-end target 2', [[2024, 4, 30], 2, [[2024, 6, 30], [2024, 6, 26], [2024, 6, 28]], 250000, 0.053], [[2024, 6, 27], 2134.72]], ['partial repair probe 1', [[2022, 7, 29], 3, [[2022, 10, 31], [2022, 10, 31], [2022, 10, 30]], 250000, 0.053], [[2022, 10, 28], 3349.31]], ['partial repair probe 2', [[2022, 2, 28], 1, [[2022, 3, 31], [2022, 3, 29]], 1000000, 0.0125], [[2022, 3, 30], 1041.67]], ['normal control 1', [[2020, 11, 10], 2, [[2021, 1, 27], [2021, 1, 28]], 1000000, 0.0425], [[2021, 1, 11], 7319.44]], ['normal control 2', [[2021, 5, 31], 1, [], 250000, 0.053], [[2021, 6, 30], 1104.17]], ['normal control 3', [[2029, 10, 22], 6, [], 1000000, 0.0125], [[2030, 4, 22], 6319.44]], ['normal control 4', [[2027, 4, 2], 2, [], 1000000, 0.0125], [[2027, 6, 2], 2118.06]]]]
for label, args, expected in fixtures[N-1]:
check(label, solve(*args), expected)
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 |
|---|---|---|---|
| regression end-end target 1 | [[2024, 11, 29], 6319.44] | [[2024, 11, 29], 6319.44] | Passed |
| regression end-end target 2 | [[2022, 7, 29], 1067.36] | [[2022, 7, 28], 1030.56] | Failed |
| partial repair probe 1 | [[2019, 4, 30], 8980.56] | [[2019, 4, 29], 8833.33] | Failed |
| partial repair probe 2 | [[2025, 3, 31], 13250.0] | [[2025, 3, 28], 12808.33] | Failed |
| normal control 1 | [[2025, 5, 19], 1859.38] | [[2025, 5, 19], 1859.38] | Passed |
| normal control 2 | [[2024, 5, 6], 546.88] | [[2024, 5, 6], 546.88] | Passed |
| normal control 3 | [[2023, 10, 9], 11097.22] | [[2023, 10, 9], 11097.22] | Passed |
| normal control 4 | [[2025, 6, 30], 1140.97] | [[2025, 6, 30], 1140.97] | Passed |
SHA-256 / e8e13f9079ab97e5d77c4b425137fc9295d7bcec4947a92503058552cba17062
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
import datetime
N = 1
observations = []
def solve(start, tenor, holidays, principal, rate):
S = datetime.date(*start)
H = {datetime.date(*h) for h in holidays}
def biz(x):
return x.weekday() < 5 and x not in H
def mlen(y, m):
if m == 2:
return 29 if (y % 4 == 0 and y % 100 != 0) or y % 400 == 0 else 28
return 30 if m in (4, 6, 9, 11) else 31
def last_biz(y, m):
x = datetime.date(y, m, mlen(y, m))
while not biz(x):
x -= datetime.timedelta(days=1)
return x
def mf(x):
f = x
while not biz(f):
f += datetime.timedelta(days=1)
if f.month != x.month:
f = x
while not biz(f):
f -= datetime.timedelta(days=1)
return f
t = S.year * 12 + S.month - 1 + tenor
y, m = t // 12, t % 12 + 1
if S == last_biz(S.year, S.month):
M = last_biz(y, m)
else:
M = mf(datetime.date(y, m, min(S.day, mlen(y, m))))
interest = round(principal * rate * (M - S).days / 360, 2)
return [[M.year, M.month, M.day], interest]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression end-end target 1', [[2024, 5, 31], 6, [[2024, 11, 30], [2024, 11, 28], [2024, 11, 27]], 1000000, 0.0125], [[2024, 11, 29], 6319.44]], ['regression end-end target 2', [[2022, 6, 30], 1, [[2022, 7, 29], [2022, 7, 27], [2022, 7, 29]], 250000, 0.053], [[2022, 7, 28], 1030.56]], ['partial repair probe 1', [[2019, 2, 28], 2, [[2019, 4, 30], [2019, 4, 26], [2019, 4, 26]], 1000000, 0.053], [[2019, 4, 29], 8833.33]], ['partial repair probe 2', [[2024, 12, 31], 3, [[2025, 3, 30], [2025, 3, 31]], 1000000, 0.053], [[2025, 3, 28], 12808.33]], ['normal control 1', [[2025, 3, 17], 2, [[2025, 5, 28], [2025, 5, 27]], 250000, 0.0425], [[2025, 5, 19], 1859.38]], ['normal control 2', [[2024, 3, 4], 2, [[2024, 5, 30], [2024, 5, 27], [2024, 5, 31]], 250000, 0.0125], [[2024, 5, 6], 546.88]], ['normal control 3', [[2023, 7, 7], 3, [[2023, 10, 29], [2023, 10, 30], [2023, 10, 28]], 1000000, 0.0425], [[2023, 10, 9], 11097.22]], ['normal control 4', [[2025, 5, 30], 1, [[2025, 6, 27]], 250000, 0.053], [[2025, 6, 30], 1140.97]]], [['regression end-end target 1', [[2025, 12, 31], 1, [], 1000000, 0.0125], [[2026, 1, 30], 1041.67]], ['regression end-end target 2', [[2019, 3, 29], 3, [[2019, 6, 27]], 1000000, 0.0425], [[2019, 6, 28], 10743.06]], ['partial repair probe 1', [[2029, 11, 30], 1, [[2029, 12, 31]], 250000, 0.0125], [[2029, 12, 28], 243.06]], ['partial repair probe 2', [[2030, 4, 30], 12, [[2031, 4, 27], [2031, 4, 30], [2031, 4, 27]], 1000000, 0.0125], [[2031, 4, 29], 12638.89]], ['normal control 1', [[2021, 5, 14], 3, [[2021, 8, 31]], 250000, 0.0425], [[2021, 8, 16], 2774.31]], ['normal control 2', [[2019, 2, 27], 2, [[2019, 4, 30], [2019, 4, 29]], 250000, 0.053], [[2019, 4, 26], 2134.72]], ['normal control 3', [[2024, 1, 31], 12, [[2025, 1, 29], [2025, 1, 29], [2025, 1, 30]], 1000000, 0.053], [[2025, 1, 31], 53883.33]], ['normal control 4', [[2027, 2, 26], 6, [[2027, 8, 29]], 250000, 0.053], [[2027, 8, 31], 6845.83]]], [['regression end-end target 1', [[2030, 3, 29], 1, [[2030, 4, 30], [2030, 4, 27], [2030, 4, 30]], 1000000, 0.0425], [[2030, 4, 29], 3659.72]], ['regression end-end target 2', [[2026, 4, 30], 1, [], 250000, 0.053], [[2026, 5, 29], 1067.36]], ['partial repair probe 1', [[2027, 7, 30], 3, [[2027, 10, 29], [2027, 10, 29]], 250000, 0.0425], [[2027, 10, 28], 2656.25]], ['partial repair probe 2', [[2025, 6, 30], 2, [[2025, 8, 31], [2025, 8, 29], [2025, 8, 31]], 250000, 0.0425], [[2025, 8, 28], 1741.32]], ['normal control 1', [[2030, 6, 17], 1, [], 250000, 0.0425], [[2030, 7, 17], 885.42]], ['normal control 2', [[2023, 7, 12], 1, [], 1000000, 0.0125], [[2023, 8, 14], 1145.83]], ['normal control 3', [[2021, 8, 16], 1, [[2021, 9, 26], [2021, 9, 29], [2021, 9, 26]], 1000000, 0.053], [[2021, 9, 16], 4563.89]], ['normal control 4', [[2027, 6, 17], 2, [[2027, 8, 28], [2027, 8, 27], [2027, 8, 29]], 250000, 0.0125], [[2027, 8, 17], 529.51]]], [['regression end-end target 1', [[2028, 3, 31], 6, [[2028, 9, 30], [2028, 9, 30], [2028, 9, 29]], 1000000, 0.0425], [[2028, 9, 28], 21368.06]], ['regression end-end target 2', [[2029, 8, 31], 6, [[2030, 2, 28]], 250000, 0.053], [[2030, 2, 27], 6625.0]], ['partial repair probe 1', [[2030, 10, 31], 3, [[2031, 1, 31], [2031, 1, 27], [2031, 1, 31]], 1000000, 0.0425], [[2031, 1, 30], 10743.06]], ['partial repair probe 2', [[2020, 11, 30], 2, [[2021, 1, 29], [2021, 1, 29], [2021, 1, 30]], 1000000, 0.0425], [[2021, 1, 28], 6965.28]], ['normal control 1', [[2024, 1, 15], 3, [], 250000, 0.0125], [[2024, 4, 15], 789.93]], ['normal control 2', [[2022, 10, 20], 6, [[2023, 4, 30], [2023, 4, 29]], 250000, 0.053], [[2023, 4, 20], 6698.61]], ['normal control 3', [[2027, 9, 21], 12, [[2028, 9, 26]], 250000, 0.053], [[2028, 9, 21], 13470.83]], ['normal control 4', [[2021, 3, 3], 12, [[2022, 3, 30], [2022, 3, 29], [2022, 3, 29]], 250000, 0.0425], [[2022, 3, 3], 10772.57]]], [['regression end-end target 1', [[2020, 12, 31], 1, [[2021, 1, 28], [2021, 1, 28], [2021, 1, 28]], 1000000, 0.0125], [[2021, 1, 29], 1006.94]], ['regression end-end target 2', [[2024, 4, 30], 2, [[2024, 6, 30], [2024, 6, 26], [2024, 6, 28]], 250000, 0.053], [[2024, 6, 27], 2134.72]], ['partial repair probe 1', [[2022, 7, 29], 3, [[2022, 10, 31], [2022, 10, 31], [2022, 10, 30]], 250000, 0.053], [[2022, 10, 28], 3349.31]], ['partial repair probe 2', [[2022, 2, 28], 1, [[2022, 3, 31], [2022, 3, 29]], 1000000, 0.0125], [[2022, 3, 30], 1041.67]], ['normal control 1', [[2020, 11, 10], 2, [[2021, 1, 27], [2021, 1, 28]], 1000000, 0.0425], [[2021, 1, 11], 7319.44]], ['normal control 2', [[2021, 5, 31], 1, [], 250000, 0.053], [[2021, 6, 30], 1104.17]], ['normal control 3', [[2029, 10, 22], 6, [], 1000000, 0.0125], [[2030, 4, 22], 6319.44]], ['normal control 4', [[2027, 4, 2], 2, [], 1000000, 0.0125], [[2027, 6, 2], 2118.06]]]]
for label, args, expected in fixtures[N-1]:
check(label, solve(*args), expected)
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 |
|---|---|---|---|
| regression end-end target 1 | [[2024, 11, 29], 6319.44] | [[2024, 11, 29], 6319.44] | Passed |
| regression end-end target 2 | [[2022, 7, 28], 1030.56] | [[2022, 7, 28], 1030.56] | Passed |
| partial repair probe 1 | [[2019, 4, 29], 8833.33] | [[2019, 4, 29], 8833.33] | Passed |
| partial repair probe 2 | [[2025, 3, 28], 12808.33] | [[2025, 3, 28], 12808.33] | Passed |
| normal control 1 | [[2025, 5, 19], 1859.38] | [[2025, 5, 19], 1859.38] | Passed |
| normal control 2 | [[2024, 5, 6], 546.88] | [[2024, 5, 6], 546.88] | Passed |
| normal control 3 | [[2023, 10, 9], 11097.22] | [[2023, 10, 9], 11097.22] | Passed |
| normal control 4 | [[2025, 6, 30], 1140.97] | [[2025, 6, 30], 1140.97] | Passed |
SHA-256 / 46ebb5f1f20d51c15da352535679e9053511ef5d539bbd2cbfe00179e31abc4c
Verification & scope
A deterministic toy contract stated explicitly in the contract field; no claim of conformance to any published convention text. 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:46:54.249440+00:00.
Case digest / bebdd667e06ead6530579212ce71c4b1508330340d8cdb8deff761bae37bea9a