FAILURE MAP
← Case archive

FA-77381 / Legal deadline computation / Open access

Short periods counted in court days with observed holidays: final roll · case 01

A 30-day period ending on a Sunday is left due on the Sunday.

Verified by executionVariant 1 · 7 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

The last-day roll is only applied to short periods.

VERIFIED REPAIR

At the final roll decision use `closed(d)`, leaving the other decision sites of the model unchanged.

Unsuccessful approach: The partial repair `d.weekday() >= 5` rolls weekends for every period but not holidays.

Case 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.

Why this case matters

Docketing systems compute filing and response deadlines from trigger events; a wrong date can forfeit a right.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import datetime as dt
import calendar
N = 1
observations = []
def solve(trigger, days, holidays):
    t = dt.date.fromisoformat(trigger)
    hol = set()
    for h in holidays:
        x = dt.date.fromisoformat(h)
        hol.add(x - dt.timedelta(days=1) if x.weekday() == 5 else x + dt.timedelta(days=1) if x.weekday() == 6 else x)
    def closed(d):
        return d.weekday() >= 5 or d in hol
    short = days < 11
    d = t
    n = 0
    while n < days:
        d += dt.timedelta(days=1)
        if short and closed(d):
            continue
        n += 1
    while short and closed(d):
        d += dt.timedelta(days=1)
    return d.isoformat()
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: observed monday holiday', ['2021-06-28', 7, ['2021-07-04']], '2021-07-08'),
  ('saturday holiday observed friday', ['2020-06-29', 5, ['2020-07-04']], '2020-07-07'),
  ('eleven day period',
   ['2024-01-02',
    11,
    ['2024-01-01',
     '2024-01-15',
     '2024-02-19',
     '2024-05-27',
     '2024-06-19',
     '2024-07-04',
     '2024-09-02',
     '2024-10-14',
     '2024-11-11',
     '2024-11-28',
     '2024-12-25']],
   '2024-01-16'),
  ('ten day period',
   ['2024-01-02',
    10,
    ['2024-01-01',
     '2024-01-15',
     '2024-02-19',
     '2024-05-27',
     '2024-06-19',
     '2024-07-04',
     '2024-09-02',
     '2024-10-14',
     '2024-11-11',
     '2024-11-28',
     '2024-12-25']],
   '2024-01-17'),
  ('short spanning holiday',
   ['2024-05-22',
    7,
    ['2024-01-01',
     '2024-01-15',
     '2024-02-19',
     '2024-05-27',
     '2024-06-19',
     '2024-07-04',
     '2024-09-02',
     '2024-10-14',
     '2024-11-11',
     '2024-11-28',
     '2024-12-25']],
   '2024-06-03'),
  ('long ends sunday',
   ['2024-02-02',
    30,
    ['2024-01-01',
     '2024-01-15',
     '2024-02-19',
     '2024-05-27',
     '2024-06-19',
     '2024-07-04',
     '2024-09-02',
     '2024-10-14',
     '2024-11-11',
     '2024-11-28',
     '2024-12-25']],
   '2024-03-04'),
  ('long ends on holiday',
   ['2024-04-27',
    30,
    ['2024-01-01',
     '2024-01-15',
     '2024-02-19',
     '2024-05-27',
     '2024-06-19',
     '2024-07-04',
     '2024-09-02',
     '2024-10-14',
     '2024-11-11',
     '2024-11-28',
     '2024-12-25']],
   '2024-05-28')],
 [('eleven day period',
   ['2024-01-02',
    11,
    ['2024-01-01',
     '2024-01-15',
     '2024-02-19',
     '2024-05-27',
     '2024-06-19',
     '2024-07-04',
     '2024-09-02',
     '2024-10-14',
     '2024-11-11',
     '2024-11-28',
     '2024-12-25']],
   '2024-01-16'),
  ('ten day period',
   ['2024-01-02',
    10,
    ['2024-01-01',
     '2024-01-15',
     '2024-02-19',
     '2024-05-27',
     '2024-06-19',
     '2024-07-04',
     '2024-09-02',
     '2024-10-14',
     '2024-11-11',
     '2024-11-28',
     '2024-12-25']],
   '2024-01-17'),
  ('short spanning holiday',
   ['2024-05-22',
    7,
    ['2024-01-01',
     '2024-01-15',
     '2024-02-19',
     '2024-05-27',
     '2024-06-19',
     '2024-07-04',
     '2024-09-02',
     '2024-10-14',
     '2024-11-11',
     '2024-11-28',
     '2024-12-25']],
   '2024-06-03'),
  ('long ends sunday',
   ['2024-02-02',
    30,
    ['2024-01-01',
     '2024-01-15',
     '2024-02-19',
     '2024-05-27',
     '2024-06-19',
     '2024-07-04',
     '2024-09-02',
     '2024-10-14',
     '2024-11-11',
     '2024-11-28',
     '2024-12-25']],
   '2024-03-04'),
  ('long ends on holiday',
   ['2024-04-27',
    30,
    ['2024-01-01',
     '2024-01-15',
     '2024-02-19',
     '2024-05-27',
     '2024-06-19',
     '2024-07-04',
     '2024-09-02',
     '2024-10-14',
     '2024-11-11',
     '2024-11-28',
     '2024-12-25']],
   '2024-05-28'),
  ('short ends at weekend',
   ['2024-03-04',
    5,
    ['2024-01-01',
     '2024-01-15',
     '2024-02-19',
     '2024-05-27',
     '2024-06-19',
     '2024-07-04',
     '2024-09-02',
     '2024-10-14',
     '2024-11-11',
     '2024-11-28',
     '2024-12-25']],
   '2024-03-11'),
  ('christmas short', ['2021-12-20', 5, ['2021-12-25', '2022-01-01']], '2021-12-28')],
 [('short spanning holiday',
   ['2024-05-22',
    7,
    ['2024-01-01',
     '2024-01-15',
     '2024-02-19',
     '2024-05-27',
     '2024-06-19',
     '2024-07-04',
     '2024-09-02',
     '2024-10-14',
     '2024-11-11',
     '2024-11-28',
     '2024-12-25']],
   '2024-06-03'),
  ('long ends sunday',
   ['2024-02-02',
    30,
    ['2024-01-01',
     '2024-01-15',
     '2024-02-19',
     '2024-05-27',
     '2024-06-19',
     '2024-07-04',
     '2024-09-02',
     '2024-10-14',
     '2024-11-11',
     '2024-11-28',
     '2024-12-25']],
   '2024-03-04'),
  ('long ends on holiday',
   ['2024-04-27',
    30,
    ['2024-01-01',
     '2024-01-15',
     '2024-02-19',
     '2024-05-27',
     '2024-06-19',
     '2024-07-04',
     '2024-09-02',
     '2024-10-14',
     '2024-11-11',
     '2024-11-28',
     '2024-12-25']],
   '2024-05-28'),
  ('short ends at weekend',
   ['2024-03-04',
    5,
    ['2024-01-01',
     '2024-01-15',
     '2024-02-19',
     '2024-05-27',
     '2024-06-19',
     '2024-07-04',
     '2024-09-02',
     '2024-10-14',
     '2024-11-11',
     '2024-11-28',
     '2024-12-25']],
   '2024-03-11'),
  ('christmas short', ['2021-12-20', 5, ['2021-12-25', '2022-01-01']], '2021-12-28'),
  ('long 14 across holiday',
   ['2024-11-20',
    14,
    ['2024-01-01',
     '2024-01-15',
     '2024-02-19',
     '2024-05-27',
     '2024-06-19',
     '2024-07-04',
     '2024-09-02',
     '2024-10-14',
     '2024-11-11',
     '2024-11-28',
     '2024-12-25']],
   '2024-12-04'),
  ('short one day friday',
   ['2024-03-08',
    1,
    ['2024-01-01',
     '2024-01-15',
     '2024-02-19',
     '2024-05-27',
     '2024-06-19',
     '2024-07-04',
     '2024-09-02',
     '2024-10-14',
     '2024-11-11',
     '2024-11-28',
     '2024-12-25']],
   '2024-03-11')],
 [('long ends on holiday',
   ['2024-04-27',
    30,
    ['2024-01-01',
     '2024-01-15',
     '2024-02-19',
     '2024-05-27',
     '2024-06-19',
     '2024-07-04',
     '2024-09-02',
     '2024-10-14',
     '2024-11-11',
     '2024-11-28',
     '2024-12-25']],
   '2024-05-28'),
  ('short ends at weekend',
   ['2024-03-04',
    5,
    ['2024-01-01',
     '2024-01-15',
     '2024-02-19',
     '2024-05-27',
     '2024-06-19',
     '2024-07-04',
     '2024-09-02',
     '2024-10-14',
     '2024-11-11',
     '2024-11-28',
     '2024-12-25']],
   '2024-03-11'),
  ('christmas short', ['2021-12-20', 5, ['2021-12-25', '2022-01-01']], '2021-12-28'),
  ('long 14 across holiday',
   ['2024-11-20',
    14,
    ['2024-01-01',
     '2024-01-15',
     '2024-02-19',
     '2024-05-27',
     '2024-06-19',
     '2024-07-04',
     '2024-09-02',
     '2024-10-14',
     '2024-11-11',
     '2024-11-28',
     '2024-12-25']],
   '2024-12-04'),
  ('short one day friday',
   ['2024-03-08',
    1,
    ['2024-01-01',
     '2024-01-15',
     '2024-02-19',
     '2024-05-27',
     '2024-06-19',
     '2024-07-04',
     '2024-09-02',
     '2024-10-14',
     '2024-11-11',
     '2024-11-28',
     '2024-12-25']],
   '2024-03-11'),
  ('short ends on observed friday', ['2020-06-29', 4, ['2020-07-04']], '2020-07-06'),
  ('long ends on observed friday', ['2020-06-03', 30, ['2020-07-04']], '2020-07-06')],
 [('christmas short', ['2021-12-20', 5, ['2021-12-25', '2022-01-01']], '2021-12-28'),
  ('long 14 across holiday',
   ['2024-11-20',
    14,
    ['2024-01-01',
     '2024-01-15',
     '2024-02-19',
     '2024-05-27',
     '2024-06-19',
     '2024-07-04',
     '2024-09-02',
     '2024-10-14',
     '2024-11-11',
     '2024-11-28',
     '2024-12-25']],
   '2024-12-04'),
  ('short one day friday',
   ['2024-03-08',
    1,
    ['2024-01-01',
     '2024-01-15',
     '2024-02-19',
     '2024-05-27',
     '2024-06-19',
     '2024-07-04',
     '2024-09-02',
     '2024-10-14',
     '2024-11-11',
     '2024-11-28',
     '2024-12-25']],
   '2024-03-11'),
  ('short ends on observed friday', ['2020-06-29', 4, ['2020-07-04']], '2020-07-06'),
  ('long ends on observed friday', ['2020-06-03', 30, ['2020-07-04']], '2020-07-06'),
  ('regression: observed monday holiday', ['2021-06-28', 7, ['2021-07-04']], '2021-07-08'),
  ('saturday holiday observed friday', ['2020-06-29', 5, ['2020-07-04']], '2020-07-07')]]
