FA-60851 / Bond day-count conventions / Open access
30/360 US bond basis: an end date on the last day of February is promoted to 30 on its own · case 01
Periods ending on the last day of February gain days although they started mid-month.
ROOT CAUSE
The D2 February rule fires on the end date alone instead of requiring both dates at February end.
THE FAILURE
The D2 February rule fires on the end date alone instead of requiring both dates at February end.
Unsuccessful approach: Additionally requiring the same year blocks the rule for the usual one-year February-to-February span.
Case contract
Inputs are two [year, month, day] dates. Apply, in order: if both dates are the last day of February, D2 becomes 30; if D1 is the last day of February, D1 becomes 30; if D2 is 31 and (adjusted) D1 is 30 or 31, D2 becomes 30; if D1 is 31, D1 becomes 30. Return 360*(Y2-Y1)+30*(M2-M1)+(D2-D1) as an integer day count.
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
N = 1
observations = []
def solve(a, b):
y1, m1, d1 = a
y2, m2, d2 = b
def feb_end(y, m, d):
leap = (y % 4 == 0 and y % 100 != 0) or y % 400 == 0
return m == 2 and d == (29 if leap else 28)
e1 = feb_end(y1, m1, d1)
e2 = feb_end(y2, m2, d2)
if e2:
d2 = 30
if e1:
d1 = 30
if d2 == 31 and d1 >= 30:
d2 = 30
if d1 == 31:
d1 = 30
return 360 * (y2 - y1) + 30 * (m2 - m1) + (d2 - d1)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression both february ends rule 1', [[2079, 11, 30], [2082, 2, 28]], 808], ['regression both february ends rule 2', [[2004, 2, 28], [2004, 2, 29]], 1], ['partial repair probe 1', [[2096, 2, 29], [2097, 2, 28]], 360], ['partial repair probe 2', [[2004, 2, 29], [2007, 2, 28]], 1080], ['boundary control 1', [[2023, 5, 30], [2023, 7, 31]], 60], ['boundary control 2', [[2024, 1, 1], [2024, 1, 1]], 0], ['normal control 1', [[2029, 12, 31], [2032, 12, 21]], 1071], ['normal control 2', [[2055, 5, 10], [2058, 3, 8]], 1018]], [['regression both february ends rule 1', [[2089, 6, 30], [2091, 2, 28]], 598], ['regression both february ends rule 2', [[2003, 1, 31], [2006, 2, 28]], 1108], ['partial repair probe 1', [[2004, 2, 29], [2006, 2, 28]], 720], ['partial repair probe 2', [[2016, 2, 29], [2017, 2, 28]], 360], ['boundary control 1', [[2023, 2, 28], [2023, 8, 31]], 180], ['boundary control 2', [[2024, 3, 15], [2024, 9, 15]], 180], ['normal control 1', [[2086, 9, 30], [2087, 2, 25]], 145], ['normal control 2', [[2004, 2, 29], [2007, 6, 16]], 1186]], [['regression both february ends rule 1', [[2041, 10, 31], [2042, 2, 28]], 118], ['regression both february ends rule 2', [[2020, 6, 30], [2022, 2, 28]], 598], ['partial repair probe 1', [[2024, 2, 29], [2025, 2, 28]], 360], ['partial repair probe 2', [[2096, 2, 29], [2098, 2, 28]], 720], ['boundary control 1', [[2024, 3, 15], [2024, 9, 15]], 180], ['boundary control 2', [[2024, 1, 1], [2024, 1, 1]], 0], ['normal control 1', [[2041, 2, 28], [2041, 10, 31]], 240], ['normal control 2', [[2032, 9, 8], [2034, 4, 30]], 592]], [['regression both february ends rule 1', [[2049, 10, 31], [2050, 2, 28]], 118], ['regression both february ends rule 2', [[2058, 10, 31], [2059, 2, 28]], 118], ['partial repair probe 1', [[2096, 2, 29], [2099, 2, 28]], 1080], ['partial repair probe 2', [[2000, 2, 29], [2001, 2, 28]], 360], ['boundary control 1', [[2024, 3, 15], [2024, 9, 15]], 180], ['boundary control 2', [[2023, 2, 28], [2023, 8, 31]], 180], ['normal control 1', [[2004, 11, 30], [2004, 11, 30]], 0], ['normal control 2', [[2039, 7, 8], [2042, 10, 31]], 1193]], [['regression both february ends rule 1', [[2014, 6, 30], [2014, 2, 28]], -122], ['regression both february ends rule 2', [[2094, 12, 1], [2096, 2, 29]], 448], ['partial repair probe 1', [[2024, 2, 29], [2026, 2, 28]], 720], ['partial repair probe 2', [[2016, 2, 29], [2018, 2, 28]], 720], ['boundary control 1', [[2023, 5, 30], [2023, 7, 31]], 60], ['boundary control 2', [[2023, 1, 31], [2023, 3, 31]], 60], ['normal control 1', [[2022, 5, 30], [2025, 3, 14]], 1004], ['normal control 2', [[2053, 8, 31], [2054, 3, 18]], 198]]]
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 both february ends rule 1 | 810 | 808 | Failed |
| regression both february ends rule 2 | 2 | 1 | Failed |
| partial repair probe 1 | 360 | 360 | Passed |
| partial repair probe 2 | 1080 | 1080 | Passed |
| boundary control 1 | 60 | 60 | Passed |
| boundary control 2 | 0 | 0 | Passed |
| normal control 1 | 1071 | 1071 | Passed |
| normal control 2 | 1018 | 1018 | Passed |
SHA-256 / 04bcb52b52a11e4922a3ddca0ff4ed65ea817d9d37e8cd837518be934ea6d29d
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(a, b):
y1, m1, d1 = a
y2, m2, d2 = b
def feb_end(y, m, d):
leap = (y % 4 == 0 and y % 100 != 0) or y % 400 == 0
return m == 2 and d == (29 if leap else 28)
e1 = feb_end(y1, m1, d1)
e2 = feb_end(y2, m2, d2)
if e1 and e2 and y1 == y2:
d2 = 30
if e1:
d1 = 30
if d2 == 31 and d1 >= 30:
d2 = 30
if d1 == 31:
d1 = 30
return 360 * (y2 - y1) + 30 * (m2 - m1) + (d2 - d1)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression both february ends rule 1', [[2079, 11, 30], [2082, 2, 28]], 808], ['regression both february ends rule 2', [[2004, 2, 28], [2004, 2, 29]], 1], ['partial repair probe 1', [[2096, 2, 29], [2097, 2, 28]], 360], ['partial repair probe 2', [[2004, 2, 29], [2007, 2, 28]], 1080], ['boundary control 1', [[2023, 5, 30], [2023, 7, 31]], 60], ['boundary control 2', [[2024, 1, 1], [2024, 1, 1]], 0], ['normal control 1', [[2029, 12, 31], [2032, 12, 21]], 1071], ['normal control 2', [[2055, 5, 10], [2058, 3, 8]], 1018]], [['regression both february ends rule 1', [[2089, 6, 30], [2091, 2, 28]], 598], ['regression both february ends rule 2', [[2003, 1, 31], [2006, 2, 28]], 1108], ['partial repair probe 1', [[2004, 2, 29], [2006, 2, 28]], 720], ['partial repair probe 2', [[2016, 2, 29], [2017, 2, 28]], 360], ['boundary control 1', [[2023, 2, 28], [2023, 8, 31]], 180], ['boundary control 2', [[2024, 3, 15], [2024, 9, 15]], 180], ['normal control 1', [[2086, 9, 30], [2087, 2, 25]], 145], ['normal control 2', [[2004, 2, 29], [2007, 6, 16]], 1186]], [['regression both february ends rule 1', [[2041, 10, 31], [2042, 2, 28]], 118], ['regression both february ends rule 2', [[2020, 6, 30], [2022, 2, 28]], 598], ['partial repair probe 1', [[2024, 2, 29], [2025, 2, 28]], 360], ['partial repair probe 2', [[2096, 2, 29], [2098, 2, 28]], 720], ['boundary control 1', [[2024, 3, 15], [2024, 9, 15]], 180], ['boundary control 2', [[2024, 1, 1], [2024, 1, 1]], 0], ['normal control 1', [[2041, 2, 28], [2041, 10, 31]], 240], ['normal control 2', [[2032, 9, 8], [2034, 4, 30]], 592]], [['regression both february ends rule 1', [[2049, 10, 31], [2050, 2, 28]], 118], ['regression both february ends rule 2', [[2058, 10, 31], [2059, 2, 28]], 118], ['partial repair probe 1', [[2096, 2, 29], [2099, 2, 28]], 1080], ['partial repair probe 2', [[2000, 2, 29], [2001, 2, 28]], 360], ['boundary control 1', [[2024, 3, 15], [2024, 9, 15]], 180], ['boundary control 2', [[2023, 2, 28], [2023, 8, 31]], 180], ['normal control 1', [[2004, 11, 30], [2004, 11, 30]], 0], ['normal control 2', [[2039, 7, 8], [2042, 10, 31]], 1193]], [['regression both february ends rule 1', [[2014, 6, 30], [2014, 2, 28]], -122], ['regression both february ends rule 2', [[2094, 12, 1], [2096, 2, 29]], 448], ['partial repair probe 1', [[2024, 2, 29], [2026, 2, 28]], 720], ['partial repair probe 2', [[2016, 2, 29], [2018, 2, 28]], 720], ['boundary control 1', [[2023, 5, 30], [2023, 7, 31]], 60], ['boundary control 2', [[2023, 1, 31], [2023, 3, 31]], 60], ['normal control 1', [[2022, 5, 30], [2025, 3, 14]], 1004], ['normal control 2', [[2053, 8, 31], [2054, 3, 18]], 198]]]
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 both february ends rule 1 | 808 | 808 | Passed |
| regression both february ends rule 2 | 1 | 1 | Passed |
| partial repair probe 1 | 358 | 360 | Failed |
| partial repair probe 2 | 1078 | 1080 | Failed |
| boundary control 1 | 60 | 60 | Passed |
| boundary control 2 | 0 | 0 | Passed |
| normal control 1 | 1071 | 1071 | Passed |
| normal control 2 | 1018 | 1018 | Passed |
SHA-256 / 91cafa47fb64541e7e86279128eda97a22bb2810793796b4a14e14e3ee477c77
HELD IN THE MEMBER ARCHIVE
The verified repair and its recorded checks are member-only.
This mechanism has 8 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.
Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.
Member access is invitation-based. Sign in with your invited account to inspect the repair.
Sign in to the archive ↗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:49.464542+00:00.
Case digest / a5335e49428f34b5ba06f03e2255c8187641863653028a0b760b6c5790a15568