{"abstract":"A rule with only BYMONTHDAY produces no instances.","category":"Calendar recurrence rules","checks":7,"contract":"FREQ=MONTHLY with BYDAY weekday codes (MO..SU) and BYMONTHDAY values (negative counts from month end). When both are present a day must satisfy both; an empty list imposes no restriction. Days are examined from dtstart forward. Return the first count ISO dates (search bounded to 50 years).","contract_signature":"dtstart, byday, bymonthday, count","evaluation_group":"w2-calendar-recurrence-rules-monthly-byday-bymonthday-intersection","failed_approach":"The partial repair `wanted is None or d.weekday() in wanted` tests for None, but an empty list is not None.","family":"w2-calendar-recurrence-rules-monthly-byday-bymonthday-intersection-empty-filter","id":"FA-77161","implementations":{"attempt":{"sha256":"6799a3477cb511504ea260e89f4ca555df707ed27633d9fa797eb6810500251f","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport datetime as dt\nimport calendar\nN = 1\nobservations = []\ndef solve(dtstart, byday, bymonthday, count):\n    start = dt.date.fromisoformat(dtstart)\n    wanted = [['MO', 'TU', 'WE', 'TH', 'FR', 'SA', 'SU'].index(w) for w in byday]\n    out = []\n    d = start\n    while len(out) < count and d.year < start.year + 50:\n        dim = calendar.monthrange(d.year, d.month)[1]\n        day_ok = wanted is None or d.weekday() in wanted\n        mday_ok = not bymonthday or (d.day in bymonthday or d.day - dim - 1 in bymonthday)\n        if day_ok and mday_ok:\n            out.append(d.isoformat())\n        d += dt.timedelta(days=1)\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression: friday the 13th',\n   ['2024-01-01', ['FR'], [13], 3],\n   ['2024-09-13', '2024-12-13', '2025-06-13']),\n  ('last sunday via -1..-7',\n   ['2024-01-01', ['SU'], [-1, -2, -3, -4, -5, -6, -7], 3],\n   ['2024-01-28', '2024-02-25', '2024-03-31']),\n  ('only bymonthday',\n   ['2024-01-10', [], [1, 15], 4],\n   ['2024-01-15', '2024-02-01', '2024-02-15', '2024-03-01']),\n  ('only byday',\n   ['2024-01-01', ['SA', 'SU'], [], 4],\n   ['2024-01-06', '2024-01-07', '2024-01-13', '2024-01-14']),\n  ('last day monday', ['2024-01-01', ['MO'], [-1], 2], ['2024-09-30', '2025-03-31']),\n  ('first monday via 1..7',\n   ['2024-02-01', ['MO'], [1, 2, 3, 4, 5, 6, 7], 3],\n   ['2024-02-05', '2024-03-04', '2024-04-01']),\n  ('sunday first of month', ['2024-01-01', ['SU'], [1], 2], ['2024-09-01', '2024-12-01'])],\n [('only bymonthday',\n   ['2024-01-10', [], [1, 15], 4],\n   ['2024-01-15', '2024-02-01', '2024-02-15', '2024-03-01']),\n  ('only byday',\n   ['2024-01-01', ['SA', 'SU'], [], 4],\n   ['2024-01-06', '2024-01-07', '2024-01-13', '2024-01-14']),\n  ('last day monday', ['2024-01-01', ['MO'], [-1], 2], ['2024-09-30', '2025-03-31']),\n  ('first monday via 1..7',\n   ['2024-02-01', ['MO'], [1, 2, 3, 4, 5, 6, 7], 3],\n   ['2024-02-05', '2024-03-04', '2024-04-01']),\n  ('sunday first of month', ['2024-01-01', ['SU'], [1], 2], ['2024-09-01', '2024-12-01']),\n  ('tuesday 29th', ['2024-01-01', ['TU'], [29], 3], ['2024-10-29', '2025-04-29', '2025-07-29']),\n  ('weekday 15th',\n   ['2024-03-01', ['MO', 'TU', 'WE', 'TH', 'FR'], [15], 4],\n   ['2024-03-15', '2024-04-15', '2024-05-15', '2024-07-15'])],\n [('last day monday', ['2024-01-01', ['MO'], [-1], 2], ['2024-09-30', '2025-03-31']),\n  ('first monday via 1..7',\n   ['2024-02-01', ['MO'], [1, 2, 3, 4, 5, 6, 7], 3],\n   ['2024-02-05', '2024-03-04', '2024-04-01']),\n  ('sunday first of month', ['2024-01-01', ['SU'], [1], 2], ['2024-09-01', '2024-12-01']),\n  ('tuesday 29th', ['2024-01-01', ['TU'], [29], 3], ['2024-10-29', '2025-04-29', '2025-07-29']),\n  ('weekday 15th',\n   ['2024-03-01', ['MO', 'TU', 'WE', 'TH', 'FR'], [15], 4],\n   ['2024-03-15', '2024-04-15', '2024-05-15', '2024-07-15']),\n  ('thursday the 13th', ['2025-01-01', ['TH'], [13], 2], ['2025-02-13', '2025-03-13']),\n  ('regression: friday the 13th',\n   ['2024-01-01', ['FR'], [13], 3],\n   ['2024-09-13', '2024-12-13', '2025-06-13']),\n  ('only bymonthday',\n   ['2024-01-10', [], [1, 15], 4],\n   ['2024-01-15', '2024-02-01', '2024-02-15', '2024-03-01'])],\n [('sunday first of month', ['2024-01-01', ['SU'], [1], 2], ['2024-09-01', '2024-12-01']),\n  ('tuesday 29th', ['2024-01-01', ['TU'], [29], 3], ['2024-10-29', '2025-04-29', '2025-07-29']),\n  ('weekday 15th',\n   ['2024-03-01', ['MO', 'TU', 'WE', 'TH', 'FR'], [15], 4],\n   ['2024-03-15', '2024-04-15', '2024-05-15', '2024-07-15']),\n  ('thursday the 13th', ['2025-01-01', ['TH'], [13], 2], ['2025-02-13', '2025-03-13']),\n  ('regression: friday the 13th',\n   ['2024-01-01', ['FR'], [13], 3],\n   ['2024-09-13', '2024-12-13', '2025-06-13']),\n  ('last sunday via -1..-7',\n   ['2024-01-01', ['SU'], [-1, -2, -3, -4, -5, -6, -7], 3],\n   ['2024-01-28', '2024-02-25', '2024-03-31']),\n  ('only bymonthday',\n   ['2024-01-10', [], [1, 15], 4],\n   ['2024-01-15', '2024-02-01', '2024-02-15', '2024-03-01'])],\n [('weekday 15th',\n   ['2024-03-01', ['MO', 'TU', 'WE', 'TH', 'FR'], [15], 4],\n   ['2024-03-15', '2024-04-15', '2024-05-15', '2024-07-15']),\n  ('thursday the 13th', ['2025-01-01', ['TH'], [13], 2], ['2025-02-13', '2025-03-13']),\n  ('regression: friday the 13th',\n   ['2024-01-01', ['FR'], [13], 3],\n   ['2024-09-13', '2024-12-13', '2025-06-13']),\n  ('last sunday via -1..-7',\n   ['2024-01-01', ['SU'], [-1, -2, -3, -4, -5, -6, -7], 3],\n   ['2024-01-28', '2024-02-25', '2024-03-31']),\n  ('only bymonthday',\n   ['2024-01-10', [], [1, 15], 4],\n   ['2024-01-15', '2024-02-01', '2024-02-15', '2024-03-01']),\n  ('only byday',\n   ['2024-01-01', ['SA', 'SU'], [], 4],\n   ['2024-01-06', '2024-01-07', '2024-01-13', '2024-01-14']),\n  ('last day monday', ['2024-01-01', ['MO'], [-1], 2], ['2024-09-30', '2025-03-31'])]]\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":"46ce01f49962e7573b7379a6c80e6fafd2d1379c0ec44915e4dfff839b653828","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport datetime as dt\nimport calendar\nN = 1\nobservations = []\ndef solve(dtstart, byday, bymonthday, count):\n    start = dt.date.fromisoformat(dtstart)\n    wanted = [['MO', 'TU', 'WE', 'TH', 'FR', 'SA', 'SU'].index(w) for w in byday]\n    out = []\n    d = start\n    while len(out) < count and d.year < start.year + 50:\n        dim = calendar.monthrange(d.year, d.month)[1]\n        day_ok = d.weekday() in wanted\n        mday_ok = not bymonthday or (d.day in bymonthday or d.day - dim - 1 in bymonthday)\n        if day_ok and mday_ok:\n            out.append(d.isoformat())\n        d += dt.timedelta(days=1)\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression: friday the 13th',\n   ['2024-01-01', ['FR'], [13], 3],\n   ['2024-09-13', '2024-12-13', '2025-06-13']),\n  ('last sunday via -1..-7',\n   ['2024-01-01', ['SU'], [-1, -2, -3, -4, -5, -6, -7], 3],\n   ['2024-01-28', '2024-02-25', '2024-03-31']),\n  ('only bymonthday',\n   ['2024-01-10', [], [1, 15], 4],\n   ['2024-01-15', '2024-02-01', '2024-02-15', '2024-03-01']),\n  ('only byday',\n   ['2024-01-01', ['SA', 'SU'], [], 4],\n   ['2024-01-06', '2024-01-07', '2024-01-13', '2024-01-14']),\n  ('last day monday', ['2024-01-01', ['MO'], [-1], 2], ['2024-09-30', '2025-03-31']),\n  ('first monday via 1..7',\n   ['2024-02-01', ['MO'], [1, 2, 3, 4, 5, 6, 7], 3],\n   ['2024-02-05', '2024-03-04', '2024-04-01']),\n  ('sunday first of month', ['2024-01-01', ['SU'], [1], 2], ['2024-09-01', '2024-12-01'])],\n [('only bymonthday',\n   ['2024-01-10', [], [1, 15], 4],\n   ['2024-01-15', '2024-02-01', '2024-02-15', '2024-03-01']),\n  ('only byday',\n   ['2024-01-01', ['SA', 'SU'], [], 4],\n   ['2024-01-06', '2024-01-07', '2024-01-13', '2024-01-14']),\n  ('last day monday', ['2024-01-01', ['MO'], [-1], 2], ['2024-09-30', '2025-03-31']),\n  ('first monday via 1..7',\n   ['2024-02-01', ['MO'], [1, 2, 3, 4, 5, 6, 7], 3],\n   ['2024-02-05', '2024-03-04', '2024-04-01']),\n  ('sunday first of month', ['2024-01-01', ['SU'], [1], 2], ['2024-09-01', '2024-12-01']),\n  ('tuesday 29th', ['2024-01-01', ['TU'], [29], 3], ['2024-10-29', '2025-04-29', '2025-07-29']),\n  ('weekday 15th',\n   ['2024-03-01', ['MO', 'TU', 'WE', 'TH', 'FR'], [15], 4],\n   ['2024-03-15', '2024-04-15', '2024-05-15', '2024-07-15'])],\n [('last day monday', ['2024-01-01', ['MO'], [-1], 2], ['2024-09-30', '2025-03-31']),\n  ('first monday via 1..7',\n   ['2024-02-01', ['MO'], [1, 2, 3, 4, 5, 6, 7], 3],\n   ['2024-02-05', '2024-03-04', '2024-04-01']),\n  ('sunday first of month', ['2024-01-01', ['SU'], [1], 2], ['2024-09-01', '2024-12-01']),\n  ('tuesday 29th', ['2024-01-01', ['TU'], [29], 3], ['2024-10-29', '2025-04-29', '2025-07-29']),\n  ('weekday 15th',\n   ['2024-03-01', ['MO', 'TU', 'WE', 'TH', 'FR'], [15], 4],\n   ['2024-03-15', '2024-04-15', '2024-05-15', '2024-07-15']),\n  ('thursday the 13th', ['2025-01-01', ['TH'], [13], 2], ['2025-02-13', '2025-03-13']),\n  ('regression: friday the 13th',\n   ['2024-01-01', ['FR'], [13], 3],\n   ['2024-09-13', '2024-12-13', '2025-06-13']),\n  ('only bymonthday',\n   ['2024-01-10', [], [1, 15], 4],\n   ['2024-01-15', '2024-02-01', '2024-02-15', '2024-03-01'])],\n [('sunday first of month', ['2024-01-01', ['SU'], [1], 2], ['2024-09-01', '2024-12-01']),\n  ('tuesday 29th', ['2024-01-01', ['TU'], [29], 3], ['2024-10-29', '2025-04-29', '2025-07-29']),\n  ('weekday 15th',\n   ['2024-03-01', ['MO', 'TU', 'WE', 'TH', 'FR'], [15], 4],\n   ['2024-03-15', '2024-04-15', '2024-05-15', '2024-07-15']),\n  ('thursday the 13th', ['2025-01-01', ['TH'], [13], 2], ['2025-02-13', '2025-03-13']),\n  ('regression: friday the 13th',\n   ['2024-01-01', ['FR'], [13], 3],\n   ['2024-09-13', '2024-12-13', '2025-06-13']),\n  ('last sunday via -1..-7',\n   ['2024-01-01', ['SU'], [-1, -2, -3, -4, -5, -6, -7], 3],\n   ['2024-01-28', '2024-02-25', '2024-03-31']),\n  ('only bymonthday',\n   ['2024-01-10', [], [1, 15], 4],\n   ['2024-01-15', '2024-02-01', '2024-02-15', '2024-03-01'])],\n [('weekday 15th',\n   ['2024-03-01', ['MO', 'TU', 'WE', 'TH', 'FR'], [15], 4],\n   ['2024-03-15', '2024-04-15', '2024-05-15', '2024-07-15']),\n  ('thursday the 13th', ['2025-01-01', ['TH'], [13], 2], ['2025-02-13', '2025-03-13']),\n  ('regression: friday the 13th',\n   ['2024-01-01', ['FR'], [13], 3],\n   ['2024-09-13', '2024-12-13', '2025-06-13']),\n  ('last sunday via -1..-7',\n   ['2024-01-01', ['SU'], [-1, -2, -3, -4, -5, -6, -7], 3],\n   ['2024-01-28', '2024-02-25', '2024-03-31']),\n  ('only bymonthday',\n   ['2024-01-10', [], [1, 15], 4],\n   ['2024-01-15', '2024-02-01', '2024-02-15', '2024-03-01']),\n  ('only byday',\n   ['2024-01-01', ['SA', 'SU'], [], 4],\n   ['2024-01-06', '2024-01-07', '2024-01-13', '2024-01-14']),\n  ('last day monday', ['2024-01-01', ['MO'], [-1], 2], ['2024-09-30', '2025-03-31'])]]\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":"Stipulated, bounded recurrence-expansion model evaluated offline on explicit fixtures; it is not a complete iCalendar implementation and makes no claim of standards conformance. 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-calendar-recurrence-rules-monthly-byday-bymonthday-intersection-empty-filter","generated_at":"2026-09-29T14:49:23.025863+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Recurring calendar series are expanded into concrete instances for display, reminders and conflict checks.","root_cause":"An empty BYDAY list is treated as matching no weekday.","sha256":"38c60960630810b2341d92c4d559dfe06decb3ef4abcecbb90df2c4ea79da168","title":"Monthly BYDAY restricted by BYMONTHDAY (Friday the 13th): empty filter · 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":55.152,"exit_code":1,"observations":[{"actual":["2024-09-13","2024-12-13","2025-06-13"],"check":"regression: friday the 13th","expected":["2024-09-13","2024-12-13","2025-06-13"],"passed":true},{"actual":["2024-01-28","2024-02-25","2024-03-31"],"check":"last sunday via -1..-7","expected":["2024-01-28","2024-02-25","2024-03-31"],"passed":true},{"actual":[],"check":"only bymonthday","expected":["2024-01-15","2024-02-01","2024-02-15","2024-03-01"],"passed":false},{"actual":["2024-01-06","2024-01-07","2024-01-13","2024-01-14"],"check":"only byday","expected":["2024-01-06","2024-01-07","2024-01-13","2024-01-14"],"passed":true},{"actual":["2024-09-30","2025-03-31"],"check":"last day monday","expected":["2024-09-30","2025-03-31"],"passed":true},{"actual":["2024-02-05","2024-03-04","2024-04-01"],"check":"first monday via 1..7","expected":["2024-02-05","2024-03-04","2024-04-01"],"passed":true},{"actual":["2024-09-01","2024-12-01"],"check":"sunday first of month","expected":["2024-09-01","2024-12-01"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: friday the 13th\", \"actual\": [\"2024-09-13\", \"2024-12-13\", \"2025-06-13\"], \"expected\": [\"2024-09-13\", \"2024-12-13\", \"2025-06-13\"], \"passed\": true}, {\"check\": \"last sunday via -1..-7\", \"actual\": [\"2024-01-28\", \"2024-02-25\", \"2024-03-31\"], \"expected\": [\"2024-01-28\", \"2024-02-25\", \"2024-03-31\"], \"passed\": true}, {\"check\": \"only bymonthday\", \"actual\": [], \"expected\": [\"2024-01-15\", \"2024-02-01\", \"2024-02-15\", \"2024-03-01\"], \"passed\": false}, {\"check\": \"only byday\", \"actual\": [\"2024-01-06\", \"2024-01-07\", \"2024-01-13\", \"2024-01-14\"], \"expected\": [\"2024-01-06\", \"2024-01-07\", \"2024-01-13\", \"2024-01-14\"], \"passed\": true}, {\"check\": \"last day monday\", \"actual\": [\"2024-09-30\", \"2025-03-31\"], \"expected\": [\"2024-09-30\", \"2025-03-31\"], \"passed\": true}, {\"check\": \"first monday via 1..7\", \"actual\": [\"2024-02-05\", \"2024-03-04\", \"2024-04-01\"], \"expected\": [\"2024-02-05\", \"2024-03-04\", \"2024-04-01\"], \"passed\": true}, {\"check\": \"sunday first of month\", \"actual\": [\"2024-09-01\", \"2024-12-01\"], \"expected\": [\"2024-09-01\", \"2024-12-01\"], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":55.022,"exit_code":1,"observations":[{"actual":["2024-09-13","2024-12-13","2025-06-13"],"check":"regression: friday the 13th","expected":["2024-09-13","2024-12-13","2025-06-13"],"passed":true},{"actual":["2024-01-28","2024-02-25","2024-03-31"],"check":"last sunday via -1..-7","expected":["2024-01-28","2024-02-25","2024-03-31"],"passed":true},{"actual":[],"check":"only bymonthday","expected":["2024-01-15","2024-02-01","2024-02-15","2024-03-01"],"passed":false},{"actual":["2024-01-06","2024-01-07","2024-01-13","2024-01-14"],"check":"only byday","expected":["2024-01-06","2024-01-07","2024-01-13","2024-01-14"],"passed":true},{"actual":["2024-09-30","2025-03-31"],"check":"last day monday","expected":["2024-09-30","2025-03-31"],"passed":true},{"actual":["2024-02-05","2024-03-04","2024-04-01"],"check":"first monday via 1..7","expected":["2024-02-05","2024-03-04","2024-04-01"],"passed":true},{"actual":["2024-09-01","2024-12-01"],"check":"sunday first of month","expected":["2024-09-01","2024-12-01"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: friday the 13th\", \"actual\": [\"2024-09-13\", \"2024-12-13\", \"2025-06-13\"], \"expected\": [\"2024-09-13\", \"2024-12-13\", \"2025-06-13\"], \"passed\": true}, {\"check\": \"last sunday via -1..-7\", \"actual\": [\"2024-01-28\", \"2024-02-25\", \"2024-03-31\"], \"expected\": [\"2024-01-28\", \"2024-02-25\", \"2024-03-31\"], \"passed\": true}, {\"check\": \"only bymonthday\", \"actual\": [], \"expected\": [\"2024-01-15\", \"2024-02-01\", \"2024-02-15\", \"2024-03-01\"], \"passed\": false}, {\"check\": \"only byday\", \"actual\": [\"2024-01-06\", \"2024-01-07\", \"2024-01-13\", \"2024-01-14\"], \"expected\": [\"2024-01-06\", \"2024-01-07\", \"2024-01-13\", \"2024-01-14\"], \"passed\": true}, {\"check\": \"last day monday\", \"actual\": [\"2024-09-30\", \"2025-03-31\"], \"expected\": [\"2024-09-30\", \"2025-03-31\"], \"passed\": true}, {\"check\": \"first monday via 1..7\", \"actual\": [\"2024-02-05\", \"2024-03-04\", \"2024-04-01\"], \"expected\": [\"2024-02-05\", \"2024-03-04\", \"2024-04-01\"], \"passed\": true}, {\"check\": \"sunday first of month\", \"actual\": [\"2024-09-01\", \"2024-12-01\"], \"expected\": [\"2024-09-01\", \"2024-12-01\"], \"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."}}