FA-61331 / Bond day-count conventions / Open access
Deposit maturity with the end-to-end rule: the end-to-end rule is triggered by the calendar month end · case 01
Deposits starting on the last business day before a month-end weekend mature mid-month.
ROOT CAUSE
The trigger tests for the calendar last day instead of the last business day.
VERIFIED REPAIR
Trigger the rule when the start equals the last business day of its month.
Unsuccessful approach: Treating any of the last three calendar days as month end triggers it for ordinary dates.
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.day == mlen(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 trigger 1', [[2026, 5, 29], 2, [], 1000000, 0.0425], [[2026, 7, 31], 7437.5]], ['regression end-end trigger 2', [[2019, 3, 29], 2, [[2019, 5, 28], [2019, 5, 27], [2019, 5, 31]], 1000000, 0.0425], [[2019, 5, 30], 7319.44]], ['partial repair probe 1', [[2030, 7, 29], 3, [], 1000000, 0.053], [[2030, 10, 29], 13544.44]], ['partial repair probe 2', [[2029, 11, 28], 6, [], 1000000, 0.053], [[2030, 5, 28], 26647.22]], ['normal control 1', [[2019, 2, 28], 3, [[2019, 5, 27]], 1000000, 0.0425], [[2019, 5, 31], 10861.11]], ['normal control 2', [[2027, 3, 31], 12, [[2028, 3, 27], [2028, 3, 30], [2028, 3, 30]], 1000000, 0.0425], [[2028, 3, 31], 43208.33]], ['normal control 3', [[2027, 7, 29], 6, [[2028, 1, 28], [2028, 1, 31], [2028, 1, 27]], 1000000, 0.0125], [[2028, 1, 26], 6284.72]], ['normal control 4', [[2028, 4, 26], 1, [[2028, 5, 30], [2028, 5, 30]], 1000000, 0.053], [[2028, 5, 26], 4416.67]]], [['regression end-end trigger 1', [[2023, 4, 28], 12, [], 250000, 0.0125], [[2024, 4, 30], 3194.44]], ['regression end-end trigger 2', [[2027, 1, 29], 6, [], 250000, 0.0125], [[2027, 7, 30], 1579.86]], ['partial repair probe 1', [[2029, 11, 28], 12, [[2030, 11, 26]], 250000, 0.0425], [[2030, 11, 28], 10772.57]], ['partial repair probe 2', [[2023, 11, 28], 6, [[2024, 5, 31]], 250000, 0.0125], [[2024, 5, 28], 1579.86]], ['normal control 1', [[2026, 3, 31], 12, [[2027, 3, 31]], 250000, 0.053], [[2027, 3, 30], 13397.22]], ['normal control 2', [[2030, 11, 11], 2, [[2031, 1, 31], [2031, 1, 28], [2031, 1, 30]], 1000000, 0.0425], [[2031, 1, 13], 7437.5]], ['normal control 3', [[2025, 1, 31], 3, [[2025, 4, 26], [2025, 4, 27]], 250000, 0.053], [[2025, 4, 30], 3275.69]], ['normal control 4', [[2023, 6, 22], 1, [], 1000000, 0.0125], [[2023, 7, 24], 1111.11]]], [['regression end-end trigger 1', [[2020, 2, 28], 2, [[2020, 4, 26], [2020, 4, 26]], 250000, 0.0125], [[2020, 4, 30], 538.19]], ['regression end-end trigger 2', [[2023, 4, 28], 6, [], 250000, 0.0425], [[2023, 10, 31], 5489.58]], ['partial repair probe 1', [[2021, 6, 28], 1, [[2021, 7, 29], [2021, 7, 27]], 1000000, 0.053], [[2021, 7, 28], 4416.67]], ['partial repair probe 2', [[2025, 2, 26], 3, [[2025, 5, 30], [2025, 5, 31]], 250000, 0.053], [[2025, 5, 26], 3275.69]], ['normal control 1', [[2023, 3, 31], 3, [[2023, 6, 26], [2023, 6, 29]], 250000, 0.0425], [[2023, 6, 30], 2685.76]], ['normal control 2', [[2029, 5, 31], 2, [[2029, 7, 28], [2029, 7, 31]], 1000000, 0.0125], [[2029, 7, 30], 2083.33]], ['normal control 3', [[2024, 9, 30], 2, [[2024, 11, 26]], 250000, 0.0425], [[2024, 11, 29], 1770.83]], ['normal control 4', [[2030, 5, 20], 12, [[2031, 5, 31], [2031, 5, 29], [2031, 5, 27]], 1000000, 0.053], [[2031, 5, 20], 53736.11]]], [['regression end-end trigger 1', [[2027, 1, 29], 2, [], 250000, 0.0425], [[2027, 3, 31], 1800.35]], ['regression end-end trigger 2', [[2027, 2, 26], 12, [[2028, 2, 25], [2028, 2, 27]], 1000000, 0.053], [[2028, 2, 29], 54177.78]], ['partial repair probe 1', [[2025, 10, 29], 2, [[2025, 12, 30]], 250000, 0.0125], [[2025, 12, 29], 529.51]], ['partial repair probe 2', [[2029, 1, 29], 12, [], 1000000, 0.053], [[2030, 1, 29], 53736.11]], ['normal control 1', [[2025, 5, 21], 2, [[2025, 7, 31], [2025, 7, 28], [2025, 7, 29]], 1000000, 0.0425], [[2025, 7, 21], 7201.39]], ['normal control 2', [[2028, 7, 31], 3, [], 1000000, 0.0125], [[2028, 10, 31], 3194.44]], ['normal control 3', [[2024, 1, 30], 2, [[2024, 3, 28], [2024, 3, 28], [2024, 3, 30]], 250000, 0.0125], [[2024, 3, 29], 512.15]], ['normal control 4', [[2023, 3, 27], 12, [[2024, 3, 31]], 250000, 0.0425], [[2024, 3, 27], 10802.08]]], [['regression end-end trigger 1', [[2030, 11, 29], 2, [[2031, 1, 29], [2031, 1, 29]], 250000, 0.0125], [[2031, 1, 31], 546.88]], ['regression end-end trigger 2', [[2023, 4, 28], 1, [[2023, 5, 31]], 250000, 0.0425], [[2023, 5, 30], 944.44]], ['partial repair probe 1', [[2021, 11, 29], 6, [], 250000, 0.053], [[2022, 5, 30], 6698.61]], ['partial repair probe 2', [[2030, 5, 29], 2, [], 250000, 0.0125], [[2030, 7, 29], 529.51]], ['normal control 1', [[2019, 1, 31], 1, [], 250000, 0.0125], [[2019, 2, 28], 243.06]], ['normal control 2', [[2021, 8, 31], 2, [[2021, 10, 29], [2021, 10, 29]], 250000, 0.0425], [[2021, 10, 28], 1711.81]], ['normal control 3', [[2020, 2, 17], 6, [[2020, 8, 29]], 1000000, 0.053], [[2020, 8, 17], 26794.44]], ['normal control 4', [[2030, 2, 28], 3, [], 1000000, 0.0425], [[2030, 5, 31], 10861.11]]]]
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 trigger 1 | [[2026, 7, 29], 7201.39] | [[2026, 7, 31], 7437.5] | Failed |
| regression end-end trigger 2 | [[2019, 5, 29], 7201.39] | [[2019, 5, 30], 7319.44] | Failed |
| partial repair probe 1 | [[2030, 10, 29], 13544.44] | [[2030, 10, 29], 13544.44] | Passed |
| partial repair probe 2 | [[2030, 5, 28], 26647.22] | [[2030, 5, 28], 26647.22] | Passed |
| normal control 1 | [[2019, 5, 31], 10861.11] | [[2019, 5, 31], 10861.11] | Passed |
| normal control 2 | [[2028, 3, 31], 43208.33] | [[2028, 3, 31], 43208.33] | Passed |
| normal control 3 | [[2028, 1, 26], 6284.72] | [[2028, 1, 26], 6284.72] | Passed |
| normal control 4 | [[2028, 5, 26], 4416.67] | [[2028, 5, 26], 4416.67] | Passed |
SHA-256 / 9652ef9e84ee5dd3aad0cdbbeff96c1ed7dfcbadd2d75d02e2588e4273bada82
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.day >= mlen(S.year, S.month) - 2:
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 trigger 1', [[2026, 5, 29], 2, [], 1000000, 0.0425], [[2026, 7, 31], 7437.5]], ['regression end-end trigger 2', [[2019, 3, 29], 2, [[2019, 5, 28], [2019, 5, 27], [2019, 5, 31]], 1000000, 0.0425], [[2019, 5, 30], 7319.44]], ['partial repair probe 1', [[2030, 7, 29], 3, [], 1000000, 0.053], [[2030, 10, 29], 13544.44]], ['partial repair probe 2', [[2029, 11, 28], 6, [], 1000000, 0.053], [[2030, 5, 28], 26647.22]], ['normal control 1', [[2019, 2, 28], 3, [[2019, 5, 27]], 1000000, 0.0425], [[2019, 5, 31], 10861.11]], ['normal control 2', [[2027, 3, 31], 12, [[2028, 3, 27], [2028, 3, 30], [2028, 3, 30]], 1000000, 0.0425], [[2028, 3, 31], 43208.33]], ['normal control 3', [[2027, 7, 29], 6, [[2028, 1, 28], [2028, 1, 31], [2028, 1, 27]], 1000000, 0.0125], [[2028, 1, 26], 6284.72]], ['normal control 4', [[2028, 4, 26], 1, [[2028, 5, 30], [2028, 5, 30]], 1000000, 0.053], [[2028, 5, 26], 4416.67]]], [['regression end-end trigger 1', [[2023, 4, 28], 12, [], 250000, 0.0125], [[2024, 4, 30], 3194.44]], ['regression end-end trigger 2', [[2027, 1, 29], 6, [], 250000, 0.0125], [[2027, 7, 30], 1579.86]], ['partial repair probe 1', [[2029, 11, 28], 12, [[2030, 11, 26]], 250000, 0.0425], [[2030, 11, 28], 10772.57]], ['partial repair probe 2', [[2023, 11, 28], 6, [[2024, 5, 31]], 250000, 0.0125], [[2024, 5, 28], 1579.86]], ['normal control 1', [[2026, 3, 31], 12, [[2027, 3, 31]], 250000, 0.053], [[2027, 3, 30], 13397.22]], ['normal control 2', [[2030, 11, 11], 2, [[2031, 1, 31], [2031, 1, 28], [2031, 1, 30]], 1000000, 0.0425], [[2031, 1, 13], 7437.5]], ['normal control 3', [[2025, 1, 31], 3, [[2025, 4, 26], [2025, 4, 27]], 250000, 0.053], [[2025, 4, 30], 3275.69]], ['normal control 4', [[2023, 6, 22], 1, [], 1000000, 0.0125], [[2023, 7, 24], 1111.11]]], [['regression end-end trigger 1', [[2020, 2, 28], 2, [[2020, 4, 26], [2020, 4, 26]], 250000, 0.0125], [[2020, 4, 30], 538.19]], ['regression end-end trigger 2', [[2023, 4, 28], 6, [], 250000, 0.0425], [[2023, 10, 31], 5489.58]], ['partial repair probe 1', [[2021, 6, 28], 1, [[2021, 7, 29], [2021, 7, 27]], 1000000, 0.053], [[2021, 7, 28], 4416.67]], ['partial repair probe 2', [[2025, 2, 26], 3, [[2025, 5, 30], [2025, 5, 31]], 250000, 0.053], [[2025, 5, 26], 3275.69]], ['normal control 1', [[2023, 3, 31], 3, [[2023, 6, 26], [2023, 6, 29]], 250000, 0.0425], [[2023, 6, 30], 2685.76]], ['normal control 2', [[2029, 5, 31], 2, [[2029, 7, 28], [2029, 7, 31]], 1000000, 0.0125], [[2029, 7, 30], 2083.33]], ['normal control 3', [[2024, 9, 30], 2, [[2024, 11, 26]], 250000, 0.0425], [[2024, 11, 29], 1770.83]], ['normal control 4', [[2030, 5, 20], 12, [[2031, 5, 31], [2031, 5, 29], [2031, 5, 27]], 1000000, 0.053], [[2031, 5, 20], 53736.11]]], [['regression end-end trigger 1', [[2027, 1, 29], 2, [], 250000, 0.0425], [[2027, 3, 31], 1800.35]], ['regression end-end trigger 2', [[2027, 2, 26], 12, [[2028, 2, 25], [2028, 2, 27]], 1000000, 0.053], [[2028, 2, 29], 54177.78]], ['partial repair probe 1', [[2025, 10, 29], 2, [[2025, 12, 30]], 250000, 0.0125], [[2025, 12, 29], 529.51]], ['partial repair probe 2', [[2029, 1, 29], 12, [], 1000000, 0.053], [[2030, 1, 29], 53736.11]], ['normal control 1', [[2025, 5, 21], 2, [[2025, 7, 31], [2025, 7, 28], [2025, 7, 29]], 1000000, 0.0425], [[2025, 7, 21], 7201.39]], ['normal control 2', [[2028, 7, 31], 3, [], 1000000, 0.0125], [[2028, 10, 31], 3194.44]], ['normal control 3', [[2024, 1, 30], 2, [[2024, 3, 28], [2024, 3, 28], [2024, 3, 30]], 250000, 0.0125], [[2024, 3, 29], 512.15]], ['normal control 4', [[2023, 3, 27], 12, [[2024, 3, 31]], 250000, 0.0425], [[2024, 3, 27], 10802.08]]], [['regression end-end trigger 1', [[2030, 11, 29], 2, [[2031, 1, 29], [2031, 1, 29]], 250000, 0.0125], [[2031, 1, 31], 546.88]], ['regression end-end trigger 2', [[2023, 4, 28], 1, [[2023, 5, 31]], 250000, 0.0425], [[2023, 5, 30], 944.44]], ['partial repair probe 1', [[2021, 11, 29], 6, [], 250000, 0.053], [[2022, 5, 30], 6698.61]], ['partial repair probe 2', [[2030, 5, 29], 2, [], 250000, 0.0125], [[2030, 7, 29], 529.51]], ['normal control 1', [[2019, 1, 31], 1, [], 250000, 0.0125], [[2019, 2, 28], 243.06]], ['normal control 2', [[2021, 8, 31], 2, [[2021, 10, 29], [2021, 10, 29]], 250000, 0.0425], [[2021, 10, 28], 1711.81]], ['normal control 3', [[2020, 2, 17], 6, [[2020, 8, 29]], 1000000, 0.053], [[2020, 8, 17], 26794.44]], ['normal control 4', [[2030, 2, 28], 3, [], 1000000, 0.0425], [[2030, 5, 31], 10861.11]]]]
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 trigger 1 | [[2026, 7, 31], 7437.5] | [[2026, 7, 31], 7437.5] | Passed |
| regression end-end trigger 2 | [[2019, 5, 30], 7319.44] | [[2019, 5, 30], 7319.44] | Passed |
| partial repair probe 1 | [[2030, 10, 31], 13838.89] | [[2030, 10, 29], 13544.44] | Failed |
| partial repair probe 2 | [[2030, 5, 31], 27088.89] | [[2030, 5, 28], 26647.22] | Failed |
| normal control 1 | [[2019, 5, 31], 10861.11] | [[2019, 5, 31], 10861.11] | Passed |
| normal control 2 | [[2028, 3, 31], 43208.33] | [[2028, 3, 31], 43208.33] | Passed |
| normal control 3 | [[2028, 1, 26], 6284.72] | [[2028, 1, 26], 6284.72] | Passed |
| normal control 4 | [[2028, 5, 26], 4416.67] | [[2028, 5, 26], 4416.67] | Passed |
SHA-256 / bd6db5faa675bf3601794c28412e1c1159561c22347b8f83a0d7c625422799fd
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 trigger 1', [[2026, 5, 29], 2, [], 1000000, 0.0425], [[2026, 7, 31], 7437.5]], ['regression end-end trigger 2', [[2019, 3, 29], 2, [[2019, 5, 28], [2019, 5, 27], [2019, 5, 31]], 1000000, 0.0425], [[2019, 5, 30], 7319.44]], ['partial repair probe 1', [[2030, 7, 29], 3, [], 1000000, 0.053], [[2030, 10, 29], 13544.44]], ['partial repair probe 2', [[2029, 11, 28], 6, [], 1000000, 0.053], [[2030, 5, 28], 26647.22]], ['normal control 1', [[2019, 2, 28], 3, [[2019, 5, 27]], 1000000, 0.0425], [[2019, 5, 31], 10861.11]], ['normal control 2', [[2027, 3, 31], 12, [[2028, 3, 27], [2028, 3, 30], [2028, 3, 30]], 1000000, 0.0425], [[2028, 3, 31], 43208.33]], ['normal control 3', [[2027, 7, 29], 6, [[2028, 1, 28], [2028, 1, 31], [2028, 1, 27]], 1000000, 0.0125], [[2028, 1, 26], 6284.72]], ['normal control 4', [[2028, 4, 26], 1, [[2028, 5, 30], [2028, 5, 30]], 1000000, 0.053], [[2028, 5, 26], 4416.67]]], [['regression end-end trigger 1', [[2023, 4, 28], 12, [], 250000, 0.0125], [[2024, 4, 30], 3194.44]], ['regression end-end trigger 2', [[2027, 1, 29], 6, [], 250000, 0.0125], [[2027, 7, 30], 1579.86]], ['partial repair probe 1', [[2029, 11, 28], 12, [[2030, 11, 26]], 250000, 0.0425], [[2030, 11, 28], 10772.57]], ['partial repair probe 2', [[2023, 11, 28], 6, [[2024, 5, 31]], 250000, 0.0125], [[2024, 5, 28], 1579.86]], ['normal control 1', [[2026, 3, 31], 12, [[2027, 3, 31]], 250000, 0.053], [[2027, 3, 30], 13397.22]], ['normal control 2', [[2030, 11, 11], 2, [[2031, 1, 31], [2031, 1, 28], [2031, 1, 30]], 1000000, 0.0425], [[2031, 1, 13], 7437.5]], ['normal control 3', [[2025, 1, 31], 3, [[2025, 4, 26], [2025, 4, 27]], 250000, 0.053], [[2025, 4, 30], 3275.69]], ['normal control 4', [[2023, 6, 22], 1, [], 1000000, 0.0125], [[2023, 7, 24], 1111.11]]], [['regression end-end trigger 1', [[2020, 2, 28], 2, [[2020, 4, 26], [2020, 4, 26]], 250000, 0.0125], [[2020, 4, 30], 538.19]], ['regression end-end trigger 2', [[2023, 4, 28], 6, [], 250000, 0.0425], [[2023, 10, 31], 5489.58]], ['partial repair probe 1', [[2021, 6, 28], 1, [[2021, 7, 29], [2021, 7, 27]], 1000000, 0.053], [[2021, 7, 28], 4416.67]], ['partial repair probe 2', [[2025, 2, 26], 3, [[2025, 5, 30], [2025, 5, 31]], 250000, 0.053], [[2025, 5, 26], 3275.69]], ['normal control 1', [[2023, 3, 31], 3, [[2023, 6, 26], [2023, 6, 29]], 250000, 0.0425], [[2023, 6, 30], 2685.76]], ['normal control 2', [[2029, 5, 31], 2, [[2029, 7, 28], [2029, 7, 31]], 1000000, 0.0125], [[2029, 7, 30], 2083.33]], ['normal control 3', [[2024, 9, 30], 2, [[2024, 11, 26]], 250000, 0.0425], [[2024, 11, 29], 1770.83]], ['normal control 4', [[2030, 5, 20], 12, [[2031, 5, 31], [2031, 5, 29], [2031, 5, 27]], 1000000, 0.053], [[2031, 5, 20], 53736.11]]], [['regression end-end trigger 1', [[2027, 1, 29], 2, [], 250000, 0.0425], [[2027, 3, 31], 1800.35]], ['regression end-end trigger 2', [[2027, 2, 26], 12, [[2028, 2, 25], [2028, 2, 27]], 1000000, 0.053], [[2028, 2, 29], 54177.78]], ['partial repair probe 1', [[2025, 10, 29], 2, [[2025, 12, 30]], 250000, 0.0125], [[2025, 12, 29], 529.51]], ['partial repair probe 2', [[2029, 1, 29], 12, [], 1000000, 0.053], [[2030, 1, 29], 53736.11]], ['normal control 1', [[2025, 5, 21], 2, [[2025, 7, 31], [2025, 7, 28], [2025, 7, 29]], 1000000, 0.0425], [[2025, 7, 21], 7201.39]], ['normal control 2', [[2028, 7, 31], 3, [], 1000000, 0.0125], [[2028, 10, 31], 3194.44]], ['normal control 3', [[2024, 1, 30], 2, [[2024, 3, 28], [2024, 3, 28], [2024, 3, 30]], 250000, 0.0125], [[2024, 3, 29], 512.15]], ['normal control 4', [[2023, 3, 27], 12, [[2024, 3, 31]], 250000, 0.0425], [[2024, 3, 27], 10802.08]]], [['regression end-end trigger 1', [[2030, 11, 29], 2, [[2031, 1, 29], [2031, 1, 29]], 250000, 0.0125], [[2031, 1, 31], 546.88]], ['regression end-end trigger 2', [[2023, 4, 28], 1, [[2023, 5, 31]], 250000, 0.0425], [[2023, 5, 30], 944.44]], ['partial repair probe 1', [[2021, 11, 29], 6, [], 250000, 0.053], [[2022, 5, 30], 6698.61]], ['partial repair probe 2', [[2030, 5, 29], 2, [], 250000, 0.0125], [[2030, 7, 29], 529.51]], ['normal control 1', [[2019, 1, 31], 1, [], 250000, 0.0125], [[2019, 2, 28], 243.06]], ['normal control 2', [[2021, 8, 31], 2, [[2021, 10, 29], [2021, 10, 29]], 250000, 0.0425], [[2021, 10, 28], 1711.81]], ['normal control 3', [[2020, 2, 17], 6, [[2020, 8, 29]], 1000000, 0.053], [[2020, 8, 17], 26794.44]], ['normal control 4', [[2030, 2, 28], 3, [], 1000000, 0.0425], [[2030, 5, 31], 10861.11]]]]
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 trigger 1 | [[2026, 7, 31], 7437.5] | [[2026, 7, 31], 7437.5] | Passed |
| regression end-end trigger 2 | [[2019, 5, 30], 7319.44] | [[2019, 5, 30], 7319.44] | Passed |
| partial repair probe 1 | [[2030, 10, 29], 13544.44] | [[2030, 10, 29], 13544.44] | Passed |
| partial repair probe 2 | [[2030, 5, 28], 26647.22] | [[2030, 5, 28], 26647.22] | Passed |
| normal control 1 | [[2019, 5, 31], 10861.11] | [[2019, 5, 31], 10861.11] | Passed |
| normal control 2 | [[2028, 3, 31], 43208.33] | [[2028, 3, 31], 43208.33] | Passed |
| normal control 3 | [[2028, 1, 26], 6284.72] | [[2028, 1, 26], 6284.72] | Passed |
| normal control 4 | [[2028, 5, 26], 4416.67] | [[2028, 5, 26], 4416.67] | Passed |
SHA-256 / f1e4e9a9aabbfc78534c18675366297bea93887a2602e04e97119ba32b384e52
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.222791+00:00.
Case digest / 1fd6add056dde2328bcc051e9db9e4e3c6d9810fa4895b450b54dfa9a2a6d9a6