{"abstract":"A period from the end of February to a 31st keeps D2=31 and overstates the count by one day.","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":"Lowering the D2 threshold to 28 instead also clamps D2 for ordinary starts on the 28th or 29th.","family":"w2-bond_day_count_conventions-thirty-360-us-adjustment-ordering","id":"FA-60856","implementations":{"attempt":{"sha256":"0c72421f46d4fa110547406b8ff253f139173d1a3e220ac0dfba27ed4e7d4caf","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 d2 == 31 and d1 >= 28:\n        d2 = 30\n    if e1:\n        d1 = 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 adjustment ordering 1', [[2004, 2, 29], [2007, 7, 31]], 1230], ['regression adjustment ordering 2', [[2075, 2, 28], [2075, 5, 31]], 90], ['partial repair probe 1', [[2000, 12, 29], [2002, 10, 31]], 662], ['partial repair probe 2', [[2074, 10, 28], [2076, 8, 31]], 663], ['boundary control 1', [[2024, 2, 29], [2025, 2, 28]], 360], ['boundary control 2', [[2024, 3, 15], [2024, 9, 15]], 180], ['normal control 1', [[2024, 2, 29], [2026, 2, 28]], 720], ['normal control 2', [[2049, 6, 15], [2051, 7, 31]], 766]], [['regression adjustment ordering 1', [[2001, 2, 28], [2001, 3, 31]], 30], ['regression adjustment ordering 2', [[2023, 2, 28], [2023, 8, 31]], 180], ['partial repair probe 1', [[2041, 1, 28], [2041, 3, 31]], 63], ['partial repair probe 2', [[2096, 2, 28], [2099, 10, 31]], 1323], ['boundary control 1', [[2023, 1, 31], [2023, 3, 31]], 60], ['boundary control 2', [[2024, 3, 15], [2024, 9, 15]], 180], ['normal control 1', [[2059, 6, 30], [2060, 8, 31]], 420], ['normal control 2', [[2003, 8, 14], [2004, 12, 7]], 473]], [['regression adjustment ordering 1', [[2096, 2, 29], [2098, 5, 31]], 810], ['regression adjustment ordering 2', [[2000, 2, 29], [2000, 3, 31]], 30], ['partial repair probe 1', [[2002, 9, 28], [2005, 5, 31]], 963], ['partial repair probe 2', [[2096, 2, 28], [2099, 1, 31]], 1053], ['boundary control 1', [[2023, 5, 30], [2023, 7, 31]], 60], ['boundary control 2', [[2024, 3, 15], [2024, 9, 15]], 180], ['normal control 1', [[2043, 11, 30], [2046, 2, 28]], 808], ['normal control 2', [[2024, 2, 28], [2026, 2, 28]], 720]], [['regression adjustment ordering 1', [[2096, 2, 29], [2097, 7, 31]], 510], ['regression adjustment ordering 2', [[2023, 2, 28], [2023, 8, 31]], 180], ['partial repair probe 1', [[2073, 12, 29], [2074, 8, 31]], 242], ['partial repair probe 2', [[2000, 2, 28], [2002, 5, 31]], 813], ['boundary control 1', [[2024, 3, 15], [2024, 9, 15]], 180], ['boundary control 2', [[2024, 2, 29], [2025, 2, 28]], 360], ['normal control 1', [[1998, 6, 14], [2000, 2, 29]], 615], ['normal control 2', [[2068, 2, 9], [2070, 10, 13]], 964]], [['regression adjustment ordering 1', [[2096, 2, 29], [2099, 3, 31]], 1110], ['regression adjustment ordering 2', [[2096, 2, 29], [2096, 1, 31]], -30], ['partial repair probe 1', [[2024, 2, 28], [2025, 3, 31]], 393], ['partial repair probe 2', [[2046, 8, 28], [2048, 7, 31]], 693], ['boundary control 1', [[2024, 3, 15], [2024, 9, 15]], 180], ['boundary control 2', [[2024, 2, 29], [2025, 2, 28]], 360], ['normal control 1', [[2052, 12, 30], [2053, 8, 16]], 226], ['normal control 2', [[2049, 9, 25], [2052, 8, 30]], 1055]]]\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":"7386d7f4469c5f004267f9f22174127119385ac56fcada44ab4fe0a581ada1b6","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 d2 == 31 and d1 >= 30:\n        d2 = 30\n    if e1:\n        d1 = 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 adjustment ordering 1', [[2004, 2, 29], [2007, 7, 31]], 1230], ['regression adjustment ordering 2', [[2075, 2, 28], [2075, 5, 31]], 90], ['partial repair probe 1', [[2000, 12, 29], [2002, 10, 31]], 662], ['partial repair probe 2', [[2074, 10, 28], [2076, 8, 31]], 663], ['boundary control 1', [[2024, 2, 29], [2025, 2, 28]], 360], ['boundary control 2', [[2024, 3, 15], [2024, 9, 15]], 180], ['normal control 1', [[2024, 2, 29], [2026, 2, 28]], 720], ['normal control 2', [[2049, 6, 15], [2051, 7, 31]], 766]], [['regression adjustment ordering 1', [[2001, 2, 28], [2001, 3, 31]], 30], ['regression adjustment ordering 2', [[2023, 2, 28], [2023, 8, 31]], 180], ['partial repair probe 1', [[2041, 1, 28], [2041, 3, 31]], 63], ['partial repair probe 2', [[2096, 2, 28], [2099, 10, 31]], 1323], ['boundary control 1', [[2023, 1, 31], [2023, 3, 31]], 60], ['boundary control 2', [[2024, 3, 15], [2024, 9, 15]], 180], ['normal control 1', [[2059, 6, 30], [2060, 8, 31]], 420], ['normal control 2', [[2003, 8, 14], [2004, 12, 7]], 473]], [['regression adjustment ordering 1', [[2096, 2, 29], [2098, 5, 31]], 810], ['regression adjustment ordering 2', [[2000, 2, 29], [2000, 3, 31]], 30], ['partial repair probe 1', [[2002, 9, 28], [2005, 5, 31]], 963], ['partial repair probe 2', [[2096, 2, 28], [2099, 1, 31]], 1053], ['boundary control 1', [[2023, 5, 30], [2023, 7, 31]], 60], ['boundary control 2', [[2024, 3, 15], [2024, 9, 15]], 180], ['normal control 1', [[2043, 11, 30], [2046, 2, 28]], 808], ['normal control 2', [[2024, 2, 28], [2026, 2, 28]], 720]], [['regression adjustment ordering 1', [[2096, 2, 29], [2097, 7, 31]], 510], ['regression adjustment ordering 2', [[2023, 2, 28], [2023, 8, 31]], 180], ['partial repair probe 1', [[2073, 12, 29], [2074, 8, 31]], 242], ['partial repair probe 2', [[2000, 2, 28], [2002, 5, 31]], 813], ['boundary control 1', [[2024, 3, 15], [2024, 9, 15]], 180], ['boundary control 2', [[2024, 2, 29], [2025, 2, 28]], 360], ['normal control 1', [[1998, 6, 14], [2000, 2, 29]], 615], ['normal control 2', [[2068, 2, 9], [2070, 10, 13]], 964]], [['regression adjustment ordering 1', [[2096, 2, 29], [2099, 3, 31]], 1110], ['regression adjustment ordering 2', [[2096, 2, 29], [2096, 1, 31]], -30], ['partial repair probe 1', [[2024, 2, 28], [2025, 3, 31]], 393], ['partial repair probe 2', [[2046, 8, 28], [2048, 7, 31]], 693], ['boundary control 1', [[2024, 3, 15], [2024, 9, 15]], 180], ['boundary control 2', [[2024, 2, 29], [2025, 2, 28]], 360], ['normal control 1', [[2052, 12, 30], [2053, 8, 16]], 226], ['normal control 2', [[2049, 9, 25], [2052, 8, 30]], 1055]]]\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":"6604ec644a255c6bdf5d107d6d89a7d601a1c7d577e8f7c41447ae2d75eb1c05","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 adjustment ordering 1', [[2004, 2, 29], [2007, 7, 31]], 1230], ['regression adjustment ordering 2', [[2075, 2, 28], [2075, 5, 31]], 90], ['partial repair probe 1', [[2000, 12, 29], [2002, 10, 31]], 662], ['partial repair probe 2', [[2074, 10, 28], [2076, 8, 31]], 663], ['boundary control 1', [[2024, 2, 29], [2025, 2, 28]], 360], ['boundary control 2', [[2024, 3, 15], [2024, 9, 15]], 180], ['normal control 1', [[2024, 2, 29], [2026, 2, 28]], 720], ['normal control 2', [[2049, 6, 15], [2051, 7, 31]], 766]], [['regression adjustment ordering 1', [[2001, 2, 28], [2001, 3, 31]], 30], ['regression adjustment ordering 2', [[2023, 2, 28], [2023, 8, 31]], 180], ['partial repair probe 1', [[2041, 1, 28], [2041, 3, 31]], 63], ['partial repair probe 2', [[2096, 2, 28], [2099, 10, 31]], 1323], ['boundary control 1', [[2023, 1, 31], [2023, 3, 31]], 60], ['boundary control 2', [[2024, 3, 15], [2024, 9, 15]], 180], ['normal control 1', [[2059, 6, 30], [2060, 8, 31]], 420], ['normal control 2', [[2003, 8, 14], [2004, 12, 7]], 473]], [['regression adjustment ordering 1', [[2096, 2, 29], [2098, 5, 31]], 810], ['regression adjustment ordering 2', [[2000, 2, 29], [2000, 3, 31]], 30], ['partial repair probe 1', [[2002, 9, 28], [2005, 5, 31]], 963], ['partial repair probe 2', [[2096, 2, 28], [2099, 1, 31]], 1053], ['boundary control 1', [[2023, 5, 30], [2023, 7, 31]], 60], ['boundary control 2', [[2024, 3, 15], [2024, 9, 15]], 180], ['normal control 1', [[2043, 11, 30], [2046, 2, 28]], 808], ['normal control 2', [[2024, 2, 28], [2026, 2, 28]], 720]], [['regression adjustment ordering 1', [[2096, 2, 29], [2097, 7, 31]], 510], ['regression adjustment ordering 2', [[2023, 2, 28], [2023, 8, 31]], 180], ['partial repair probe 1', [[2073, 12, 29], [2074, 8, 31]], 242], ['partial repair probe 2', [[2000, 2, 28], [2002, 5, 31]], 813], ['boundary control 1', [[2024, 3, 15], [2024, 9, 15]], 180], ['boundary control 2', [[2024, 2, 29], [2025, 2, 28]], 360], ['normal control 1', [[1998, 6, 14], [2000, 2, 29]], 615], ['normal control 2', [[2068, 2, 9], [2070, 10, 13]], 964]], [['regression adjustment ordering 1', [[2096, 2, 29], [2099, 3, 31]], 1110], ['regression adjustment ordering 2', [[2096, 2, 29], [2096, 1, 31]], -30], ['partial repair probe 1', [[2024, 2, 28], [2025, 3, 31]], 393], ['partial repair probe 2', [[2046, 8, 28], [2048, 7, 31]], 693], ['boundary control 1', [[2024, 3, 15], [2024, 9, 15]], 180], ['boundary control 2', [[2024, 2, 29], [2025, 2, 28]], 360], ['normal control 1', [[2052, 12, 30], [2053, 8, 16]], 226], ['normal control 2', [[2049, 9, 25], [2052, 8, 30]], 1055]]]\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-adjustment-ordering","generated_at":"2026-09-29T14:46:49.577016+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":"Promote a February-end D1 to 30 before testing D2=31 against D1.","root_cause":"The D2=31 test runs before the February-end promotion of D1, so it sees the raw 28 or 29.","sha256":"47448b1911c77433d945fe79751a026fd7c8cf02540db8f9c7a499ce38cbf3fe","title":"30/360 US bond basis: the D2 rule is evaluated before D1 is promoted from February end · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":43.854,"exit_code":1,"observations":[{"actual":1230,"check":"regression adjustment ordering 1","expected":1230,"passed":true},{"actual":90,"check":"regression adjustment ordering 2","expected":90,"passed":true},{"actual":661,"check":"partial repair probe 1","expected":662,"passed":false},{"actual":662,"check":"partial repair probe 2","expected":663,"passed":false},{"actual":360,"check":"boundary control 1","expected":360,"passed":true},{"actual":180,"check":"boundary control 2","expected":180,"passed":true},{"actual":720,"check":"normal control 1","expected":720,"passed":true},{"actual":766,"check":"normal control 2","expected":766,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression adjustment ordering 1\", \"actual\": 1230, \"expected\": 1230, \"passed\": true}, {\"check\": \"regression adjustment ordering 2\", \"actual\": 90, \"expected\": 90, \"passed\": true}, {\"check\": \"partial repair probe 1\", \"actual\": 661, \"expected\": 662, \"passed\": false}, {\"check\": \"partial repair probe 2\", \"actual\": 662, \"expected\": 663, \"passed\": false}, {\"check\": \"boundary control 1\", \"actual\": 360, \"expected\": 360, \"passed\": true}, {\"check\": \"boundary control 2\", \"actual\": 180, \"expected\": 180, \"passed\": true}, {\"check\": \"normal control 1\", \"actual\": 720, \"expected\": 720, \"passed\": true}, {\"check\": \"normal control 2\", \"actual\": 766, \"expected\": 766, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":41.646,"exit_code":1,"observations":[{"actual":1231,"check":"regression adjustment ordering 1","expected":1230,"passed":false},{"actual":91,"check":"regression adjustment ordering 2","expected":90,"passed":false},{"actual":662,"check":"partial repair probe 1","expected":662,"passed":true},{"actual":663,"check":"partial repair probe 2","expected":663,"passed":true},{"actual":360,"check":"boundary control 1","expected":360,"passed":true},{"actual":180,"check":"boundary control 2","expected":180,"passed":true},{"actual":720,"check":"normal control 1","expected":720,"passed":true},{"actual":766,"check":"normal control 2","expected":766,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression adjustment ordering 1\", \"actual\": 1231, \"expected\": 1230, \"passed\": false}, {\"check\": \"regression adjustment ordering 2\", \"actual\": 91, \"expected\": 90, \"passed\": false}, {\"check\": \"partial repair probe 1\", \"actual\": 662, \"expected\": 662, \"passed\": true}, {\"check\": \"partial repair probe 2\", \"actual\": 663, \"expected\": 663, \"passed\": true}, {\"check\": \"boundary control 1\", \"actual\": 360, \"expected\": 360, \"passed\": true}, {\"check\": \"boundary control 2\", \"actual\": 180, \"expected\": 180, \"passed\": true}, {\"check\": \"normal control 1\", \"actual\": 720, \"expected\": 720, \"passed\": true}, {\"check\": \"normal control 2\", \"actual\": 766, \"expected\": 766, \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":42.262,"exit_code":0,"observations":[{"actual":1230,"check":"regression adjustment ordering 1","expected":1230,"passed":true},{"actual":90,"check":"regression adjustment ordering 2","expected":90,"passed":true},{"actual":662,"check":"partial repair probe 1","expected":662,"passed":true},{"actual":663,"check":"partial repair probe 2","expected":663,"passed":true},{"actual":360,"check":"boundary control 1","expected":360,"passed":true},{"actual":180,"check":"boundary control 2","expected":180,"passed":true},{"actual":720,"check":"normal control 1","expected":720,"passed":true},{"actual":766,"check":"normal control 2","expected":766,"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression adjustment ordering 1\", \"actual\": 1230, \"expected\": 1230, \"passed\": true}, {\"check\": \"regression adjustment ordering 2\", \"actual\": 90, \"expected\": 90, \"passed\": true}, {\"check\": \"partial repair probe 1\", \"actual\": 662, \"expected\": 662, \"passed\": true}, {\"check\": \"partial repair probe 2\", \"actual\": 663, \"expected\": 663, \"passed\": true}, {\"check\": \"boundary control 1\", \"actual\": 360, \"expected\": 360, \"passed\": true}, {\"check\": \"boundary control 2\", \"actual\": 180, \"expected\": 180, \"passed\": true}, {\"check\": \"normal control 1\", \"actual\": 720, \"expected\": 720, \"passed\": true}, {\"check\": \"normal control 2\", \"actual\": 766, \"expected\": 766, \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}