FAILURE MAP
← Case archive

FA-77701 / Legal deadline computation / Open access

Docket countdown: court days remaining and urgency status: passed test · case 01

On the deadline day the court-day count is blank instead of zero.

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

ROOT CAUSE

The deadline day itself is treated as passed.

VERIFIED REPAIR

At the passed test decision use `cal < 0`, leaving the other decision sites of the model unchanged.

Unsuccessful approach: The partial repair `dl < t - dt.timedelta(days=1)` treats yesterday's deadline as not yet passed.

Case contract

For today and a deadline, return [calendar days remaining, court days remaining, status]. Court days remaining counts open days (not Saturday, Sunday or a listed holiday) after today up to and including the deadline; it is None when the deadline has passed. Status is "overdue" if the deadline is before today, "due today" if equal, "due soon" if at most 3 court days remain, else "open".

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(today, deadline, holidays):
    t = dt.date.fromisoformat(today)
    dl = dt.date.fromisoformat(deadline)
    hol = {dt.date.fromisoformat(x) for x in holidays}
    cal = (dl - t).days
    if cal <= 0:
        court = None
    else:
        court = sum(1 for i in range(1, cal + 1) if (t + dt.timedelta(days=i)).weekday() < 5 and t + dt.timedelta(days=i) not in hol)
    if cal < 0:
        status = 'overdue'
    elif cal == 0:
        status = 'due today'
    elif court <= 3:
        status = 'due soon'
    else:
        status = 'open'
    return [cal, court, status]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: saturday before monday deadline',
   ['2024-03-09',
    '2024-03-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']],
   [2, 1, 'due soon']),
  ('deadline today',
   ['2024-03-11',
    '2024-03-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']],
   [0, 0, 'due today']),
  ('yesterday',
   ['2024-03-12',
    '2024-03-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']],
   [-1, None, 'overdue']),
  ('three court days',
   ['2024-03-11',
    '2024-03-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']],
   [3, 3, 'due soon']),
  ('long weekend',
   ['2024-05-24',
    '2024-05-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']],
   [6, 3, 'due soon']),
  ('five calendar four court',
   ['2024-05-23',
    '2024-05-28',
    ['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']],
   [5, 2, 'due soon']),
  ('far off',
   ['2024-01-02',
    '2024-02-15',
    ['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']],
   [44, 31, 'open'])],
 [('yesterday',
   ['2024-03-12',
    '2024-03-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']],
   [-1, None, 'overdue']),
  ('three court days',
   ['2024-03-11',
    '2024-03-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']],
   [3, 3, 'due soon']),
  ('long weekend',
   ['2024-05-24',
    '2024-05-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']],
   [6, 3, 'due soon']),
  ('five calendar four court',
   ['2024-05-23',
    '2024-05-28',
    ['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']],
   [5, 2, 'due soon']),
  ('far off',
   ['2024-01-02',
    '2024-02-15',
    ['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']],
   [44, 31, 'open']),
  ('tomorrow',
   ['2024-04-01',
    '2024-04-02',
    ['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']],
   [1, 1, 'due soon']),
  ('two weeks ago',
   ['2024-04-15',
    '2024-04-01',
    ['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']],
   [-14, None, 'overdue']),
  ('deadline today',
   ['2024-03-11',
    '2024-03-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']],
   [0, 0, 'due today'])],
 [('long weekend',
   ['2024-05-24',
    '2024-05-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']],
   [6, 3, 'due soon']),
  ('five calendar four court',
   ['2024-05-23',
    '2024-05-28',
    ['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']],
   [5, 2, 'due soon']),
  ('far off',
   ['2024-01-02',
    '2024-02-15',
    ['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']],
   [44, 31, 'open']),
  ('tomorrow',
   ['2024-04-01',
    '2024-04-02',
    ['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']],
   [1, 1, 'due soon']),
  ('two weeks ago',
   ['2024-04-15',
    '2024-04-01',
    ['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']],
   [-14, None, 'overdue']),
  ('friday to wednesday',
   ['2024-06-14',
    '2024-06-19',
    ['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']],
   [5, 2, 'due soon']),
  ('thanksgiving week',
   ['2024-11-26',
    '2024-12-02',
    ['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']],
   [6, 3, 'due soon']),
  ('deadline today',
   ['2024-03-11',
    '2024-03-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']],
   [0, 0, 'due today']),
  ('yesterday',
   ['2024-03-12',
    '2024-03-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']],
   [-1, None, 'overdue'])],
 [('far off',
   ['2024-01-02',
    '2024-02-15',
    ['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']],
   [44, 31, 'open']),
  ('tomorrow',
   ['2024-04-01',
    '2024-04-02',
    ['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']],
   [1, 1, 'due soon']),
  ('two weeks ago',
   ['2024-04-15',
    '2024-04-01',
    ['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']],
   [-14, None, 'overdue']),
  ('friday to wednesday',
   ['2024-06-14',
    '2024-06-19',
    ['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']],
   [5, 2, 'due soon']),
  ('thanksgiving week',
   ['2024-11-26',
    '2024-12-02',
    ['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']],
   [6, 3, 'due soon']),
  ('saturday before sunday deadline',
   ['2024-03-09',
    '2024-03-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']],
   [1, 0, 'due soon']),
  ('regression: saturday before monday deadline',
   ['2024-03-09',
    '2024-03-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']],
   [2, 1, 'due soon']),
  ('deadline today',
   ['2024-03-11',
    '2024-03-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']],
   [0, 0, 'due today']),
  ('yesterday',
   ['2024-03-12',
    '2024-03-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']],
   [-1, None, 'overdue'])],
 [('two weeks ago',
   ['2024-04-15',
    '2024-04-01',
    ['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']],
   [-14, None, 'overdue']),
  ('friday to wednesday',
   ['2024-06-14',
    '2024-06-19',
    ['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']],
   [5, 2, 'due soon']),
  ('thanksgiving week',
   ['2024-11-26',
    '2024-12-02',
    ['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']],
   [6, 3, 'due soon']),
  ('saturday before sunday deadline',
   ['2024-03-09',
    '2024-03-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']],
   [1, 0, 'due soon']),
  ('regression: saturday before monday deadline',
   ['2024-03-09',
    '2024-03-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']],
   [2, 1, 'due soon']),
  ('deadline today',
   ['2024-03-11',
    '2024-03-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']],
   [0, 0, 'due today']),
  ('yesterday',
   ['2024-03-12',
    '2024-03-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']],
   [-1, None, 'overdue'])]]
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: saturday before monday deadline[2, 1, 'due soon'][2, 1, 'due soon']Passed
deadline today[0, None, 'due today'][0, 0, 'due today']Failed
yesterday[-1, None, 'overdue'][-1, None, 'overdue']Passed
three court days[3, 3, 'due soon'][3, 3, 'due soon']Passed
long weekend[6, 3, 'due soon'][6, 3, 'due soon']Passed
five calendar four court[5, 2, 'due soon'][5, 2, 'due soon']Passed
far off[44, 31, 'open'][44, 31, 'open']Passed