for label, args, expected in fixtures[N-1]:
    check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
regression: observed monday holiday2021-07-082021-07-08Passed
saturday holiday observed friday2020-07-072020-07-07Passed
eleven day period2024-01-132024-01-16Failed
ten day period2024-01-172024-01-17Passed
short spanning holiday2024-06-032024-06-03Passed
long ends sunday2024-03-032024-03-04Failed
long ends on holiday2024-05-272024-05-28Failed

SHA-256 / 756ac38939eb991501fe72a18f1c1cdda458e53d360aaa0a445ad77193c348fd

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import datetime as dt
import calendar
N = 1
observations = []
def solve(trigger, days, holidays):
    t = dt.date.fromisoformat(trigger)
    hol = set()
    for h in holidays:
        x = dt.date.fromisoformat(h)
        hol.add(x - dt.timedelta(days=1) if x.weekday() == 5 else x + dt.timedelta(days=1) if x.weekday() == 6 else x)
    def closed(d):
        return d.weekday() >= 5 or d in hol
    short = days < 11
    d = t
    n = 0
    while n < days:
        d += dt.timedelta(days=1)
        if short and closed(d):
            continue
        n += 1
    while d.weekday() >= 5:
        d += dt.timedelta(days=1)
    return d.isoformat()
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: observed monday holiday', ['2021-06-28', 7, ['2021-07-04']], '2021-07-08'),
  ('saturday holiday observed friday', ['2020-06-29', 5, ['2020-07-04']], '2020-07-07'),
  ('eleven day period',
   ['2024-01-02',
    11,
    ['2024-01-01',
     '2024-01-15',
     '2024-02-19',
     '2024-05-27',
     '2024-06-19',
     '2024-07-04',
     '2024-09-02',
     '2024-10-14',
     '2024-11-11',
     '2024-11-28',
     '2024-12-25']],
   '2024-01-16'),
  ('ten day period',
   ['2024-01-02',
    10,
    ['2024-01-01',
     '2024-01-15',
     '2024-02-19',
     '2024-05-27',
     '2024-06-19',
     '2024-07-04',
     '2024-09-02',
     '2024-10-14',
     '2024-11-11',
     '2024-11-28',
     '2024-12-25']],
   '2024-01-17'),
  ('short spanning holiday',
   ['2024-05-22',
    7,
    ['2024-01-01',
     '2024-01-15',
     '2024-02-19',
     '2024-05-27',
     '2024-06-19',
     '2024-07-04',
     '2024-09-02',
     '2024-10-14',
     '2024-11-11',
     '2024-11-28',
     '2024-12-25']],
   '2024-06-03'),
  ('long ends sunday',
   ['2024-02-02',
    30,
    ['2024-01-01',
     '2024-01-15',
     '2024-02-19',
     '2024-05-27',
     '2024-06-19',
     '2024-07-04',
     '2024-09-02',
     '2024-10-14',
     '2024-11-11',
     '2024-11-28',
     '2024-12-25']],
   '2024-03-04'),
  ('long ends on holiday',
   ['2024-04-27',
    30,
    ['2024-01-01',
     '2024-01-15',
     '2024-02-19',
     '2024-05-27',
     '2024-06-19',
     '2024-07-04',
     '2024-09-02',
     '2024-10-14',
     '2024-11-11',
     '2024-11-28',
     '2024-12-25']],
   '2024-05-28')],
 [('eleven day period',
   ['2024-01-02',
    11,
    ['2024-01-01',
     '2024-01-15',
     '2024-02-19',
     '2024-05-27',
     '2024-06-19',
     '2024-07-04',
     '2024-09-02',
     '2024-10-14',
     '2024-11-11',
     '2024-11-28',
     '2024-12-25']],
   '2024-01-16'),
  ('ten day period',
   ['2024-01-02',
    10,
    ['2024-01-01',
     '2024-01-15',
     '2024-02-19',
     '2024-05-27',
     '2024-06-19',
     '2024-07-04',
     '2024-09-02',
     '2024-10-14',
     '2024-11-11',
     '2024-11-28',
     '2024-12-25']],
   '2024-01-17'),
  ('short spanning holiday',
   ['2024-05-22',
    7,
    ['2024-01-01',
     '2024-01-15',
     '2024-02-19',
     '2024-05-27',
     '2024-06-19',
     '2024-07-04',
     '2024-09-02',
     '2024-10-14',
     '2024-11-11',
     '2024-11-28',
     '2024-12-25']],
   '2024-06-03'),
  ('long ends sunday',
   ['2024-02-02',
    30,
    ['2024-01-01',
     '2024-01-15',
     '2024-02-19',
     '2024-05-27',
     '2024-06-19',
     '2024-07-04',
     '2024-09-02',
     '2024-10-14',
     '2024-11-11',
     '2024-11-28',
     '2024-12-25']],
   '2024-03-04'),
  ('long ends on holiday',
   ['2024-04-27',
    30,
    ['2024-01-01',
     '2024-01-15',
     '2024-02-19',
     '2024-05-27',
     '2024-06-19',
     '2024-07-04',
     '2024-09-02',
     '2024-10-14',
     '2024-11-11',
     '2024-11-28',
     '2024-12-25']],
   '2024-05-28'),
  ('short ends at weekend',
   ['2024-03-04',
    5,
    ['2024-01-01',
     '2024-01-15',
     '2024-02-19',
     '2024-05-27',
     '2024-06-19',
     '2024-07-04',
     '2024-09-02',
     '2024-10-14',
     '2024-11-11',
     '2024-11-28',
     '2024-12-25']],
   '2024-03-11'),
  ('christmas short', ['2021-12-20', 5, ['2021-12-25', '2022-01-01']], '2021-12-28')],
 [('short spanning holiday',
   ['2024-05-22',
    7,
    ['2024-01-01',
     '2024-01-15',
     '2024-02-19',
     '2024-05-27',
     '2024-06-19',
     '2024-07-04',
     '2024-09-02',
     '2024-10-14',
     '2024-11-11',
     '2024-11-28',
     '2024-12-25']],
   '2024-06-03'),
  ('long ends sunday',
   ['2024-02-02',
    30,
    ['2024-01-01',
     '2024-01-15',
     '2024-02-19',
     '2024-05-27',
     '2024-06-19',
     '2024-07-04',
     '2024-09-02',
     '2024-10-14',
     '2024-11-11',
     '2024-11-28',
     '2024-12-25']],
   '2024-03-04'),
  ('long ends on holiday',
   ['2024-04-27',
    30,
    ['2024-01-01',
     '2024-01-15',
     '2024-02-19',
     '2024-05-27',
     '2024-06-19',
     '2024-07-04',
     '2024-09-02',
     '2024-10-14',
     '2024-11-11',
     '2024-11-28',
     '2024-12-25']],
   '2024-05-28'),
  ('short ends at weekend',
   ['2024-03-04',
    5,
    ['2024-01-01',
     '2024-01-15',
     '2024-02-19',
     '2024-05-27',
     '2024-06-19',
     '2024-07-04',
     '2024-09-02',
     '2024-10-14',
     '2024-11-11',
     '2024-11-28',
     '2024-12-25']],
   '2024-03-11'),
  ('christmas short', ['2021-12-20', 5, ['2021-12-25', '2022-01-01']], '2021-12-28'),
  ('long 14 across holiday',
   ['2024-11-20',
    14,
    ['2024-01-01',
     '2024-01-15',
     '2024-02-19',
     '2024-05-27',
     '2024-06-19',
     '2024-07-04',
     '2024-09-02',
     '2024-10-14',
     '2024-11-11',
     '2024-11-28',
     '2024-12-25']],
   '2024-12-04'),
  ('short one day friday',
   ['2024-03-08',
    1,
    ['2024-01-01',
     '2024-01-15',
     '2024-02-19',
     '2024-05-27',
     '2024-06-19',
     '2024-07-04',
     '2024-09-02',
     '2024-10-14',
     '2024-11-11',
     '2024-11-28',
     '2024-12-25']],
   '2024-03-11')],
 [('long ends on holiday',
   ['2024-04-27',
    30,
    ['2024-01-01',
     '2024-01-15',
     '2024-02-19',
     '2024-05-27',
     '2024-06-19',
     '2024-07-04',
     '2024-09-02',
     '2024-10-14',
     '2024-11-11',
     '2024-11-28',
     '2024-12-25']],
   '2024-05-28'),
  ('short ends at weekend',
   ['2024-03-04',
    5,
    ['2024-01-01',
     '2024-01-15',
     '2024-02-19',
     '2024-05-27',
     '2024-06-19',
     '2024-07-04',
     '2024-09-02',
     '2024-10-14',
     '2024-11-11',
     '2024-11-28',
     '2024-12-25']],
   '2024-03-11'),
  ('christmas short', ['2021-12-20', 5, ['2021-12-25', '2022-01-01']], '2021-12-28'),
  ('long 14 across holiday',
   ['2024-11-20',
    14,
    ['2024-01-01',
     '2024-01-15',
     '2024-02-19',
     '2024-05-27',
     '2024-06-19',
     '2024-07-04',
     '2024-09-02',
     '2024-10-14',
     '2024-11-11',
     '2024-11-28',
     '2024-12-25']],
   '2024-12-04'),
  ('short one day friday',
   ['2024-03-08',
    1,
    ['2024-01-01',
     '2024-01-15',
     '2024-02-19',
     '2024-05-27',
     '2024-06-19',
     '2024-07-04',
     '2024-09-02',
     '2024-10-14',
     '2024-11-11',
     '2024-11-28',
     '2024-12-25']],
   '2024-03-11'),
  ('short ends on observed friday', ['2020-06-29', 4, ['2020-07-04']], '2020-07-06'),
  ('long ends on observed friday', ['2020-06-03', 30, ['2020-07-04']], '2020-07-06')],
 [('christmas short', ['2021-12-20', 5, ['2021-12-25', '2022-01-01']], '2021-12-28'),
  ('long 14 across holiday',
   ['2024-11-20',
    14,
    ['2024-01-01',
     '2024-01-15',
     '2024-02-19',
     '2024-05-27',
     '2024-06-19',
     '2024-07-04',
     '2024-09-02',
     '2024-10-14',
     '2024-11-11',
     '2024-11-28',
     '2024-12-25']],
   '2024-12-04'),
  ('short one day friday',
   ['2024-03-08',
    1,
    ['2024-01-01',
     '2024-01-15',
     '2024-02-19',
     '2024-05-27',
     '2024-06-19',
     '2024-07-04',
     '2024-09-02',
     '2024-10-14',
     '2024-11-11',
     '2024-11-28',
     '2024-12-25']],
   '2024-03-11'),
  ('short ends on observed friday', ['2020-06-29', 4, ['2020-07-04']], '2020-07-06'),
  ('long ends on observed friday', ['2020-06-03', 30, ['2020-07-04']], '2020-07-06'),
  ('regression: observed monday holiday', ['2021-06-28', 7, ['2021-07-04']], '2021-07-08'),
  ('saturday holiday observed friday', ['2020-06-29', 5, ['2020-07-04']], '2020-07-07')]]
