{"abstract":"Quarter-end expiries on Saturdays or Sundays are not moved.","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":"Rolling only over weekends ignores quarter-end holidays.","family":"w2-options_payoff_and_settlement-expiration-date-quarterly-business-day","id":"FA-61606","implementations":{"attempt":{"sha256":"fd56d1267e4f0efbeb5dbec5693cb8e09feec88f6c711121e0a15cc4eeeed903","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 - 1) // 3 + 1) * 3\n        x = datetime.date(y, qm, mlen(y, qm))\n        while x.weekday() >= 5:\n            x -= datetime.timedelta(days=1)\n        return [x.year, x.month, x.day]\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 quarterly business day 1', [2021, 7, 'quarterly', [[2021, 9, 30]]], [2021, 9, 29]], ['regression quarterly business day 2', [2028, 10, 'quarterly', [[2028, 10, 20], [2028, 10, 19]]], [2028, 12, 29]], ['partial repair probe 1', [2030, 4, 'quarterly', [[2030, 6, 28]]], [2030, 6, 27]], ['partial repair probe 2', [2024, 1, 'quarterly', [[2024, 3, 29]]], [2024, 3, 28]], ['boundary control 1', [2024, 3, 'monthly', []], [2024, 3, 15]], ['boundary control 2', [2024, 6, 'monthly', []], [2024, 6, 21]], ['normal control 1', [2022, 12, 'monthly', []], [2022, 12, 16]], ['normal control 2', [2021, 4, 'monthly', []], [2021, 4, 16]]], [['regression quarterly business day 1', [2031, 4, 'quarterly', [[2031, 6, 30]]], [2031, 6, 27]], ['regression quarterly business day 2', [2027, 8, 'quarterly', [[2027, 9, 30]]], [2027, 9, 29]], ['partial repair probe 1', [2031, 6, 'quarterly', [[2031, 6, 30]]], [2031, 6, 27]], ['partial repair probe 2', [2027, 10, 'quarterly', [[2027, 10, 15], [2027, 10, 14], [2027, 12, 31]]], [2027, 12, 30]], ['boundary control 1', [2024, 6, 'monthly', []], [2024, 6, 21]], ['boundary control 2', [2024, 12, 'quarterly', []], [2024, 12, 31]], ['normal control 1', [2022, 1, 'monthly', [[2022, 1, 21]]], [2022, 1, 20]], ['normal control 2', [2023, 4, 'quarterly', [[2023, 4, 21]]], [2023, 6, 30]]], [['regression quarterly business day 1', [2028, 11, 'quarterly', [[2028, 12, 29]]], [2028, 12, 28]], ['regression quarterly business day 2', [2019, 5, 'quarterly', [[2019, 6, 27]]], [2019, 6, 28]], ['partial repair probe 1', [2021, 3, 'quarterly', [[2021, 3, 31]]], [2021, 3, 30]], ['partial repair probe 2', [2021, 9, 'quarterly', [[2021, 9, 17], [2021, 9, 16], [2021, 9, 30]]], [2021, 9, 29]], ['boundary control 1', [2024, 12, 'quarterly', []], [2024, 12, 31]], ['boundary control 2', [2024, 3, 'monthly', []], [2024, 3, 15]], ['normal control 1', [2024, 12, 'monthly', [[2024, 12, 20], [2024, 12, 19]]], [2024, 12, 18]], ['normal control 2', [2025, 11, 'monthly', []], [2025, 11, 21]]], [['regression quarterly business day 1', [2023, 7, 'quarterly', []], [2023, 9, 29]], ['regression quarterly business day 2', [2030, 6, 'quarterly', [[2030, 6, 21], [2030, 6, 20]]], [2030, 6, 28]], ['partial repair probe 1', [2019, 12, 'quarterly', [[2019, 12, 31]]], [2019, 12, 30]], ['partial repair probe 2', [2024, 6, 'quarterly', [[2024, 6, 28]]], [2024, 6, 27]], ['boundary control 1', [2024, 6, 'monthly', []], [2024, 6, 21]], ['boundary control 2', [2024, 12, 'quarterly', []], [2024, 12, 31]], ['normal control 1', [2020, 5, 'monthly', []], [2020, 5, 15]], ['normal control 2', [2023, 6, 'quarterly', [[2023, 6, 16]]], [2023, 6, 30]]], [['regression quarterly business day 1', [2029, 7, 'quarterly', [[2029, 7, 20], [2029, 7, 19]]], [2029, 9, 28]], ['regression quarterly business day 2', [2029, 4, 'quarterly', [[2029, 6, 29]]], [2029, 6, 28]], ['partial repair probe 1', [2031, 7, 'quarterly', [[2031, 9, 30]]], [2031, 9, 29]], ['partial repair probe 2', [2027, 5, 'quarterly', [[2027, 6, 30]]], [2027, 6, 29]], ['boundary control 1', [2024, 6, 'monthly', []], [2024, 6, 21]], ['boundary control 2', [2024, 3, 'monthly', []], [2024, 3, 15]], ['normal control 1', [2026, 10, 'monthly', [[2026, 10, 16], [2026, 10, 15]]], [2026, 10, 14]], ['normal control 2', [2028, 10, 'monthly', []], [2028, 10, 20]]]]\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":"91e1f3a8a7d14c0037a141e2470038142292e566cc8bc655157f07429c733a9d","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 - 1) // 3 + 1) * 3\n        x = datetime.date(y, qm, mlen(y, qm))\n        return [x.year, x.month, x.day]\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 quarterly business day 1', [2021, 7, 'quarterly', [[2021, 9, 30]]], [2021, 9, 29]], ['regression quarterly business day 2', [2028, 10, 'quarterly', [[2028, 10, 20], [2028, 10, 19]]], [2028, 12, 29]], ['partial repair probe 1', [2030, 4, 'quarterly', [[2030, 6, 28]]], [2030, 6, 27]], ['partial repair probe 2', [2024, 1, 'quarterly', [[2024, 3, 29]]], [2024, 3, 28]], ['boundary control 1', [2024, 3, 'monthly', []], [2024, 3, 15]], ['boundary control 2', [2024, 6, 'monthly', []], [2024, 6, 21]], ['normal control 1', [2022, 12, 'monthly', []], [2022, 12, 16]], ['normal control 2', [2021, 4, 'monthly', []], [2021, 4, 16]]], [['regression quarterly business day 1', [2031, 4, 'quarterly', [[2031, 6, 30]]], [2031, 6, 27]], ['regression quarterly business day 2', [2027, 8, 'quarterly', [[2027, 9, 30]]], [2027, 9, 29]], ['partial repair probe 1', [2031, 6, 'quarterly', [[2031, 6, 30]]], [2031, 6, 27]], ['partial repair probe 2', [2027, 10, 'quarterly', [[2027, 10, 15], [2027, 10, 14], [2027, 12, 31]]], [2027, 12, 30]], ['boundary control 1', [2024, 6, 'monthly', []], [2024, 6, 21]], ['boundary control 2', [2024, 12, 'quarterly', []], [2024, 12, 31]], ['normal control 1', [2022, 1, 'monthly', [[2022, 1, 21]]], [2022, 1, 20]], ['normal control 2', [2023, 4, 'quarterly', [[2023, 4, 21]]], [2023, 6, 30]]], [['regression quarterly business day 1', [2028, 11, 'quarterly', [[2028, 12, 29]]], [2028, 12, 28]], ['regression quarterly business day 2', [2019, 5, 'quarterly', [[2019, 6, 27]]], [2019, 6, 28]], ['partial repair probe 1', [2021, 3, 'quarterly', [[2021, 3, 31]]], [2021, 3, 30]], ['partial repair probe 2', [2021, 9, 'quarterly', [[2021, 9, 17], [2021, 9, 16], [2021, 9, 30]]], [2021, 9, 29]], ['boundary control 1', [2024, 12, 'quarterly', []], [2024, 12, 31]], ['boundary control 2', [2024, 3, 'monthly', []], [2024, 3, 15]], ['normal control 1', [2024, 12, 'monthly', [[2024, 12, 20], [2024, 12, 19]]], [2024, 12, 18]], ['normal control 2', [2025, 11, 'monthly', []], [2025, 11, 21]]], [['regression quarterly business day 1', [2023, 7, 'quarterly', []], [2023, 9, 29]], ['regression quarterly business day 2', [2030, 6, 'quarterly', [[2030, 6, 21], [2030, 6, 20]]], [2030, 6, 28]], ['partial repair probe 1', [2019, 12, 'quarterly', [[2019, 12, 31]]], [2019, 12, 30]], ['partial repair probe 2', [2024, 6, 'quarterly', [[2024, 6, 28]]], [2024, 6, 27]], ['boundary control 1', [2024, 6, 'monthly', []], [2024, 6, 21]], ['boundary control 2', [2024, 12, 'quarterly', []], [2024, 12, 31]], ['normal control 1', [2020, 5, 'monthly', []], [2020, 5, 15]], ['normal control 2', [2023, 6, 'quarterly', [[2023, 6, 16]]], [2023, 6, 30]]], [['regression quarterly business day 1', [2029, 7, 'quarterly', [[2029, 7, 20], [2029, 7, 19]]], [2029, 9, 28]], ['regression quarterly business day 2', [2029, 4, 'quarterly', [[2029, 6, 29]]], [2029, 6, 28]], ['partial repair probe 1', [2031, 7, 'quarterly', [[2031, 9, 30]]], [2031, 9, 29]], ['partial repair probe 2', [2027, 5, 'quarterly', [[2027, 6, 30]]], [2027, 6, 29]], ['boundary control 1', [2024, 6, 'monthly', []], [2024, 6, 21]], ['boundary control 2', [2024, 3, 'monthly', []], [2024, 3, 15]], ['normal control 1', [2026, 10, 'monthly', [[2026, 10, 16], [2026, 10, 15]]], [2026, 10, 14]], ['normal control 2', [2028, 10, 'monthly', []], [2028, 10, 20]]]]\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-quarterly-business-day","generated_at":"2026-09-29T14:46:56.788463+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 quarterly branch returns the calendar month end before the business-day roll.","sha256":"c2201caba2f116bd196bd809584f146abc36af7f22d3a9cd221d97264a93d46a","title":"Listed option expiration date calendar: quarterly expiries fall on weekend month ends · 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.383,"exit_code":1,"observations":[{"actual":[2021,9,30],"check":"regression quarterly business day 1","expected":[2021,9,29],"passed":false},{"actual":[2028,12,29],"check":"regression quarterly business day 2","expected":[2028,12,29],"passed":true},{"actual":[2030,6,28],"check":"partial repair probe 1","expected":[2030,6,27],"passed":false},{"actual":[2024,3,29],"check":"partial repair probe 2","expected":[2024,3,28],"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":[2022,12,16],"check":"normal control 1","expected":[2022,12,16],"passed":true},{"actual":[2021,4,16],"check":"normal control 2","expected":[2021,4,16],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression quarterly business day 1\", \"actual\": [2021, 9, 30], \"expected\": [2021, 9, 29], \"passed\": false}, {\"check\": \"regression quarterly business day 2\", \"actual\": [2028, 12, 29], \"expected\": [2028, 12, 29], \"passed\": true}, {\"check\": \"partial repair probe 1\", \"actual\": [2030, 6, 28], \"expected\": [2030, 6, 27], \"passed\": false}, {\"check\": \"partial repair probe 2\", \"actual\": [2024, 3, 29], \"expected\": [2024, 3, 28], \"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\": [2022, 12, 16], \"expected\": [2022, 12, 16], \"passed\": true}, {\"check\": \"normal control 2\", \"actual\": [2021, 4, 16], \"expected\": [2021, 4, 16], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":42.228,"exit_code":1,"observations":[{"actual":[2021,9,30],"check":"regression quarterly business day 1","expected":[2021,9,29],"passed":false},{"actual":[2028,12,31],"check":"regression quarterly business day 2","expected":[2028,12,29],"passed":false},{"actual":[2030,6,30],"check":"partial repair probe 1","expected":[2030,6,27],"passed":false},{"actual":[2024,3,31],"check":"partial repair probe 2","expected":[2024,3,28],"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":[2022,12,16],"check":"normal control 1","expected":[2022,12,16],"passed":true},{"actual":[2021,4,16],"check":"normal control 2","expected":[2021,4,16],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression quarterly business day 1\", \"actual\": [2021, 9, 30], \"expected\": [2021, 9, 29], \"passed\": false}, {\"check\": \"regression quarterly business day 2\", \"actual\": [2028, 12, 31], \"expected\": [2028, 12, 29], \"passed\": false}, {\"check\": \"partial repair probe 1\", \"actual\": [2030, 6, 30], \"expected\": [2030, 6, 27], \"passed\": false}, {\"check\": \"partial repair probe 2\", \"actual\": [2024, 3, 31], \"expected\": [2024, 3, 28], \"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\": [2022, 12, 16], \"expected\": [2022, 12, 16], \"passed\": true}, {\"check\": \"normal control 2\", \"actual\": [2021, 4, 16], \"expected\": [2021, 4, 16], \"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."}}