SHA-256 / 24d0dd9befb1ceb7b38da863029c8318f10ac317bbd423bc42c1ebe53846a921

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(today, deadline, holidays):
    t = dt.date.fromisoformat(today)
    dl = dt.date.fromisoformat(deadline)
    hol = {dt.date.fromisoformat(x) for x in holidays}
    cal = (dl - t).days
    if dl < t - dt.timedelta(days=1):
        court = None
    else:
        court = sum(1 for i in range(1, cal + 1) if (t + dt.timedelta(days=i)).weekday() < 5 and t + dt.timedelta(days=i) not in hol)
    if cal < 0:
        status = 'overdue'
    elif cal == 0:
        status = 'due today'
    elif court <= 3:
        status = 'due soon'
    else:
        status = 'open'
    return [cal, court, status]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: saturday before monday deadline',
   ['2024-03-09',
    '2024-03-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']],
   [2, 1, 'due soon']),
  ('deadline today',
   ['2024-03-11',
    '2024-03-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']],
   [0, 0, 'due today']),
  ('yesterday',
   ['2024-03-12',
    '2024-03-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']],
   [-1, None, 'overdue']),
  ('three court days',
   ['2024-03-11',
    '2024-03-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']],
   [3, 3, 'due soon']),
  ('long weekend',
   ['2024-05-24',
    '2024-05-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']],
   [6, 3, 'due soon']),
  ('five calendar four court',
   ['2024-05-23',
    '2024-05-28',
    ['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']],
   [5, 2, 'due soon']),
  ('far off',
   ['2024-01-02',
    '2024-02-15',
    ['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']],
   [44, 31, 'open'])],
 [('yesterday',
   ['2024-03-12',
    '2024-03-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']],
   [-1, None, 'overdue']),
  ('three court days',
   ['2024-03-11',
    '2024-03-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']],
   [3, 3, 'due soon']),
  ('long weekend',
   ['2024-05-24',
    '2024-05-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']],
   [6, 3, 'due soon']),
  ('five calendar four court',
   ['2024-05-23',
    '2024-05-28',
    ['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']],
   [5, 2, 'due soon']),
  ('far off',
   ['2024-01-02',
    '2024-02-15',
    ['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']],
   [44, 31, 'open']),
  ('tomorrow',
   ['2024-04-01',
    '2024-04-02',
    ['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']],
   [1, 1, 'due soon']),
  ('two weeks ago',
   ['2024-04-15',
    '2024-04-01',
    ['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']],
   [-14, None, 'overdue']),
  ('deadline today',
   ['2024-03-11',
    '2024-03-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']],
   [0, 0, 'due today'])],
 [('long weekend',
   ['2024-05-24',
    '2024-05-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']],
   [6, 3, 'due soon']),
  ('five calendar four court',
   ['2024-05-23',
    '2024-05-28',
    ['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']],
   [5, 2, 'due soon']),
  ('far off',
   ['2024-01-02',
    '2024-02-15',
    ['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']],
   [44, 31, 'open']),
  ('tomorrow',
   ['2024-04-01',
    '2024-04-02',
    ['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']],
   [1, 1, 'due soon']),
  ('two weeks ago',
   ['2024-04-15',
    '2024-04-01',
    ['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']],
   [-14, None, 'overdue']),
  ('friday to wednesday',
   ['2024-06-14',
    '2024-06-19',
    ['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']],
   [5, 2, 'due soon']),
  ('thanksgiving week',
   ['2024-11-26',
    '2024-12-02',
    ['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']],
   [6, 3, 'due soon']),
  ('deadline today',
   ['2024-03-11',
    '2024-03-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']],
   [0, 0, 'due today']),
  ('yesterday',
   ['2024-03-12',
    '2024-03-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']],
   [-1, None, 'overdue'])],
 [('far off',
   ['2024-01-02',
    '2024-02-15',
    ['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']],
   [44, 31, 'open']),
  ('tomorrow',
   ['2024-04-01',
    '2024-04-02',
    ['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']],
   [1, 1, 'due soon']),
  ('two weeks ago',
   ['2024-04-15',
    '2024-04-01',
    ['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']],
   [-14, None, 'overdue']),
  ('friday to wednesday',
   ['2024-06-14',
    '2024-06-19',
    ['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']],
   [5, 2, 'due soon']),
  ('thanksgiving week',
   ['2024-11-26',
    '2024-12-02',
    ['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']],
   [6, 3, 'due soon']),
  ('saturday before sunday deadline',
   ['2024-03-09',
    '2024-03-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']],
   [1, 0, 'due soon']),
  ('regression: saturday before monday deadline',
   ['2024-03-09',
    '2024-03-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']],
   [2, 1, 'due soon']),
  ('deadline today',
   ['2024-03-11',
    '2024-03-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']],
   [0, 0, 'due today']),
  ('yesterday',
   ['2024-03-12',
    '2024-03-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']],
   [-1, None, 'overdue'])],
 [('two weeks ago',
   ['2024-04-15',
    '2024-04-01',
    ['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']],
   [-14, None, 'overdue']),
  ('friday to wednesday',
   ['2024-06-14',
    '2024-06-19',
    ['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']],
   [5, 2, 'due soon']),
  ('thanksgiving week',
   ['2024-11-26',
    '2024-12-02',
    ['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']],
   [6, 3, 'due soon']),
  ('saturday before sunday deadline',
   ['2024-03-09',
    '2024-03-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']],
   [1, 0, 'due soon']),
  ('regression: saturday before monday deadline',
   ['2024-03-09',
    '2024-03-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']],
   [2, 1, 'due soon']),
  ('deadline today',
   ['2024-03-11',
    '2024-03-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']],
   [0, 0, 'due today']),
  ('yesterday',
   ['2024-03-12',
    '2024-03-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']],
   [-1, None, 'overdue'])]]
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: saturday before monday deadline[2, 1, 'due soon'][2, 1, 'due soon']Passed
deadline today[0, 0, 'due today'][0, 0, 'due today']Passed
yesterday[-1, 0, 'overdue'][-1, None, 'overdue']Failed
three court days[3, 3, 'due soon'][3, 3, 'due soon']Passed
long weekend[6, 3, 'due soon'][6, 3, 'due soon']Passed
five calendar four court[5, 2, 'due soon'][5, 2, 'due soon']Passed
far off[44, 31, 'open'][44, 31, 'open']Passed