for label, args, expected in fixtures[N-1]:
    check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
regression: observed monday holiday2021-07-082021-07-08Passed
saturday holiday observed friday2020-07-072020-07-07Passed
eleven day period2024-01-152024-01-16Failed
ten day period2024-01-172024-01-17Passed
short spanning holiday2024-06-032024-06-03Passed
long ends sunday2024-03-042024-03-04Passed
long ends on holiday2024-05-272024-05-28Failed

SHA-256 / 68d4b955ce5666a7a5de068ecd884447ff70065e76ad9e1b9715eab0ae3e0421

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json
import datetime as dt
import calendar
N = 1
observations = []
def solve(trigger, days, holidays):
    t = dt.date.fromisoformat(trigger)
    hol = set()
    for h in holidays:
        x = dt.date.fromisoformat(h)
        hol.add(x - dt.timedelta(days=1) if x.weekday() == 5 else x + dt.timedelta(days=1) if x.weekday() == 6 else x)
    def closed(d):
        return d.weekday() >= 5 or d in hol
    short = days < 11
    d = t
    n = 0
    while n < days:
        d += dt.timedelta(days=1)
        if short and closed(d):
            continue
        n += 1
    while closed(d):
        d += dt.timedelta(days=1)
    return d.isoformat()
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: observed monday holiday', ['2021-06-28', 7, ['2021-07-04']], '2021-07-08'),
  ('saturday holiday observed friday', ['2020-06-29', 5, ['2020-07-04']], '2020-07-07'),
  ('eleven day period',
   ['2024-01-02',
    11,
    ['2024-01-01',
     '2024-01-15',
     '2024-02-19',
     '2024-05-27',
     '2024-06-19',
     '2024-07-04',
     '2024-09-02',
     '2024-10-14',
     '2024-11-11',
     '2024-11-28',
     '2024-12-25']],
   '2024-01-16'),
  ('ten day period',
   ['2024-01-02',
    10,
    ['2024-01-01',
     '2024-01-15',
     '2024-02-19',
     '2024-05-27',
     '2024-06-19',
     '2024-07-04',
     '2024-09-02',
     '2024-10-14',
     '2024-11-11',
     '2024-11-28',
     '2024-12-25']],
   '2024-01-17'),
  ('short spanning holiday',
   ['2024-05-22',
    7,
    ['2024-01-01',
     '2024-01-15',
     '2024-02-19',
     '2024-05-27',
     '2024-06-19',
     '2024-07-04',
     '2024-09-02',
     '2024-10-14',
     '2024-11-11',
     '2024-11-28',
     '2024-12-25']],
   '2024-06-03'),
  ('long ends sunday',
   ['2024-02-02',
    30,
    ['2024-01-01',
     '2024-01-15',
     '2024-02-19',
     '2024-05-27',
     '2024-06-19',
     '2024-07-04',
     '2024-09-02',
     '2024-10-14',
     '2024-11-11',
     '2024-11-28',
     '2024-12-25']],
   '2024-03-04'),
  ('long ends on holiday',
   ['2024-04-27',
    30,
    ['2024-01-01',
     '2024-01-15',
     '2024-02-19',
     '2024-05-27',
     '2024-06-19',
     '2024-07-04',
     '2024-09-02',
     '2024-10-14',
     '2024-11-11',
     '2024-11-28',
     '2024-12-25']],
   '2024-05-28')],
 [('eleven day period',
   ['2024-01-02',
    11,
    ['2024-01-01',
     '2024-01-15',
     '2024-02-19',
     '2024-05-27',
     '2024-06-19',
     '2024-07-04',
     '2024-09-02',
     '2024-10-14',
     '2024-11-11',
     '2024-11-28',
     '2024-12-25']],
   '2024-01-16'),
  ('ten day period',
   ['2024-01-02',
    10,
    ['2024-01-01',
     '2024-01-15',
     '2024-02-19',
     '2024-05-27',
     '2024-06-19',
     '2024-07-04',
     '2024-09-02',
     '2024-10-14',
     '2024-11-11',
     '2024-11-28',
     '2024-12-25']],
   '2024-01-17'),
  ('short spanning holiday',
   ['2024-05-22',
    7,
    ['2024-01-01',
     '2024-01-15',
     '2024-02-19',
     '2024-05-27',
     '2024-06-19',
     '2024-07-04',
     '2024-09-02',
     '2024-10-14',
     '2024-11-11',
     '2024-11-28',
     '2024-12-25']],
   '2024-06-03'),
  ('long ends sunday',
   ['2024-02-02',
    30,
    ['2024-01-01',
     '2024-01-15',
     '2024-02-19',
     '2024-05-27',
     '2024-06-19',
     '2024-07-04',
     '2024-09-02',
     '2024-10-14',
     '2024-11-11',
     '2024-11-28',
     '2024-12-25']],
   '2024-03-04'),
  ('long ends on holiday',
   ['2024-04-27',
    30,
    ['2024-01-01',
     '2024-01-15',
     '2024-02-19',
     '2024-05-27',
     '2024-06-19',
     '2024-07-04',
     '2024-09-02',
     '2024-10-14',
     '2024-11-11',
     '2024-11-28',
     '2024-12-25']],
   '2024-05-28'),
  ('short ends at weekend',
   ['2024-03-04',
    5,
    ['2024-01-01',
     '2024-01-15',
     '2024-02-19',
     '2024-05-27',
     '2024-06-19',
     '2024-07-04',
     '2024-09-02',
     '2024-10-14',
     '2024-11-11',
     '2024-11-28',
     '2024-12-25']],
   '2024-03-11'),
  ('christmas short', ['2021-12-20', 5, ['2021-12-25', '2022-01-01']], '2021-12-28')],
 [('short spanning holiday',
   ['2024-05-22',
    7,
    ['2024-01-01',
     '2024-01-15',
     '2024-02-19',
     '2024-05-27',
     '2024-06-19',
     '2024-07-04',
     '2024-09-02',
     '2024-10-14',
     '2024-11-11',
     '2024-11-28',
     '2024-12-25']],
   '2024-06-03'),
  ('long ends sunday',
   ['2024-02-02',
    30,
    ['2024-01-01',
     '2024-01-15',
     '2024-02-19',
     '2024-05-27',
     '2024-06-19',
     '2024-07-04',
     '2024-09-02',
     '2024-10-14',
     '2024-11-11',
     '2024-11-28',
     '2024-12-25']],
   '2024-03-04'),
  ('long ends on holiday',
   ['2024-04-27',
    30,
    ['2024-01-01',
     '2024-01-15',
     '2024-02-19',
     '2024-05-27',
     '2024-06-19',
     '2024-07-04',
     '2024-09-02',
     '2024-10-14',
     '2024-11-11',
     '2024-11-28',
     '2024-12-25']],
   '2024-05-28'),
  ('short ends at weekend',
   ['2024-03-04',
    5,
    ['2024-01-01',
     '2024-01-15',
     '2024-02-19',
     '2024-05-27',
     '2024-06-19',
     '2024-07-04',
     '2024-09-02',
     '2024-10-14',
     '2024-11-11',
     '2024-11-28',
     '2024-12-25']],
   '2024-03-11'),
  ('christmas short', ['2021-12-20', 5, ['2021-12-25', '2022-01-01']], '2021-12-28'),
  ('long 14 across holiday',
   ['2024-11-20',
    14,
    ['2024-01-01',
     '2024-01-15',
     '2024-02-19',
     '2024-05-27',
     '2024-06-19',
     '2024-07-04',
     '2024-09-02',
     '2024-10-14',
     '2024-11-11',
     '2024-11-28',
     '2024-12-25']],
   '2024-12-04'),
  ('short one day friday',
   ['2024-03-08',
    1,
    ['2024-01-01',
     '2024-01-15',
     '2024-02-19',
     '2024-05-27',
     '2024-06-19',
     '2024-07-04',
     '2024-09-02',
     '2024-10-14',
     '2024-11-11',
     '2024-11-28',
     '2024-12-25']],
   '2024-03-11')],
 [('long ends on holiday',
   ['2024-04-27',
    30,
    ['2024-01-01',
     '2024-01-15',
     '2024-02-19',
     '2024-05-27',
     '2024-06-19',
     '2024-07-04',
     '2024-09-02',
     '2024-10-14',
     '2024-11-11',
     '2024-11-28',
     '2024-12-25']],
   '2024-05-28'),
  ('short ends at weekend',
   ['2024-03-04',
    5,
    ['2024-01-01',
     '2024-01-15',
     '2024-02-19',
     '2024-05-27',
     '2024-06-19',
     '2024-07-04',
     '2024-09-02',
     '2024-10-14',
     '2024-11-11',
     '2024-11-28',
     '2024-12-25']],
   '2024-03-11'),
  ('christmas short', ['2021-12-20', 5, ['2021-12-25', '2022-01-01']], '2021-12-28'),
  ('long 14 across holiday',
   ['2024-11-20',
    14,
    ['2024-01-01',
     '2024-01-15',
     '2024-02-19',
     '2024-05-27',
     '2024-06-19',
     '2024-07-04',
     '2024-09-02',
     '2024-10-14',
     '2024-11-11',
     '2024-11-28',
     '2024-12-25']],
   '2024-12-04'),
  ('short one day friday',
   ['2024-03-08',
    1,
    ['2024-01-01',
     '2024-01-15',
     '2024-02-19',
     '2024-05-27',
     '2024-06-19',
     '2024-07-04',
     '2024-09-02',
     '2024-10-14',
     '2024-11-11',
     '2024-11-28',
     '2024-12-25']],
   '2024-03-11'),
  ('short ends on observed friday', ['2020-06-29', 4, ['2020-07-04']], '2020-07-06'),
  ('long ends on observed friday', ['2020-06-03', 30, ['2020-07-04']], '2020-07-06')],
 [('christmas short', ['2021-12-20', 5, ['2021-12-25', '2022-01-01']], '2021-12-28'),
  ('long 14 across holiday',
   ['2024-11-20',
    14,
    ['2024-01-01',
     '2024-01-15',
     '2024-02-19',
     '2024-05-27',
     '2024-06-19',
     '2024-07-04',
     '2024-09-02',
     '2024-10-14',
     '2024-11-11',
     '2024-11-28',
     '2024-12-25']],
   '2024-12-04'),
  ('short one day friday',
   ['2024-03-08',
    1,
    ['2024-01-01',
     '2024-01-15',
     '2024-02-19',
     '2024-05-27',
     '2024-06-19',
     '2024-07-04',
     '2024-09-02',
     '2024-10-14',
     '2024-11-11',
     '2024-11-28',
     '2024-12-25']],
   '2024-03-11'),
  ('short ends on observed friday', ['2020-06-29', 4, ['2020-07-04']], '2020-07-06'),
  ('long ends on observed friday', ['2020-06-03', 30, ['2020-07-04']], '2020-07-06'),
  ('regression: observed monday holiday', ['2021-06-28', 7, ['2021-07-04']], '2021-07-08'),
  ('saturday holiday observed friday', ['2020-06-29', 5, ['2020-07-04']], '2020-07-07')]]
for label, args, expected in fixtures[N-1]:
    check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
regression: observed monday holiday2021-07-082021-07-08Passed
saturday holiday observed friday2020-07-072020-07-07Passed
eleven day period2024-01-162024-01-16Passed
ten day period2024-01-172024-01-17Passed
short spanning holiday2024-06-032024-06-03Passed
long ends sunday2024-03-042024-03-04Passed
long ends on holiday2024-05-282024-05-28Passed

SHA-256 / 82f5f44f3c5cb37a67e56841741313856faeb9b4e48f44121b16b2b2ad86020e

Verification & scope

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.

Observations recorded using Python 3.12.14 at 2026-09-29T14:49:25.063954+00:00.

Case digest / 927b603cb065727f68584c1c552f572c71d9a7574a589b7373fd3fb7d8b4097b