{"abstract":"Periods ending on the last day of February gain days although they started mid-month.","category":"Bond day-count conventions","checks":8,"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.","contract_signature":"a, b","evaluation_group":"w2-bond_day_count_conventions-thirty-360-us","failed_approach":"Additionally requiring the same year blocks the rule for the usual one-year February-to-February span.","family":"w2-bond_day_count_conventions-thirty-360-us-both-february-ends-rule","id":"FA-60851","implementations":{"attempt":{"sha256":"91cafa47fb64541e7e86279128eda97a22bb2810793796b4a14e14e3ee477c77","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(a, b):\n    y1, m1, d1 = a\n    y2, m2, d2 = b\n    def feb_end(y, m, d):\n        leap = (y % 4 == 0 and y % 100 != 0) or y % 400 == 0\n        return m == 2 and d == (29 if leap else 28)\n    e1 = feb_end(y1, m1, d1)\n    e2 = feb_end(y2, m2, d2)\n    if e1 and e2 and y1 == y2:\n        d2 = 30\n    if e1:\n        d1 = 30\n    if d2 == 31 and d1 >= 30:\n        d2 = 30\n    if d1 == 31:\n        d1 = 30\n    return 360 * (y2 - y1) + 30 * (m2 - m1) + (d2 - d1)\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['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]]]\nfor label, args, expected in fixtures[N-1]:\n    check(label, solve(*args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"broken":{"sha256":"04bcb52b52a11e4922a3ddca0ff4ed65ea817d9d37e8cd837518be934ea6d29d","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(a, b):\n    y1, m1, d1 = a\n    y2, m2, d2 = b\n    def feb_end(y, m, d):\n        leap = (y % 4 == 0 and y % 100 != 0) or y % 400 == 0\n        return m == 2 and d == (29 if leap else 28)\n    e1 = feb_end(y1, m1, d1)\n    e2 = feb_end(y2, m2, d2)\n    if e2:\n        d2 = 30\n    if e1:\n        d1 = 30\n    if d2 == 31 and d1 >= 30:\n        d2 = 30\n    if d1 == 31:\n        d1 = 30\n    return 360 * (y2 - y1) + 30 * (m2 - m1) + (d2 - d1)\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['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]]]\nfor label, args, expected in fixtures[N-1]:\n    check(label, solve(*args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"}},"limitations":"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.","method":"Deterministic executable model with adversarial boundary fixtures.","provenance":{"created_by":"Failure Map","dependencies":"Python standard library","family":"w2-bond_day_count_conventions-thirty-360-us-both-february-ends-rule","generated_at":"2026-09-29T14:46:49.464542+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Bond accrual and pricing systems depend on exact day-count arithmetic; a single-day error changes settlement cash.","root_cause":"The D2 February rule fires on the end date alone instead of requiring both dates at February end.","sha256":"a5335e49428f34b5ba06f03e2255c8187641863653028a0b760b6c5790a15568","title":"30/360 US bond basis: an end date on the last day of February is promoted to 30 on its own · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verified":true,"visibility":"public","verification":{"attempt":{"elapsed_ms":43.045,"exit_code":1,"observations":[{"actual":808,"check":"regression both february ends rule 1","expected":808,"passed":true},{"actual":1,"check":"regression both february ends rule 2","expected":1,"passed":true},{"actual":358,"check":"partial repair probe 1","expected":360,"passed":false},{"actual":1078,"check":"partial repair probe 2","expected":1080,"passed":false},{"actual":60,"check":"boundary control 1","expected":60,"passed":true},{"actual":0,"check":"boundary control 2","expected":0,"passed":true},{"actual":1071,"check":"normal control 1","expected":1071,"passed":true},{"actual":1018,"check":"normal control 2","expected":1018,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression both february ends rule 1\", \"actual\": 808, \"expected\": 808, \"passed\": true}, {\"check\": \"regression both february ends rule 2\", \"actual\": 1, \"expected\": 1, \"passed\": true}, {\"check\": \"partial repair probe 1\", \"actual\": 358, \"expected\": 360, \"passed\": false}, {\"check\": \"partial repair probe 2\", \"actual\": 1078, \"expected\": 1080, \"passed\": false}, {\"check\": \"boundary control 1\", \"actual\": 60, \"expected\": 60, \"passed\": true}, {\"check\": \"boundary control 2\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"normal control 1\", \"actual\": 1071, \"expected\": 1071, \"passed\": true}, {\"check\": \"normal control 2\", \"actual\": 1018, \"expected\": 1018, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":41.42,"exit_code":1,"observations":[{"actual":810,"check":"regression both february ends rule 1","expected":808,"passed":false},{"actual":2,"check":"regression both february ends rule 2","expected":1,"passed":false},{"actual":360,"check":"partial repair probe 1","expected":360,"passed":true},{"actual":1080,"check":"partial repair probe 2","expected":1080,"passed":true},{"actual":60,"check":"boundary control 1","expected":60,"passed":true},{"actual":0,"check":"boundary control 2","expected":0,"passed":true},{"actual":1071,"check":"normal control 1","expected":1071,"passed":true},{"actual":1018,"check":"normal control 2","expected":1018,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression both february ends rule 1\", \"actual\": 810, \"expected\": 808, \"passed\": false}, {\"check\": \"regression both february ends rule 2\", \"actual\": 2, \"expected\": 1, \"passed\": false}, {\"check\": \"partial repair probe 1\", \"actual\": 360, \"expected\": 360, \"passed\": true}, {\"check\": \"partial repair probe 2\", \"actual\": 1080, \"expected\": 1080, \"passed\": true}, {\"check\": \"boundary control 1\", \"actual\": 60, \"expected\": 60, \"passed\": true}, {\"check\": \"boundary control 2\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"normal control 1\", \"actual\": 1071, \"expected\": 1071, \"passed\": true}, {\"check\": \"normal control 2\", \"actual\": 1018, \"expected\": 1018, \"passed\": true}], \"passed\": false}\n"}},"member_only":{"stages":["fixed"],"fields":["implementations.fixed","verification.fixed","harness","repair"],"note":"The verified repair, its recorded checks, the repair description, and the scoring harness are available to members."}}