{"abstract":"A July 4 falling on Sunday does not close the court on Monday July 5.","category":"Legal deadline computation","checks":8,"contract":"Stipulated legacy rule: a period of fewer than 11 days excludes intermediate Saturdays, Sundays and holidays; longer periods count every calendar day. The trigger day is excluded, and for any period a last day that is closed rolls forward to the next open day. Holidays are listed by nominal date; a holiday on Saturday is observed the preceding Friday and one on Sunday the following Monday.","evaluation_group":"w2-legal-deadline-computation-short-period-court-days","failed_approach":"The partial repair `x + dt.timedelta(days=(7 - x.weekday()) % 7) if x.weekday() >= 5 else x` moves Saturday holidays to Monday instead of the preceding Friday.","family":"w2-legal-deadline-computation-short-period-court-days-observed-shift","id":"FA-77366","implementations":{"attempt":{"sha256":"9d6f2eaf809374a05a6e0370472d014aa6af4cee61942e4e52272a93b895b609","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport datetime as dt\nimport calendar\nN = 1\nobservations = []\ndef solve(trigger, days, holidays):\n    t = dt.date.fromisoformat(trigger)\n    hol = set()\n    for h in holidays:\n        x = dt.date.fromisoformat(h)\n        hol.add(x + dt.timedelta(days=(7 - x.weekday()) % 7) if x.weekday() >= 5 else x)\n    def closed(d):\n        return d.weekday() >= 5 or d in hol\n    short = days < 11\n    d = t\n    n = 0\n    while n < days:\n        d += dt.timedelta(days=1)\n        if short and closed(d):\n            continue\n        n += 1\n    while closed(d):\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: observed monday holiday', ['2021-06-28', 7, ['2021-07-04']], '2021-07-08'),\n  ('saturday holiday observed friday', ['2020-06-29', 5, ['2020-07-04']], '2020-07-07'),\n  ('eleven day period',\n   ['2024-01-02',\n    11,\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-01-16'),\n  ('ten day period',\n   ['2024-01-02',\n    10,\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-01-17'),\n  ('short spanning holiday',\n   ['2024-05-22',\n    7,\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-06-03'),\n  ('long ends sunday',\n   ['2024-02-02',\n    30,\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-04'),\n  ('long ends on holiday',\n   ['2024-04-27',\n    30,\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-28'),\n  ('short ends on observed friday', ['2020-06-29', 4, ['2020-07-04']], '2020-07-06')],\n [('eleven day period',\n   ['2024-01-02',\n    11,\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-01-16'),\n  ('ten day period',\n   ['2024-01-02',\n    10,\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-01-17'),\n  ('short spanning holiday',\n   ['2024-05-22',\n    7,\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-06-03'),\n  ('long ends sunday',\n   ['2024-02-02',\n    30,\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-04'),\n  ('long ends on holiday',\n   ['2024-04-27',\n    30,\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-28'),\n  ('short ends at weekend',\n   ['2024-03-04',\n    5,\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-11'),\n  ('christmas short', ['2021-12-20', 5, ['2021-12-25', '2022-01-01']], '2021-12-28'),\n  ('long ends on observed friday', ['2020-06-03', 30, ['2020-07-04']], '2020-07-06')],\n [('short spanning holiday',\n   ['2024-05-22',\n    7,\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-06-03'),\n  ('long ends sunday',\n   ['2024-02-02',\n    30,\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-04'),\n  ('long ends on holiday',\n   ['2024-04-27',\n    30,\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-28'),\n  ('short ends at weekend',\n   ['2024-03-04',\n    5,\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-11'),\n  ('christmas short', ['2021-12-20', 5, ['2021-12-25', '2022-01-01']], '2021-12-28'),\n  ('long 14 across holiday',\n   ['2024-11-20',\n    14,\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-04'),\n  ('short one day friday',\n   ['2024-03-08',\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-03-11'),\n  ('short ends on observed friday', ['2020-06-29', 4, ['2020-07-04']], '2020-07-06')],\n [('long ends on holiday',\n   ['2024-04-27',\n    30,\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-28'),\n  ('short ends at weekend',\n   ['2024-03-04',\n    5,\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-11'),\n  ('christmas short', ['2021-12-20', 5, ['2021-12-25', '2022-01-01']], '2021-12-28'),\n  ('long 14 across holiday',\n   ['2024-11-20',\n    14,\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-04'),\n  ('short one day friday',\n   ['2024-03-08',\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-03-11'),\n  ('short ends on observed friday', ['2020-06-29', 4, ['2020-07-04']], '2020-07-06'),\n  ('long ends on observed friday', ['2020-06-03', 30, ['2020-07-04']], '2020-07-06')],\n [('christmas short', ['2021-12-20', 5, ['2021-12-25', '2022-01-01']], '2021-12-28'),\n  ('long 14 across holiday',\n   ['2024-11-20',\n    14,\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-04'),\n  ('short one day friday',\n   ['2024-03-08',\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-03-11'),\n  ('short ends on observed friday', ['2020-06-29', 4, ['2020-07-04']], '2020-07-06'),\n  ('long ends on observed friday', ['2020-06-03', 30, ['2020-07-04']], '2020-07-06'),\n  ('regression: observed monday holiday', ['2021-06-28', 7, ['2021-07-04']], '2021-07-08'),\n  ('saturday holiday observed friday', ['2020-06-29', 5, ['2020-07-04']], '2020-07-07')]]\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":"79ff21100f93f8d1bc13efc86e15eefc092d4c48b39605d2bcd58614b3d66cfc","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport datetime as dt\nimport calendar\nN = 1\nobservations = []\ndef solve(trigger, days, holidays):\n    t = dt.date.fromisoformat(trigger)\n    hol = set()\n    for h in holidays:\n        x = dt.date.fromisoformat(h)\n        hol.add(x)\n    def closed(d):\n        return d.weekday() >= 5 or d in hol\n    short = days < 11\n    d = t\n    n = 0\n    while n < days:\n        d += dt.timedelta(days=1)\n        if short and closed(d):\n            continue\n        n += 1\n    while closed(d):\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: observed monday holiday', ['2021-06-28', 7, ['2021-07-04']], '2021-07-08'),\n  ('saturday holiday observed friday', ['2020-06-29', 5, ['2020-07-04']], '2020-07-07'),\n  ('eleven day period',\n   ['2024-01-02',\n    11,\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-01-16'),\n  ('ten day period',\n   ['2024-01-02',\n    10,\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-01-17'),\n  ('short spanning holiday',\n   ['2024-05-22',\n    7,\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-06-03'),\n  ('long ends sunday',\n   ['2024-02-02',\n    30,\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-04'),\n  ('long ends on holiday',\n   ['2024-04-27',\n    30,\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-28'),\n  ('short ends on observed friday', ['2020-06-29', 4, ['2020-07-04']], '2020-07-06')],\n [('eleven day period',\n   ['2024-01-02',\n    11,\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-01-16'),\n  ('ten day period',\n   ['2024-01-02',\n    10,\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-01-17'),\n  ('short spanning holiday',\n   ['2024-05-22',\n    7,\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-06-03'),\n  ('long ends sunday',\n   ['2024-02-02',\n    30,\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-04'),\n  ('long ends on holiday',\n   ['2024-04-27',\n    30,\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-28'),\n  ('short ends at weekend',\n   ['2024-03-04',\n    5,\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-11'),\n  ('christmas short', ['2021-12-20', 5, ['2021-12-25', '2022-01-01']], '2021-12-28'),\n  ('long ends on observed friday', ['2020-06-03', 30, ['2020-07-04']], '2020-07-06')],\n [('short spanning holiday',\n   ['2024-05-22',\n    7,\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-06-03'),\n  ('long ends sunday',\n   ['2024-02-02',\n    30,\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-04'),\n  ('long ends on holiday',\n   ['2024-04-27',\n    30,\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-28'),\n  ('short ends at weekend',\n   ['2024-03-04',\n    5,\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-11'),\n  ('christmas short', ['2021-12-20', 5, ['2021-12-25', '2022-01-01']], '2021-12-28'),\n  ('long 14 across holiday',\n   ['2024-11-20',\n    14,\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-04'),\n  ('short one day friday',\n   ['2024-03-08',\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-03-11'),\n  ('short ends on observed friday', ['2020-06-29', 4, ['2020-07-04']], '2020-07-06')],\n [('long ends on holiday',\n   ['2024-04-27',\n    30,\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-28'),\n  ('short ends at weekend',\n   ['2024-03-04',\n    5,\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-11'),\n  ('christmas short', ['2021-12-20', 5, ['2021-12-25', '2022-01-01']], '2021-12-28'),\n  ('long 14 across holiday',\n   ['2024-11-20',\n    14,\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-04'),\n  ('short one day friday',\n   ['2024-03-08',\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-03-11'),\n  ('short ends on observed friday', ['2020-06-29', 4, ['2020-07-04']], '2020-07-06'),\n  ('long ends on observed friday', ['2020-06-03', 30, ['2020-07-04']], '2020-07-06')],\n [('christmas short', ['2021-12-20', 5, ['2021-12-25', '2022-01-01']], '2021-12-28'),\n  ('long 14 across holiday',\n   ['2024-11-20',\n    14,\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-04'),\n  ('short one day friday',\n   ['2024-03-08',\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-03-11'),\n  ('short ends on observed friday', ['2020-06-29', 4, ['2020-07-04']], '2020-07-06'),\n  ('long ends on observed friday', ['2020-06-03', 30, ['2020-07-04']], '2020-07-06'),\n  ('regression: observed monday holiday', ['2021-06-28', 7, ['2021-07-04']], '2021-07-08'),\n  ('saturday holiday observed friday', ['2020-06-29', 5, ['2020-07-04']], '2020-07-07')]]\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":"9f3d5641c0700723b2413b0261c2e20da3b69cf113a56651e19aaa7a792caaf2","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport datetime as dt\nimport calendar\nN = 1\nobservations = []\ndef solve(trigger, days, holidays):\n    t = dt.date.fromisoformat(trigger)\n    hol = set()\n    for h in holidays:\n        x = dt.date.fromisoformat(h)\n        hol.add(x - dt.timedelta(days=1) if x.weekday() == 5 else x + dt.timedelta(days=1) if x.weekday() == 6 else x)\n    def closed(d):\n        return d.weekday() >= 5 or d in hol\n    short = days < 11\n    d = t\n    n = 0\n    while n < days:\n        d += dt.timedelta(days=1)\n        if short and closed(d):\n            continue\n        n += 1\n    while closed(d):\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: observed monday holiday', ['2021-06-28', 7, ['2021-07-04']], '2021-07-08'),\n  ('saturday holiday observed friday', ['2020-06-29', 5, ['2020-07-04']], '2020-07-07'),\n  ('eleven day period',\n   ['2024-01-02',\n    11,\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-01-16'),\n  ('ten day period',\n   ['2024-01-02',\n    10,\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-01-17'),\n  ('short spanning holiday',\n   ['2024-05-22',\n    7,\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-06-03'),\n  ('long ends sunday',\n   ['2024-02-02',\n    30,\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-04'),\n  ('long ends on holiday',\n   ['2024-04-27',\n    30,\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-28'),\n  ('short ends on observed friday', ['2020-06-29', 4, ['2020-07-04']], '2020-07-06')],\n [('eleven day period',\n   ['2024-01-02',\n    11,\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-01-16'),\n  ('ten day period',\n   ['2024-01-02',\n    10,\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-01-17'),\n  ('short spanning holiday',\n   ['2024-05-22',\n    7,\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-06-03'),\n  ('long ends sunday',\n   ['2024-02-02',\n    30,\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-04'),\n  ('long ends on holiday',\n   ['2024-04-27',\n    30,\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-28'),\n  ('short ends at weekend',\n   ['2024-03-04',\n    5,\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-11'),\n  ('christmas short', ['2021-12-20', 5, ['2021-12-25', '2022-01-01']], '2021-12-28'),\n  ('long ends on observed friday', ['2020-06-03', 30, ['2020-07-04']], '2020-07-06')],\n [('short spanning holiday',\n   ['2024-05-22',\n    7,\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-06-03'),\n  ('long ends sunday',\n   ['2024-02-02',\n    30,\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-04'),\n  ('long ends on holiday',\n   ['2024-04-27',\n    30,\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-28'),\n  ('short ends at weekend',\n   ['2024-03-04',\n    5,\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-11'),\n  ('christmas short', ['2021-12-20', 5, ['2021-12-25', '2022-01-01']], '2021-12-28'),\n  ('long 14 across holiday',\n   ['2024-11-20',\n    14,\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-04'),\n  ('short one day friday',\n   ['2024-03-08',\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-03-11'),\n  ('short ends on observed friday', ['2020-06-29', 4, ['2020-07-04']], '2020-07-06')],\n [('long ends on holiday',\n   ['2024-04-27',\n    30,\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-28'),\n  ('short ends at weekend',\n   ['2024-03-04',\n    5,\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-11'),\n  ('christmas short', ['2021-12-20', 5, ['2021-12-25', '2022-01-01']], '2021-12-28'),\n  ('long 14 across holiday',\n   ['2024-11-20',\n    14,\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-04'),\n  ('short one day friday',\n   ['2024-03-08',\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-03-11'),\n  ('short ends on observed friday', ['2020-06-29', 4, ['2020-07-04']], '2020-07-06'),\n  ('long ends on observed friday', ['2020-06-03', 30, ['2020-07-04']], '2020-07-06')],\n [('christmas short', ['2021-12-20', 5, ['2021-12-25', '2022-01-01']], '2021-12-28'),\n  ('long 14 across holiday',\n   ['2024-11-20',\n    14,\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-04'),\n  ('short one day friday',\n   ['2024-03-08',\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-03-11'),\n  ('short ends on observed friday', ['2020-06-29', 4, ['2020-07-04']], '2020-07-06'),\n  ('long ends on observed friday', ['2020-06-03', 30, ['2020-07-04']], '2020-07-06'),\n  ('regression: observed monday holiday', ['2021-06-28', 7, ['2021-07-04']], '2021-07-08'),\n  ('saturday holiday observed friday', ['2020-06-29', 5, ['2020-07-04']], '2020-07-07')]]\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-short-period-court-days-observed-shift","generated_at":"2026-09-29T14:49:25.020035+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 observed shift decision use `x - dt.timedelta(days=1) if x.weekday() == 5 else x + dt.timedelta(days=1) if x.weekday() == 6 else x`, leaving the other decision sites of the model unchanged.","root_cause":"Holidays are applied on their nominal date only, never on the observed weekday.","sha256":"c43d47e86282957b50e812b0077393c2e075c4c6b780e7a3ae88e57121f1783f","title":"Short periods counted in court days with observed holidays: observed shift · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":42.168,"exit_code":1,"observations":[{"actual":"2021-07-08","check":"regression: observed monday holiday","expected":"2021-07-08","passed":true},{"actual":"2020-07-07","check":"saturday holiday observed friday","expected":"2020-07-07","passed":true},{"actual":"2024-01-16","check":"eleven day period","expected":"2024-01-16","passed":true},{"actual":"2024-01-17","check":"ten day period","expected":"2024-01-17","passed":true},{"actual":"2024-06-03","check":"short spanning holiday","expected":"2024-06-03","passed":true},{"actual":"2024-03-04","check":"long ends sunday","expected":"2024-03-04","passed":true},{"actual":"2024-05-28","check":"long ends on holiday","expected":"2024-05-28","passed":true},{"actual":"2020-07-03","check":"short ends on observed friday","expected":"2020-07-06","passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: observed monday holiday\", \"actual\": \"2021-07-08\", \"expected\": \"2021-07-08\", \"passed\": true}, {\"check\": \"saturday holiday observed friday\", \"actual\": \"2020-07-07\", \"expected\": \"2020-07-07\", \"passed\": true}, {\"check\": \"eleven day period\", \"actual\": \"2024-01-16\", \"expected\": \"2024-01-16\", \"passed\": true}, {\"check\": \"ten day period\", \"actual\": \"2024-01-17\", \"expected\": \"2024-01-17\", \"passed\": true}, {\"check\": \"short spanning holiday\", \"actual\": \"2024-06-03\", \"expected\": \"2024-06-03\", \"passed\": true}, {\"check\": \"long ends sunday\", \"actual\": \"2024-03-04\", \"expected\": \"2024-03-04\", \"passed\": true}, {\"check\": \"long ends on holiday\", \"actual\": \"2024-05-28\", \"expected\": \"2024-05-28\", \"passed\": true}, {\"check\": \"short ends on observed friday\", \"actual\": \"2020-07-03\", \"expected\": \"2020-07-06\", \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":40.64,"exit_code":1,"observations":[{"actual":"2021-07-07","check":"regression: observed monday holiday","expected":"2021-07-08","passed":false},{"actual":"2020-07-06","check":"saturday holiday observed friday","expected":"2020-07-07","passed":false},{"actual":"2024-01-16","check":"eleven day period","expected":"2024-01-16","passed":true},{"actual":"2024-01-17","check":"ten day period","expected":"2024-01-17","passed":true},{"actual":"2024-06-03","check":"short spanning holiday","expected":"2024-06-03","passed":true},{"actual":"2024-03-04","check":"long ends sunday","expected":"2024-03-04","passed":true},{"actual":"2024-05-28","check":"long ends on holiday","expected":"2024-05-28","passed":true},{"actual":"2020-07-03","check":"short ends on observed friday","expected":"2020-07-06","passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: observed monday holiday\", \"actual\": \"2021-07-07\", \"expected\": \"2021-07-08\", \"passed\": false}, {\"check\": \"saturday holiday observed friday\", \"actual\": \"2020-07-06\", \"expected\": \"2020-07-07\", \"passed\": false}, {\"check\": \"eleven day period\", \"actual\": \"2024-01-16\", \"expected\": \"2024-01-16\", \"passed\": true}, {\"check\": \"ten day period\", \"actual\": \"2024-01-17\", \"expected\": \"2024-01-17\", \"passed\": true}, {\"check\": \"short spanning holiday\", \"actual\": \"2024-06-03\", \"expected\": \"2024-06-03\", \"passed\": true}, {\"check\": \"long ends sunday\", \"actual\": \"2024-03-04\", \"expected\": \"2024-03-04\", \"passed\": true}, {\"check\": \"long ends on holiday\", \"actual\": \"2024-05-28\", \"expected\": \"2024-05-28\", \"passed\": true}, {\"check\": \"short ends on observed friday\", \"actual\": \"2020-07-03\", \"expected\": \"2020-07-06\", \"passed\": false}], \"passed\": false}\n"},"fixed":{"elapsed_ms":43.466,"exit_code":0,"observations":[{"actual":"2021-07-08","check":"regression: observed monday holiday","expected":"2021-07-08","passed":true},{"actual":"2020-07-07","check":"saturday holiday observed friday","expected":"2020-07-07","passed":true},{"actual":"2024-01-16","check":"eleven day period","expected":"2024-01-16","passed":true},{"actual":"2024-01-17","check":"ten day period","expected":"2024-01-17","passed":true},{"actual":"2024-06-03","check":"short spanning holiday","expected":"2024-06-03","passed":true},{"actual":"2024-03-04","check":"long ends sunday","expected":"2024-03-04","passed":true},{"actual":"2024-05-28","check":"long ends on holiday","expected":"2024-05-28","passed":true},{"actual":"2020-07-06","check":"short ends on observed friday","expected":"2020-07-06","passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: observed monday holiday\", \"actual\": \"2021-07-08\", \"expected\": \"2021-07-08\", \"passed\": true}, {\"check\": \"saturday holiday observed friday\", \"actual\": \"2020-07-07\", \"expected\": \"2020-07-07\", \"passed\": true}, {\"check\": \"eleven day period\", \"actual\": \"2024-01-16\", \"expected\": \"2024-01-16\", \"passed\": true}, {\"check\": \"ten day period\", \"actual\": \"2024-01-17\", \"expected\": \"2024-01-17\", \"passed\": true}, {\"check\": \"short spanning holiday\", \"actual\": \"2024-06-03\", \"expected\": \"2024-06-03\", \"passed\": true}, {\"check\": \"long ends sunday\", \"actual\": \"2024-03-04\", \"expected\": \"2024-03-04\", \"passed\": true}, {\"check\": \"long ends on holiday\", \"actual\": \"2024-05-28\", \"expected\": \"2024-05-28\", \"passed\": true}, {\"check\": \"short ends on observed friday\", \"actual\": \"2020-07-06\", \"expected\": \"2020-07-06\", \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}