{"abstract":"Accrued interest on long first coupons exceeds the per-period coupon once more than one quasi period has passed.","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 whole irregular period length understates accrual for long first coupons.","family":"w2-bond_day_count_conventions-long-first-coupon-quasi-long-period-denominator","id":"FA-61051","implementations":{"attempt":{"sha256":"eeba6a2c07af8074600e40cc94e54a91543edd1d9749be2778b2498d8be58655","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    frac = Fraction((S - I).days, (Fc - I).days)\n    return round(float(100 * Fraction(str(rate)) / freq * frac), 6)\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression long period denominator 1', [[2035, 3, 1], [2036, 10, 31], [2035, 6, 11], 0.08, 12], 2.235616], ['regression long period denominator 2', [[2014, 1, 18], [2014, 6, 30], [2014, 6, 25], 0.0675, 3], 2.927038], ['partial repair probe 1', [[2026, 7, 10], [2027, 7, 24], [2027, 5, 13], 0.045, 12], 3.784932], ['partial repair probe 2', [[2007, 5, 31], [2007, 9, 30], [2007, 9, 10], 0.045, 6], 1.247283], ['boundary control 1', [[2024, 3, 15], [2024, 9, 15], [2024, 6, 15], 0.05, 6], 1.25], ['boundary control 2', [[2024, 1, 10], [2024, 9, 15], [2024, 9, 16], 0.05, 6], 'settlement outside first period'], ['normal control 1', [[2030, 12, 1], [2030, 12, 25], [2030, 11, 28], 0.045, 1], 'settlement outside first period'], ['normal control 2', [[2011, 8, 6], [2013, 1, 29], [2011, 8, 3], 0.045, 6], 'settlement outside first period']], [['regression long period denominator 1', [[2026, 6, 29], [2027, 12, 28], [2027, 3, 29], 0.05, 6], 3.736339], ['regression long period denominator 2', [[2020, 9, 30], [2021, 10, 30], [2021, 7, 11], 0.0675, 6], 5.256148], ['partial repair probe 1', [[2034, 5, 27], [2035, 1, 31], [2034, 9, 6], 0.02, 12], 0.558904], ['partial repair probe 2', [[2005, 3, 11], [2005, 8, 16], [2005, 4, 24], 0.05, 6], 0.607735], ['boundary control 1', [[2024, 3, 15], [2024, 9, 15], [2024, 6, 15], 0.05, 6], 1.25], ['boundary control 2', [[2024, 1, 10], [2024, 9, 15], [2024, 9, 16], 0.05, 6], 'settlement outside first period'], ['normal control 1', [[2021, 4, 20], [2021, 4, 30], [2021, 4, 20], 0.0675, 1], 0.0], ['normal control 2', [[2011, 6, 28], [2011, 7, 5], [2011, 6, 25], 0.045, 1], 'settlement outside first period']], [['regression long period denominator 1', [[2006, 2, 8], [2006, 3, 23], [2006, 3, 1], 0.045, 1], 0.261809], ['regression long period denominator 2', [[2004, 10, 16], [2005, 9, 5], [2004, 11, 30], 0.08, 6], 0.994475], ['partial repair probe 1', [[2020, 11, 13], [2020, 12, 31], [2020, 12, 31], 0.03, 3], 0.391304], ['partial repair probe 2', [[2042, 7, 29], [2043, 1, 31], [2042, 12, 9], 0.0675, 12], 2.459589], ['boundary control 1', [[2024, 1, 10], [2024, 9, 15], [2024, 9, 16], 0.05, 6], 'settlement outside first period'], ['boundary control 2', [[2024, 3, 15], [2024, 9, 15], [2024, 6, 15], 0.05, 6], 1.25], ['normal control 1', [[2041, 6, 16], [2041, 8, 30], [2041, 6, 13], 0.08, 12], 'settlement outside first period'], ['normal control 2', [[2005, 1, 10], [2005, 1, 31], [2005, 1, 10], 0.045, 3], 0.0]], [['regression long period denominator 1', [[2036, 7, 10], [2037, 2, 28], [2037, 2, 16], 0.0675, 6], 4.063545], ['regression long period denominator 2', [[2006, 9, 2], [2007, 3, 12], [2006, 12, 9], 0.045, 6], 1.216205], ['partial repair probe 1', [[2029, 5, 22], [2029, 7, 31], [2029, 7, 11], 0.0675, 6], 0.93232], ['partial repair probe 2', [[2033, 9, 26], [2034, 2, 28], [2033, 10, 19], 0.0675, 3], 0.421875], ['boundary control 1', [[2024, 1, 10], [2024, 9, 15], [2024, 9, 16], 0.05, 6], 'settlement outside first period'], ['boundary control 2', [[2024, 3, 15], [2024, 9, 15], [2024, 6, 15], 0.05, 6], 1.25], ['normal control 1', [[2004, 9, 16], [2004, 9, 30], [2004, 9, 16], 0.045, 3], 0.0], ['normal control 2', [[2035, 5, 9], [2035, 6, 30], [2035, 5, 6], 0.03, 6], 'settlement outside first period']], [['regression long period denominator 1', [[2019, 3, 16], [2019, 4, 30], [2019, 4, 4], 0.03, 1], 0.156989], ['regression long period denominator 2', [[2039, 4, 20], [2039, 6, 30], [2039, 5, 24], 0.02, 1], 0.187097], ['partial repair probe 1', [[2031, 8, 23], [2031, 12, 28], [2031, 9, 3], 0.045, 6], 0.135246], ['partial repair probe 2', [[2017, 9, 1], [2018, 2, 28], [2018, 2, 6], 0.0675, 12], 2.921918], ['boundary control 1', [[2024, 3, 15], [2024, 9, 15], [2024, 6, 15], 0.05, 6], 1.25], ['boundary control 2', [[2024, 1, 10], [2024, 9, 15], [2024, 9, 16], 0.05, 6], 'settlement outside first period'], ['normal control 1', [[2034, 7, 30], [2034, 11, 30], [2034, 7, 27], 0.045, 12], 'settlement outside first period'], ['normal control 2', [[2041, 1, 14], [2041, 1, 24], [2041, 1, 14], 0.03, 1], 0.0]]]\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":"d569fb326d6e2a2a5b00d508cdd00337c3a401db9b6f41a6514dfd333027c007","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    frac = Fraction((S - I).days, (Fc - q[1]).days)\n    return round(float(100 * Fraction(str(rate)) / freq * frac), 6)\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression long period denominator 1', [[2035, 3, 1], [2036, 10, 31], [2035, 6, 11], 0.08, 12], 2.235616], ['regression long period denominator 2', [[2014, 1, 18], [2014, 6, 30], [2014, 6, 25], 0.0675, 3], 2.927038], ['partial repair probe 1', [[2026, 7, 10], [2027, 7, 24], [2027, 5, 13], 0.045, 12], 3.784932], ['partial repair probe 2', [[2007, 5, 31], [2007, 9, 30], [2007, 9, 10], 0.045, 6], 1.247283], ['boundary control 1', [[2024, 3, 15], [2024, 9, 15], [2024, 6, 15], 0.05, 6], 1.25], ['boundary control 2', [[2024, 1, 10], [2024, 9, 15], [2024, 9, 16], 0.05, 6], 'settlement outside first period'], ['normal control 1', [[2030, 12, 1], [2030, 12, 25], [2030, 11, 28], 0.045, 1], 'settlement outside first period'], ['normal control 2', [[2011, 8, 6], [2013, 1, 29], [2011, 8, 3], 0.045, 6], 'settlement outside first period']], [['regression long period denominator 1', [[2026, 6, 29], [2027, 12, 28], [2027, 3, 29], 0.05, 6], 3.736339], ['regression long period denominator 2', [[2020, 9, 30], [2021, 10, 30], [2021, 7, 11], 0.0675, 6], 5.256148], ['partial repair probe 1', [[2034, 5, 27], [2035, 1, 31], [2034, 9, 6], 0.02, 12], 0.558904], ['partial repair probe 2', [[2005, 3, 11], [2005, 8, 16], [2005, 4, 24], 0.05, 6], 0.607735], ['boundary control 1', [[2024, 3, 15], [2024, 9, 15], [2024, 6, 15], 0.05, 6], 1.25], ['boundary control 2', [[2024, 1, 10], [2024, 9, 15], [2024, 9, 16], 0.05, 6], 'settlement outside first period'], ['normal control 1', [[2021, 4, 20], [2021, 4, 30], [2021, 4, 20], 0.0675, 1], 0.0], ['normal control 2', [[2011, 6, 28], [2011, 7, 5], [2011, 6, 25], 0.045, 1], 'settlement outside first period']], [['regression long period denominator 1', [[2006, 2, 8], [2006, 3, 23], [2006, 3, 1], 0.045, 1], 0.261809], ['regression long period denominator 2', [[2004, 10, 16], [2005, 9, 5], [2004, 11, 30], 0.08, 6], 0.994475], ['partial repair probe 1', [[2020, 11, 13], [2020, 12, 31], [2020, 12, 31], 0.03, 3], 0.391304], ['partial repair probe 2', [[2042, 7, 29], [2043, 1, 31], [2042, 12, 9], 0.0675, 12], 2.459589], ['boundary control 1', [[2024, 1, 10], [2024, 9, 15], [2024, 9, 16], 0.05, 6], 'settlement outside first period'], ['boundary control 2', [[2024, 3, 15], [2024, 9, 15], [2024, 6, 15], 0.05, 6], 1.25], ['normal control 1', [[2041, 6, 16], [2041, 8, 30], [2041, 6, 13], 0.08, 12], 'settlement outside first period'], ['normal control 2', [[2005, 1, 10], [2005, 1, 31], [2005, 1, 10], 0.045, 3], 0.0]], [['regression long period denominator 1', [[2036, 7, 10], [2037, 2, 28], [2037, 2, 16], 0.0675, 6], 4.063545], ['regression long period denominator 2', [[2006, 9, 2], [2007, 3, 12], [2006, 12, 9], 0.045, 6], 1.216205], ['partial repair probe 1', [[2029, 5, 22], [2029, 7, 31], [2029, 7, 11], 0.0675, 6], 0.93232], ['partial repair probe 2', [[2033, 9, 26], [2034, 2, 28], [2033, 10, 19], 0.0675, 3], 0.421875], ['boundary control 1', [[2024, 1, 10], [2024, 9, 15], [2024, 9, 16], 0.05, 6], 'settlement outside first period'], ['boundary control 2', [[2024, 3, 15], [2024, 9, 15], [2024, 6, 15], 0.05, 6], 1.25], ['normal control 1', [[2004, 9, 16], [2004, 9, 30], [2004, 9, 16], 0.045, 3], 0.0], ['normal control 2', [[2035, 5, 9], [2035, 6, 30], [2035, 5, 6], 0.03, 6], 'settlement outside first period']], [['regression long period denominator 1', [[2019, 3, 16], [2019, 4, 30], [2019, 4, 4], 0.03, 1], 0.156989], ['regression long period denominator 2', [[2039, 4, 20], [2039, 6, 30], [2039, 5, 24], 0.02, 1], 0.187097], ['partial repair probe 1', [[2031, 8, 23], [2031, 12, 28], [2031, 9, 3], 0.045, 6], 0.135246], ['partial repair probe 2', [[2017, 9, 1], [2018, 2, 28], [2018, 2, 6], 0.0675, 12], 2.921918], ['boundary control 1', [[2024, 3, 15], [2024, 9, 15], [2024, 6, 15], 0.05, 6], 1.25], ['boundary control 2', [[2024, 1, 10], [2024, 9, 15], [2024, 9, 16], 0.05, 6], 'settlement outside first period'], ['normal control 1', [[2034, 7, 30], [2034, 11, 30], [2034, 7, 27], 0.045, 12], 'settlement outside first period'], ['normal control 2', [[2041, 1, 14], [2041, 1, 24], [2041, 1, 14], 0.03, 1], 0.0]]]\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-long-period-denominator","generated_at":"2026-09-29T14:46:51.416721+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 accrual divides days since issue by a single regular period length instead of summing quasi periods.","sha256":"4f005af498400f25b0ff6c71c253903231a49c0c4aa70afd19c2c6fa6a634f1a","title":"Irregular first coupon accrued by quasi-coupon periods: a long first period is accrued as one regular period · 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":45.974,"exit_code":1,"observations":[{"actual":1.337705,"check":"regression long period denominator 1","expected":2.235616,"passed":false},{"actual":1.635736,"check":"regression long period denominator 2","expected":2.927038,"passed":false},{"actual":3.645119,"check":"partial repair probe 1","expected":3.784932,"passed":false},{"actual":1.881148,"check":"partial repair probe 2","expected":1.247283,"passed":false},{"actual":1.25,"check":"boundary control 1","expected":1.25,"passed":true},{"actual":"settlement outside first period","check":"boundary control 2","expected":"settlement outside first period","passed":true},{"actual":"settlement outside first period","check":"normal control 1","expected":"settlement outside first period","passed":true},{"actual":"settlement outside first period","check":"normal control 2","expected":"settlement outside first period","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression long period denominator 1\", \"actual\": 1.337705, \"expected\": 2.235616, \"passed\": false}, {\"check\": \"regression long period denominator 2\", \"actual\": 1.635736, \"expected\": 2.927038, \"passed\": false}, {\"check\": \"partial repair probe 1\", \"actual\": 3.645119, \"expected\": 3.784932, \"passed\": false}, {\"check\": \"partial repair probe 2\", \"actual\": 1.881148, \"expected\": 1.247283, \"passed\": false}, {\"check\": \"boundary control 1\", \"actual\": 1.25, \"expected\": 1.25, \"passed\": true}, {\"check\": \"boundary control 2\", \"actual\": \"settlement outside first period\", \"expected\": \"settlement outside first period\", \"passed\": true}, {\"check\": \"normal control 1\", \"actual\": \"settlement outside first period\", \"expected\": \"settlement outside first period\", \"passed\": true}, {\"check\": \"normal control 2\", \"actual\": \"settlement outside first period\", \"expected\": \"settlement outside first period\", \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":44.565,"exit_code":1,"observations":[{"actual":2.229508,"check":"regression long period denominator 1","expected":2.235616,"passed":false},{"actual":2.898098,"check":"regression long period denominator 2","expected":2.927038,"passed":false},{"actual":3.784932,"check":"partial repair probe 1","expected":3.784932,"passed":true},{"actual":1.247283,"check":"partial repair probe 2","expected":1.247283,"passed":true},{"actual":1.25,"check":"boundary control 1","expected":1.25,"passed":true},{"actual":"settlement outside first period","check":"boundary control 2","expected":"settlement outside first period","passed":true},{"actual":"settlement outside first period","check":"normal control 1","expected":"settlement outside first period","passed":true},{"actual":"settlement outside first period","check":"normal control 2","expected":"settlement outside first period","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression long period denominator 1\", \"actual\": 2.229508, \"expected\": 2.235616, \"passed\": false}, {\"check\": \"regression long period denominator 2\", \"actual\": 2.898098, \"expected\": 2.927038, \"passed\": false}, {\"check\": \"partial repair probe 1\", \"actual\": 3.784932, \"expected\": 3.784932, \"passed\": true}, {\"check\": \"partial repair probe 2\", \"actual\": 1.247283, \"expected\": 1.247283, \"passed\": true}, {\"check\": \"boundary control 1\", \"actual\": 1.25, \"expected\": 1.25, \"passed\": true}, {\"check\": \"boundary control 2\", \"actual\": \"settlement outside first period\", \"expected\": \"settlement outside first period\", \"passed\": true}, {\"check\": \"normal control 1\", \"actual\": \"settlement outside first period\", \"expected\": \"settlement outside first period\", \"passed\": true}, {\"check\": \"normal control 2\", \"actual\": \"settlement outside first period\", \"expected\": \"settlement outside first period\", \"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."}}