{"abstract":"Accruals starting on 28 February of a leap year are extended as if the month had ended.","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.","evaluation_group":"w2-bond_day_count_conventions-thirty-360-us","failed_approach":"Accepting any day of at least 28 still treats 28 February in a leap year as month end.","family":"w2-bond_day_count_conventions-thirty-360-us-february-end-detection","id":"FA-60846","implementations":{"attempt":{"sha256":"722196da2d578439742402f21d45e4783c2e9441ade7bf589cf78398b58fd63f","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 >= 28\n    e1 = feb_end(y1, m1, d1)\n    e2 = feb_end(y2, m2, d2)\n    if e1 and 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 february end detection 1', [[2096, 2, 28], [2097, 1, 29]], 331], ['regression february end detection 2', [[2015, 2, 28], [2016, 2, 29]], 360], ['partial repair probe 1', [[2024, 2, 28], [2025, 1, 5]], 307], ['partial repair probe 2', [[2004, 2, 28], [2005, 3, 31]], 393], ['boundary control 1', [[2024, 3, 15], [2024, 9, 15]], 180], ['boundary control 2', [[2024, 1, 1], [2024, 1, 1]], 0], ['normal control 1', [[2018, 4, 30], [2021, 5, 31]], 1110], ['normal control 2', [[2049, 1, 31], [2052, 2, 29]], 1109]], [['regression february end detection 1', [[2000, 2, 29], [2002, 2, 28]], 720], ['regression february end detection 2', [[2024, 2, 29], [2027, 2, 28]], 1080], ['partial repair probe 1', [[2004, 2, 28], [2005, 12, 17]], 649], ['partial repair probe 2', [[2008, 2, 28], [2011, 4, 25]], 1137], ['boundary control 1', [[2023, 2, 28], [2023, 8, 31]], 180], ['boundary control 2', [[2024, 1, 1], [2024, 1, 1]], 0], ['normal control 1', [[2047, 7, 31], [2050, 2, 28]], 928], ['normal control 2', [[2057, 2, 28], [2059, 5, 6]], 786]], [['regression february end detection 1', [[2000, 2, 29], [2000, 5, 30]], 90], ['regression february end detection 2', [[2000, 2, 28], [2003, 4, 30]], 1142], ['partial repair probe 1', [[2096, 2, 28], [2098, 1, 31]], 693], ['partial repair probe 2', [[2024, 2, 28], [2024, 11, 13]], 255], ['boundary control 1', [[2023, 1, 31], [2023, 3, 31]], 60], ['boundary control 2', [[2023, 5, 30], [2023, 7, 31]], 60], ['normal control 1', [[2089, 6, 30], [2091, 2, 28]], 598], ['normal control 2', [[2011, 6, 30], [2013, 7, 14]], 734]], [['regression february end detection 1', [[2096, 2, 28], [2098, 6, 1]], 813], ['regression february end detection 2', [[2016, 2, 28], [2016, 11, 30]], 272], ['partial repair probe 1', [[2000, 2, 28], [2001, 5, 31]], 453], ['partial repair probe 2', [[2024, 2, 28], [2027, 5, 1]], 1143], ['boundary control 1', [[2023, 5, 30], [2023, 7, 31]], 60], ['boundary control 2', [[2024, 3, 15], [2024, 9, 15]], 180], ['normal control 1', [[2062, 11, 30], [2064, 3, 26]], 476], ['normal control 2', [[2060, 11, 30], [2062, 12, 30]], 750]], [['regression february end detection 1', [[2096, 2, 28], [2096, 10, 31]], 243], ['regression february end detection 2', [[2004, 2, 29], [2006, 5, 30]], 810], ['partial repair probe 1', [[2096, 2, 28], [2097, 1, 8]], 310], ['partial repair probe 2', [[2004, 2, 28], [2005, 5, 31]], 453], ['boundary control 1', [[2023, 5, 30], [2023, 7, 31]], 60], ['boundary control 2', [[2023, 2, 28], [2023, 8, 31]], 180], ['normal control 1', [[2053, 1, 28], [2055, 2, 28]], 750], ['normal control 2', [[2011, 10, 20], [2012, 6, 19]], 239]]]\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":"1a9f43c38e4b30e180dafae4f984e31bff2db3bb4b9e708fd05a5da54112ca38","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 == 28\n    e1 = feb_end(y1, m1, d1)\n    e2 = feb_end(y2, m2, d2)\n    if e1 and 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 february end detection 1', [[2096, 2, 28], [2097, 1, 29]], 331], ['regression february end detection 2', [[2015, 2, 28], [2016, 2, 29]], 360], ['partial repair probe 1', [[2024, 2, 28], [2025, 1, 5]], 307], ['partial repair probe 2', [[2004, 2, 28], [2005, 3, 31]], 393], ['boundary control 1', [[2024, 3, 15], [2024, 9, 15]], 180], ['boundary control 2', [[2024, 1, 1], [2024, 1, 1]], 0], ['normal control 1', [[2018, 4, 30], [2021, 5, 31]], 1110], ['normal control 2', [[2049, 1, 31], [2052, 2, 29]], 1109]], [['regression february end detection 1', [[2000, 2, 29], [2002, 2, 28]], 720], ['regression february end detection 2', [[2024, 2, 29], [2027, 2, 28]], 1080], ['partial repair probe 1', [[2004, 2, 28], [2005, 12, 17]], 649], ['partial repair probe 2', [[2008, 2, 28], [2011, 4, 25]], 1137], ['boundary control 1', [[2023, 2, 28], [2023, 8, 31]], 180], ['boundary control 2', [[2024, 1, 1], [2024, 1, 1]], 0], ['normal control 1', [[2047, 7, 31], [2050, 2, 28]], 928], ['normal control 2', [[2057, 2, 28], [2059, 5, 6]], 786]], [['regression february end detection 1', [[2000, 2, 29], [2000, 5, 30]], 90], ['regression february end detection 2', [[2000, 2, 28], [2003, 4, 30]], 1142], ['partial repair probe 1', [[2096, 2, 28], [2098, 1, 31]], 693], ['partial repair probe 2', [[2024, 2, 28], [2024, 11, 13]], 255], ['boundary control 1', [[2023, 1, 31], [2023, 3, 31]], 60], ['boundary control 2', [[2023, 5, 30], [2023, 7, 31]], 60], ['normal control 1', [[2089, 6, 30], [2091, 2, 28]], 598], ['normal control 2', [[2011, 6, 30], [2013, 7, 14]], 734]], [['regression february end detection 1', [[2096, 2, 28], [2098, 6, 1]], 813], ['regression february end detection 2', [[2016, 2, 28], [2016, 11, 30]], 272], ['partial repair probe 1', [[2000, 2, 28], [2001, 5, 31]], 453], ['partial repair probe 2', [[2024, 2, 28], [2027, 5, 1]], 1143], ['boundary control 1', [[2023, 5, 30], [2023, 7, 31]], 60], ['boundary control 2', [[2024, 3, 15], [2024, 9, 15]], 180], ['normal control 1', [[2062, 11, 30], [2064, 3, 26]], 476], ['normal control 2', [[2060, 11, 30], [2062, 12, 30]], 750]], [['regression february end detection 1', [[2096, 2, 28], [2096, 10, 31]], 243], ['regression february end detection 2', [[2004, 2, 29], [2006, 5, 30]], 810], ['partial repair probe 1', [[2096, 2, 28], [2097, 1, 8]], 310], ['partial repair probe 2', [[2004, 2, 28], [2005, 5, 31]], 453], ['boundary control 1', [[2023, 5, 30], [2023, 7, 31]], 60], ['boundary control 2', [[2023, 2, 28], [2023, 8, 31]], 180], ['normal control 1', [[2053, 1, 28], [2055, 2, 28]], 750], ['normal control 2', [[2011, 10, 20], [2012, 6, 19]], 239]]]\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"},"fixed":{"sha256":"d7acf55eb05f73442fc13213c4d94e4b46c6ae51f038016aee491bbf53b8e66f","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:\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 february end detection 1', [[2096, 2, 28], [2097, 1, 29]], 331], ['regression february end detection 2', [[2015, 2, 28], [2016, 2, 29]], 360], ['partial repair probe 1', [[2024, 2, 28], [2025, 1, 5]], 307], ['partial repair probe 2', [[2004, 2, 28], [2005, 3, 31]], 393], ['boundary control 1', [[2024, 3, 15], [2024, 9, 15]], 180], ['boundary control 2', [[2024, 1, 1], [2024, 1, 1]], 0], ['normal control 1', [[2018, 4, 30], [2021, 5, 31]], 1110], ['normal control 2', [[2049, 1, 31], [2052, 2, 29]], 1109]], [['regression february end detection 1', [[2000, 2, 29], [2002, 2, 28]], 720], ['regression february end detection 2', [[2024, 2, 29], [2027, 2, 28]], 1080], ['partial repair probe 1', [[2004, 2, 28], [2005, 12, 17]], 649], ['partial repair probe 2', [[2008, 2, 28], [2011, 4, 25]], 1137], ['boundary control 1', [[2023, 2, 28], [2023, 8, 31]], 180], ['boundary control 2', [[2024, 1, 1], [2024, 1, 1]], 0], ['normal control 1', [[2047, 7, 31], [2050, 2, 28]], 928], ['normal control 2', [[2057, 2, 28], [2059, 5, 6]], 786]], [['regression february end detection 1', [[2000, 2, 29], [2000, 5, 30]], 90], ['regression february end detection 2', [[2000, 2, 28], [2003, 4, 30]], 1142], ['partial repair probe 1', [[2096, 2, 28], [2098, 1, 31]], 693], ['partial repair probe 2', [[2024, 2, 28], [2024, 11, 13]], 255], ['boundary control 1', [[2023, 1, 31], [2023, 3, 31]], 60], ['boundary control 2', [[2023, 5, 30], [2023, 7, 31]], 60], ['normal control 1', [[2089, 6, 30], [2091, 2, 28]], 598], ['normal control 2', [[2011, 6, 30], [2013, 7, 14]], 734]], [['regression february end detection 1', [[2096, 2, 28], [2098, 6, 1]], 813], ['regression february end detection 2', [[2016, 2, 28], [2016, 11, 30]], 272], ['partial repair probe 1', [[2000, 2, 28], [2001, 5, 31]], 453], ['partial repair probe 2', [[2024, 2, 28], [2027, 5, 1]], 1143], ['boundary control 1', [[2023, 5, 30], [2023, 7, 31]], 60], ['boundary control 2', [[2024, 3, 15], [2024, 9, 15]], 180], ['normal control 1', [[2062, 11, 30], [2064, 3, 26]], 476], ['normal control 2', [[2060, 11, 30], [2062, 12, 30]], 750]], [['regression february end detection 1', [[2096, 2, 28], [2096, 10, 31]], 243], ['regression february end detection 2', [[2004, 2, 29], [2006, 5, 30]], 810], ['partial repair probe 1', [[2096, 2, 28], [2097, 1, 8]], 310], ['partial repair probe 2', [[2004, 2, 28], [2005, 5, 31]], 453], ['boundary control 1', [[2023, 5, 30], [2023, 7, 31]], 60], ['boundary control 2', [[2023, 2, 28], [2023, 8, 31]], 180], ['normal control 1', [[2053, 1, 28], [2055, 2, 28]], 750], ['normal control 2', [[2011, 10, 20], [2012, 6, 19]], 239]]]\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-february-end-detection","generated_at":"2026-09-29T14:46:49.370133+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.","repair":"Compare against 29 in leap years and 28 otherwise.","root_cause":"The February-end test compares the day with 28 without consulting the leap-year rule.","sha256":"bffce8ec106d2bd0b5eb9696a3a602ff4e9e745c5aa2b986a51e16750bff224b","title":"30/360 US bond basis: the 28th of a leap February counts as month end · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":41.434,"exit_code":1,"observations":[{"actual":329,"check":"regression february end detection 1","expected":331,"passed":false},{"actual":360,"check":"regression february end detection 2","expected":360,"passed":true},{"actual":305,"check":"partial repair probe 1","expected":307,"passed":false},{"actual":390,"check":"partial repair probe 2","expected":393,"passed":false},{"actual":180,"check":"boundary control 1","expected":180,"passed":true},{"actual":0,"check":"boundary control 2","expected":0,"passed":true},{"actual":1110,"check":"normal control 1","expected":1110,"passed":true},{"actual":1109,"check":"normal control 2","expected":1109,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression february end detection 1\", \"actual\": 329, \"expected\": 331, \"passed\": false}, {\"check\": \"regression february end detection 2\", \"actual\": 360, \"expected\": 360, \"passed\": true}, {\"check\": \"partial repair probe 1\", \"actual\": 305, \"expected\": 307, \"passed\": false}, {\"check\": \"partial repair probe 2\", \"actual\": 390, \"expected\": 393, \"passed\": false}, {\"check\": \"boundary control 1\", \"actual\": 180, \"expected\": 180, \"passed\": true}, {\"check\": \"boundary control 2\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"normal control 1\", \"actual\": 1110, \"expected\": 1110, \"passed\": true}, {\"check\": \"normal control 2\", \"actual\": 1109, \"expected\": 1109, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":42.908,"exit_code":1,"observations":[{"actual":329,"check":"regression february end detection 1","expected":331,"passed":false},{"actual":359,"check":"regression february end detection 2","expected":360,"passed":false},{"actual":305,"check":"partial repair probe 1","expected":307,"passed":false},{"actual":390,"check":"partial repair probe 2","expected":393,"passed":false},{"actual":180,"check":"boundary control 1","expected":180,"passed":true},{"actual":0,"check":"boundary control 2","expected":0,"passed":true},{"actual":1110,"check":"normal control 1","expected":1110,"passed":true},{"actual":1109,"check":"normal control 2","expected":1109,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression february end detection 1\", \"actual\": 329, \"expected\": 331, \"passed\": false}, {\"check\": \"regression february end detection 2\", \"actual\": 359, \"expected\": 360, \"passed\": false}, {\"check\": \"partial repair probe 1\", \"actual\": 305, \"expected\": 307, \"passed\": false}, {\"check\": \"partial repair probe 2\", \"actual\": 390, \"expected\": 393, \"passed\": false}, {\"check\": \"boundary control 1\", \"actual\": 180, \"expected\": 180, \"passed\": true}, {\"check\": \"boundary control 2\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"normal control 1\", \"actual\": 1110, \"expected\": 1110, \"passed\": true}, {\"check\": \"normal control 2\", \"actual\": 1109, \"expected\": 1109, \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":40.115,"exit_code":0,"observations":[{"actual":331,"check":"regression february end detection 1","expected":331,"passed":true},{"actual":360,"check":"regression february end detection 2","expected":360,"passed":true},{"actual":307,"check":"partial repair probe 1","expected":307,"passed":true},{"actual":393,"check":"partial repair probe 2","expected":393,"passed":true},{"actual":180,"check":"boundary control 1","expected":180,"passed":true},{"actual":0,"check":"boundary control 2","expected":0,"passed":true},{"actual":1110,"check":"normal control 1","expected":1110,"passed":true},{"actual":1109,"check":"normal control 2","expected":1109,"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression february end detection 1\", \"actual\": 331, \"expected\": 331, \"passed\": true}, {\"check\": \"regression february end detection 2\", \"actual\": 360, \"expected\": 360, \"passed\": true}, {\"check\": \"partial repair probe 1\", \"actual\": 307, \"expected\": 307, \"passed\": true}, {\"check\": \"partial repair probe 2\", \"actual\": 393, \"expected\": 393, \"passed\": true}, {\"check\": \"boundary control 1\", \"actual\": 180, \"expected\": 180, \"passed\": true}, {\"check\": \"boundary control 2\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"normal control 1\", \"actual\": 1110, \"expected\": 1110, \"passed\": true}, {\"check\": \"normal control 2\", \"actual\": 1109, \"expected\": 1109, \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}