SHA-256 / d2ee9e52c8ad9585089a438220bcb1021ddb4b38134cdeff51e43cba876af3a1

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(today, deadline, holidays):
    t = dt.date.fromisoformat(today)
    dl = dt.date.fromisoformat(deadline)
    hol = {dt.date.fromisoformat(x) for x in holidays}
    cal = (dl - t).days
    if cal < 0:
        court = None
    else:
        court = sum(1 for i in range(1, cal + 1) if (t + dt.timedelta(days=i)).weekday() < 5 and t + dt.timedelta(days=i) not in hol)
    if cal < 0:
        status = 'overdue'
    elif cal == 0:
        status = 'due today'
    elif court <= 3:
        status = 'due soon'
    else:
        status = 'open'
    return [cal, court, status]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: saturday before monday deadline',
   ['2024-03-09',
    '2024-03-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']],
   [2, 1, 'due soon']),
  ('deadline today',
   ['2024-03-11',
    '2024-03-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']],
   [0, 0, 'due today']),
  ('yesterday',
   ['2024-03-12',
    '2024-03-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']],
   [-1, None, 'overdue']),
  ('three court days',
   ['2024-03-11',
    '2024-03-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']],
   [3, 3, 'due soon']),
  ('long weekend',
   ['2024-05-24',
    '2024-05-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']],
   [6, 3, 'due soon']),
  ('five calendar four court',
   ['2024-05-23',
    '2024-05-28',
    ['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']],
   [5, 2, 'due soon']),
  ('far off',
   ['2024-01-02',
    '2024-02-15',
    ['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']],
   [44, 31, 'open'])],
 [('yesterday',
   ['2024-03-12',
    '2024-03-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']],
   [-1, None, 'overdue']),
  ('three court days',
   ['2024-03-11',
    '2024-03-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']],
   [3, 3, 'due soon']),
  ('long weekend',
   ['2024-05-24',
    '2024-05-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']],
   [6, 3, 'due soon']),
  ('five calendar four court',
   ['2024-05-23',
    '2024-05-28',
    ['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']],
   [5, 2, 'due soon']),
  ('far off',
   ['2024-01-02',
    '2024-02-15',
    ['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']],
   [44, 31, 'open']),
  ('tomorrow',
   ['2024-04-01',
    '2024-04-02',
    ['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']],
   [1, 1, 'due soon']),
  ('two weeks ago',
   ['2024-04-15',
    '2024-04-01',
    ['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']],
   [-14, None, 'overdue']),
  ('deadline today',
   ['2024-03-11',
    '2024-03-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']],
   [0, 0, 'due today'])],
 [('long weekend',
   ['2024-05-24',
    '2024-05-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']],
   [6, 3, 'due soon']),
  ('five calendar four court',
   ['2024-05-23',
    '2024-05-28',
    ['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']],
   [5, 2, 'due soon']),
  ('far off',
   ['2024-01-02',
    '2024-02-15',
    ['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']],
   [44, 31, 'open']),
  ('tomorrow',
   ['2024-04-01',
    '2024-04-02',
    ['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']],
   [1, 1, 'due soon']),
  ('two weeks ago',
   ['2024-04-15',
    '2024-04-01',
    ['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']],
   [-14, None, 'overdue']),
  ('friday to wednesday',
   ['2024-06-14',
    '2024-06-19',
    ['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']],
   [5, 2, 'due soon']),
  ('thanksgiving week',
   ['2024-11-26',
    '2024-12-02',
    ['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']],
   [6, 3, 'due soon']),
  ('deadline today',
   ['2024-03-11',
    '2024-03-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']],
   [0, 0, 'due today']),
  ('yesterday',
   ['2024-03-12',
    '2024-03-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']],
   [-1, None, 'overdue'])],
 [('far off',
   ['2024-01-02',
    '2024-02-15',
    ['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']],
   [44, 31, 'open']),
  ('tomorrow',
   ['2024-04-01',
    '2024-04-02',
    ['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']],
   [1, 1, 'due soon']),
  ('two weeks ago',
   ['2024-04-15',
    '2024-04-01',
    ['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']],
   [-14, None, 'overdue']),
  ('friday to wednesday',
   ['2024-06-14',
    '2024-06-19',
    ['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']],
   [5, 2, 'due soon']),
  ('thanksgiving week',
   ['2024-11-26',
    '2024-12-02',
    ['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']],
   [6, 3, 'due soon']),
  ('saturday before sunday deadline',
   ['2024-03-09',
    '2024-03-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']],
   [1, 0, 'due soon']),
  ('regression: saturday before monday deadline',
   ['2024-03-09',
    '2024-03-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']],
   [2, 1, 'due soon']),
  ('deadline today',
   ['2024-03-11',
    '2024-03-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']],
   [0, 0, 'due today']),
  ('yesterday',
   ['2024-03-12',
    '2024-03-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']],
   [-1, None, 'overdue'])],
 [('two weeks ago',
   ['2024-04-15',
    '2024-04-01',
    ['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']],
   [-14, None, 'overdue']),
  ('friday to wednesday',
   ['2024-06-14',
    '2024-06-19',
    ['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']],
   [5, 2, 'due soon']),
  ('thanksgiving week',
   ['2024-11-26',
    '2024-12-02',
    ['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']],
   [6, 3, 'due soon']),
  ('saturday before sunday deadline',
   ['2024-03-09',
    '2024-03-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']],
   [1, 0, 'due soon']),
  ('regression: saturday before monday deadline',
   ['2024-03-09',
    '2024-03-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']],
   [2, 1, 'due soon']),
  ('deadline today',
   ['2024-03-11',
    '2024-03-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']],
   [0, 0, 'due today']),
  ('yesterday',
   ['2024-03-12',
    '2024-03-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']],
   [-1, None, 'overdue'])]]
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: saturday before monday deadline[2, 1, 'due soon'][2, 1, 'due soon']Passed
deadline today[0, 0, 'due today'][0, 0, 'due today']Passed
yesterday[-1, None, 'overdue'][-1, None, 'overdue']Passed
three court days[3, 3, 'due soon'][3, 3, 'due soon']Passed
long weekend[6, 3, 'due soon'][6, 3, 'due soon']Passed
five calendar four court[5, 2, 'due soon'][5, 2, 'due soon']Passed
far off[44, 31, 'open'][44, 31, 'open']Passed

SHA-256 / 097e3f6bdd484bd0a3b1f031348844628cafd323af9de5df7b3d8ce1ab8f57ee

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:27.975937+00:00.

Case digest / cdbae2f34b60b526675638b9a947931323c95f10ea34cc324af7b13f61282ebb