FA-60956 / Bond day-count conventions / Open access
Backward coupon schedule generation: each date is clamped from the previous date instead of the maturity day · case 01
After passing a short month every earlier coupon date is stuck on the shorter day number.
ROOT CAUSE
The day of month is carried forward from the previously generated date, so clamping accumulates.
VERIFIED REPAIR
Clamp the maturity day against each target month independently.
Unsuccessful approach: Resetting the carried day only after February still accumulates clamps from 30-day months.
Case contract
Inputs issue and maturity [y,m,d], months per period and an end-of-month flag. Unadjusted coupon dates are generated backward from maturity: the k-th date is maturity shifted back k*months calendar months, keeping the maturity day clamped to the month length; if the flag is set and maturity is the last day of its month, every date is the last day of its month. Dates on or before issue are dropped. If more than one date remains and the first is fewer than 15 days after issue, it is removed (long first coupon). Return the dates ascending.
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
from fractions import Fraction
N = 1
observations = []
def solve(issue, maturity, months, eom):
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 shift(y, m, k):
t = y * 12 + (m - 1) - k
return t // 12, t % 12 + 1
I = datetime.date(*issue)
my, mm, md = maturity
end_eom = md == mlen(my, mm)
out = []
k = 0
while True:
y, m = shift(my, mm, k * months)
d = mlen(y, m) if (eom and end_eom) else min(out[-1][2] if out else md, mlen(y, m))
if datetime.date(y, m, d) <= I:
break
out.append([y, m, d])
k += 1
out.reverse()
if len(out) > 1 and (datetime.date(*out[0]) - I).days < 15:
out.pop(0)
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression roll day anchor 1', [[2022, 12, 30], [2024, 5, 31], 1, False], [[2023, 1, 31], [2023, 2, 28], [2023, 3, 31], [2023, 4, 30], [2023, 5, 31], [2023, 6, 30], [2023, 7, 31], [2023, 8, 31], [2023, 9, 30], [2023, 10, 31], [2023, 11, 30], [2023, 12, 31], [2024, 1, 31], [2024, 2, 29], [2024, 3, 31], [2024, 4, 30], [2024, 5, 31]]], ['regression roll day anchor 2', [[2022, 11, 18], [2026, 11, 29], 1, False], [[2022, 12, 29], [2023, 1, 29], [2023, 2, 28], [2023, 3, 29], [2023, 4, 29], [2023, 5, 29], [2023, 6, 29], [2023, 7, 29], [2023, 8, 29], [2023, 9, 29], [2023, 10, 29], [2023, 11, 29], [2023, 12, 29], [2024, 1, 29], [2024, 2, 29], [2024, 3, 29], [2024, 4, 29], [2024, 5, 29], [2024, 6, 29], [2024, 7, 29], [2024, 8, 29], [2024, 9, 29], [2024, 10, 29], [2024, 11, 29], [2024, 12, 29], [2025, 1, 29], [2025, 2, 28], [2025, 3, 29], [2025, 4, 29], [2025, 5, 29], [2025, 6, 29], [2025, 7, 29], [2025, 8, 29], [2025, 9, 29], [2025, 10, 29], [2025, 11, 29], [2025, 12, 29], [2026, 1, 29], [2026, 2, 28], [2026, 3, 29], [2026, 4, 29], [2026, 5, 29], [2026, 6, 29], [2026, 7, 29], [2026, 8, 29], [2026, 9, 29], [2026, 10, 29], [2026, 11, 29]]], ['partial repair probe 1', [[2004, 4, 10], [2008, 1, 31], 1, False], [[2004, 4, 30], [2004, 5, 31], [2004, 6, 30], [2004, 7, 31], [2004, 8, 31], [2004, 9, 30], [2004, 10, 31], [2004, 11, 30], [2004, 12, 31], [2005, 1, 31], [2005, 2, 28], [2005, 3, 31], [2005, 4, 30], [2005, 5, 31], [2005, 6, 30], [2005, 7, 31], [2005, 8, 31], [2005, 9, 30], [2005, 10, 31], [2005, 11, 30], [2005, 12, 31], [2006, 1, 31], [2006, 2, 28], [2006, 3, 31], [2006, 4, 30], [2006, 5, 31], [2006, 6, 30], [2006, 7, 31], [2006, 8, 31], [2006, 9, 30], [2006, 10, 31], [2006, 11, 30], [2006, 12, 31], [2007, 1, 31], [2007, 2, 28], [2007, 3, 31], [2007, 4, 30], [2007, 5, 31], [2007, 6, 30], [2007, 7, 31], [2007, 8, 31], [2007, 9, 30], [2007, 10, 31], [2007, 11, 30], [2007, 12, 31], [2008, 1, 31]]], ['partial repair probe 2', [[2024, 10, 31], [2026, 10, 31], 6, False], [[2025, 4, 30], [2025, 10, 31], [2026, 4, 30], [2026, 10, 31]]], ['boundary control 1', [[2024, 3, 15], [2025, 3, 15], 3, False], [[2024, 6, 15], [2024, 9, 15], [2024, 12, 15], [2025, 3, 15]]], ['boundary control 2', [[2024, 1, 10], [2025, 8, 31], 6, True], [[2024, 2, 29], [2024, 8, 31], [2025, 2, 28], [2025, 8, 31]]], ['normal control 1', [[2036, 4, 8], [2037, 3, 29], 12, False], [[2037, 3, 29]]], ['normal control 2', [[2004, 9, 13], [2006, 6, 1], 6, True], [[2004, 12, 1], [2005, 6, 1], [2005, 12, 1], [2006, 6, 1]]]], [['regression roll day anchor 1', [[2030, 5, 12], [2034, 3, 31], 3, False], [[2030, 6, 30], [2030, 9, 30], [2030, 12, 31], [2031, 3, 31], [2031, 6, 30], [2031, 9, 30], [2031, 12, 31], [2032, 3, 31], [2032, 6, 30], [2032, 9, 30], [2032, 12, 31], [2033, 3, 31], [2033, 6, 30], [2033, 9, 30], [2033, 12, 31], [2034, 3, 31]]], ['regression roll day anchor 2', [[2018, 3, 2], [2021, 12, 31], 3, False], [[2018, 3, 31], [2018, 6, 30], [2018, 9, 30], [2018, 12, 31], [2019, 3, 31], [2019, 6, 30], [2019, 9, 30], [2019, 12, 31], [2020, 3, 31], [2020, 6, 30], [2020, 9, 30], [2020, 12, 31], [2021, 3, 31], [2021, 6, 30], [2021, 9, 30], [2021, 12, 31]]], ['partial repair probe 1', [[2006, 9, 7], [2009, 5, 31], 1, False], [[2006, 9, 30], [2006, 10, 31], [2006, 11, 30], [2006, 12, 31], [2007, 1, 31], [2007, 2, 28], [2007, 3, 31], [2007, 4, 30], [2007, 5, 31], [2007, 6, 30], [2007, 7, 31], [2007, 8, 31], [2007, 9, 30], [2007, 10, 31], [2007, 11, 30], [2007, 12, 31], [2008, 1, 31], [2008, 2, 29], [2008, 3, 31], [2008, 4, 30], [2008, 5, 31], [2008, 6, 30], [2008, 7, 31], [2008, 8, 31], [2008, 9, 30], [2008, 10, 31], [2008, 11, 30], [2008, 12, 31], [2009, 1, 31], [2009, 2, 28], [2009, 3, 31], [2009, 4, 30], [2009, 5, 31]]], ['partial repair probe 2', [[2029, 10, 27], [2030, 7, 31], 3, False], [[2030, 1, 31], [2030, 4, 30], [2030, 7, 31]]], ['boundary control 1', [[2024, 3, 1], [2025, 3, 15], 6, False], [[2024, 9, 15], [2025, 3, 15]]], ['boundary control 2', [[2024, 1, 10], [2025, 8, 31], 6, True], [[2024, 2, 29], [2024, 8, 31], [2025, 2, 28], [2025, 8, 31]]], ['normal control 1', [[2005, 9, 17], [2005, 10, 7], 12, True], [[2005, 10, 7]]], ['normal control 2', [[2011, 6, 6], [2012, 9, 30], 3, True], [[2011, 6, 30], [2011, 9, 30], [2011, 12, 31], [2012, 3, 31], [2012, 6, 30], [2012, 9, 30]]]], [['regression roll day anchor 1', [[2010, 3, 20], [2011, 5, 31], 3, False], [[2010, 5, 31], [2010, 8, 31], [2010, 11, 30], [2011, 2, 28], [2011, 5, 31]]], ['regression roll day anchor 2', [[2026, 9, 24], [2029, 4, 30], 1, False], [[2026, 10, 30], [2026, 11, 30], [2026, 12, 30], [2027, 1, 30], [2027, 2, 28], [2027, 3, 30], [2027, 4, 30], [2027, 5, 30], [2027, 6, 30], [2027, 7, 30], [2027, 8, 30], [2027, 9, 30], [2027, 10, 30], [2027, 11, 30], [2027, 12, 30], [2028, 1, 30], [2028, 2, 29], [2028, 3, 30], [2028, 4, 30], [2028, 5, 30], [2028, 6, 30], [2028, 7, 30], [2028, 8, 30], [2028, 9, 30], [2028, 10, 30], [2028, 11, 30], [2028, 12, 30], [2029, 1, 30], [2029, 2, 28], [2029, 3, 30], [2029, 4, 30]]], ['partial repair probe 1', [[2023, 5, 5], [2026, 8, 31], 3, False], [[2023, 5, 31], [2023, 8, 31], [2023, 11, 30], [2024, 2, 29], [2024, 5, 31], [2024, 8, 31], [2024, 11, 30], [2025, 2, 28], [2025, 5, 31], [2025, 8, 31], [2025, 11, 30], [2026, 2, 28], [2026, 5, 31], [2026, 8, 31]]], ['partial repair probe 2', [[2031, 4, 18], [2035, 3, 31], 1, False], [[2031, 5, 31], [2031, 6, 30], [2031, 7, 31], [2031, 8, 31], [2031, 9, 30], [2031, 10, 31], [2031, 11, 30], [2031, 12, 31], [2032, 1, 31], [2032, 2, 29], [2032, 3, 31], [2032, 4, 30], [2032, 5, 31], [2032, 6, 30], [2032, 7, 31], [2032, 8, 31], [2032, 9, 30], [2032, 10, 31], [2032, 11, 30], [2032, 12, 31], [2033, 1, 31], [2033, 2, 28], [2033, 3, 31], [2033, 4, 30], [2033, 5, 31], [2033, 6, 30], [2033, 7, 31], [2033, 8, 31], [2033, 9, 30], [2033, 10, 31], [2033, 11, 30], [2033, 12, 31], [2034, 1, 31], [2034, 2, 28], [2034, 3, 31], [2034, 4, 30], [2034, 5, 31], [2034, 6, 30], [2034, 7, 31], [2034, 8, 31], [2034, 9, 30], [2034, 10, 31], [2034, 11, 30], [2034, 12, 31], [2035, 1, 31], [2035, 2, 28], [2035, 3, 31]]], ['boundary control 1', [[2024, 2, 20], [2025, 2, 28], 6, True], [[2024, 8, 31], [2025, 2, 28]]], ['boundary control 2', [[2024, 3, 15], [2025, 3, 15], 3, False], [[2024, 6, 15], [2024, 9, 15], [2024, 12, 15], [2025, 3, 15]]], ['normal control 1', [[2000, 9, 20], [2003, 6, 30], 6, False], [[2000, 12, 30], [2001, 6, 30], [2001, 12, 30], [2002, 6, 30], [2002, 12, 30], [2003, 6, 30]]], ['normal control 2', [[2006, 10, 14], [2010, 2, 28], 1, False], [[2006, 11, 28], [2006, 12, 28], [2007, 1, 28], [2007, 2, 28], [2007, 3, 28], [2007, 4, 28], [2007, 5, 28], [2007, 6, 28], [2007, 7, 28], [2007, 8, 28], [2007, 9, 28], [2007, 10, 28], [2007, 11, 28], [2007, 12, 28], [2008, 1, 28], [2008, 2, 28], [2008, 3, 28], [2008, 4, 28], [2008, 5, 28], [2008, 6, 28], [2008, 7, 28], [2008, 8, 28], [2008, 9, 28], [2008, 10, 28], [2008, 11, 28], [2008, 12, 28], [2009, 1, 28], [2009, 2, 28], [2009, 3, 28], [2009, 4, 28], [2009, 5, 28], [2009, 6, 28], [2009, 7, 28], [2009, 8, 28], [2009, 9, 28], [2009, 10, 28], [2009, 11, 28], [2009, 12, 28], [2010, 1, 28], [2010, 2, 28]]]], [['regression roll day anchor 1', [[2006, 8, 31], [2009, 8, 31], 6, False], [[2007, 2, 28], [2007, 8, 31], [2008, 2, 29], [2008, 8, 31], [2009, 2, 28], [2009, 8, 31]]], ['regression roll day anchor 2', [[2009, 10, 26], [2012, 2, 29], 3, False], [[2009, 11, 29], [2010, 2, 28], [2010, 5, 29], [2010, 8, 29], [2010, 11, 29], [2011, 2, 28], [2011, 5, 29], [2011, 8, 29], [2011, 11, 29], [2012, 2, 29]]], ['partial repair probe 1', [[2035, 12, 20], [2036, 7, 31], 3, False], [[2036, 1, 31], [2036, 4, 30], [2036, 7, 31]]], ['partial repair probe 2', [[2036, 4, 30], [2038, 10, 31], 6, False], [[2036, 10, 31], [2037, 4, 30], [2037, 10, 31], [2038, 4, 30], [2038, 10, 31]]], ['boundary control 1', [[2024, 2, 20], [2025, 2, 28], 6, True], [[2024, 8, 31], [2025, 2, 28]]], ['boundary control 2', [[2024, 3, 15], [2025, 3, 15], 3, False], [[2024, 6, 15], [2024, 9, 15], [2024, 12, 15], [2025, 3, 15]]], ['normal control 1', [[2028, 12, 19], [2031, 8, 28], 6, False], [[2029, 2, 28], [2029, 8, 28], [2030, 2, 28], [2030, 8, 28], [2031, 2, 28], [2031, 8, 28]]], ['normal control 2', [[2022, 7, 27], [2025, 6, 30], 6, False], [[2022, 12, 30], [2023, 6, 30], [2023, 12, 30], [2024, 6, 30], [2024, 12, 30], [2025, 6, 30]]]], [['regression roll day anchor 1', [[2039, 1, 3], [2040, 12, 31], 6, False], [[2039, 6, 30], [2039, 12, 31], [2040, 6, 30], [2040, 12, 31]]], ['regression roll day anchor 2', [[2038, 8, 6], [2040, 2, 29], 6, False], [[2038, 8, 29], [2039, 2, 28], [2039, 8, 29], [2040, 2, 29]]], ['partial repair probe 1', [[2012, 11, 27], [2015, 8, 31], 3, False], [[2013, 2, 28], [2013, 5, 31], [2013, 8, 31], [2013, 11, 30], [2014, 2, 28], [2014, 5, 31], [2014, 8, 31], [2014, 11, 30], [2015, 2, 28], [2015, 5, 31], [2015, 8, 31]]], ['partial repair probe 2', [[2024, 12, 1], [2027, 5, 31], 3, False], [[2025, 2, 28], [2025, 5, 31], [2025, 8, 31], [2025, 11, 30], [2026, 2, 28], [2026, 5, 31], [2026, 8, 31], [2026, 11, 30], [2027, 2, 28], [2027, 5, 31]]], ['boundary control 1', [[2024, 3, 1], [2025, 3, 15], 6, False], [[2024, 9, 15], [2025, 3, 15]]], ['boundary control 2', [[2024, 2, 20], [2025, 2, 28], 6, True], [[2024, 8, 31], [2025, 2, 28]]], ['normal control 1', [[2026, 7, 15], [2026, 7, 31], 12, True], [[2026, 7, 31]]], ['normal control 2', [[2030, 7, 16], [2031, 6, 30], 6, False], [[2030, 12, 30], [2031, 6, 30]]]]]
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 roll day anchor 1 | [[2023, 1, 28], [2023, 2, 28], [2023, 3, 29], [2023, 4, 29], [2023, 5, 29], [2023, 6, 29], [2023, 7, 29], [2023, 8, 29], [2023, 9, 29], [2023, 10, 29], [2023, 11, 29], [2023, 12, 29], [2024, 1, 29], [2024, 2, 29], [2024, 3, 30], [2024, 4, 30], [2024, 5, 31]] | [[2023, 1, 31], [2023, 2, 28], [2023, 3, 31], [2023, 4, 30], [2023, 5, 31], [2023, 6, 30], [2023, 7, 31], [2023, 8, 31], [2023, 9, 30], [2023, 10, 31], [2023, 11, 30], [2023, 12, 31], [2024, 1, 31], [2024, 2, 29], [2024, 3, 31], [2024, 4, 30], [2024, 5, 31]] | Failed |
| regression roll day anchor 2 | [[2022, 12, 28], [2023, 1, 28], [2023, 2, 28], [2023, 3, 28], [2023, 4, 28], [2023, 5, 28], [2023, 6, 28], [2023, 7, 28], [2023, 8, 28], [2023, 9, 28], [2023, 10, 28], [2023, 11, 28], [2023, 12, 28], [2024, 1, 28], [2024, 2, 28], [2024, 3, 28], [2024, 4, 28], [2024, 5, 28], [2024, 6, 28], [2024, 7, 28], [2024, 8, 28], [2024, 9, 28], [2024, 10, 28], [2024, 11, 28], [2024, 12, 28], [2025, 1, 28], [2025, 2, 28], [2025, 3, 28], [2025, 4, 28], [2025, 5, 28], [2025, 6, 28], [2025, 7, 28], [2025, 8, 28], [2025, 9, 28], [2025, 10, 28], [2025, 11, 28], [2025, 12, 28], [2026, 1, 28], [2026, 2, 28], [2026, 3, 29], [2026, 4, 29], [2026, 5, 29], [2026, 6, 29], [2026, 7, 29], [2026, 8, 29], [2026, 9, 29], [2026, 10, 29], [2026, 11, 29]] | [[2022, 12, 29], [2023, 1, 29], [2023, 2, 28], [2023, 3, 29], [2023, 4, 29], [2023, 5, 29], [2023, 6, 29], [2023, 7, 29], [2023, 8, 29], [2023, 9, 29], [2023, 10, 29], [2023, 11, 29], [2023, 12, 29], [2024, 1, 29], [2024, 2, 29], [2024, 3, 29], [2024, 4, 29], [2024, 5, 29], [2024, 6, 29], [2024, 7, 29], [2024, 8, 29], [2024, 9, 29], [2024, 10, 29], [2024, 11, 29], [2024, 12, 29], [2025, 1, 29], [2025, 2, 28], [2025, 3, 29], [2025, 4, 29], [2025, 5, 29], [2025, 6, 29], [2025, 7, 29], [2025, 8, 29], [2025, 9, 29], [2025, 10, 29], [2025, 11, 29], [2025, 12, 29], [2026, 1, 29], [2026, 2, 28], [2026, 3, 29], [2026, 4, 29], [2026, 5, 29], [2026, 6, 29], [2026, 7, 29], [2026, 8, 29], [2026, 9, 29], [2026, 10, 29], [2026, 11, 29]] | Failed |
| partial repair probe 1 | [[2004, 4, 28], [2004, 5, 28], [2004, 6, 28], [2004, 7, 28], [2004, 8, 28], [2004, 9, 28], [2004, 10, 28], [2004, 11, 28], [2004, 12, 28], [2005, 1, 28], [2005, 2, 28], [2005, 3, 28], [2005, 4, 28], [2005, 5, 28], [2005, 6, 28], [2005, 7, 28], [2005, 8, 28], [2005, 9, 28], [2005, 10, 28], [2005, 11, 28], [2005, 12, 28], [2006, 1, 28], [2006, 2, 28], [2006, 3, 28], [2006, 4, 28], [2006, 5, 28], [2006, 6, 28], [2006, 7, 28], [2006, 8, 28], [2006, 9, 28], [2006, 10, 28], [2006, 11, 28], [2006, 12, 28], [2007, 1, 28], [2007, 2, 28], [2007, 3, 30], [2007, 4, 30], [2007, 5, 30], [2007, 6, 30], [2007, 7, 30], [2007, 8, 30], [2007, 9, 30], [2007, 10, 30], [2007, 11, 30], [2007, 12, 31], [2008, 1, 31]] | [[2004, 4, 30], [2004, 5, 31], [2004, 6, 30], [2004, 7, 31], [2004, 8, 31], [2004, 9, 30], [2004, 10, 31], [2004, 11, 30], [2004, 12, 31], [2005, 1, 31], [2005, 2, 28], [2005, 3, 31], [2005, 4, 30], [2005, 5, 31], [2005, 6, 30], [2005, 7, 31], [2005, 8, 31], [2005, 9, 30], [2005, 10, 31], [2005, 11, 30], [2005, 12, 31], [2006, 1, 31], [2006, 2, 28], [2006, 3, 31], [2006, 4, 30], [2006, 5, 31], [2006, 6, 30], [2006, 7, 31], [2006, 8, 31], [2006, 9, 30], [2006, 10, 31], [2006, 11, 30], [2006, 12, 31], [2007, 1, 31], [2007, 2, 28], [2007, 3, 31], [2007, 4, 30], [2007, 5, 31], [2007, 6, 30], [2007, 7, 31], [2007, 8, 31], [2007, 9, 30], [2007, 10, 31], [2007, 11, 30], [2007, 12, 31], [2008, 1, 31]] | Failed |
| partial repair probe 2 | [[2025, 4, 30], [2025, 10, 30], [2026, 4, 30], [2026, 10, 31]] | [[2025, 4, 30], [2025, 10, 31], [2026, 4, 30], [2026, 10, 31]] | Failed |
| boundary control 1 | [[2024, 6, 15], [2024, 9, 15], [2024, 12, 15], [2025, 3, 15]] | [[2024, 6, 15], [2024, 9, 15], [2024, 12, 15], [2025, 3, 15]] | Passed |
| boundary control 2 | [[2024, 2, 29], [2024, 8, 31], [2025, 2, 28], [2025, 8, 31]] | [[2024, 2, 29], [2024, 8, 31], [2025, 2, 28], [2025, 8, 31]] | Passed |
| normal control 1 | [[2037, 3, 29]] | [[2037, 3, 29]] | Passed |
| normal control 2 | [[2004, 12, 1], [2005, 6, 1], [2005, 12, 1], [2006, 6, 1]] | [[2004, 12, 1], [2005, 6, 1], [2005, 12, 1], [2006, 6, 1]] | Passed |
SHA-256 / d6353e13b99c87999f01f00586ddb07c407a8aecb2ee9678eb8a2c6e29d6bba6
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import datetime
from fractions import Fraction
N = 1
observations = []
def solve(issue, maturity, months, eom):
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 shift(y, m, k):
t = y * 12 + (m - 1) - k
return t // 12, t % 12 + 1
I = datetime.date(*issue)
my, mm, md = maturity
end_eom = md == mlen(my, mm)
out = []
k = 0
while True:
y, m = shift(my, mm, k * months)
d = mlen(y, m) if (eom and end_eom) else min(out[-1][2] if out and out[-1][1] != 2 else md, mlen(y, m))
if datetime.date(y, m, d) <= I:
break
out.append([y, m, d])
k += 1
out.reverse()
if len(out) > 1 and (datetime.date(*out[0]) - I).days < 15:
out.pop(0)
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression roll day anchor 1', [[2022, 12, 30], [2024, 5, 31], 1, False], [[2023, 1, 31], [2023, 2, 28], [2023, 3, 31], [2023, 4, 30], [2023, 5, 31], [2023, 6, 30], [2023, 7, 31], [2023, 8, 31], [2023, 9, 30], [2023, 10, 31], [2023, 11, 30], [2023, 12, 31], [2024, 1, 31], [2024, 2, 29], [2024, 3, 31], [2024, 4, 30], [2024, 5, 31]]], ['regression roll day anchor 2', [[2022, 11, 18], [2026, 11, 29], 1, False], [[2022, 12, 29], [2023, 1, 29], [2023, 2, 28], [2023, 3, 29], [2023, 4, 29], [2023, 5, 29], [2023, 6, 29], [2023, 7, 29], [2023, 8, 29], [2023, 9, 29], [2023, 10, 29], [2023, 11, 29], [2023, 12, 29], [2024, 1, 29], [2024, 2, 29], [2024, 3, 29], [2024, 4, 29], [2024, 5, 29], [2024, 6, 29], [2024, 7, 29], [2024, 8, 29], [2024, 9, 29], [2024, 10, 29], [2024, 11, 29], [2024, 12, 29], [2025, 1, 29], [2025, 2, 28], [2025, 3, 29], [2025, 4, 29], [2025, 5, 29], [2025, 6, 29], [2025, 7, 29], [2025, 8, 29], [2025, 9, 29], [2025, 10, 29], [2025, 11, 29], [2025, 12, 29], [2026, 1, 29], [2026, 2, 28], [2026, 3, 29], [2026, 4, 29], [2026, 5, 29], [2026, 6, 29], [2026, 7, 29], [2026, 8, 29], [2026, 9, 29], [2026, 10, 29], [2026, 11, 29]]], ['partial repair probe 1', [[2004, 4, 10], [2008, 1, 31], 1, False], [[2004, 4, 30], [2004, 5, 31], [2004, 6, 30], [2004, 7, 31], [2004, 8, 31], [2004, 9, 30], [2004, 10, 31], [2004, 11, 30], [2004, 12, 31], [2005, 1, 31], [2005, 2, 28], [2005, 3, 31], [2005, 4, 30], [2005, 5, 31], [2005, 6, 30], [2005, 7, 31], [2005, 8, 31], [2005, 9, 30], [2005, 10, 31], [2005, 11, 30], [2005, 12, 31], [2006, 1, 31], [2006, 2, 28], [2006, 3, 31], [2006, 4, 30], [2006, 5, 31], [2006, 6, 30], [2006, 7, 31], [2006, 8, 31], [2006, 9, 30], [2006, 10, 31], [2006, 11, 30], [2006, 12, 31], [2007, 1, 31], [2007, 2, 28], [2007, 3, 31], [2007, 4, 30], [2007, 5, 31], [2007, 6, 30], [2007, 7, 31], [2007, 8, 31], [2007, 9, 30], [2007, 10, 31], [2007, 11, 30], [2007, 12, 31], [2008, 1, 31]]], ['partial repair probe 2', [[2024, 10, 31], [2026, 10, 31], 6, False], [[2025, 4, 30], [2025, 10, 31], [2026, 4, 30], [2026, 10, 31]]], ['boundary control 1', [[2024, 3, 15], [2025, 3, 15], 3, False], [[2024, 6, 15], [2024, 9, 15], [2024, 12, 15], [2025, 3, 15]]], ['boundary control 2', [[2024, 1, 10], [2025, 8, 31], 6, True], [[2024, 2, 29], [2024, 8, 31], [2025, 2, 28], [2025, 8, 31]]], ['normal control 1', [[2036, 4, 8], [2037, 3, 29], 12, False], [[2037, 3, 29]]], ['normal control 2', [[2004, 9, 13], [2006, 6, 1], 6, True], [[2004, 12, 1], [2005, 6, 1], [2005, 12, 1], [2006, 6, 1]]]], [['regression roll day anchor 1', [[2030, 5, 12], [2034, 3, 31], 3, False], [[2030, 6, 30], [2030, 9, 30], [2030, 12, 31], [2031, 3, 31], [2031, 6, 30], [2031, 9, 30], [2031, 12, 31], [2032, 3, 31], [2032, 6, 30], [2032, 9, 30], [2032, 12, 31], [2033, 3, 31], [2033, 6, 30], [2033, 9, 30], [2033, 12, 31], [2034, 3, 31]]], ['regression roll day anchor 2', [[2018, 3, 2], [2021, 12, 31], 3, False], [[2018, 3, 31], [2018, 6, 30], [2018, 9, 30], [2018, 12, 31], [2019, 3, 31], [2019, 6, 30], [2019, 9, 30], [2019, 12, 31], [2020, 3, 31], [2020, 6, 30], [2020, 9, 30], [2020, 12, 31], [2021, 3, 31], [2021, 6, 30], [2021, 9, 30], [2021, 12, 31]]], ['partial repair probe 1', [[2006, 9, 7], [2009, 5, 31], 1, False], [[2006, 9, 30], [2006, 10, 31], [2006, 11, 30], [2006, 12, 31], [2007, 1, 31], [2007, 2, 28], [2007, 3, 31], [2007, 4, 30], [2007, 5, 31], [2007, 6, 30], [2007, 7, 31], [2007, 8, 31], [2007, 9, 30], [2007, 10, 31], [2007, 11, 30], [2007, 12, 31], [2008, 1, 31], [2008, 2, 29], [2008, 3, 31], [2008, 4, 30], [2008, 5, 31], [2008, 6, 30], [2008, 7, 31], [2008, 8, 31], [2008, 9, 30], [2008, 10, 31], [2008, 11, 30], [2008, 12, 31], [2009, 1, 31], [2009, 2, 28], [2009, 3, 31], [2009, 4, 30], [2009, 5, 31]]], ['partial repair probe 2', [[2029, 10, 27], [2030, 7, 31], 3, False], [[2030, 1, 31], [2030, 4, 30], [2030, 7, 31]]], ['boundary control 1', [[2024, 3, 1], [2025, 3, 15], 6, False], [[2024, 9, 15], [2025, 3, 15]]], ['boundary control 2', [[2024, 1, 10], [2025, 8, 31], 6, True], [[2024, 2, 29], [2024, 8, 31], [2025, 2, 28], [2025, 8, 31]]], ['normal control 1', [[2005, 9, 17], [2005, 10, 7], 12, True], [[2005, 10, 7]]], ['normal control 2', [[2011, 6, 6], [2012, 9, 30], 3, True], [[2011, 6, 30], [2011, 9, 30], [2011, 12, 31], [2012, 3, 31], [2012, 6, 30], [2012, 9, 30]]]], [['regression roll day anchor 1', [[2010, 3, 20], [2011, 5, 31], 3, False], [[2010, 5, 31], [2010, 8, 31], [2010, 11, 30], [2011, 2, 28], [2011, 5, 31]]], ['regression roll day anchor 2', [[2026, 9, 24], [2029, 4, 30], 1, False], [[2026, 10, 30], [2026, 11, 30], [2026, 12, 30], [2027, 1, 30], [2027, 2, 28], [2027, 3, 30], [2027, 4, 30], [2027, 5, 30], [2027, 6, 30], [2027, 7, 30], [2027, 8, 30], [2027, 9, 30], [2027, 10, 30], [2027, 11, 30], [2027, 12, 30], [2028, 1, 30], [2028, 2, 29], [2028, 3, 30], [2028, 4, 30], [2028, 5, 30], [2028, 6, 30], [2028, 7, 30], [2028, 8, 30], [2028, 9, 30], [2028, 10, 30], [2028, 11, 30], [2028, 12, 30], [2029, 1, 30], [2029, 2, 28], [2029, 3, 30], [2029, 4, 30]]], ['partial repair probe 1', [[2023, 5, 5], [2026, 8, 31], 3, False], [[2023, 5, 31], [2023, 8, 31], [2023, 11, 30], [2024, 2, 29], [2024, 5, 31], [2024, 8, 31], [2024, 11, 30], [2025, 2, 28], [2025, 5, 31], [2025, 8, 31], [2025, 11, 30], [2026, 2, 28], [2026, 5, 31], [2026, 8, 31]]], ['partial repair probe 2', [[2031, 4, 18], [2035, 3, 31], 1, False], [[2031, 5, 31], [2031, 6, 30], [2031, 7, 31], [2031, 8, 31], [2031, 9, 30], [2031, 10, 31], [2031, 11, 30], [2031, 12, 31], [2032, 1, 31], [2032, 2, 29], [2032, 3, 31], [2032, 4, 30], [2032, 5, 31], [2032, 6, 30], [2032, 7, 31], [2032, 8, 31], [2032, 9, 30], [2032, 10, 31], [2032, 11, 30], [2032, 12, 31], [2033, 1, 31], [2033, 2, 28], [2033, 3, 31], [2033, 4, 30], [2033, 5, 31], [2033, 6, 30], [2033, 7, 31], [2033, 8, 31], [2033, 9, 30], [2033, 10, 31], [2033, 11, 30], [2033, 12, 31], [2034, 1, 31], [2034, 2, 28], [2034, 3, 31], [2034, 4, 30], [2034, 5, 31], [2034, 6, 30], [2034, 7, 31], [2034, 8, 31], [2034, 9, 30], [2034, 10, 31], [2034, 11, 30], [2034, 12, 31], [2035, 1, 31], [2035, 2, 28], [2035, 3, 31]]], ['boundary control 1', [[2024, 2, 20], [2025, 2, 28], 6, True], [[2024, 8, 31], [2025, 2, 28]]], ['boundary control 2', [[2024, 3, 15], [2025, 3, 15], 3, False], [[2024, 6, 15], [2024, 9, 15], [2024, 12, 15], [2025, 3, 15]]], ['normal control 1', [[2000, 9, 20], [2003, 6, 30], 6, False], [[2000, 12, 30], [2001, 6, 30], [2001, 12, 30], [2002, 6, 30], [2002, 12, 30], [2003, 6, 30]]], ['normal control 2', [[2006, 10, 14], [2010, 2, 28], 1, False], [[2006, 11, 28], [2006, 12, 28], [2007, 1, 28], [2007, 2, 28], [2007, 3, 28], [2007, 4, 28], [2007, 5, 28], [2007, 6, 28], [2007, 7, 28], [2007, 8, 28], [2007, 9, 28], [2007, 10, 28], [2007, 11, 28], [2007, 12, 28], [2008, 1, 28], [2008, 2, 28], [2008, 3, 28], [2008, 4, 28], [2008, 5, 28], [2008, 6, 28], [2008, 7, 28], [2008, 8, 28], [2008, 9, 28], [2008, 10, 28], [2008, 11, 28], [2008, 12, 28], [2009, 1, 28], [2009, 2, 28], [2009, 3, 28], [2009, 4, 28], [2009, 5, 28], [2009, 6, 28], [2009, 7, 28], [2009, 8, 28], [2009, 9, 28], [2009, 10, 28], [2009, 11, 28], [2009, 12, 28], [2010, 1, 28], [2010, 2, 28]]]], [['regression roll day anchor 1', [[2006, 8, 31], [2009, 8, 31], 6, False], [[2007, 2, 28], [2007, 8, 31], [2008, 2, 29], [2008, 8, 31], [2009, 2, 28], [2009, 8, 31]]], ['regression roll day anchor 2', [[2009, 10, 26], [2012, 2, 29], 3, False], [[2009, 11, 29], [2010, 2, 28], [2010, 5, 29], [2010, 8, 29], [2010, 11, 29], [2011, 2, 28], [2011, 5, 29], [2011, 8, 29], [2011, 11, 29], [2012, 2, 29]]], ['partial repair probe 1', [[2035, 12, 20], [2036, 7, 31], 3, False], [[2036, 1, 31], [2036, 4, 30], [2036, 7, 31]]], ['partial repair probe 2', [[2036, 4, 30], [2038, 10, 31], 6, False], [[2036, 10, 31], [2037, 4, 30], [2037, 10, 31], [2038, 4, 30], [2038, 10, 31]]], ['boundary control 1', [[2024, 2, 20], [2025, 2, 28], 6, True], [[2024, 8, 31], [2025, 2, 28]]], ['boundary control 2', [[2024, 3, 15], [2025, 3, 15], 3, False], [[2024, 6, 15], [2024, 9, 15], [2024, 12, 15], [2025, 3, 15]]], ['normal control 1', [[2028, 12, 19], [2031, 8, 28], 6, False], [[2029, 2, 28], [2029, 8, 28], [2030, 2, 28], [2030, 8, 28], [2031, 2, 28], [2031, 8, 28]]], ['normal control 2', [[2022, 7, 27], [2025, 6, 30], 6, False], [[2022, 12, 30], [2023, 6, 30], [2023, 12, 30], [2024, 6, 30], [2024, 12, 30], [2025, 6, 30]]]], [['regression roll day anchor 1', [[2039, 1, 3], [2040, 12, 31], 6, False], [[2039, 6, 30], [2039, 12, 31], [2040, 6, 30], [2040, 12, 31]]], ['regression roll day anchor 2', [[2038, 8, 6], [2040, 2, 29], 6, False], [[2038, 8, 29], [2039, 2, 28], [2039, 8, 29], [2040, 2, 29]]], ['partial repair probe 1', [[2012, 11, 27], [2015, 8, 31], 3, False], [[2013, 2, 28], [2013, 5, 31], [2013, 8, 31], [2013, 11, 30], [2014, 2, 28], [2014, 5, 31], [2014, 8, 31], [2014, 11, 30], [2015, 2, 28], [2015, 5, 31], [2015, 8, 31]]], ['partial repair probe 2', [[2024, 12, 1], [2027, 5, 31], 3, False], [[2025, 2, 28], [2025, 5, 31], [2025, 8, 31], [2025, 11, 30], [2026, 2, 28], [2026, 5, 31], [2026, 8, 31], [2026, 11, 30], [2027, 2, 28], [2027, 5, 31]]], ['boundary control 1', [[2024, 3, 1], [2025, 3, 15], 6, False], [[2024, 9, 15], [2025, 3, 15]]], ['boundary control 2', [[2024, 2, 20], [2025, 2, 28], 6, True], [[2024, 8, 31], [2025, 2, 28]]], ['normal control 1', [[2026, 7, 15], [2026, 7, 31], 12, True], [[2026, 7, 31]]], ['normal control 2', [[2030, 7, 16], [2031, 6, 30], 6, False], [[2030, 12, 30], [2031, 6, 30]]]]]
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 roll day anchor 1 | [[2023, 1, 31], [2023, 2, 28], [2023, 3, 30], [2023, 4, 30], [2023, 5, 30], [2023, 6, 30], [2023, 7, 30], [2023, 8, 30], [2023, 9, 30], [2023, 10, 30], [2023, 11, 30], [2023, 12, 31], [2024, 1, 31], [2024, 2, 29], [2024, 3, 30], [2024, 4, 30], [2024, 5, 31]] | [[2023, 1, 31], [2023, 2, 28], [2023, 3, 31], [2023, 4, 30], [2023, 5, 31], [2023, 6, 30], [2023, 7, 31], [2023, 8, 31], [2023, 9, 30], [2023, 10, 31], [2023, 11, 30], [2023, 12, 31], [2024, 1, 31], [2024, 2, 29], [2024, 3, 31], [2024, 4, 30], [2024, 5, 31]] | Failed |
| regression roll day anchor 2 | [[2022, 12, 29], [2023, 1, 29], [2023, 2, 28], [2023, 3, 29], [2023, 4, 29], [2023, 5, 29], [2023, 6, 29], [2023, 7, 29], [2023, 8, 29], [2023, 9, 29], [2023, 10, 29], [2023, 11, 29], [2023, 12, 29], [2024, 1, 29], [2024, 2, 29], [2024, 3, 29], [2024, 4, 29], [2024, 5, 29], [2024, 6, 29], [2024, 7, 29], [2024, 8, 29], [2024, 9, 29], [2024, 10, 29], [2024, 11, 29], [2024, 12, 29], [2025, 1, 29], [2025, 2, 28], [2025, 3, 29], [2025, 4, 29], [2025, 5, 29], [2025, 6, 29], [2025, 7, 29], [2025, 8, 29], [2025, 9, 29], [2025, 10, 29], [2025, 11, 29], [2025, 12, 29], [2026, 1, 29], [2026, 2, 28], [2026, 3, 29], [2026, 4, 29], [2026, 5, 29], [2026, 6, 29], [2026, 7, 29], [2026, 8, 29], [2026, 9, 29], [2026, 10, 29], [2026, 11, 29]] | [[2022, 12, 29], [2023, 1, 29], [2023, 2, 28], [2023, 3, 29], [2023, 4, 29], [2023, 5, 29], [2023, 6, 29], [2023, 7, 29], [2023, 8, 29], [2023, 9, 29], [2023, 10, 29], [2023, 11, 29], [2023, 12, 29], [2024, 1, 29], [2024, 2, 29], [2024, 3, 29], [2024, 4, 29], [2024, 5, 29], [2024, 6, 29], [2024, 7, 29], [2024, 8, 29], [2024, 9, 29], [2024, 10, 29], [2024, 11, 29], [2024, 12, 29], [2025, 1, 29], [2025, 2, 28], [2025, 3, 29], [2025, 4, 29], [2025, 5, 29], [2025, 6, 29], [2025, 7, 29], [2025, 8, 29], [2025, 9, 29], [2025, 10, 29], [2025, 11, 29], [2025, 12, 29], [2026, 1, 29], [2026, 2, 28], [2026, 3, 29], [2026, 4, 29], [2026, 5, 29], [2026, 6, 29], [2026, 7, 29], [2026, 8, 29], [2026, 9, 29], [2026, 10, 29], [2026, 11, 29]] | Passed |
| partial repair probe 1 | [[2004, 4, 30], [2004, 5, 30], [2004, 6, 30], [2004, 7, 30], [2004, 8, 30], [2004, 9, 30], [2004, 10, 30], [2004, 11, 30], [2004, 12, 31], [2005, 1, 31], [2005, 2, 28], [2005, 3, 30], [2005, 4, 30], [2005, 5, 30], [2005, 6, 30], [2005, 7, 30], [2005, 8, 30], [2005, 9, 30], [2005, 10, 30], [2005, 11, 30], [2005, 12, 31], [2006, 1, 31], [2006, 2, 28], [2006, 3, 30], [2006, 4, 30], [2006, 5, 30], [2006, 6, 30], [2006, 7, 30], [2006, 8, 30], [2006, 9, 30], [2006, 10, 30], [2006, 11, 30], [2006, 12, 31], [2007, 1, 31], [2007, 2, 28], [2007, 3, 30], [2007, 4, 30], [2007, 5, 30], [2007, 6, 30], [2007, 7, 30], [2007, 8, 30], [2007, 9, 30], [2007, 10, 30], [2007, 11, 30], [2007, 12, 31], [2008, 1, 31]] | [[2004, 4, 30], [2004, 5, 31], [2004, 6, 30], [2004, 7, 31], [2004, 8, 31], [2004, 9, 30], [2004, 10, 31], [2004, 11, 30], [2004, 12, 31], [2005, 1, 31], [2005, 2, 28], [2005, 3, 31], [2005, 4, 30], [2005, 5, 31], [2005, 6, 30], [2005, 7, 31], [2005, 8, 31], [2005, 9, 30], [2005, 10, 31], [2005, 11, 30], [2005, 12, 31], [2006, 1, 31], [2006, 2, 28], [2006, 3, 31], [2006, 4, 30], [2006, 5, 31], [2006, 6, 30], [2006, 7, 31], [2006, 8, 31], [2006, 9, 30], [2006, 10, 31], [2006, 11, 30], [2006, 12, 31], [2007, 1, 31], [2007, 2, 28], [2007, 3, 31], [2007, 4, 30], [2007, 5, 31], [2007, 6, 30], [2007, 7, 31], [2007, 8, 31], [2007, 9, 30], [2007, 10, 31], [2007, 11, 30], [2007, 12, 31], [2008, 1, 31]] | Failed |
| partial repair probe 2 | [[2025, 4, 30], [2025, 10, 30], [2026, 4, 30], [2026, 10, 31]] | [[2025, 4, 30], [2025, 10, 31], [2026, 4, 30], [2026, 10, 31]] | Failed |
| boundary control 1 | [[2024, 6, 15], [2024, 9, 15], [2024, 12, 15], [2025, 3, 15]] | [[2024, 6, 15], [2024, 9, 15], [2024, 12, 15], [2025, 3, 15]] | Passed |
| boundary control 2 | [[2024, 2, 29], [2024, 8, 31], [2025, 2, 28], [2025, 8, 31]] | [[2024, 2, 29], [2024, 8, 31], [2025, 2, 28], [2025, 8, 31]] | Passed |
| normal control 1 | [[2037, 3, 29]] | [[2037, 3, 29]] | Passed |
| normal control 2 | [[2004, 12, 1], [2005, 6, 1], [2005, 12, 1], [2006, 6, 1]] | [[2004, 12, 1], [2005, 6, 1], [2005, 12, 1], [2006, 6, 1]] | Passed |
SHA-256 / b3be635377d8436cabb2c7e52985ba040d16cf781791fcfcb04ee8640e501bd7
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
import datetime
from fractions import Fraction
N = 1
observations = []
def solve(issue, maturity, months, eom):
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 shift(y, m, k):
t = y * 12 + (m - 1) - k
return t // 12, t % 12 + 1
I = datetime.date(*issue)
my, mm, md = maturity
end_eom = md == mlen(my, mm)
out = []
k = 0
while True:
y, m = shift(my, mm, k * months)
d = mlen(y, m) if (eom and end_eom) else min(md, mlen(y, m))
if datetime.date(y, m, d) <= I:
break
out.append([y, m, d])
k += 1
out.reverse()
if len(out) > 1 and (datetime.date(*out[0]) - I).days < 15:
out.pop(0)
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression roll day anchor 1', [[2022, 12, 30], [2024, 5, 31], 1, False], [[2023, 1, 31], [2023, 2, 28], [2023, 3, 31], [2023, 4, 30], [2023, 5, 31], [2023, 6, 30], [2023, 7, 31], [2023, 8, 31], [2023, 9, 30], [2023, 10, 31], [2023, 11, 30], [2023, 12, 31], [2024, 1, 31], [2024, 2, 29], [2024, 3, 31], [2024, 4, 30], [2024, 5, 31]]], ['regression roll day anchor 2', [[2022, 11, 18], [2026, 11, 29], 1, False], [[2022, 12, 29], [2023, 1, 29], [2023, 2, 28], [2023, 3, 29], [2023, 4, 29], [2023, 5, 29], [2023, 6, 29], [2023, 7, 29], [2023, 8, 29], [2023, 9, 29], [2023, 10, 29], [2023, 11, 29], [2023, 12, 29], [2024, 1, 29], [2024, 2, 29], [2024, 3, 29], [2024, 4, 29], [2024, 5, 29], [2024, 6, 29], [2024, 7, 29], [2024, 8, 29], [2024, 9, 29], [2024, 10, 29], [2024, 11, 29], [2024, 12, 29], [2025, 1, 29], [2025, 2, 28], [2025, 3, 29], [2025, 4, 29], [2025, 5, 29], [2025, 6, 29], [2025, 7, 29], [2025, 8, 29], [2025, 9, 29], [2025, 10, 29], [2025, 11, 29], [2025, 12, 29], [2026, 1, 29], [2026, 2, 28], [2026, 3, 29], [2026, 4, 29], [2026, 5, 29], [2026, 6, 29], [2026, 7, 29], [2026, 8, 29], [2026, 9, 29], [2026, 10, 29], [2026, 11, 29]]], ['partial repair probe 1', [[2004, 4, 10], [2008, 1, 31], 1, False], [[2004, 4, 30], [2004, 5, 31], [2004, 6, 30], [2004, 7, 31], [2004, 8, 31], [2004, 9, 30], [2004, 10, 31], [2004, 11, 30], [2004, 12, 31], [2005, 1, 31], [2005, 2, 28], [2005, 3, 31], [2005, 4, 30], [2005, 5, 31], [2005, 6, 30], [2005, 7, 31], [2005, 8, 31], [2005, 9, 30], [2005, 10, 31], [2005, 11, 30], [2005, 12, 31], [2006, 1, 31], [2006, 2, 28], [2006, 3, 31], [2006, 4, 30], [2006, 5, 31], [2006, 6, 30], [2006, 7, 31], [2006, 8, 31], [2006, 9, 30], [2006, 10, 31], [2006, 11, 30], [2006, 12, 31], [2007, 1, 31], [2007, 2, 28], [2007, 3, 31], [2007, 4, 30], [2007, 5, 31], [2007, 6, 30], [2007, 7, 31], [2007, 8, 31], [2007, 9, 30], [2007, 10, 31], [2007, 11, 30], [2007, 12, 31], [2008, 1, 31]]], ['partial repair probe 2', [[2024, 10, 31], [2026, 10, 31], 6, False], [[2025, 4, 30], [2025, 10, 31], [2026, 4, 30], [2026, 10, 31]]], ['boundary control 1', [[2024, 3, 15], [2025, 3, 15], 3, False], [[2024, 6, 15], [2024, 9, 15], [2024, 12, 15], [2025, 3, 15]]], ['boundary control 2', [[2024, 1, 10], [2025, 8, 31], 6, True], [[2024, 2, 29], [2024, 8, 31], [2025, 2, 28], [2025, 8, 31]]], ['normal control 1', [[2036, 4, 8], [2037, 3, 29], 12, False], [[2037, 3, 29]]], ['normal control 2', [[2004, 9, 13], [2006, 6, 1], 6, True], [[2004, 12, 1], [2005, 6, 1], [2005, 12, 1], [2006, 6, 1]]]], [['regression roll day anchor 1', [[2030, 5, 12], [2034, 3, 31], 3, False], [[2030, 6, 30], [2030, 9, 30], [2030, 12, 31], [2031, 3, 31], [2031, 6, 30], [2031, 9, 30], [2031, 12, 31], [2032, 3, 31], [2032, 6, 30], [2032, 9, 30], [2032, 12, 31], [2033, 3, 31], [2033, 6, 30], [2033, 9, 30], [2033, 12, 31], [2034, 3, 31]]], ['regression roll day anchor 2', [[2018, 3, 2], [2021, 12, 31], 3, False], [[2018, 3, 31], [2018, 6, 30], [2018, 9, 30], [2018, 12, 31], [2019, 3, 31], [2019, 6, 30], [2019, 9, 30], [2019, 12, 31], [2020, 3, 31], [2020, 6, 30], [2020, 9, 30], [2020, 12, 31], [2021, 3, 31], [2021, 6, 30], [2021, 9, 30], [2021, 12, 31]]], ['partial repair probe 1', [[2006, 9, 7], [2009, 5, 31], 1, False], [[2006, 9, 30], [2006, 10, 31], [2006, 11, 30], [2006, 12, 31], [2007, 1, 31], [2007, 2, 28], [2007, 3, 31], [2007, 4, 30], [2007, 5, 31], [2007, 6, 30], [2007, 7, 31], [2007, 8, 31], [2007, 9, 30], [2007, 10, 31], [2007, 11, 30], [2007, 12, 31], [2008, 1, 31], [2008, 2, 29], [2008, 3, 31], [2008, 4, 30], [2008, 5, 31], [2008, 6, 30], [2008, 7, 31], [2008, 8, 31], [2008, 9, 30], [2008, 10, 31], [2008, 11, 30], [2008, 12, 31], [2009, 1, 31], [2009, 2, 28], [2009, 3, 31], [2009, 4, 30], [2009, 5, 31]]], ['partial repair probe 2', [[2029, 10, 27], [2030, 7, 31], 3, False], [[2030, 1, 31], [2030, 4, 30], [2030, 7, 31]]], ['boundary control 1', [[2024, 3, 1], [2025, 3, 15], 6, False], [[2024, 9, 15], [2025, 3, 15]]], ['boundary control 2', [[2024, 1, 10], [2025, 8, 31], 6, True], [[2024, 2, 29], [2024, 8, 31], [2025, 2, 28], [2025, 8, 31]]], ['normal control 1', [[2005, 9, 17], [2005, 10, 7], 12, True], [[2005, 10, 7]]], ['normal control 2', [[2011, 6, 6], [2012, 9, 30], 3, True], [[2011, 6, 30], [2011, 9, 30], [2011, 12, 31], [2012, 3, 31], [2012, 6, 30], [2012, 9, 30]]]], [['regression roll day anchor 1', [[2010, 3, 20], [2011, 5, 31], 3, False], [[2010, 5, 31], [2010, 8, 31], [2010, 11, 30], [2011, 2, 28], [2011, 5, 31]]], ['regression roll day anchor 2', [[2026, 9, 24], [2029, 4, 30], 1, False], [[2026, 10, 30], [2026, 11, 30], [2026, 12, 30], [2027, 1, 30], [2027, 2, 28], [2027, 3, 30], [2027, 4, 30], [2027, 5, 30], [2027, 6, 30], [2027, 7, 30], [2027, 8, 30], [2027, 9, 30], [2027, 10, 30], [2027, 11, 30], [2027, 12, 30], [2028, 1, 30], [2028, 2, 29], [2028, 3, 30], [2028, 4, 30], [2028, 5, 30], [2028, 6, 30], [2028, 7, 30], [2028, 8, 30], [2028, 9, 30], [2028, 10, 30], [2028, 11, 30], [2028, 12, 30], [2029, 1, 30], [2029, 2, 28], [2029, 3, 30], [2029, 4, 30]]], ['partial repair probe 1', [[2023, 5, 5], [2026, 8, 31], 3, False], [[2023, 5, 31], [2023, 8, 31], [2023, 11, 30], [2024, 2, 29], [2024, 5, 31], [2024, 8, 31], [2024, 11, 30], [2025, 2, 28], [2025, 5, 31], [2025, 8, 31], [2025, 11, 30], [2026, 2, 28], [2026, 5, 31], [2026, 8, 31]]], ['partial repair probe 2', [[2031, 4, 18], [2035, 3, 31], 1, False], [[2031, 5, 31], [2031, 6, 30], [2031, 7, 31], [2031, 8, 31], [2031, 9, 30], [2031, 10, 31], [2031, 11, 30], [2031, 12, 31], [2032, 1, 31], [2032, 2, 29], [2032, 3, 31], [2032, 4, 30], [2032, 5, 31], [2032, 6, 30], [2032, 7, 31], [2032, 8, 31], [2032, 9, 30], [2032, 10, 31], [2032, 11, 30], [2032, 12, 31], [2033, 1, 31], [2033, 2, 28], [2033, 3, 31], [2033, 4, 30], [2033, 5, 31], [2033, 6, 30], [2033, 7, 31], [2033, 8, 31], [2033, 9, 30], [2033, 10, 31], [2033, 11, 30], [2033, 12, 31], [2034, 1, 31], [2034, 2, 28], [2034, 3, 31], [2034, 4, 30], [2034, 5, 31], [2034, 6, 30], [2034, 7, 31], [2034, 8, 31], [2034, 9, 30], [2034, 10, 31], [2034, 11, 30], [2034, 12, 31], [2035, 1, 31], [2035, 2, 28], [2035, 3, 31]]], ['boundary control 1', [[2024, 2, 20], [2025, 2, 28], 6, True], [[2024, 8, 31], [2025, 2, 28]]], ['boundary control 2', [[2024, 3, 15], [2025, 3, 15], 3, False], [[2024, 6, 15], [2024, 9, 15], [2024, 12, 15], [2025, 3, 15]]], ['normal control 1', [[2000, 9, 20], [2003, 6, 30], 6, False], [[2000, 12, 30], [2001, 6, 30], [2001, 12, 30], [2002, 6, 30], [2002, 12, 30], [2003, 6, 30]]], ['normal control 2', [[2006, 10, 14], [2010, 2, 28], 1, False], [[2006, 11, 28], [2006, 12, 28], [2007, 1, 28], [2007, 2, 28], [2007, 3, 28], [2007, 4, 28], [2007, 5, 28], [2007, 6, 28], [2007, 7, 28], [2007, 8, 28], [2007, 9, 28], [2007, 10, 28], [2007, 11, 28], [2007, 12, 28], [2008, 1, 28], [2008, 2, 28], [2008, 3, 28], [2008, 4, 28], [2008, 5, 28], [2008, 6, 28], [2008, 7, 28], [2008, 8, 28], [2008, 9, 28], [2008, 10, 28], [2008, 11, 28], [2008, 12, 28], [2009, 1, 28], [2009, 2, 28], [2009, 3, 28], [2009, 4, 28], [2009, 5, 28], [2009, 6, 28], [2009, 7, 28], [2009, 8, 28], [2009, 9, 28], [2009, 10, 28], [2009, 11, 28], [2009, 12, 28], [2010, 1, 28], [2010, 2, 28]]]], [['regression roll day anchor 1', [[2006, 8, 31], [2009, 8, 31], 6, False], [[2007, 2, 28], [2007, 8, 31], [2008, 2, 29], [2008, 8, 31], [2009, 2, 28], [2009, 8, 31]]], ['regression roll day anchor 2', [[2009, 10, 26], [2012, 2, 29], 3, False], [[2009, 11, 29], [2010, 2, 28], [2010, 5, 29], [2010, 8, 29], [2010, 11, 29], [2011, 2, 28], [2011, 5, 29], [2011, 8, 29], [2011, 11, 29], [2012, 2, 29]]], ['partial repair probe 1', [[2035, 12, 20], [2036, 7, 31], 3, False], [[2036, 1, 31], [2036, 4, 30], [2036, 7, 31]]], ['partial repair probe 2', [[2036, 4, 30], [2038, 10, 31], 6, False], [[2036, 10, 31], [2037, 4, 30], [2037, 10, 31], [2038, 4, 30], [2038, 10, 31]]], ['boundary control 1', [[2024, 2, 20], [2025, 2, 28], 6, True], [[2024, 8, 31], [2025, 2, 28]]], ['boundary control 2', [[2024, 3, 15], [2025, 3, 15], 3, False], [[2024, 6, 15], [2024, 9, 15], [2024, 12, 15], [2025, 3, 15]]], ['normal control 1', [[2028, 12, 19], [2031, 8, 28], 6, False], [[2029, 2, 28], [2029, 8, 28], [2030, 2, 28], [2030, 8, 28], [2031, 2, 28], [2031, 8, 28]]], ['normal control 2', [[2022, 7, 27], [2025, 6, 30], 6, False], [[2022, 12, 30], [2023, 6, 30], [2023, 12, 30], [2024, 6, 30], [2024, 12, 30], [2025, 6, 30]]]], [['regression roll day anchor 1', [[2039, 1, 3], [2040, 12, 31], 6, False], [[2039, 6, 30], [2039, 12, 31], [2040, 6, 30], [2040, 12, 31]]], ['regression roll day anchor 2', [[2038, 8, 6], [2040, 2, 29], 6, False], [[2038, 8, 29], [2039, 2, 28], [2039, 8, 29], [2040, 2, 29]]], ['partial repair probe 1', [[2012, 11, 27], [2015, 8, 31], 3, False], [[2013, 2, 28], [2013, 5, 31], [2013, 8, 31], [2013, 11, 30], [2014, 2, 28], [2014, 5, 31], [2014, 8, 31], [2014, 11, 30], [2015, 2, 28], [2015, 5, 31], [2015, 8, 31]]], ['partial repair probe 2', [[2024, 12, 1], [2027, 5, 31], 3, False], [[2025, 2, 28], [2025, 5, 31], [2025, 8, 31], [2025, 11, 30], [2026, 2, 28], [2026, 5, 31], [2026, 8, 31], [2026, 11, 30], [2027, 2, 28], [2027, 5, 31]]], ['boundary control 1', [[2024, 3, 1], [2025, 3, 15], 6, False], [[2024, 9, 15], [2025, 3, 15]]], ['boundary control 2', [[2024, 2, 20], [2025, 2, 28], 6, True], [[2024, 8, 31], [2025, 2, 28]]], ['normal control 1', [[2026, 7, 15], [2026, 7, 31], 12, True], [[2026, 7, 31]]], ['normal control 2', [[2030, 7, 16], [2031, 6, 30], 6, False], [[2030, 12, 30], [2031, 6, 30]]]]]
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 roll day anchor 1 | [[2023, 1, 31], [2023, 2, 28], [2023, 3, 31], [2023, 4, 30], [2023, 5, 31], [2023, 6, 30], [2023, 7, 31], [2023, 8, 31], [2023, 9, 30], [2023, 10, 31], [2023, 11, 30], [2023, 12, 31], [2024, 1, 31], [2024, 2, 29], [2024, 3, 31], [2024, 4, 30], [2024, 5, 31]] | [[2023, 1, 31], [2023, 2, 28], [2023, 3, 31], [2023, 4, 30], [2023, 5, 31], [2023, 6, 30], [2023, 7, 31], [2023, 8, 31], [2023, 9, 30], [2023, 10, 31], [2023, 11, 30], [2023, 12, 31], [2024, 1, 31], [2024, 2, 29], [2024, 3, 31], [2024, 4, 30], [2024, 5, 31]] | Passed |
| regression roll day anchor 2 | [[2022, 12, 29], [2023, 1, 29], [2023, 2, 28], [2023, 3, 29], [2023, 4, 29], [2023, 5, 29], [2023, 6, 29], [2023, 7, 29], [2023, 8, 29], [2023, 9, 29], [2023, 10, 29], [2023, 11, 29], [2023, 12, 29], [2024, 1, 29], [2024, 2, 29], [2024, 3, 29], [2024, 4, 29], [2024, 5, 29], [2024, 6, 29], [2024, 7, 29], [2024, 8, 29], [2024, 9, 29], [2024, 10, 29], [2024, 11, 29], [2024, 12, 29], [2025, 1, 29], [2025, 2, 28], [2025, 3, 29], [2025, 4, 29], [2025, 5, 29], [2025, 6, 29], [2025, 7, 29], [2025, 8, 29], [2025, 9, 29], [2025, 10, 29], [2025, 11, 29], [2025, 12, 29], [2026, 1, 29], [2026, 2, 28], [2026, 3, 29], [2026, 4, 29], [2026, 5, 29], [2026, 6, 29], [2026, 7, 29], [2026, 8, 29], [2026, 9, 29], [2026, 10, 29], [2026, 11, 29]] | [[2022, 12, 29], [2023, 1, 29], [2023, 2, 28], [2023, 3, 29], [2023, 4, 29], [2023, 5, 29], [2023, 6, 29], [2023, 7, 29], [2023, 8, 29], [2023, 9, 29], [2023, 10, 29], [2023, 11, 29], [2023, 12, 29], [2024, 1, 29], [2024, 2, 29], [2024, 3, 29], [2024, 4, 29], [2024, 5, 29], [2024, 6, 29], [2024, 7, 29], [2024, 8, 29], [2024, 9, 29], [2024, 10, 29], [2024, 11, 29], [2024, 12, 29], [2025, 1, 29], [2025, 2, 28], [2025, 3, 29], [2025, 4, 29], [2025, 5, 29], [2025, 6, 29], [2025, 7, 29], [2025, 8, 29], [2025, 9, 29], [2025, 10, 29], [2025, 11, 29], [2025, 12, 29], [2026, 1, 29], [2026, 2, 28], [2026, 3, 29], [2026, 4, 29], [2026, 5, 29], [2026, 6, 29], [2026, 7, 29], [2026, 8, 29], [2026, 9, 29], [2026, 10, 29], [2026, 11, 29]] | Passed |
| partial repair probe 1 | [[2004, 4, 30], [2004, 5, 31], [2004, 6, 30], [2004, 7, 31], [2004, 8, 31], [2004, 9, 30], [2004, 10, 31], [2004, 11, 30], [2004, 12, 31], [2005, 1, 31], [2005, 2, 28], [2005, 3, 31], [2005, 4, 30], [2005, 5, 31], [2005, 6, 30], [2005, 7, 31], [2005, 8, 31], [2005, 9, 30], [2005, 10, 31], [2005, 11, 30], [2005, 12, 31], [2006, 1, 31], [2006, 2, 28], [2006, 3, 31], [2006, 4, 30], [2006, 5, 31], [2006, 6, 30], [2006, 7, 31], [2006, 8, 31], [2006, 9, 30], [2006, 10, 31], [2006, 11, 30], [2006, 12, 31], [2007, 1, 31], [2007, 2, 28], [2007, 3, 31], [2007, 4, 30], [2007, 5, 31], [2007, 6, 30], [2007, 7, 31], [2007, 8, 31], [2007, 9, 30], [2007, 10, 31], [2007, 11, 30], [2007, 12, 31], [2008, 1, 31]] | [[2004, 4, 30], [2004, 5, 31], [2004, 6, 30], [2004, 7, 31], [2004, 8, 31], [2004, 9, 30], [2004, 10, 31], [2004, 11, 30], [2004, 12, 31], [2005, 1, 31], [2005, 2, 28], [2005, 3, 31], [2005, 4, 30], [2005, 5, 31], [2005, 6, 30], [2005, 7, 31], [2005, 8, 31], [2005, 9, 30], [2005, 10, 31], [2005, 11, 30], [2005, 12, 31], [2006, 1, 31], [2006, 2, 28], [2006, 3, 31], [2006, 4, 30], [2006, 5, 31], [2006, 6, 30], [2006, 7, 31], [2006, 8, 31], [2006, 9, 30], [2006, 10, 31], [2006, 11, 30], [2006, 12, 31], [2007, 1, 31], [2007, 2, 28], [2007, 3, 31], [2007, 4, 30], [2007, 5, 31], [2007, 6, 30], [2007, 7, 31], [2007, 8, 31], [2007, 9, 30], [2007, 10, 31], [2007, 11, 30], [2007, 12, 31], [2008, 1, 31]] | Passed |
| partial repair probe 2 | [[2025, 4, 30], [2025, 10, 31], [2026, 4, 30], [2026, 10, 31]] | [[2025, 4, 30], [2025, 10, 31], [2026, 4, 30], [2026, 10, 31]] | Passed |
| boundary control 1 | [[2024, 6, 15], [2024, 9, 15], [2024, 12, 15], [2025, 3, 15]] | [[2024, 6, 15], [2024, 9, 15], [2024, 12, 15], [2025, 3, 15]] | Passed |
| boundary control 2 | [[2024, 2, 29], [2024, 8, 31], [2025, 2, 28], [2025, 8, 31]] | [[2024, 2, 29], [2024, 8, 31], [2025, 2, 28], [2025, 8, 31]] | Passed |
| normal control 1 | [[2037, 3, 29]] | [[2037, 3, 29]] | Passed |
| normal control 2 | [[2004, 12, 1], [2005, 6, 1], [2005, 12, 1], [2006, 6, 1]] | [[2004, 12, 1], [2005, 6, 1], [2005, 12, 1], [2006, 6, 1]] | Passed |
SHA-256 / 8aeef61d33892bc242383bab7b69e67e3754c61bc10e2d2f0c4683de3936d1b2
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:50.586388+00:00.
Case digest / 91fe94cd43914934bc37ded3d2e5d39ca2b0d21e724be9d5df3854c80c1562c9