{"abstract":"Monthly expiries land on the third Saturday.","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":"Switching to isoweekday() but keeping 4 targets Thursday.","family":"w2-options_payoff_and_settlement-expiration-date-weekday-numbering","id":"FA-61611","implementations":{"attempt":{"sha256":"d280885c09e41fa9f0727e98857a87372c0e6077505d4f7a7a8b0645c268d7e8","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    else:\n        first = datetime.date(y, m, 1)\n        offset = (4 - first.isoweekday()) % 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 weekday numbering 1', [2022, 10, 'monthly', []], [2022, 10, 21]], ['regression weekday numbering 2', [2028, 4, 'monthly', [[2028, 4, 21]]], [2028, 4, 20]], ['partial repair probe 1', [2023, 6, 'monthly', []], [2023, 6, 16]], ['partial repair probe 2', [2022, 4, 'monthly', []], [2022, 4, 15]], ['boundary control 1', [2024, 3, 'quarterly', []], [2024, 3, 29]], ['boundary control 2', [2024, 12, 'quarterly', []], [2024, 12, 31]], ['normal control 1', [2024, 2, 'quarterly', [[2024, 2, 16], [2024, 2, 15], [2024, 3, 31]]], [2024, 3, 29]], ['normal control 2', [2030, 6, 'quarterly', [[2030, 6, 28]]], [2030, 6, 27]]], [['regression weekday numbering 1', [2031, 11, 'monthly', [[2031, 11, 21], [2031, 11, 20]]], [2031, 11, 19]], ['regression weekday numbering 2', [2032, 5, 'monthly', []], [2032, 5, 21]], ['partial repair probe 1', [2019, 7, 'monthly', []], [2019, 7, 19]], ['partial repair probe 2', [2029, 6, 'monthly', [[2029, 6, 15], [2029, 6, 14]]], [2029, 6, 13]], ['boundary control 1', [2024, 3, 'quarterly', []], [2024, 3, 29]], ['boundary control 2', [2024, 12, 'quarterly', []], [2024, 12, 31]], ['normal control 1', [2022, 2, 'quarterly', []], [2022, 3, 31]], ['normal control 2', [2032, 12, 'monthly', [[2032, 12, 17], [2032, 12, 16]]], [2032, 12, 15]]], [['regression weekday numbering 1', [2028, 4, 'monthly', []], [2028, 4, 21]], ['regression weekday numbering 2', [2025, 11, 'monthly', [[2025, 11, 21], [2025, 11, 20]]], [2025, 11, 19]], ['partial repair probe 1', [2028, 2, 'monthly', []], [2028, 2, 18]], ['partial repair probe 2', [2022, 11, 'monthly', []], [2022, 11, 18]], ['boundary control 1', [2024, 3, 'quarterly', []], [2024, 3, 29]], ['boundary control 2', [2024, 12, 'quarterly', []], [2024, 12, 31]], ['normal control 1', [2026, 7, 'quarterly', []], [2026, 9, 30]], ['normal control 2', [2031, 5, 'monthly', [[2031, 5, 16], [2031, 5, 15]]], [2031, 5, 14]]], [['regression weekday numbering 1', [2020, 8, 'monthly', []], [2020, 8, 21]], ['regression weekday numbering 2', [2031, 11, 'monthly', []], [2031, 11, 21]], ['partial repair probe 1', [2024, 8, 'monthly', []], [2024, 8, 16]], ['partial repair probe 2', [2029, 5, 'monthly', []], [2029, 5, 18]], ['boundary control 1', [2024, 12, 'quarterly', []], [2024, 12, 31]], ['boundary control 2', [2024, 3, 'quarterly', []], [2024, 3, 29]], ['normal control 1', [2030, 12, 'monthly', [[2030, 12, 20]]], [2030, 12, 19]], ['normal control 2', [2031, 3, 'quarterly', [[2031, 3, 28]]], [2031, 3, 31]]], [['regression weekday numbering 1', [2028, 1, 'monthly', []], [2028, 1, 21]], ['regression weekday numbering 2', [2025, 3, 'monthly', []], [2025, 3, 21]], ['partial repair probe 1', [2025, 8, 'monthly', []], [2025, 8, 15]], ['partial repair probe 2', [2030, 2, 'monthly', [[2030, 2, 15]]], [2030, 2, 14]], ['boundary control 1', [2024, 12, 'quarterly', []], [2024, 12, 31]], ['boundary control 2', [2024, 3, 'quarterly', []], [2024, 3, 29]], ['normal control 1', [2019, 5, 'quarterly', []], [2019, 6, 28]], ['normal control 2', [2024, 5, 'quarterly', [[2024, 5, 17], [2024, 6, 27]]], [2024, 6, 28]]]]\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":"bd37d9d68467db7d92be8b48754e49a7dfcbe4ea64954aa9d4e786bd189238dc","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    else:\n        first = datetime.date(y, m, 1)\n        offset = (5 - 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 weekday numbering 1', [2022, 10, 'monthly', []], [2022, 10, 21]], ['regression weekday numbering 2', [2028, 4, 'monthly', [[2028, 4, 21]]], [2028, 4, 20]], ['partial repair probe 1', [2023, 6, 'monthly', []], [2023, 6, 16]], ['partial repair probe 2', [2022, 4, 'monthly', []], [2022, 4, 15]], ['boundary control 1', [2024, 3, 'quarterly', []], [2024, 3, 29]], ['boundary control 2', [2024, 12, 'quarterly', []], [2024, 12, 31]], ['normal control 1', [2024, 2, 'quarterly', [[2024, 2, 16], [2024, 2, 15], [2024, 3, 31]]], [2024, 3, 29]], ['normal control 2', [2030, 6, 'quarterly', [[2030, 6, 28]]], [2030, 6, 27]]], [['regression weekday numbering 1', [2031, 11, 'monthly', [[2031, 11, 21], [2031, 11, 20]]], [2031, 11, 19]], ['regression weekday numbering 2', [2032, 5, 'monthly', []], [2032, 5, 21]], ['partial repair probe 1', [2019, 7, 'monthly', []], [2019, 7, 19]], ['partial repair probe 2', [2029, 6, 'monthly', [[2029, 6, 15], [2029, 6, 14]]], [2029, 6, 13]], ['boundary control 1', [2024, 3, 'quarterly', []], [2024, 3, 29]], ['boundary control 2', [2024, 12, 'quarterly', []], [2024, 12, 31]], ['normal control 1', [2022, 2, 'quarterly', []], [2022, 3, 31]], ['normal control 2', [2032, 12, 'monthly', [[2032, 12, 17], [2032, 12, 16]]], [2032, 12, 15]]], [['regression weekday numbering 1', [2028, 4, 'monthly', []], [2028, 4, 21]], ['regression weekday numbering 2', [2025, 11, 'monthly', [[2025, 11, 21], [2025, 11, 20]]], [2025, 11, 19]], ['partial repair probe 1', [2028, 2, 'monthly', []], [2028, 2, 18]], ['partial repair probe 2', [2022, 11, 'monthly', []], [2022, 11, 18]], ['boundary control 1', [2024, 3, 'quarterly', []], [2024, 3, 29]], ['boundary control 2', [2024, 12, 'quarterly', []], [2024, 12, 31]], ['normal control 1', [2026, 7, 'quarterly', []], [2026, 9, 30]], ['normal control 2', [2031, 5, 'monthly', [[2031, 5, 16], [2031, 5, 15]]], [2031, 5, 14]]], [['regression weekday numbering 1', [2020, 8, 'monthly', []], [2020, 8, 21]], ['regression weekday numbering 2', [2031, 11, 'monthly', []], [2031, 11, 21]], ['partial repair probe 1', [2024, 8, 'monthly', []], [2024, 8, 16]], ['partial repair probe 2', [2029, 5, 'monthly', []], [2029, 5, 18]], ['boundary control 1', [2024, 12, 'quarterly', []], [2024, 12, 31]], ['boundary control 2', [2024, 3, 'quarterly', []], [2024, 3, 29]], ['normal control 1', [2030, 12, 'monthly', [[2030, 12, 20]]], [2030, 12, 19]], ['normal control 2', [2031, 3, 'quarterly', [[2031, 3, 28]]], [2031, 3, 31]]], [['regression weekday numbering 1', [2028, 1, 'monthly', []], [2028, 1, 21]], ['regression weekday numbering 2', [2025, 3, 'monthly', []], [2025, 3, 21]], ['partial repair probe 1', [2025, 8, 'monthly', []], [2025, 8, 15]], ['partial repair probe 2', [2030, 2, 'monthly', [[2030, 2, 15]]], [2030, 2, 14]], ['boundary control 1', [2024, 12, 'quarterly', []], [2024, 12, 31]], ['boundary control 2', [2024, 3, 'quarterly', []], [2024, 3, 29]], ['normal control 1', [2019, 5, 'quarterly', []], [2019, 6, 28]], ['normal control 2', [2024, 5, 'quarterly', [[2024, 5, 17], [2024, 6, 27]]], [2024, 6, 28]]]]\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-weekday-numbering","generated_at":"2026-09-29T14:46:56.783989+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 offset uses 5 with weekday(), mixing it up with isoweekday() numbering.","sha256":"52b0c7f0a928189c42bf32df3c2eecdb776ec6cd1cf285352193ab390f95522c","title":"Listed option expiration date calendar: the Friday offset uses the Saturday index · 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":41.682,"exit_code":1,"observations":[{"actual":[2022,10,20],"check":"regression weekday numbering 1","expected":[2022,10,21],"passed":false},{"actual":[2028,4,20],"check":"regression weekday numbering 2","expected":[2028,4,20],"passed":true},{"actual":[2023,6,15],"check":"partial repair probe 1","expected":[2023,6,16],"passed":false},{"actual":[2022,4,21],"check":"partial repair probe 2","expected":[2022,4,15],"passed":false},{"actual":[2024,3,29],"check":"boundary control 1","expected":[2024,3,29],"passed":true},{"actual":[2024,12,31],"check":"boundary control 2","expected":[2024,12,31],"passed":true},{"actual":[2024,3,29],"check":"normal control 1","expected":[2024,3,29],"passed":true},{"actual":[2030,6,27],"check":"normal control 2","expected":[2030,6,27],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression weekday numbering 1\", \"actual\": [2022, 10, 20], \"expected\": [2022, 10, 21], \"passed\": false}, {\"check\": \"regression weekday numbering 2\", \"actual\": [2028, 4, 20], \"expected\": [2028, 4, 20], \"passed\": true}, {\"check\": \"partial repair probe 1\", \"actual\": [2023, 6, 15], \"expected\": [2023, 6, 16], \"passed\": false}, {\"check\": \"partial repair probe 2\", \"actual\": [2022, 4, 21], \"expected\": [2022, 4, 15], \"passed\": false}, {\"check\": \"boundary control 1\", \"actual\": [2024, 3, 29], \"expected\": [2024, 3, 29], \"passed\": true}, {\"check\": \"boundary control 2\", \"actual\": [2024, 12, 31], \"expected\": [2024, 12, 31], \"passed\": true}, {\"check\": \"normal control 1\", \"actual\": [2024, 3, 29], \"expected\": [2024, 3, 29], \"passed\": true}, {\"check\": \"normal control 2\", \"actual\": [2030, 6, 27], \"expected\": [2030, 6, 27], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":41.711,"exit_code":1,"observations":[{"actual":[2022,10,14],"check":"regression weekday numbering 1","expected":[2022,10,21],"passed":false},{"actual":[2028,4,14],"check":"regression weekday numbering 2","expected":[2028,4,20],"passed":false},{"actual":[2023,6,16],"check":"partial repair probe 1","expected":[2023,6,16],"passed":true},{"actual":[2022,4,15],"check":"partial repair probe 2","expected":[2022,4,15],"passed":true},{"actual":[2024,3,29],"check":"boundary control 1","expected":[2024,3,29],"passed":true},{"actual":[2024,12,31],"check":"boundary control 2","expected":[2024,12,31],"passed":true},{"actual":[2024,3,29],"check":"normal control 1","expected":[2024,3,29],"passed":true},{"actual":[2030,6,27],"check":"normal control 2","expected":[2030,6,27],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression weekday numbering 1\", \"actual\": [2022, 10, 14], \"expected\": [2022, 10, 21], \"passed\": false}, {\"check\": \"regression weekday numbering 2\", \"actual\": [2028, 4, 14], \"expected\": [2028, 4, 20], \"passed\": false}, {\"check\": \"partial repair probe 1\", \"actual\": [2023, 6, 16], \"expected\": [2023, 6, 16], \"passed\": true}, {\"check\": \"partial repair probe 2\", \"actual\": [2022, 4, 15], \"expected\": [2022, 4, 15], \"passed\": true}, {\"check\": \"boundary control 1\", \"actual\": [2024, 3, 29], \"expected\": [2024, 3, 29], \"passed\": true}, {\"check\": \"boundary control 2\", \"actual\": [2024, 12, 31], \"expected\": [2024, 12, 31], \"passed\": true}, {\"check\": \"normal control 1\", \"actual\": [2024, 3, 29], \"expected\": [2024, 3, 29], \"passed\": true}, {\"check\": \"normal control 2\", \"actual\": [2030, 6, 27], \"expected\": [2030, 6, 27], \"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."}}