{"abstract":"A deadline landing on a weekend is moved earlier, shortening the period.","category":"Legal deadline computation","checks":7,"contract":"A period of months runs to the same-numbered day of the target month. Stipulated: if the trigger is the last day of its month the period ends on the last day of the target month; otherwise a missing day (e.g. the 30th of February) becomes the last day of the target month. A closed last day (Saturday, Sunday, listed holiday) moves forward to the next open day, even into the next month.","evaluation_group":"w2-legal-deadline-computation-month-period-end-of-month","failed_approach":"The partial repair `e = d; while e.weekday() >= 5 or e in hol:;     e += dt.timedelta(days=1); if e.month != d.month:;     e = d;     while e.weekday() >= 5 or e in hol:;         e -= dt.timedelta(days=1); d = e` applies a modified-following convention borrowed from finance, which moves month-end weekend deadlines backward.","family":"w2-legal-deadline-computation-month-period-end-of-month-roll-convention","id":"FA-77411","implementations":{"attempt":{"sha256":"b7783535edc271ef9bf7208230ae31e226b5105c1699cc46f8a78d61b43d381a","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport datetime as dt\nimport calendar\nN = 1\nobservations = []\ndef solve(trigger, months, holidays):\n    t = dt.date.fromisoformat(trigger)\n    hol = {dt.date.fromisoformat(x) for x in holidays}\n    mi = t.month - 1 + months\n    y, m = t.year + mi // 12, mi % 12 + 1\n    dim = calendar.monthrange(y, m)[1]\n    eom = t.day == calendar.monthrange(t.year, t.month)[1]\n    day = dim if eom else min(t.day, dim)\n    d = dt.date(y, m, 1) + dt.timedelta(days=day - 1)\n    e = d\n    while e.weekday() >= 5 or e in hol:\n        e += dt.timedelta(days=1)\n    if e.month != d.month:\n        e = d\n        while e.weekday() >= 5 or e in hol:\n            e -= dt.timedelta(days=1)\n    d = e\n    return d.isoformat()\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression: jan 30 plus one month', ['2023-01-30', 1, []], '2023-02-28'),\n  ('month end april to may',\n   ['2024-04-30',\n    1,\n    ['2024-01-01',\n     '2024-01-15',\n     '2024-02-19',\n     '2024-05-27',\n     '2024-06-19',\n     '2024-07-04',\n     '2024-09-02',\n     '2024-10-14',\n     '2024-11-11',\n     '2024-11-28',\n     '2024-12-25']],\n   '2024-05-31'),\n  ('month end feb common', ['2023-02-28', 1, []], '2023-03-31'),\n  ('month end feb leap to march',\n   ['2024-02-29',\n    1,\n    ['2024-01-01',\n     '2024-01-15',\n     '2024-02-19',\n     '2024-05-27',\n     '2024-06-19',\n     '2024-07-04',\n     '2024-09-02',\n     '2024-10-14',\n     '2024-11-11',\n     '2024-11-28',\n     '2024-12-25']],\n   '2024-04-01'),\n  ('lands saturday month end',\n   ['2024-05-31',\n    3,\n    ['2024-01-01',\n     '2024-01-15',\n     '2024-02-19',\n     '2024-05-27',\n     '2024-06-19',\n     '2024-07-04',\n     '2024-09-02',\n     '2024-10-14',\n     '2024-11-11',\n     '2024-11-28',\n     '2024-12-25']],\n   '2024-09-03'),\n  ('lands sunday mid month',\n   ['2024-01-14',\n    6,\n    ['2024-01-01',\n     '2024-01-15',\n     '2024-02-19',\n     '2024-05-27',\n     '2024-06-19',\n     '2024-07-04',\n     '2024-09-02',\n     '2024-10-14',\n     '2024-11-11',\n     '2024-11-28',\n     '2024-12-25']],\n   '2024-07-15'),\n  ('twelve months from leap day', ['2024-02-29', 12, []], '2025-02-28')],\n [('month end feb common', ['2023-02-28', 1, []], '2023-03-31'),\n  ('month end feb leap to march',\n   ['2024-02-29',\n    1,\n    ['2024-01-01',\n     '2024-01-15',\n     '2024-02-19',\n     '2024-05-27',\n     '2024-06-19',\n     '2024-07-04',\n     '2024-09-02',\n     '2024-10-14',\n     '2024-11-11',\n     '2024-11-28',\n     '2024-12-25']],\n   '2024-04-01'),\n  ('lands saturday month end',\n   ['2024-05-31',\n    3,\n    ['2024-01-01',\n     '2024-01-15',\n     '2024-02-19',\n     '2024-05-27',\n     '2024-06-19',\n     '2024-07-04',\n     '2024-09-02',\n     '2024-10-14',\n     '2024-11-11',\n     '2024-11-28',\n     '2024-12-25']],\n   '2024-09-03'),\n  ('lands sunday mid month',\n   ['2024-01-14',\n    6,\n    ['2024-01-01',\n     '2024-01-15',\n     '2024-02-19',\n     '2024-05-27',\n     '2024-06-19',\n     '2024-07-04',\n     '2024-09-02',\n     '2024-10-14',\n     '2024-11-11',\n     '2024-11-28',\n     '2024-12-25']],\n   '2024-07-15'),\n  ('twelve months from leap day', ['2024-02-29', 12, []], '2025-02-28'),\n  ('lands on holiday',\n   ['2024-04-04',\n    3,\n    ['2024-01-01',\n     '2024-01-15',\n     '2024-02-19',\n     '2024-05-27',\n     '2024-06-19',\n     '2024-07-04',\n     '2024-09-02',\n     '2024-10-14',\n     '2024-11-11',\n     '2024-11-28',\n     '2024-12-25']],\n   '2024-07-05'),\n  ('jan 31 plus one',\n   ['2024-01-31',\n    1,\n    ['2024-01-01',\n     '2024-01-15',\n     '2024-02-19',\n     '2024-05-27',\n     '2024-06-19',\n     '2024-07-04',\n     '2024-09-02',\n     '2024-10-14',\n     '2024-11-11',\n     '2024-11-28',\n     '2024-12-25']],\n   '2024-02-29')],\n [('lands saturday month end',\n   ['2024-05-31',\n    3,\n    ['2024-01-01',\n     '2024-01-15',\n     '2024-02-19',\n     '2024-05-27',\n     '2024-06-19',\n     '2024-07-04',\n     '2024-09-02',\n     '2024-10-14',\n     '2024-11-11',\n     '2024-11-28',\n     '2024-12-25']],\n   '2024-09-03'),\n  ('lands sunday mid month',\n   ['2024-01-14',\n    6,\n    ['2024-01-01',\n     '2024-01-15',\n     '2024-02-19',\n     '2024-05-27',\n     '2024-06-19',\n     '2024-07-04',\n     '2024-09-02',\n     '2024-10-14',\n     '2024-11-11',\n     '2024-11-28',\n     '2024-12-25']],\n   '2024-07-15'),\n  ('twelve months from leap day', ['2024-02-29', 12, []], '2025-02-28'),\n  ('lands on holiday',\n   ['2024-04-04',\n    3,\n    ['2024-01-01',\n     '2024-01-15',\n     '2024-02-19',\n     '2024-05-27',\n     '2024-06-19',\n     '2024-07-04',\n     '2024-09-02',\n     '2024-10-14',\n     '2024-11-11',\n     '2024-11-28',\n     '2024-12-25']],\n   '2024-07-05'),\n  ('jan 31 plus one',\n   ['2024-01-31',\n    1,\n    ['2024-01-01',\n     '2024-01-15',\n     '2024-02-19',\n     '2024-05-27',\n     '2024-06-19',\n     '2024-07-04',\n     '2024-09-02',\n     '2024-10-14',\n     '2024-11-11',\n     '2024-11-28',\n     '2024-12-25']],\n   '2024-02-29'),\n  ('mid month simple',\n   ['2024-03-12',\n    2,\n    ['2024-01-01',\n     '2024-01-15',\n     '2024-02-19',\n     '2024-05-27',\n     '2024-06-19',\n     '2024-07-04',\n     '2024-09-02',\n     '2024-10-14',\n     '2024-11-11',\n     '2024-11-28',\n     '2024-12-25']],\n   '2024-05-13'),\n  ('aug 31 to nov 30 saturday',\n   ['2024-08-31',\n    3,\n    ['2024-01-01',\n     '2024-01-15',\n     '2024-02-19',\n     '2024-05-27',\n     '2024-06-19',\n     '2024-07-04',\n     '2024-09-02',\n     '2024-10-14',\n     '2024-11-11',\n     '2024-11-28',\n     '2024-12-25']],\n   '2024-12-02')],\n [('twelve months from leap day', ['2024-02-29', 12, []], '2025-02-28'),\n  ('lands on holiday',\n   ['2024-04-04',\n    3,\n    ['2024-01-01',\n     '2024-01-15',\n     '2024-02-19',\n     '2024-05-27',\n     '2024-06-19',\n     '2024-07-04',\n     '2024-09-02',\n     '2024-10-14',\n     '2024-11-11',\n     '2024-11-28',\n     '2024-12-25']],\n   '2024-07-05'),\n  ('jan 31 plus one',\n   ['2024-01-31',\n    1,\n    ['2024-01-01',\n     '2024-01-15',\n     '2024-02-19',\n     '2024-05-27',\n     '2024-06-19',\n     '2024-07-04',\n     '2024-09-02',\n     '2024-10-14',\n     '2024-11-11',\n     '2024-11-28',\n     '2024-12-25']],\n   '2024-02-29'),\n  ('mid month simple',\n   ['2024-03-12',\n    2,\n    ['2024-01-01',\n     '2024-01-15',\n     '2024-02-19',\n     '2024-05-27',\n     '2024-06-19',\n     '2024-07-04',\n     '2024-09-02',\n     '2024-10-14',\n     '2024-11-11',\n     '2024-11-28',\n     '2024-12-25']],\n   '2024-05-13'),\n  ('aug 31 to nov 30 saturday',\n   ['2024-08-31',\n    3,\n    ['2024-01-01',\n     '2024-01-15',\n     '2024-02-19',\n     '2024-05-27',\n     '2024-06-19',\n     '2024-07-04',\n     '2024-09-02',\n     '2024-10-14',\n     '2024-11-11',\n     '2024-11-28',\n     '2024-12-25']],\n   '2024-12-02'),\n  ('day 29 two months',\n   ['2024-01-29',\n    2,\n    ['2024-01-01',\n     '2024-01-15',\n     '2024-02-19',\n     '2024-05-27',\n     '2024-06-19',\n     '2024-07-04',\n     '2024-09-02',\n     '2024-10-14',\n     '2024-11-11',\n     '2024-11-28',\n     '2024-12-25']],\n   '2024-03-29'),\n  ('day 30 to may',\n   ['2024-01-30',\n    4,\n    ['2024-01-01',\n     '2024-01-15',\n     '2024-02-19',\n     '2024-05-27',\n     '2024-06-19',\n     '2024-07-04',\n     '2024-09-02',\n     '2024-10-14',\n     '2024-11-11',\n     '2024-11-28',\n     '2024-12-25']],\n   '2024-05-30')],\n [('jan 31 plus one',\n   ['2024-01-31',\n    1,\n    ['2024-01-01',\n     '2024-01-15',\n     '2024-02-19',\n     '2024-05-27',\n     '2024-06-19',\n     '2024-07-04',\n     '2024-09-02',\n     '2024-10-14',\n     '2024-11-11',\n     '2024-11-28',\n     '2024-12-25']],\n   '2024-02-29'),\n  ('mid month simple',\n   ['2024-03-12',\n    2,\n    ['2024-01-01',\n     '2024-01-15',\n     '2024-02-19',\n     '2024-05-27',\n     '2024-06-19',\n     '2024-07-04',\n     '2024-09-02',\n     '2024-10-14',\n     '2024-11-11',\n     '2024-11-28',\n     '2024-12-25']],\n   '2024-05-13'),\n  ('aug 31 to nov 30 saturday',\n   ['2024-08-31',\n    3,\n    ['2024-01-01',\n     '2024-01-15',\n     '2024-02-19',\n     '2024-05-27',\n     '2024-06-19',\n     '2024-07-04',\n     '2024-09-02',\n     '2024-10-14',\n     '2024-11-11',\n     '2024-11-28',\n     '2024-12-25']],\n   '2024-12-02'),\n  ('day 29 two months',\n   ['2024-01-29',\n    2,\n    ['2024-01-01',\n     '2024-01-15',\n     '2024-02-19',\n     '2024-05-27',\n     '2024-06-19',\n     '2024-07-04',\n     '2024-09-02',\n     '2024-10-14',\n     '2024-11-11',\n     '2024-11-28',\n     '2024-12-25']],\n   '2024-03-29'),\n  ('day 30 to may',\n   ['2024-01-30',\n    4,\n    ['2024-01-01',\n     '2024-01-15',\n     '2024-02-19',\n     '2024-05-27',\n     '2024-06-19',\n     '2024-07-04',\n     '2024-09-02',\n     '2024-10-14',\n     '2024-11-11',\n     '2024-11-28',\n     '2024-12-25']],\n   '2024-05-30'),\n  ('regression: jan 30 plus one month', ['2023-01-30', 1, []], '2023-02-28'),\n  ('month end april to may',\n   ['2024-04-30',\n    1,\n    ['2024-01-01',\n     '2024-01-15',\n     '2024-02-19',\n     '2024-05-27',\n     '2024-06-19',\n     '2024-07-04',\n     '2024-09-02',\n     '2024-10-14',\n     '2024-11-11',\n     '2024-11-28',\n     '2024-12-25']],\n   '2024-05-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":"c34b245c6829e72fc8e207ac2d1e4bf6918a8f83f0dc85e7e2937690928fc71b","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport datetime as dt\nimport calendar\nN = 1\nobservations = []\ndef solve(trigger, months, holidays):\n    t = dt.date.fromisoformat(trigger)\n    hol = {dt.date.fromisoformat(x) for x in holidays}\n    mi = t.month - 1 + months\n    y, m = t.year + mi // 12, mi % 12 + 1\n    dim = calendar.monthrange(y, m)[1]\n    eom = t.day == calendar.monthrange(t.year, t.month)[1]\n    day = dim if eom else min(t.day, dim)\n    d = dt.date(y, m, 1) + dt.timedelta(days=day - 1)\n    while d.weekday() >= 5 or d in hol:\n        d -= dt.timedelta(days=1)\n    return d.isoformat()\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression: jan 30 plus one month', ['2023-01-30', 1, []], '2023-02-28'),\n  ('month end april to may',\n   ['2024-04-30',\n    1,\n    ['2024-01-01',\n     '2024-01-15',\n     '2024-02-19',\n     '2024-05-27',\n     '2024-06-19',\n     '2024-07-04',\n     '2024-09-02',\n     '2024-10-14',\n     '2024-11-11',\n     '2024-11-28',\n     '2024-12-25']],\n   '2024-05-31'),\n  ('month end feb common', ['2023-02-28', 1, []], '2023-03-31'),\n  ('month end feb leap to march',\n   ['2024-02-29',\n    1,\n    ['2024-01-01',\n     '2024-01-15',\n     '2024-02-19',\n     '2024-05-27',\n     '2024-06-19',\n     '2024-07-04',\n     '2024-09-02',\n     '2024-10-14',\n     '2024-11-11',\n     '2024-11-28',\n     '2024-12-25']],\n   '2024-04-01'),\n  ('lands saturday month end',\n   ['2024-05-31',\n    3,\n    ['2024-01-01',\n     '2024-01-15',\n     '2024-02-19',\n     '2024-05-27',\n     '2024-06-19',\n     '2024-07-04',\n     '2024-09-02',\n     '2024-10-14',\n     '2024-11-11',\n     '2024-11-28',\n     '2024-12-25']],\n   '2024-09-03'),\n  ('lands sunday mid month',\n   ['2024-01-14',\n    6,\n    ['2024-01-01',\n     '2024-01-15',\n     '2024-02-19',\n     '2024-05-27',\n     '2024-06-19',\n     '2024-07-04',\n     '2024-09-02',\n     '2024-10-14',\n     '2024-11-11',\n     '2024-11-28',\n     '2024-12-25']],\n   '2024-07-15'),\n  ('twelve months from leap day', ['2024-02-29', 12, []], '2025-02-28')],\n [('month end feb common', ['2023-02-28', 1, []], '2023-03-31'),\n  ('month end feb leap to march',\n   ['2024-02-29',\n    1,\n    ['2024-01-01',\n     '2024-01-15',\n     '2024-02-19',\n     '2024-05-27',\n     '2024-06-19',\n     '2024-07-04',\n     '2024-09-02',\n     '2024-10-14',\n     '2024-11-11',\n     '2024-11-28',\n     '2024-12-25']],\n   '2024-04-01'),\n  ('lands saturday month end',\n   ['2024-05-31',\n    3,\n    ['2024-01-01',\n     '2024-01-15',\n     '2024-02-19',\n     '2024-05-27',\n     '2024-06-19',\n     '2024-07-04',\n     '2024-09-02',\n     '2024-10-14',\n     '2024-11-11',\n     '2024-11-28',\n     '2024-12-25']],\n   '2024-09-03'),\n  ('lands sunday mid month',\n   ['2024-01-14',\n    6,\n    ['2024-01-01',\n     '2024-01-15',\n     '2024-02-19',\n     '2024-05-27',\n     '2024-06-19',\n     '2024-07-04',\n     '2024-09-02',\n     '2024-10-14',\n     '2024-11-11',\n     '2024-11-28',\n     '2024-12-25']],\n   '2024-07-15'),\n  ('twelve months from leap day', ['2024-02-29', 12, []], '2025-02-28'),\n  ('lands on holiday',\n   ['2024-04-04',\n    3,\n    ['2024-01-01',\n     '2024-01-15',\n     '2024-02-19',\n     '2024-05-27',\n     '2024-06-19',\n     '2024-07-04',\n     '2024-09-02',\n     '2024-10-14',\n     '2024-11-11',\n     '2024-11-28',\n     '2024-12-25']],\n   '2024-07-05'),\n  ('jan 31 plus one',\n   ['2024-01-31',\n    1,\n    ['2024-01-01',\n     '2024-01-15',\n     '2024-02-19',\n     '2024-05-27',\n     '2024-06-19',\n     '2024-07-04',\n     '2024-09-02',\n     '2024-10-14',\n     '2024-11-11',\n     '2024-11-28',\n     '2024-12-25']],\n   '2024-02-29')],\n [('lands saturday month end',\n   ['2024-05-31',\n    3,\n    ['2024-01-01',\n     '2024-01-15',\n     '2024-02-19',\n     '2024-05-27',\n     '2024-06-19',\n     '2024-07-04',\n     '2024-09-02',\n     '2024-10-14',\n     '2024-11-11',\n     '2024-11-28',\n     '2024-12-25']],\n   '2024-09-03'),\n  ('lands sunday mid month',\n   ['2024-01-14',\n    6,\n    ['2024-01-01',\n     '2024-01-15',\n     '2024-02-19',\n     '2024-05-27',\n     '2024-06-19',\n     '2024-07-04',\n     '2024-09-02',\n     '2024-10-14',\n     '2024-11-11',\n     '2024-11-28',\n     '2024-12-25']],\n   '2024-07-15'),\n  ('twelve months from leap day', ['2024-02-29', 12, []], '2025-02-28'),\n  ('lands on holiday',\n   ['2024-04-04',\n    3,\n    ['2024-01-01',\n     '2024-01-15',\n     '2024-02-19',\n     '2024-05-27',\n     '2024-06-19',\n     '2024-07-04',\n     '2024-09-02',\n     '2024-10-14',\n     '2024-11-11',\n     '2024-11-28',\n     '2024-12-25']],\n   '2024-07-05'),\n  ('jan 31 plus one',\n   ['2024-01-31',\n    1,\n    ['2024-01-01',\n     '2024-01-15',\n     '2024-02-19',\n     '2024-05-27',\n     '2024-06-19',\n     '2024-07-04',\n     '2024-09-02',\n     '2024-10-14',\n     '2024-11-11',\n     '2024-11-28',\n     '2024-12-25']],\n   '2024-02-29'),\n  ('mid month simple',\n   ['2024-03-12',\n    2,\n    ['2024-01-01',\n     '2024-01-15',\n     '2024-02-19',\n     '2024-05-27',\n     '2024-06-19',\n     '2024-07-04',\n     '2024-09-02',\n     '2024-10-14',\n     '2024-11-11',\n     '2024-11-28',\n     '2024-12-25']],\n   '2024-05-13'),\n  ('aug 31 to nov 30 saturday',\n   ['2024-08-31',\n    3,\n    ['2024-01-01',\n     '2024-01-15',\n     '2024-02-19',\n     '2024-05-27',\n     '2024-06-19',\n     '2024-07-04',\n     '2024-09-02',\n     '2024-10-14',\n     '2024-11-11',\n     '2024-11-28',\n     '2024-12-25']],\n   '2024-12-02')],\n [('twelve months from leap day', ['2024-02-29', 12, []], '2025-02-28'),\n  ('lands on holiday',\n   ['2024-04-04',\n    3,\n    ['2024-01-01',\n     '2024-01-15',\n     '2024-02-19',\n     '2024-05-27',\n     '2024-06-19',\n     '2024-07-04',\n     '2024-09-02',\n     '2024-10-14',\n     '2024-11-11',\n     '2024-11-28',\n     '2024-12-25']],\n   '2024-07-05'),\n  ('jan 31 plus one',\n   ['2024-01-31',\n    1,\n    ['2024-01-01',\n     '2024-01-15',\n     '2024-02-19',\n     '2024-05-27',\n     '2024-06-19',\n     '2024-07-04',\n     '2024-09-02',\n     '2024-10-14',\n     '2024-11-11',\n     '2024-11-28',\n     '2024-12-25']],\n   '2024-02-29'),\n  ('mid month simple',\n   ['2024-03-12',\n    2,\n    ['2024-01-01',\n     '2024-01-15',\n     '2024-02-19',\n     '2024-05-27',\n     '2024-06-19',\n     '2024-07-04',\n     '2024-09-02',\n     '2024-10-14',\n     '2024-11-11',\n     '2024-11-28',\n     '2024-12-25']],\n   '2024-05-13'),\n  ('aug 31 to nov 30 saturday',\n   ['2024-08-31',\n    3,\n    ['2024-01-01',\n     '2024-01-15',\n     '2024-02-19',\n     '2024-05-27',\n     '2024-06-19',\n     '2024-07-04',\n     '2024-09-02',\n     '2024-10-14',\n     '2024-11-11',\n     '2024-11-28',\n     '2024-12-25']],\n   '2024-12-02'),\n  ('day 29 two months',\n   ['2024-01-29',\n    2,\n    ['2024-01-01',\n     '2024-01-15',\n     '2024-02-19',\n     '2024-05-27',\n     '2024-06-19',\n     '2024-07-04',\n     '2024-09-02',\n     '2024-10-14',\n     '2024-11-11',\n     '2024-11-28',\n     '2024-12-25']],\n   '2024-03-29'),\n  ('day 30 to may',\n   ['2024-01-30',\n    4,\n    ['2024-01-01',\n     '2024-01-15',\n     '2024-02-19',\n     '2024-05-27',\n     '2024-06-19',\n     '2024-07-04',\n     '2024-09-02',\n     '2024-10-14',\n     '2024-11-11',\n     '2024-11-28',\n     '2024-12-25']],\n   '2024-05-30')],\n [('jan 31 plus one',\n   ['2024-01-31',\n    1,\n    ['2024-01-01',\n     '2024-01-15',\n     '2024-02-19',\n     '2024-05-27',\n     '2024-06-19',\n     '2024-07-04',\n     '2024-09-02',\n     '2024-10-14',\n     '2024-11-11',\n     '2024-11-28',\n     '2024-12-25']],\n   '2024-02-29'),\n  ('mid month simple',\n   ['2024-03-12',\n    2,\n    ['2024-01-01',\n     '2024-01-15',\n     '2024-02-19',\n     '2024-05-27',\n     '2024-06-19',\n     '2024-07-04',\n     '2024-09-02',\n     '2024-10-14',\n     '2024-11-11',\n     '2024-11-28',\n     '2024-12-25']],\n   '2024-05-13'),\n  ('aug 31 to nov 30 saturday',\n   ['2024-08-31',\n    3,\n    ['2024-01-01',\n     '2024-01-15',\n     '2024-02-19',\n     '2024-05-27',\n     '2024-06-19',\n     '2024-07-04',\n     '2024-09-02',\n     '2024-10-14',\n     '2024-11-11',\n     '2024-11-28',\n     '2024-12-25']],\n   '2024-12-02'),\n  ('day 29 two months',\n   ['2024-01-29',\n    2,\n    ['2024-01-01',\n     '2024-01-15',\n     '2024-02-19',\n     '2024-05-27',\n     '2024-06-19',\n     '2024-07-04',\n     '2024-09-02',\n     '2024-10-14',\n     '2024-11-11',\n     '2024-11-28',\n     '2024-12-25']],\n   '2024-03-29'),\n  ('day 30 to may',\n   ['2024-01-30',\n    4,\n    ['2024-01-01',\n     '2024-01-15',\n     '2024-02-19',\n     '2024-05-27',\n     '2024-06-19',\n     '2024-07-04',\n     '2024-09-02',\n     '2024-10-14',\n     '2024-11-11',\n     '2024-11-28',\n     '2024-12-25']],\n   '2024-05-30'),\n  ('regression: jan 30 plus one month', ['2023-01-30', 1, []], '2023-02-28'),\n  ('month end april to may',\n   ['2024-04-30',\n    1,\n    ['2024-01-01',\n     '2024-01-15',\n     '2024-02-19',\n     '2024-05-27',\n     '2024-06-19',\n     '2024-07-04',\n     '2024-09-02',\n     '2024-10-14',\n     '2024-11-11',\n     '2024-11-28',\n     '2024-12-25']],\n   '2024-05-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"},"fixed":{"sha256":"c6da07f52cbde07d38227f736a878537cf23730703f4b3b0b398231b161bfc63","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport datetime as dt\nimport calendar\nN = 1\nobservations = []\ndef solve(trigger, months, holidays):\n    t = dt.date.fromisoformat(trigger)\n    hol = {dt.date.fromisoformat(x) for x in holidays}\n    mi = t.month - 1 + months\n    y, m = t.year + mi // 12, mi % 12 + 1\n    dim = calendar.monthrange(y, m)[1]\n    eom = t.day == calendar.monthrange(t.year, t.month)[1]\n    day = dim if eom else min(t.day, dim)\n    d = dt.date(y, m, 1) + dt.timedelta(days=day - 1)\n    while d.weekday() >= 5 or d in hol:\n        d += dt.timedelta(days=1)\n    return d.isoformat()\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression: jan 30 plus one month', ['2023-01-30', 1, []], '2023-02-28'),\n  ('month end april to may',\n   ['2024-04-30',\n    1,\n    ['2024-01-01',\n     '2024-01-15',\n     '2024-02-19',\n     '2024-05-27',\n     '2024-06-19',\n     '2024-07-04',\n     '2024-09-02',\n     '2024-10-14',\n     '2024-11-11',\n     '2024-11-28',\n     '2024-12-25']],\n   '2024-05-31'),\n  ('month end feb common', ['2023-02-28', 1, []], '2023-03-31'),\n  ('month end feb leap to march',\n   ['2024-02-29',\n    1,\n    ['2024-01-01',\n     '2024-01-15',\n     '2024-02-19',\n     '2024-05-27',\n     '2024-06-19',\n     '2024-07-04',\n     '2024-09-02',\n     '2024-10-14',\n     '2024-11-11',\n     '2024-11-28',\n     '2024-12-25']],\n   '2024-04-01'),\n  ('lands saturday month end',\n   ['2024-05-31',\n    3,\n    ['2024-01-01',\n     '2024-01-15',\n     '2024-02-19',\n     '2024-05-27',\n     '2024-06-19',\n     '2024-07-04',\n     '2024-09-02',\n     '2024-10-14',\n     '2024-11-11',\n     '2024-11-28',\n     '2024-12-25']],\n   '2024-09-03'),\n  ('lands sunday mid month',\n   ['2024-01-14',\n    6,\n    ['2024-01-01',\n     '2024-01-15',\n     '2024-02-19',\n     '2024-05-27',\n     '2024-06-19',\n     '2024-07-04',\n     '2024-09-02',\n     '2024-10-14',\n     '2024-11-11',\n     '2024-11-28',\n     '2024-12-25']],\n   '2024-07-15'),\n  ('twelve months from leap day', ['2024-02-29', 12, []], '2025-02-28')],\n [('month end feb common', ['2023-02-28', 1, []], '2023-03-31'),\n  ('month end feb leap to march',\n   ['2024-02-29',\n    1,\n    ['2024-01-01',\n     '2024-01-15',\n     '2024-02-19',\n     '2024-05-27',\n     '2024-06-19',\n     '2024-07-04',\n     '2024-09-02',\n     '2024-10-14',\n     '2024-11-11',\n     '2024-11-28',\n     '2024-12-25']],\n   '2024-04-01'),\n  ('lands saturday month end',\n   ['2024-05-31',\n    3,\n    ['2024-01-01',\n     '2024-01-15',\n     '2024-02-19',\n     '2024-05-27',\n     '2024-06-19',\n     '2024-07-04',\n     '2024-09-02',\n     '2024-10-14',\n     '2024-11-11',\n     '2024-11-28',\n     '2024-12-25']],\n   '2024-09-03'),\n  ('lands sunday mid month',\n   ['2024-01-14',\n    6,\n    ['2024-01-01',\n     '2024-01-15',\n     '2024-02-19',\n     '2024-05-27',\n     '2024-06-19',\n     '2024-07-04',\n     '2024-09-02',\n     '2024-10-14',\n     '2024-11-11',\n     '2024-11-28',\n     '2024-12-25']],\n   '2024-07-15'),\n  ('twelve months from leap day', ['2024-02-29', 12, []], '2025-02-28'),\n  ('lands on holiday',\n   ['2024-04-04',\n    3,\n    ['2024-01-01',\n     '2024-01-15',\n     '2024-02-19',\n     '2024-05-27',\n     '2024-06-19',\n     '2024-07-04',\n     '2024-09-02',\n     '2024-10-14',\n     '2024-11-11',\n     '2024-11-28',\n     '2024-12-25']],\n   '2024-07-05'),\n  ('jan 31 plus one',\n   ['2024-01-31',\n    1,\n    ['2024-01-01',\n     '2024-01-15',\n     '2024-02-19',\n     '2024-05-27',\n     '2024-06-19',\n     '2024-07-04',\n     '2024-09-02',\n     '2024-10-14',\n     '2024-11-11',\n     '2024-11-28',\n     '2024-12-25']],\n   '2024-02-29')],\n [('lands saturday month end',\n   ['2024-05-31',\n    3,\n    ['2024-01-01',\n     '2024-01-15',\n     '2024-02-19',\n     '2024-05-27',\n     '2024-06-19',\n     '2024-07-04',\n     '2024-09-02',\n     '2024-10-14',\n     '2024-11-11',\n     '2024-11-28',\n     '2024-12-25']],\n   '2024-09-03'),\n  ('lands sunday mid month',\n   ['2024-01-14',\n    6,\n    ['2024-01-01',\n     '2024-01-15',\n     '2024-02-19',\n     '2024-05-27',\n     '2024-06-19',\n     '2024-07-04',\n     '2024-09-02',\n     '2024-10-14',\n     '2024-11-11',\n     '2024-11-28',\n     '2024-12-25']],\n   '2024-07-15'),\n  ('twelve months from leap day', ['2024-02-29', 12, []], '2025-02-28'),\n  ('lands on holiday',\n   ['2024-04-04',\n    3,\n    ['2024-01-01',\n     '2024-01-15',\n     '2024-02-19',\n     '2024-05-27',\n     '2024-06-19',\n     '2024-07-04',\n     '2024-09-02',\n     '2024-10-14',\n     '2024-11-11',\n     '2024-11-28',\n     '2024-12-25']],\n   '2024-07-05'),\n  ('jan 31 plus one',\n   ['2024-01-31',\n    1,\n    ['2024-01-01',\n     '2024-01-15',\n     '2024-02-19',\n     '2024-05-27',\n     '2024-06-19',\n     '2024-07-04',\n     '2024-09-02',\n     '2024-10-14',\n     '2024-11-11',\n     '2024-11-28',\n     '2024-12-25']],\n   '2024-02-29'),\n  ('mid month simple',\n   ['2024-03-12',\n    2,\n    ['2024-01-01',\n     '2024-01-15',\n     '2024-02-19',\n     '2024-05-27',\n     '2024-06-19',\n     '2024-07-04',\n     '2024-09-02',\n     '2024-10-14',\n     '2024-11-11',\n     '2024-11-28',\n     '2024-12-25']],\n   '2024-05-13'),\n  ('aug 31 to nov 30 saturday',\n   ['2024-08-31',\n    3,\n    ['2024-01-01',\n     '2024-01-15',\n     '2024-02-19',\n     '2024-05-27',\n     '2024-06-19',\n     '2024-07-04',\n     '2024-09-02',\n     '2024-10-14',\n     '2024-11-11',\n     '2024-11-28',\n     '2024-12-25']],\n   '2024-12-02')],\n [('twelve months from leap day', ['2024-02-29', 12, []], '2025-02-28'),\n  ('lands on holiday',\n   ['2024-04-04',\n    3,\n    ['2024-01-01',\n     '2024-01-15',\n     '2024-02-19',\n     '2024-05-27',\n     '2024-06-19',\n     '2024-07-04',\n     '2024-09-02',\n     '2024-10-14',\n     '2024-11-11',\n     '2024-11-28',\n     '2024-12-25']],\n   '2024-07-05'),\n  ('jan 31 plus one',\n   ['2024-01-31',\n    1,\n    ['2024-01-01',\n     '2024-01-15',\n     '2024-02-19',\n     '2024-05-27',\n     '2024-06-19',\n     '2024-07-04',\n     '2024-09-02',\n     '2024-10-14',\n     '2024-11-11',\n     '2024-11-28',\n     '2024-12-25']],\n   '2024-02-29'),\n  ('mid month simple',\n   ['2024-03-12',\n    2,\n    ['2024-01-01',\n     '2024-01-15',\n     '2024-02-19',\n     '2024-05-27',\n     '2024-06-19',\n     '2024-07-04',\n     '2024-09-02',\n     '2024-10-14',\n     '2024-11-11',\n     '2024-11-28',\n     '2024-12-25']],\n   '2024-05-13'),\n  ('aug 31 to nov 30 saturday',\n   ['2024-08-31',\n    3,\n    ['2024-01-01',\n     '2024-01-15',\n     '2024-02-19',\n     '2024-05-27',\n     '2024-06-19',\n     '2024-07-04',\n     '2024-09-02',\n     '2024-10-14',\n     '2024-11-11',\n     '2024-11-28',\n     '2024-12-25']],\n   '2024-12-02'),\n  ('day 29 two months',\n   ['2024-01-29',\n    2,\n    ['2024-01-01',\n     '2024-01-15',\n     '2024-02-19',\n     '2024-05-27',\n     '2024-06-19',\n     '2024-07-04',\n     '2024-09-02',\n     '2024-10-14',\n     '2024-11-11',\n     '2024-11-28',\n     '2024-12-25']],\n   '2024-03-29'),\n  ('day 30 to may',\n   ['2024-01-30',\n    4,\n    ['2024-01-01',\n     '2024-01-15',\n     '2024-02-19',\n     '2024-05-27',\n     '2024-06-19',\n     '2024-07-04',\n     '2024-09-02',\n     '2024-10-14',\n     '2024-11-11',\n     '2024-11-28',\n     '2024-12-25']],\n   '2024-05-30')],\n [('jan 31 plus one',\n   ['2024-01-31',\n    1,\n    ['2024-01-01',\n     '2024-01-15',\n     '2024-02-19',\n     '2024-05-27',\n     '2024-06-19',\n     '2024-07-04',\n     '2024-09-02',\n     '2024-10-14',\n     '2024-11-11',\n     '2024-11-28',\n     '2024-12-25']],\n   '2024-02-29'),\n  ('mid month simple',\n   ['2024-03-12',\n    2,\n    ['2024-01-01',\n     '2024-01-15',\n     '2024-02-19',\n     '2024-05-27',\n     '2024-06-19',\n     '2024-07-04',\n     '2024-09-02',\n     '2024-10-14',\n     '2024-11-11',\n     '2024-11-28',\n     '2024-12-25']],\n   '2024-05-13'),\n  ('aug 31 to nov 30 saturday',\n   ['2024-08-31',\n    3,\n    ['2024-01-01',\n     '2024-01-15',\n     '2024-02-19',\n     '2024-05-27',\n     '2024-06-19',\n     '2024-07-04',\n     '2024-09-02',\n     '2024-10-14',\n     '2024-11-11',\n     '2024-11-28',\n     '2024-12-25']],\n   '2024-12-02'),\n  ('day 29 two months',\n   ['2024-01-29',\n    2,\n    ['2024-01-01',\n     '2024-01-15',\n     '2024-02-19',\n     '2024-05-27',\n     '2024-06-19',\n     '2024-07-04',\n     '2024-09-02',\n     '2024-10-14',\n     '2024-11-11',\n     '2024-11-28',\n     '2024-12-25']],\n   '2024-03-29'),\n  ('day 30 to may',\n   ['2024-01-30',\n    4,\n    ['2024-01-01',\n     '2024-01-15',\n     '2024-02-19',\n     '2024-05-27',\n     '2024-06-19',\n     '2024-07-04',\n     '2024-09-02',\n     '2024-10-14',\n     '2024-11-11',\n     '2024-11-28',\n     '2024-12-25']],\n   '2024-05-30'),\n  ('regression: jan 30 plus one month', ['2023-01-30', 1, []], '2023-02-28'),\n  ('month end april to may',\n   ['2024-04-30',\n    1,\n    ['2024-01-01',\n     '2024-01-15',\n     '2024-02-19',\n     '2024-05-27',\n     '2024-06-19',\n     '2024-07-04',\n     '2024-09-02',\n     '2024-10-14',\n     '2024-11-11',\n     '2024-11-28',\n     '2024-12-25']],\n   '2024-05-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 toy deadline rules evaluated offline on explicit fixtures. The contract is inspired by common court-rule structures but is not legal advice and makes no claim to reproduce any jurisdiction's rules. 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-legal-deadline-computation-month-period-end-of-month-roll-convention","generated_at":"2026-09-29T14:49:25.193136+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Docketing systems compute filing and response deadlines from trigger events; a wrong date can forfeit a right.","repair":"At the roll convention decision use `while d.weekday() >= 5 or d in hol:;     d += dt.timedelta(days=1)`, leaving the other decision sites of the model unchanged.","root_cause":"The closed-day adjustment uses a preceding-business-day convention.","sha256":"92831d30ab0e422e13268e817315577dbafeca9ce8b75c7aad2c0140dbfba4f5","title":"Month-denominated periods with end-of-month rule: roll convention · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":42.574,"exit_code":1,"observations":[{"actual":"2023-02-28","check":"regression: jan 30 plus one month","expected":"2023-02-28","passed":true},{"actual":"2024-05-31","check":"month end april to may","expected":"2024-05-31","passed":true},{"actual":"2023-03-31","check":"month end feb common","expected":"2023-03-31","passed":true},{"actual":"2024-03-29","check":"month end feb leap to march","expected":"2024-04-01","passed":false},{"actual":"2024-08-30","check":"lands saturday month end","expected":"2024-09-03","passed":false},{"actual":"2024-07-15","check":"lands sunday mid month","expected":"2024-07-15","passed":true},{"actual":"2025-02-28","check":"twelve months from leap day","expected":"2025-02-28","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: jan 30 plus one month\", \"actual\": \"2023-02-28\", \"expected\": \"2023-02-28\", \"passed\": true}, {\"check\": \"month end april to may\", \"actual\": \"2024-05-31\", \"expected\": \"2024-05-31\", \"passed\": true}, {\"check\": \"month end feb common\", \"actual\": \"2023-03-31\", \"expected\": \"2023-03-31\", \"passed\": true}, {\"check\": \"month end feb leap to march\", \"actual\": \"2024-03-29\", \"expected\": \"2024-04-01\", \"passed\": false}, {\"check\": \"lands saturday month end\", \"actual\": \"2024-08-30\", \"expected\": \"2024-09-03\", \"passed\": false}, {\"check\": \"lands sunday mid month\", \"actual\": \"2024-07-15\", \"expected\": \"2024-07-15\", \"passed\": true}, {\"check\": \"twelve months from leap day\", \"actual\": \"2025-02-28\", \"expected\": \"2025-02-28\", \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":41.83,"exit_code":1,"observations":[{"actual":"2023-02-28","check":"regression: jan 30 plus one month","expected":"2023-02-28","passed":true},{"actual":"2024-05-31","check":"month end april to may","expected":"2024-05-31","passed":true},{"actual":"2023-03-31","check":"month end feb common","expected":"2023-03-31","passed":true},{"actual":"2024-03-29","check":"month end feb leap to march","expected":"2024-04-01","passed":false},{"actual":"2024-08-30","check":"lands saturday month end","expected":"2024-09-03","passed":false},{"actual":"2024-07-12","check":"lands sunday mid month","expected":"2024-07-15","passed":false},{"actual":"2025-02-28","check":"twelve months from leap day","expected":"2025-02-28","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: jan 30 plus one month\", \"actual\": \"2023-02-28\", \"expected\": \"2023-02-28\", \"passed\": true}, {\"check\": \"month end april to may\", \"actual\": \"2024-05-31\", \"expected\": \"2024-05-31\", \"passed\": true}, {\"check\": \"month end feb common\", \"actual\": \"2023-03-31\", \"expected\": \"2023-03-31\", \"passed\": true}, {\"check\": \"month end feb leap to march\", \"actual\": \"2024-03-29\", \"expected\": \"2024-04-01\", \"passed\": false}, {\"check\": \"lands saturday month end\", \"actual\": \"2024-08-30\", \"expected\": \"2024-09-03\", \"passed\": false}, {\"check\": \"lands sunday mid month\", \"actual\": \"2024-07-12\", \"expected\": \"2024-07-15\", \"passed\": false}, {\"check\": \"twelve months from leap day\", \"actual\": \"2025-02-28\", \"expected\": \"2025-02-28\", \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":39.678,"exit_code":0,"observations":[{"actual":"2023-02-28","check":"regression: jan 30 plus one month","expected":"2023-02-28","passed":true},{"actual":"2024-05-31","check":"month end april to may","expected":"2024-05-31","passed":true},{"actual":"2023-03-31","check":"month end feb common","expected":"2023-03-31","passed":true},{"actual":"2024-04-01","check":"month end feb leap to march","expected":"2024-04-01","passed":true},{"actual":"2024-09-03","check":"lands saturday month end","expected":"2024-09-03","passed":true},{"actual":"2024-07-15","check":"lands sunday mid month","expected":"2024-07-15","passed":true},{"actual":"2025-02-28","check":"twelve months from leap day","expected":"2025-02-28","passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: jan 30 plus one month\", \"actual\": \"2023-02-28\", \"expected\": \"2023-02-28\", \"passed\": true}, {\"check\": \"month end april to may\", \"actual\": \"2024-05-31\", \"expected\": \"2024-05-31\", \"passed\": true}, {\"check\": \"month end feb common\", \"actual\": \"2023-03-31\", \"expected\": \"2023-03-31\", \"passed\": true}, {\"check\": \"month end feb leap to march\", \"actual\": \"2024-04-01\", \"expected\": \"2024-04-01\", \"passed\": true}, {\"check\": \"lands saturday month end\", \"actual\": \"2024-09-03\", \"expected\": \"2024-09-03\", \"passed\": true}, {\"check\": \"lands sunday mid month\", \"actual\": \"2024-07-15\", \"expected\": \"2024-07-15\", \"passed\": true}, {\"check\": \"twelve months from leap day\", \"actual\": \"2025-02-28\", \"expected\": \"2025-02-28\", \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}