{"abstract":"March, June and September quarterly contracts expire three months late.","category":"Options payoff and settlement","checks":8,"contract":"Inputs year, month, kind and holidays. Monthly expiry is the third Friday of the month; quarterly expiry is the last calendar day of the quarter-end month (Mar/Jun/Sep/Dec) containing the month. Either date rolls back to the preceding business day (weekday not in holidays) when it is not a business day. Return [y,m,d].","contract_signature":"y, m, kind, holidays","evaluation_group":"w2-options_payoff_and_settlement-expiration-date","failed_approach":"Clamping the result at December fixes only the December overflow.","family":"w2-options_payoff_and_settlement-expiration-date-quarter-month-mapping","id":"FA-61601","implementations":{"attempt":{"sha256":"dd5666a1aa0336178aa7c01f413a572ee154ba168f706888be3913e05c6f9c9f","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport datetime\nN = 1\nobservations = []\ndef solve(y, m, kind, holidays):\n    H = {datetime.date(*h) for h in holidays}\n    def biz(x):\n        return x.weekday() < 5 and x not in H\n    def mlen(yy, mm):\n        if mm == 2:\n            return 29 if (yy % 4 == 0 and yy % 100 != 0) or yy % 400 == 0 else 28\n        return 30 if mm in (4, 6, 9, 11) else 31\n    if kind == 'quarterly':\n        qm = min(12, (m // 3 + 1) * 3)\n        x = datetime.date(y, qm, mlen(y, qm))\n    else:\n        first = datetime.date(y, m, 1)\n        offset = (4 - first.weekday()) % 7\n        x = first + datetime.timedelta(days=offset + 14)\n    while not biz(x):\n        x -= datetime.timedelta(days=1)\n    return [x.year, x.month, x.day]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression quarter month mapping 1', [2021, 3, 'quarterly', [[2021, 3, 29]]], [2021, 3, 31]], ['regression quarter month mapping 2', [2026, 6, 'quarterly', [[2026, 6, 19], [2026, 6, 18]]], [2026, 6, 30]], ['partial repair probe 1', [2030, 9, 'quarterly', []], [2030, 9, 30]], ['partial repair probe 2', [2025, 9, 'quarterly', []], [2025, 9, 30]], ['boundary control 1', [2024, 3, 'monthly', []], [2024, 3, 15]], ['boundary control 2', [2024, 6, 'monthly', []], [2024, 6, 21]], ['normal control 1', [2031, 3, 'monthly', []], [2031, 3, 21]], ['normal control 2', [2024, 3, 'monthly', [[2024, 3, 15], [2024, 3, 14]]], [2024, 3, 13]]], [['regression quarter month mapping 1', [2030, 3, 'quarterly', []], [2030, 3, 29]], ['regression quarter month mapping 2', [2027, 6, 'quarterly', [[2027, 6, 27]]], [2027, 6, 30]], ['partial repair probe 1', [2020, 6, 'quarterly', [[2020, 6, 19], [2020, 6, 18]]], [2020, 6, 30]], ['partial repair probe 2', [2029, 3, 'quarterly', [[2029, 3, 28]]], [2029, 3, 30]], ['boundary control 1', [2024, 6, 'monthly', []], [2024, 6, 21]], ['boundary control 2', [2024, 3, 'monthly', []], [2024, 3, 15]], ['normal control 1', [2028, 11, 'monthly', [[2028, 11, 17], [2028, 11, 16]]], [2028, 11, 15]], ['normal control 2', [2030, 11, 'quarterly', []], [2030, 12, 31]]], [['regression quarter month mapping 1', [2026, 9, 'quarterly', []], [2026, 9, 30]], ['regression quarter month mapping 2', [2027, 6, 'quarterly', [[2027, 6, 18], [2027, 6, 28]]], [2027, 6, 30]], ['partial repair probe 1', [2030, 9, 'quarterly', []], [2030, 9, 30]], ['partial repair probe 2', [2029, 9, 'quarterly', [[2029, 9, 21], [2029, 9, 28]]], [2029, 9, 27]], ['boundary control 1', [2024, 6, 'monthly', []], [2024, 6, 21]], ['boundary control 2', [2024, 3, 'monthly', []], [2024, 3, 15]], ['normal control 1', [2029, 8, 'monthly', []], [2029, 8, 17]], ['normal control 2', [2022, 4, 'monthly', [[2022, 4, 15]]], [2022, 4, 14]]], [['regression quarter month mapping 1', [2031, 9, 'quarterly', [[2031, 9, 27]]], [2031, 9, 30]], ['regression quarter month mapping 2', [2032, 3, 'quarterly', [[2032, 3, 28]]], [2032, 3, 31]], ['partial repair probe 1', [2029, 6, 'quarterly', []], [2029, 6, 29]], ['partial repair probe 2', [2027, 9, 'quarterly', [[2027, 9, 17], [2027, 9, 27]]], [2027, 9, 30]], ['boundary control 1', [2024, 6, 'monthly', []], [2024, 6, 21]], ['boundary control 2', [2024, 3, 'monthly', []], [2024, 3, 15]], ['normal control 1', [2023, 3, 'monthly', []], [2023, 3, 17]], ['normal control 2', [2032, 5, 'quarterly', [[2032, 6, 28]]], [2032, 6, 30]]], [['regression quarter month mapping 1', [2029, 3, 'quarterly', [[2029, 3, 16], [2029, 3, 30]]], [2029, 3, 29]], ['regression quarter month mapping 2', [2029, 3, 'quarterly', []], [2029, 3, 30]], ['partial repair probe 1', [2029, 3, 'quarterly', [[2029, 3, 16], [2029, 3, 15], [2029, 3, 30]]], [2029, 3, 29]], ['partial repair probe 2', [2019, 9, 'quarterly', [[2019, 9, 20], [2019, 9, 30]]], [2019, 9, 27]], ['boundary control 1', [2024, 3, 'monthly', []], [2024, 3, 15]], ['boundary control 2', [2024, 6, 'monthly', []], [2024, 6, 21]], ['normal control 1', [2020, 7, 'quarterly', [[2020, 9, 30]]], [2020, 9, 29]], ['normal control 2', [2026, 9, 'monthly', [[2026, 9, 18]]], [2026, 9, 17]]]]\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":"9b58c2bc3dcc93fc07adc5983b7942494ed8970132e74088f1d6927dff23b6f9","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport datetime\nN = 1\nobservations = []\ndef solve(y, m, kind, holidays):\n    H = {datetime.date(*h) for h in holidays}\n    def biz(x):\n        return x.weekday() < 5 and x not in H\n    def mlen(yy, mm):\n        if mm == 2:\n            return 29 if (yy % 4 == 0 and yy % 100 != 0) or yy % 400 == 0 else 28\n        return 30 if mm in (4, 6, 9, 11) else 31\n    if kind == 'quarterly':\n        qm = (m // 3 + 1) * 3\n        x = datetime.date(y, qm, mlen(y, qm))\n    else:\n        first = datetime.date(y, m, 1)\n        offset = (4 - first.weekday()) % 7\n        x = first + datetime.timedelta(days=offset + 14)\n    while not biz(x):\n        x -= datetime.timedelta(days=1)\n    return [x.year, x.month, x.day]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression quarter month mapping 1', [2021, 3, 'quarterly', [[2021, 3, 29]]], [2021, 3, 31]], ['regression quarter month mapping 2', [2026, 6, 'quarterly', [[2026, 6, 19], [2026, 6, 18]]], [2026, 6, 30]], ['partial repair probe 1', [2030, 9, 'quarterly', []], [2030, 9, 30]], ['partial repair probe 2', [2025, 9, 'quarterly', []], [2025, 9, 30]], ['boundary control 1', [2024, 3, 'monthly', []], [2024, 3, 15]], ['boundary control 2', [2024, 6, 'monthly', []], [2024, 6, 21]], ['normal control 1', [2031, 3, 'monthly', []], [2031, 3, 21]], ['normal control 2', [2024, 3, 'monthly', [[2024, 3, 15], [2024, 3, 14]]], [2024, 3, 13]]], [['regression quarter month mapping 1', [2030, 3, 'quarterly', []], [2030, 3, 29]], ['regression quarter month mapping 2', [2027, 6, 'quarterly', [[2027, 6, 27]]], [2027, 6, 30]], ['partial repair probe 1', [2020, 6, 'quarterly', [[2020, 6, 19], [2020, 6, 18]]], [2020, 6, 30]], ['partial repair probe 2', [2029, 3, 'quarterly', [[2029, 3, 28]]], [2029, 3, 30]], ['boundary control 1', [2024, 6, 'monthly', []], [2024, 6, 21]], ['boundary control 2', [2024, 3, 'monthly', []], [2024, 3, 15]], ['normal control 1', [2028, 11, 'monthly', [[2028, 11, 17], [2028, 11, 16]]], [2028, 11, 15]], ['normal control 2', [2030, 11, 'quarterly', []], [2030, 12, 31]]], [['regression quarter month mapping 1', [2026, 9, 'quarterly', []], [2026, 9, 30]], ['regression quarter month mapping 2', [2027, 6, 'quarterly', [[2027, 6, 18], [2027, 6, 28]]], [2027, 6, 30]], ['partial repair probe 1', [2030, 9, 'quarterly', []], [2030, 9, 30]], ['partial repair probe 2', [2029, 9, 'quarterly', [[2029, 9, 21], [2029, 9, 28]]], [2029, 9, 27]], ['boundary control 1', [2024, 6, 'monthly', []], [2024, 6, 21]], ['boundary control 2', [2024, 3, 'monthly', []], [2024, 3, 15]], ['normal control 1', [2029, 8, 'monthly', []], [2029, 8, 17]], ['normal control 2', [2022, 4, 'monthly', [[2022, 4, 15]]], [2022, 4, 14]]], [['regression quarter month mapping 1', [2031, 9, 'quarterly', [[2031, 9, 27]]], [2031, 9, 30]], ['regression quarter month mapping 2', [2032, 3, 'quarterly', [[2032, 3, 28]]], [2032, 3, 31]], ['partial repair probe 1', [2029, 6, 'quarterly', []], [2029, 6, 29]], ['partial repair probe 2', [2027, 9, 'quarterly', [[2027, 9, 17], [2027, 9, 27]]], [2027, 9, 30]], ['boundary control 1', [2024, 6, 'monthly', []], [2024, 6, 21]], ['boundary control 2', [2024, 3, 'monthly', []], [2024, 3, 15]], ['normal control 1', [2023, 3, 'monthly', []], [2023, 3, 17]], ['normal control 2', [2032, 5, 'quarterly', [[2032, 6, 28]]], [2032, 6, 30]]], [['regression quarter month mapping 1', [2029, 3, 'quarterly', [[2029, 3, 16], [2029, 3, 30]]], [2029, 3, 29]], ['regression quarter month mapping 2', [2029, 3, 'quarterly', []], [2029, 3, 30]], ['partial repair probe 1', [2029, 3, 'quarterly', [[2029, 3, 16], [2029, 3, 15], [2029, 3, 30]]], [2029, 3, 29]], ['partial repair probe 2', [2019, 9, 'quarterly', [[2019, 9, 20], [2019, 9, 30]]], [2019, 9, 27]], ['boundary control 1', [2024, 3, 'monthly', []], [2024, 3, 15]], ['boundary control 2', [2024, 6, 'monthly', []], [2024, 6, 21]], ['normal control 1', [2020, 7, 'quarterly', [[2020, 9, 30]]], [2020, 9, 29]], ['normal control 2', [2026, 9, 'monthly', [[2026, 9, 18]]], [2026, 9, 17]]]]\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 exchange or clearing rulebook. 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-options_payoff_and_settlement-expiration-date-quarter-month-mapping","generated_at":"2026-09-29T14:46:56.789011+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Option expiry, exercise and settlement engines move cash and shares; a wrong branch misstates obligations.","root_cause":"The quarter month is computed from m // 3 instead of (m - 1) // 3.","sha256":"7b3d22568832e4f99273b3045d5ce6161a2385fcc0c7549c49bc0a3b680c8c37","title":"Listed option expiration date calendar: a quarter-end month maps to the next quarter · 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":44.633,"exit_code":1,"observations":[{"actual":[2021,6,30],"check":"regression quarter month mapping 1","expected":[2021,3,31],"passed":false},{"actual":[2026,9,30],"check":"regression quarter month mapping 2","expected":[2026,6,30],"passed":false},{"actual":[2030,12,31],"check":"partial repair probe 1","expected":[2030,9,30],"passed":false},{"actual":[2025,12,31],"check":"partial repair probe 2","expected":[2025,9,30],"passed":false},{"actual":[2024,3,15],"check":"boundary control 1","expected":[2024,3,15],"passed":true},{"actual":[2024,6,21],"check":"boundary control 2","expected":[2024,6,21],"passed":true},{"actual":[2031,3,21],"check":"normal control 1","expected":[2031,3,21],"passed":true},{"actual":[2024,3,13],"check":"normal control 2","expected":[2024,3,13],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression quarter month mapping 1\", \"actual\": [2021, 6, 30], \"expected\": [2021, 3, 31], \"passed\": false}, {\"check\": \"regression quarter month mapping 2\", \"actual\": [2026, 9, 30], \"expected\": [2026, 6, 30], \"passed\": false}, {\"check\": \"partial repair probe 1\", \"actual\": [2030, 12, 31], \"expected\": [2030, 9, 30], \"passed\": false}, {\"check\": \"partial repair probe 2\", \"actual\": [2025, 12, 31], \"expected\": [2025, 9, 30], \"passed\": false}, {\"check\": \"boundary control 1\", \"actual\": [2024, 3, 15], \"expected\": [2024, 3, 15], \"passed\": true}, {\"check\": \"boundary control 2\", \"actual\": [2024, 6, 21], \"expected\": [2024, 6, 21], \"passed\": true}, {\"check\": \"normal control 1\", \"actual\": [2031, 3, 21], \"expected\": [2031, 3, 21], \"passed\": true}, {\"check\": \"normal control 2\", \"actual\": [2024, 3, 13], \"expected\": [2024, 3, 13], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":44.165,"exit_code":1,"observations":[{"actual":[2021,6,30],"check":"regression quarter month mapping 1","expected":[2021,3,31],"passed":false},{"actual":[2026,9,30],"check":"regression quarter month mapping 2","expected":[2026,6,30],"passed":false},{"actual":[2030,12,31],"check":"partial repair probe 1","expected":[2030,9,30],"passed":false},{"actual":[2025,12,31],"check":"partial repair probe 2","expected":[2025,9,30],"passed":false},{"actual":[2024,3,15],"check":"boundary control 1","expected":[2024,3,15],"passed":true},{"actual":[2024,6,21],"check":"boundary control 2","expected":[2024,6,21],"passed":true},{"actual":[2031,3,21],"check":"normal control 1","expected":[2031,3,21],"passed":true},{"actual":[2024,3,13],"check":"normal control 2","expected":[2024,3,13],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression quarter month mapping 1\", \"actual\": [2021, 6, 30], \"expected\": [2021, 3, 31], \"passed\": false}, {\"check\": \"regression quarter month mapping 2\", \"actual\": [2026, 9, 30], \"expected\": [2026, 6, 30], \"passed\": false}, {\"check\": \"partial repair probe 1\", \"actual\": [2030, 12, 31], \"expected\": [2030, 9, 30], \"passed\": false}, {\"check\": \"partial repair probe 2\", \"actual\": [2025, 12, 31], \"expected\": [2025, 9, 30], \"passed\": false}, {\"check\": \"boundary control 1\", \"actual\": [2024, 3, 15], \"expected\": [2024, 3, 15], \"passed\": true}, {\"check\": \"boundary control 2\", \"actual\": [2024, 6, 21], \"expected\": [2024, 6, 21], \"passed\": true}, {\"check\": \"normal control 1\", \"actual\": [2031, 3, 21], \"expected\": [2031, 3, 21], \"passed\": true}, {\"check\": \"normal control 2\", \"actual\": [2024, 3, 13], \"expected\": [2024, 3, 13], \"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."}}