{"abstract":"Accrued interest is freq times too large.","category":"Bond day-count conventions","checks":8,"contract":"Inputs issue, first coupon and settlement [y,m,d], annual rate and months per period. Settlement must lie in [issue, first] else return \"settlement outside first period\". Quasi-coupon dates are generated back from the first coupon in steps of months (day clamped to month length) until one is on or before issue. For each quasi period [start, end), accrued days are those in [max(start, issue), min(end, settle)) and are divided by that quasi period length. Accrued = 100*rate/freq*sum, rounded to 6 decimals.","contract_signature":"issue, first, settle, rate, months","evaluation_group":"w2-bond_day_count_conventions-long-first-coupon-quasi","failed_approach":"Dividing by the number of quasi periods confuses irregular period count with frequency.","family":"w2-bond_day_count_conventions-long-first-coupon-quasi-coupon-per-quasi-period","id":"FA-61066","implementations":{"attempt":{"sha256":"2f88fa8d62b1dee1ce5f923429665f1c62e100c4b0dc5ed2ab03fc2f579ab759","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport datetime\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(issue, first, settle, rate, months):\n    def mlen(y, m):\n        if m == 2:\n            return 29 if (y % 4 == 0 and y % 100 != 0) or y % 400 == 0 else 28\n        return 30 if m in (4, 6, 9, 11) else 31\n    I = datetime.date(*issue)\n    Fc = datetime.date(*first)\n    S = datetime.date(*settle)\n    if not (I <= S <= Fc):\n        return 'settlement outside first period'\n    freq = 12 // months\n    def back(k):\n        t = Fc.year * 12 + Fc.month - 1 - k * months\n        y, m = t // 12, t % 12 + 1\n        return datetime.date(y, m, min(Fc.day, mlen(y, m)))\n    q = [Fc]\n    k = 1\n    while q[-1] > I:\n        q.append(back(k))\n        k += 1\n    frac = Fraction(0)\n    for j in range(len(q) - 1):\n        end, start = q[j], q[j + 1]\n        lo = max(start, I)\n        hi = min(end, S)\n        if hi > lo:\n            frac += Fraction((hi - lo).days, (end - start).days)\n    return round(float(100 * Fraction(str(rate)) / (len(q) - 1) * frac), 6)\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression coupon per quasi period 1', [[2005, 9, 29], [2005, 10, 31], [2005, 9, 30], 0.02, 3], 0.005435], ['regression coupon per quasi period 2', [[2041, 9, 29], [2042, 3, 31], [2041, 10, 18], 0.05, 6], 0.260914], ['partial repair probe 1', [[2030, 8, 6], [2031, 11, 1], [2031, 4, 19], 0.0675, 12], 4.734247], ['partial repair probe 2', [[2031, 8, 7], [2033, 2, 28], [2031, 10, 22], 0.02, 12], 0.416438], ['boundary control 1', [[2024, 1, 10], [2024, 9, 15], [2024, 9, 16], 0.05, 6], 'settlement outside first period'], ['normal control 1', [[2035, 2, 3], [2035, 5, 4], [2035, 2, 3], 0.045, 3], 0.0], ['normal control 2', [[2019, 11, 10], [2020, 3, 3], [2019, 11, 7], 0.045, 6], 'settlement outside first period'], ['normal control 3', [[2007, 12, 27], [2008, 1, 1], [2007, 12, 27], 0.05, 1], 0.0]], [['regression coupon per quasi period 1', [[2040, 8, 29], [2040, 9, 6], [2040, 8, 31], 0.03, 3], 0.016304], ['regression coupon per quasi period 2', [[2030, 7, 25], [2030, 9, 15], [2030, 9, 15], 0.05, 3], 0.706522], ['partial repair probe 1', [[2015, 7, 5], [2018, 1, 31], [2017, 9, 10], 0.02, 12], 4.367123], ['partial repair probe 2', [[2023, 11, 5], [2025, 4, 30], [2025, 4, 30], 0.03, 12], 4.45082], ['boundary control 1', [[2024, 1, 10], [2024, 9, 15], [2024, 9, 16], 0.05, 6], 'settlement outside first period'], ['normal control 1', [[2038, 1, 19], [2038, 3, 31], [2038, 1, 19], 0.03, 6], 0.0], ['normal control 2', [[2012, 6, 22], [2012, 7, 20], [2012, 6, 22], 0.0675, 1], 0.0], ['normal control 3', [[2000, 6, 21], [2001, 1, 22], [2000, 12, 7], 0.02, 12], 0.923497]], [['regression coupon per quasi period 1', [[2003, 9, 19], [2003, 9, 30], [2003, 9, 22], 0.03, 1], 0.024194], ['regression coupon per quasi period 2', [[2014, 12, 1], [2014, 12, 28], [2014, 12, 27], 0.03, 1], 0.216667], ['partial repair probe 1', [[2034, 4, 21], [2035, 9, 1], [2035, 6, 28], 0.05, 12], 5.931507], ['partial repair probe 2', [[2007, 7, 11], [2008, 11, 28], [2008, 1, 9], 0.0675, 12], 3.363631], ['boundary control 1', [[2024, 1, 10], [2024, 9, 15], [2024, 9, 16], 0.05, 6], 'settlement outside first period'], ['normal control 1', [[2001, 12, 2], [2003, 4, 13], [2001, 12, 2], 0.05, 12], 0.0], ['normal control 2', [[2012, 10, 11], [2014, 5, 30], [2012, 10, 8], 0.05, 12], 'settlement outside first period'], ['normal control 3', [[2009, 2, 26], [2009, 11, 12], [2009, 2, 26], 0.05, 3], 0.0]], [['regression coupon per quasi period 1', [[2029, 8, 10], [2029, 9, 30], [2029, 9, 30], 0.0675, 1], 0.925403], ['regression coupon per quasi period 2', [[2014, 9, 3], [2014, 11, 30], [2014, 9, 15], 0.045, 1], 0.145161], ['partial repair probe 1', [[2003, 6, 28], [2006, 2, 11], [2005, 1, 15], 0.0675, 12], 10.468488], ['partial repair probe 2', [[2014, 1, 8], [2016, 8, 1], [2014, 9, 23], 0.0675, 12], 4.771233], ['boundary control 1', [[2024, 1, 10], [2024, 9, 15], [2024, 9, 16], 0.05, 6], 'settlement outside first period'], ['normal control 1', [[2020, 3, 5], [2021, 2, 28], [2020, 6, 30], 0.03, 12], 0.959016], ['normal control 2', [[2007, 2, 26], [2007, 12, 16], [2007, 2, 23], 0.05, 12], 'settlement outside first period'], ['normal control 3', [[2003, 4, 30], [2003, 7, 31], [2003, 5, 22], 0.05, 12], 0.30137]], [['regression coupon per quasi period 1', [[2034, 6, 17], [2034, 7, 16], [2034, 6, 27], 0.045, 1], 0.125], ['regression coupon per quasi period 2', [[2010, 7, 5], [2010, 8, 1], [2010, 7, 14], 0.03, 6], 0.074586], ['partial repair probe 1', [[2032, 8, 31], [2034, 4, 30], [2032, 12, 30], 0.03, 12], 0.994521], ['partial repair probe 2', [[2026, 2, 25], [2027, 4, 30], [2027, 2, 11], 0.045, 12], 4.327397], ['boundary control 1', [[2024, 1, 10], [2024, 9, 15], [2024, 9, 16], 0.05, 6], 'settlement outside first period'], ['normal control 1', [[2029, 1, 21], [2029, 5, 29], [2029, 1, 21], 0.02, 6], 0.0], ['normal control 2', [[2019, 5, 3], [2019, 7, 29], [2019, 4, 30], 0.08, 3], 'settlement outside first period'], ['normal control 3', [[2001, 12, 9], [2002, 5, 1], [2001, 12, 6], 0.08, 6], 'settlement outside first period']]]\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":"a7b4bd5f79c40fcfa5d61c8403f9172262ab48f81a60403a41ab67ac6eb45f8f","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport datetime\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(issue, first, settle, rate, months):\n    def mlen(y, m):\n        if m == 2:\n            return 29 if (y % 4 == 0 and y % 100 != 0) or y % 400 == 0 else 28\n        return 30 if m in (4, 6, 9, 11) else 31\n    I = datetime.date(*issue)\n    Fc = datetime.date(*first)\n    S = datetime.date(*settle)\n    if not (I <= S <= Fc):\n        return 'settlement outside first period'\n    freq = 12 // months\n    def back(k):\n        t = Fc.year * 12 + Fc.month - 1 - k * months\n        y, m = t // 12, t % 12 + 1\n        return datetime.date(y, m, min(Fc.day, mlen(y, m)))\n    q = [Fc]\n    k = 1\n    while q[-1] > I:\n        q.append(back(k))\n        k += 1\n    frac = Fraction(0)\n    for j in range(len(q) - 1):\n        end, start = q[j], q[j + 1]\n        lo = max(start, I)\n        hi = min(end, S)\n        if hi > lo:\n            frac += Fraction((hi - lo).days, (end - start).days)\n    return round(float(100 * Fraction(str(rate)) * frac), 6)\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression coupon per quasi period 1', [[2005, 9, 29], [2005, 10, 31], [2005, 9, 30], 0.02, 3], 0.005435], ['regression coupon per quasi period 2', [[2041, 9, 29], [2042, 3, 31], [2041, 10, 18], 0.05, 6], 0.260914], ['partial repair probe 1', [[2030, 8, 6], [2031, 11, 1], [2031, 4, 19], 0.0675, 12], 4.734247], ['partial repair probe 2', [[2031, 8, 7], [2033, 2, 28], [2031, 10, 22], 0.02, 12], 0.416438], ['boundary control 1', [[2024, 1, 10], [2024, 9, 15], [2024, 9, 16], 0.05, 6], 'settlement outside first period'], ['normal control 1', [[2035, 2, 3], [2035, 5, 4], [2035, 2, 3], 0.045, 3], 0.0], ['normal control 2', [[2019, 11, 10], [2020, 3, 3], [2019, 11, 7], 0.045, 6], 'settlement outside first period'], ['normal control 3', [[2007, 12, 27], [2008, 1, 1], [2007, 12, 27], 0.05, 1], 0.0]], [['regression coupon per quasi period 1', [[2040, 8, 29], [2040, 9, 6], [2040, 8, 31], 0.03, 3], 0.016304], ['regression coupon per quasi period 2', [[2030, 7, 25], [2030, 9, 15], [2030, 9, 15], 0.05, 3], 0.706522], ['partial repair probe 1', [[2015, 7, 5], [2018, 1, 31], [2017, 9, 10], 0.02, 12], 4.367123], ['partial repair probe 2', [[2023, 11, 5], [2025, 4, 30], [2025, 4, 30], 0.03, 12], 4.45082], ['boundary control 1', [[2024, 1, 10], [2024, 9, 15], [2024, 9, 16], 0.05, 6], 'settlement outside first period'], ['normal control 1', [[2038, 1, 19], [2038, 3, 31], [2038, 1, 19], 0.03, 6], 0.0], ['normal control 2', [[2012, 6, 22], [2012, 7, 20], [2012, 6, 22], 0.0675, 1], 0.0], ['normal control 3', [[2000, 6, 21], [2001, 1, 22], [2000, 12, 7], 0.02, 12], 0.923497]], [['regression coupon per quasi period 1', [[2003, 9, 19], [2003, 9, 30], [2003, 9, 22], 0.03, 1], 0.024194], ['regression coupon per quasi period 2', [[2014, 12, 1], [2014, 12, 28], [2014, 12, 27], 0.03, 1], 0.216667], ['partial repair probe 1', [[2034, 4, 21], [2035, 9, 1], [2035, 6, 28], 0.05, 12], 5.931507], ['partial repair probe 2', [[2007, 7, 11], [2008, 11, 28], [2008, 1, 9], 0.0675, 12], 3.363631], ['boundary control 1', [[2024, 1, 10], [2024, 9, 15], [2024, 9, 16], 0.05, 6], 'settlement outside first period'], ['normal control 1', [[2001, 12, 2], [2003, 4, 13], [2001, 12, 2], 0.05, 12], 0.0], ['normal control 2', [[2012, 10, 11], [2014, 5, 30], [2012, 10, 8], 0.05, 12], 'settlement outside first period'], ['normal control 3', [[2009, 2, 26], [2009, 11, 12], [2009, 2, 26], 0.05, 3], 0.0]], [['regression coupon per quasi period 1', [[2029, 8, 10], [2029, 9, 30], [2029, 9, 30], 0.0675, 1], 0.925403], ['regression coupon per quasi period 2', [[2014, 9, 3], [2014, 11, 30], [2014, 9, 15], 0.045, 1], 0.145161], ['partial repair probe 1', [[2003, 6, 28], [2006, 2, 11], [2005, 1, 15], 0.0675, 12], 10.468488], ['partial repair probe 2', [[2014, 1, 8], [2016, 8, 1], [2014, 9, 23], 0.0675, 12], 4.771233], ['boundary control 1', [[2024, 1, 10], [2024, 9, 15], [2024, 9, 16], 0.05, 6], 'settlement outside first period'], ['normal control 1', [[2020, 3, 5], [2021, 2, 28], [2020, 6, 30], 0.03, 12], 0.959016], ['normal control 2', [[2007, 2, 26], [2007, 12, 16], [2007, 2, 23], 0.05, 12], 'settlement outside first period'], ['normal control 3', [[2003, 4, 30], [2003, 7, 31], [2003, 5, 22], 0.05, 12], 0.30137]], [['regression coupon per quasi period 1', [[2034, 6, 17], [2034, 7, 16], [2034, 6, 27], 0.045, 1], 0.125], ['regression coupon per quasi period 2', [[2010, 7, 5], [2010, 8, 1], [2010, 7, 14], 0.03, 6], 0.074586], ['partial repair probe 1', [[2032, 8, 31], [2034, 4, 30], [2032, 12, 30], 0.03, 12], 0.994521], ['partial repair probe 2', [[2026, 2, 25], [2027, 4, 30], [2027, 2, 11], 0.045, 12], 4.327397], ['boundary control 1', [[2024, 1, 10], [2024, 9, 15], [2024, 9, 16], 0.05, 6], 'settlement outside first period'], ['normal control 1', [[2029, 1, 21], [2029, 5, 29], [2029, 1, 21], 0.02, 6], 0.0], ['normal control 2', [[2019, 5, 3], [2019, 7, 29], [2019, 4, 30], 0.08, 3], 'settlement outside first period'], ['normal control 3', [[2001, 12, 9], [2002, 5, 1], [2001, 12, 6], 0.08, 6], 'settlement outside first period']]]\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-long-first-coupon-quasi-coupon-per-quasi-period","generated_at":"2026-09-29T14:46:51.684115+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 periodic coupon omits division by the payment frequency.","sha256":"efd52d0a353e6823333144a573b0a01cf7a4a6735f7c2978c34d6f2ba1f55de0","title":"Irregular first coupon accrued by quasi-coupon periods: the annual coupon is applied to each quasi-period fraction · 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":47.358,"exit_code":1,"observations":[{"actual":0.021739,"check":"regression coupon per quasi period 1","expected":0.005435,"passed":false},{"actual":0.260914,"check":"regression coupon per quasi period 2","expected":0.260914,"passed":true},{"actual":2.367123,"check":"partial repair probe 1","expected":4.734247,"passed":false},{"actual":0.208219,"check":"partial repair probe 2","expected":0.416438,"passed":false},{"actual":"settlement outside first period","check":"boundary control 1","expected":"settlement outside first period","passed":true},{"actual":0.0,"check":"normal control 1","expected":0.0,"passed":true},{"actual":"settlement outside first period","check":"normal control 2","expected":"settlement outside first period","passed":true},{"actual":0.0,"check":"normal control 3","expected":0.0,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression coupon per quasi period 1\", \"actual\": 0.021739, \"expected\": 0.005435, \"passed\": false}, {\"check\": \"regression coupon per quasi period 2\", \"actual\": 0.260914, \"expected\": 0.260914, \"passed\": true}, {\"check\": \"partial repair probe 1\", \"actual\": 2.367123, \"expected\": 4.734247, \"passed\": false}, {\"check\": \"partial repair probe 2\", \"actual\": 0.208219, \"expected\": 0.416438, \"passed\": false}, {\"check\": \"boundary control 1\", \"actual\": \"settlement outside first period\", \"expected\": \"settlement outside first period\", \"passed\": true}, {\"check\": \"normal control 1\", \"actual\": 0.0, \"expected\": 0.0, \"passed\": true}, {\"check\": \"normal control 2\", \"actual\": \"settlement outside first period\", \"expected\": \"settlement outside first period\", \"passed\": true}, {\"check\": \"normal control 3\", \"actual\": 0.0, \"expected\": 0.0, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":45.663,"exit_code":1,"observations":[{"actual":0.021739,"check":"regression coupon per quasi period 1","expected":0.005435,"passed":false},{"actual":0.521828,"check":"regression coupon per quasi period 2","expected":0.260914,"passed":false},{"actual":4.734247,"check":"partial repair probe 1","expected":4.734247,"passed":true},{"actual":0.416438,"check":"partial repair probe 2","expected":0.416438,"passed":true},{"actual":"settlement outside first period","check":"boundary control 1","expected":"settlement outside first period","passed":true},{"actual":0.0,"check":"normal control 1","expected":0.0,"passed":true},{"actual":"settlement outside first period","check":"normal control 2","expected":"settlement outside first period","passed":true},{"actual":0.0,"check":"normal control 3","expected":0.0,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression coupon per quasi period 1\", \"actual\": 0.021739, \"expected\": 0.005435, \"passed\": false}, {\"check\": \"regression coupon per quasi period 2\", \"actual\": 0.521828, \"expected\": 0.260914, \"passed\": false}, {\"check\": \"partial repair probe 1\", \"actual\": 4.734247, \"expected\": 4.734247, \"passed\": true}, {\"check\": \"partial repair probe 2\", \"actual\": 0.416438, \"expected\": 0.416438, \"passed\": true}, {\"check\": \"boundary control 1\", \"actual\": \"settlement outside first period\", \"expected\": \"settlement outside first period\", \"passed\": true}, {\"check\": \"normal control 1\", \"actual\": 0.0, \"expected\": 0.0, \"passed\": true}, {\"check\": \"normal control 2\", \"actual\": \"settlement outside first period\", \"expected\": \"settlement outside first period\", \"passed\": true}, {\"check\": \"normal control 3\", \"actual\": 0.0, \"expected\": 0.0, \"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."}}