FAILURE MAP
← Case archive

FA-77831 / Legal deadline computation / Open access

Extending a last day when the clerk office is inaccessible: close boundary · case 01

A closure recorded at the normal closing time is treated as making the day inaccessible.

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

ROOT CAUSE

A closure starting exactly at office close is counted as an early closure.

VERIFIED REPAIR

At the close boundary decision use `cl[d] < office_close`, leaving the other decision sites of the model unchanged.

Unsuccessful approach: The partial repair `cl[d] < '12:00'` only counts closures that start before noon.

Case contract

Stipulated: closures are [date, start] where start is "all" (full-day outage) or a local "HH:MM" time the office closed early; several entries for one day merge to "all" if any is "all", else the earliest start. A last day is inaccessible for paper or fax filing if closed all day or early before office_close; for electronic filing only a full-day outage counts. If the last day is inaccessible, the period continues to the first later day that is not a weekend, listed holiday or itself inaccessible.

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(last_day, method, closures, office_close, holidays):
    ld = dt.date.fromisoformat(last_day)
    hol = {dt.date.fromisoformat(x) for x in holidays}
    cl = {}
    for day, start in closures:
        k = dt.date.fromisoformat(day)
        cl[k] = 'all' if start == 'all' or cl.get(k) == 'all' else min(start, cl.get(k, start))
    def inaccessible(d):
        if d not in cl:
            return False
        if cl[d] == 'all':
            return True
        return method in ('paper', 'fax') and cl[d] <= office_close
    d = ld
    if inaccessible(d):
        d += dt.timedelta(days=1)
        while d.weekday() >= 5 or d in hol or inaccessible(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: partial then full outage same day',
   ['2024-03-05',
    'paper',
    [['2024-03-05', 'all'], ['2024-03-05', '15:00']],
    '17:00',
    ['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-06'),
  ('electronic partial closure',
   ['2024-03-05',
    'electronic',
    [['2024-03-05', '14:00']],
    '17:00',
    ['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-05'),
  ('fax partial closure',
   ['2024-03-05',
    'fax',
    [['2024-03-05', '14:00']],
    '17:00',
    ['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-06'),
  ('closure at office close',
   ['2024-03-05',
    'paper',
    [['2024-03-05', '17:00']],
    '17:00',
    ['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-05'),
  ('afternoon closure paper',
   ['2024-03-05',
    'paper',
    [['2024-03-05', '13:30']],
    '17:00',
    ['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-06'),
  ('two-day outage',
   ['2024-03-05',
    'electronic',
    [['2024-03-05', 'all'], ['2024-03-06', 'all']],
    '17:00',
    ['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-07'),
  ('friday outage',
   ['2024-03-08',
    'electronic',
    [['2024-03-08', 'all']],
    '17:00',
    ['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')],
 [('fax partial closure',
   ['2024-03-05',
    'fax',
    [['2024-03-05', '14:00']],
    '17:00',
    ['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-06'),
  ('closure at office close',
   ['2024-03-05',
    'paper',
    [['2024-03-05', '17:00']],
    '17:00',
    ['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-05'),
  ('afternoon closure paper',
   ['2024-03-05',
    'paper',
    [['2024-03-05', '13:30']],
    '17:00',
    ['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-06'),
  ('two-day outage',
   ['2024-03-05',
    'electronic',
    [['2024-03-05', 'all'], ['2024-03-06', 'all']],
    '17:00',
    ['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-07'),
  ('friday outage',
   ['2024-03-08',
    'electronic',
    [['2024-03-08', 'all']],
    '17:00',
    ['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'),
  ('outage before holiday',
   ['2024-07-03',
    'paper',
    [['2024-07-03', '10:00']],
    '17:00',
    ['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-07-05'),
  ('no closure on last day',
   ['2024-03-05',
    'paper',
    [['2024-03-04', 'all']],
    '17:00',
    ['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-05')],
 [('afternoon closure paper',
   ['2024-03-05',
    'paper',
    [['2024-03-05', '13:30']],
    '17:00',
    ['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-06'),
  ('two-day outage',
   ['2024-03-05',
    'electronic',
    [['2024-03-05', 'all'], ['2024-03-06', 'all']],
    '17:00',
    ['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-07'),
  ('friday outage',
   ['2024-03-08',
    'electronic',
    [['2024-03-08', 'all']],
    '17:00',
    ['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'),
  ('outage before holiday',
   ['2024-07-03',
    'paper',
    [['2024-07-03', '10:00']],
    '17:00',
    ['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-07-05'),
  ('no closure on last day',
   ['2024-03-05',
    'paper',
    [['2024-03-04', 'all']],
    '17:00',
    ['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-05'),
  ('friday outage then monday closure',
   ['2024-03-08',
    'paper',
    [['2024-03-08', 'all'], ['2024-03-11', '09:00']],
    '16: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-12'),
  ('two partials same day',
   ['2024-04-10',
    'paper',
    [['2024-04-10', '16:45'], ['2024-04-10', '17:30']],
    '17:00',
    ['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-04-11'),
  ('closure at office close',
   ['2024-03-05',
    'paper',
    [['2024-03-05', '17:00']],
    '17:00',
    ['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-05')],
 [('friday outage',
   ['2024-03-08',
    'electronic',
    [['2024-03-08', 'all']],
    '17:00',
    ['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'),
  ('outage before holiday',
   ['2024-07-03',
    'paper',
    [['2024-07-03', '10:00']],
    '17:00',
    ['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-07-05'),
  ('no closure on last day',
   ['2024-03-05',
    'paper',
    [['2024-03-04', 'all']],
    '17:00',
    ['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-05'),
  ('friday outage then monday closure',
   ['2024-03-08',
    'paper',
    [['2024-03-08', 'all'], ['2024-03-11', '09:00']],
    '16: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-12'),
  ('two partials same day',
   ['2024-04-10',
    'paper',
    [['2024-04-10', '16:45'], ['2024-04-10', '17:30']],
    '17:00',
    ['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-04-11'),
  ('electronic partial then full outage',
   ['2024-04-10',
    'electronic',
    [['2024-04-10', '15:00'], ['2024-04-10', 'all']],
    '17:00',
    ['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-04-11'),
  ('regression: partial then full outage same day',
   ['2024-03-05',
    'paper',
    [['2024-03-05', 'all'], ['2024-03-05', '15:00']],
    '17:00',
    ['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-06'),
  ('closure at office close',
   ['2024-03-05',
    'paper',
    [['2024-03-05', '17:00']],
    '17:00',
    ['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-05')],
 [('no closure on last day',
   ['2024-03-05',
    'paper',
    [['2024-03-04', 'all']],
    '17:00',
    ['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-05'),
  ('friday outage then monday closure',
   ['2024-03-08',
    'paper',
    [['2024-03-08', 'all'], ['2024-03-11', '09:00']],
    '16: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-12'),
  ('two partials same day',
   ['2024-04-10',
    'paper',
    [['2024-04-10', '16:45'], ['2024-04-10', '17:30']],
    '17:00',
    ['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-04-11'),
  ('electronic partial then full outage',
   ['2024-04-10',
    'electronic',
    [['2024-04-10', '15:00'], ['2024-04-10', 'all']],
    '17:00',
    ['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-04-11'),
  ('regression: partial then full outage same day',
   ['2024-03-05',
    'paper',
    [['2024-03-05', 'all'], ['2024-03-05', '15:00']],
    '17:00',
    ['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-06'),
  ('electronic partial closure',
   ['2024-03-05',
    'electronic',
    [['2024-03-05', '14:00']],
    '17:00',
    ['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-05'),
  ('fax partial closure',
   ['2024-03-05',
    'fax',
    [['2024-03-05', '14:00']],
    '17:00',
    ['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-06'),
  ('closure at office close',
   ['2024-03-05',
    'paper',
    [['2024-03-05', '17:00']],
    '17:00',
    ['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-05')]]
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: partial then full outage same day2024-03-062024-03-06Passed
electronic partial closure2024-03-052024-03-05Passed
fax partial closure2024-03-062024-03-06Passed
closure at office close2024-03-062024-03-05Failed
afternoon closure paper2024-03-062024-03-06Passed
two-day outage2024-03-072024-03-07Passed
friday outage2024-03-112024-03-11Passed

SHA-256 / 020488c71ce62917334eb90da9bfe7b0e40927baa24c92a726bb9a81d5afd296

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(last_day, method, closures, office_close, holidays):
    ld = dt.date.fromisoformat(last_day)
    hol = {dt.date.fromisoformat(x) for x in holidays}
    cl = {}
    for day, start in closures:
        k = dt.date.fromisoformat(day)
        cl[k] = 'all' if start == 'all' or cl.get(k) == 'all' else min(start, cl.get(k, start))
    def inaccessible(d):
        if d not in cl:
            return False
        if cl[d] == 'all':
            return True
        return method in ('paper', 'fax') and cl[d] < '12:00'
    d = ld
    if inaccessible(d):
        d += dt.timedelta(days=1)
        while d.weekday() >= 5 or d in hol or inaccessible(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: partial then full outage same day',
   ['2024-03-05',
    'paper',
    [['2024-03-05', 'all'], ['2024-03-05', '15:00']],
    '17:00',
    ['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-06'),
  ('electronic partial closure',
   ['2024-03-05',
    'electronic',
    [['2024-03-05', '14:00']],
    '17:00',
    ['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-05'),
  ('fax partial closure',
   ['2024-03-05',
    'fax',
    [['2024-03-05', '14:00']],
    '17:00',
    ['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-06'),
  ('closure at office close',
   ['2024-03-05',
    'paper',
    [['2024-03-05', '17:00']],
    '17:00',
    ['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-05'),
  ('afternoon closure paper',
   ['2024-03-05',
    'paper',
    [['2024-03-05', '13:30']],
    '17:00',
    ['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-06'),
  ('two-day outage',
   ['2024-03-05',
    'electronic',
    [['2024-03-05', 'all'], ['2024-03-06', 'all']],
    '17:00',
    ['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-07'),
  ('friday outage',
   ['2024-03-08',
    'electronic',
    [['2024-03-08', 'all']],
    '17:00',
    ['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')],
 [('fax partial closure',
   ['2024-03-05',
    'fax',
    [['2024-03-05', '14:00']],
    '17:00',
    ['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-06'),
  ('closure at office close',
   ['2024-03-05',
    'paper',
    [['2024-03-05', '17:00']],
    '17:00',
    ['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-05'),
  ('afternoon closure paper',
   ['2024-03-05',
    'paper',
    [['2024-03-05', '13:30']],
    '17:00',
    ['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-06'),
  ('two-day outage',
   ['2024-03-05',
    'electronic',
    [['2024-03-05', 'all'], ['2024-03-06', 'all']],
    '17:00',
    ['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-07'),
  ('friday outage',
   ['2024-03-08',
    'electronic',
    [['2024-03-08', 'all']],
    '17:00',
    ['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'),
  ('outage before holiday',
   ['2024-07-03',
    'paper',
    [['2024-07-03', '10:00']],
    '17:00',
    ['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-07-05'),
  ('no closure on last day',
   ['2024-03-05',
    'paper',
    [['2024-03-04', 'all']],
    '17:00',
    ['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-05')],
 [('afternoon closure paper',
   ['2024-03-05',
    'paper',
    [['2024-03-05', '13:30']],
    '17:00',
    ['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-06'),
  ('two-day outage',
   ['2024-03-05',
    'electronic',
    [['2024-03-05', 'all'], ['2024-03-06', 'all']],
    '17:00',
    ['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-07'),
  ('friday outage',
   ['2024-03-08',
    'electronic',
    [['2024-03-08', 'all']],
    '17:00',
    ['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'),
  ('outage before holiday',
   ['2024-07-03',
    'paper',
    [['2024-07-03', '10:00']],
    '17:00',
    ['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-07-05'),
  ('no closure on last day',
   ['2024-03-05',
    'paper',
    [['2024-03-04', 'all']],
    '17:00',
    ['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-05'),
  ('friday outage then monday closure',
   ['2024-03-08',
    'paper',
    [['2024-03-08', 'all'], ['2024-03-11', '09:00']],
    '16: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-12'),
  ('two partials same day',
   ['2024-04-10',
    'paper',
    [['2024-04-10', '16:45'], ['2024-04-10', '17:30']],
    '17:00',
    ['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-04-11'),
  ('closure at office close',
   ['2024-03-05',
    'paper',
    [['2024-03-05', '17:00']],
    '17:00',
    ['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-05')],
 [('friday outage',
   ['2024-03-08',
    'electronic',
    [['2024-03-08', 'all']],
    '17:00',
    ['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'),
  ('outage before holiday',
   ['2024-07-03',
    'paper',
    [['2024-07-03', '10:00']],
    '17:00',
    ['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-07-05'),
  ('no closure on last day',
   ['2024-03-05',
    'paper',
    [['2024-03-04', 'all']],
    '17:00',
    ['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-05'),
  ('friday outage then monday closure',
   ['2024-03-08',
    'paper',
    [['2024-03-08', 'all'], ['2024-03-11', '09:00']],
    '16: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-12'),
  ('two partials same day',
   ['2024-04-10',
    'paper',
    [['2024-04-10', '16:45'], ['2024-04-10', '17:30']],
    '17:00',
    ['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-04-11'),
  ('electronic partial then full outage',
   ['2024-04-10',
    'electronic',
    [['2024-04-10', '15:00'], ['2024-04-10', 'all']],
    '17:00',
    ['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-04-11'),
  ('regression: partial then full outage same day',
   ['2024-03-05',
    'paper',
    [['2024-03-05', 'all'], ['2024-03-05', '15:00']],
    '17:00',
    ['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-06'),
  ('closure at office close',
   ['2024-03-05',
    'paper',
    [['2024-03-05', '17:00']],
    '17:00',
    ['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-05')],
 [('no closure on last day',
   ['2024-03-05',
    'paper',
    [['2024-03-04', 'all']],
    '17:00',
    ['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-05'),
  ('friday outage then monday closure',
   ['2024-03-08',
    'paper',
    [['2024-03-08', 'all'], ['2024-03-11', '09:00']],
    '16: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-12'),
  ('two partials same day',
   ['2024-04-10',
    'paper',
    [['2024-04-10', '16:45'], ['2024-04-10', '17:30']],
    '17:00',
    ['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-04-11'),
  ('electronic partial then full outage',
   ['2024-04-10',
    'electronic',
    [['2024-04-10', '15:00'], ['2024-04-10', 'all']],
    '17:00',
    ['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-04-11'),
  ('regression: partial then full outage same day',
   ['2024-03-05',
    'paper',
    [['2024-03-05', 'all'], ['2024-03-05', '15:00']],
    '17:00',
    ['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-06'),
  ('electronic partial closure',
   ['2024-03-05',
    'electronic',
    [['2024-03-05', '14:00']],
    '17:00',
    ['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-05'),
  ('fax partial closure',
   ['2024-03-05',
    'fax',
    [['2024-03-05', '14:00']],
    '17:00',
    ['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-06'),
  ('closure at office close',
   ['2024-03-05',
    'paper',
    [['2024-03-05', '17:00']],
    '17:00',
    ['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-05')]]
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: partial then full outage same day2024-03-062024-03-06Passed
electronic partial closure2024-03-052024-03-05Passed
fax partial closure2024-03-052024-03-06Failed
closure at office close2024-03-052024-03-05Passed
afternoon closure paper2024-03-052024-03-06Failed
two-day outage2024-03-072024-03-07Passed
friday outage2024-03-112024-03-11Passed

SHA-256 / 2d296a0677ea48ebaa4554635bab271cf8603ec6a222d3b8035a2b9e1eac13d6

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(last_day, method, closures, office_close, holidays):
    ld = dt.date.fromisoformat(last_day)
    hol = {dt.date.fromisoformat(x) for x in holidays}
    cl = {}
    for day, start in closures:
        k = dt.date.fromisoformat(day)
        cl[k] = 'all' if start == 'all' or cl.get(k) == 'all' else min(start, cl.get(k, start))
    def inaccessible(d):
        if d not in cl:
            return False
        if cl[d] == 'all':
            return True
        return method in ('paper', 'fax') and cl[d] < office_close
    d = ld
    if inaccessible(d):
        d += dt.timedelta(days=1)
        while d.weekday() >= 5 or d in hol or inaccessible(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: partial then full outage same day',
   ['2024-03-05',
    'paper',
    [['2024-03-05', 'all'], ['2024-03-05', '15:00']],
    '17:00',
    ['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-06'),
  ('electronic partial closure',
   ['2024-03-05',
    'electronic',
    [['2024-03-05', '14:00']],
    '17:00',
    ['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-05'),
  ('fax partial closure',
   ['2024-03-05',
    'fax',
    [['2024-03-05', '14:00']],
    '17:00',
    ['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-06'),
  ('closure at office close',
   ['2024-03-05',
    'paper',
    [['2024-03-05', '17:00']],
    '17:00',
    ['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-05'),
  ('afternoon closure paper',
   ['2024-03-05',
    'paper',
    [['2024-03-05', '13:30']],
    '17:00',
    ['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-06'),
  ('two-day outage',
   ['2024-03-05',
    'electronic',
    [['2024-03-05', 'all'], ['2024-03-06', 'all']],
    '17:00',
    ['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-07'),
  ('friday outage',
   ['2024-03-08',
    'electronic',
    [['2024-03-08', 'all']],
    '17:00',
    ['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')],
 [('fax partial closure',
   ['2024-03-05',
    'fax',
    [['2024-03-05', '14:00']],
    '17:00',
    ['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-06'),
  ('closure at office close',
   ['2024-03-05',
    'paper',
    [['2024-03-05', '17:00']],
    '17:00',
    ['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-05'),
  ('afternoon closure paper',
   ['2024-03-05',
    'paper',
    [['2024-03-05', '13:30']],
    '17:00',
    ['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-06'),
  ('two-day outage',
   ['2024-03-05',
    'electronic',
    [['2024-03-05', 'all'], ['2024-03-06', 'all']],
    '17:00',
    ['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-07'),
  ('friday outage',
   ['2024-03-08',
    'electronic',
    [['2024-03-08', 'all']],
    '17:00',
    ['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'),
  ('outage before holiday',
   ['2024-07-03',
    'paper',
    [['2024-07-03', '10:00']],
    '17:00',
    ['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-07-05'),
  ('no closure on last day',
   ['2024-03-05',
    'paper',
    [['2024-03-04', 'all']],
    '17:00',
    ['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-05')],
 [('afternoon closure paper',
   ['2024-03-05',
    'paper',
    [['2024-03-05', '13:30']],
    '17:00',
    ['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-06'),
  ('two-day outage',
   ['2024-03-05',
    'electronic',
    [['2024-03-05', 'all'], ['2024-03-06', 'all']],
    '17:00',
    ['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-07'),
  ('friday outage',
   ['2024-03-08',
    'electronic',
    [['2024-03-08', 'all']],
    '17:00',
    ['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'),
  ('outage before holiday',
   ['2024-07-03',
    'paper',
    [['2024-07-03', '10:00']],
    '17:00',
    ['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-07-05'),
  ('no closure on last day',
   ['2024-03-05',
    'paper',
    [['2024-03-04', 'all']],
    '17:00',
    ['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-05'),
  ('friday outage then monday closure',
   ['2024-03-08',
    'paper',
    [['2024-03-08', 'all'], ['2024-03-11', '09:00']],
    '16: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-12'),
  ('two partials same day',
   ['2024-04-10',
    'paper',
    [['2024-04-10', '16:45'], ['2024-04-10', '17:30']],
    '17:00',
    ['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-04-11'),
  ('closure at office close',
   ['2024-03-05',
    'paper',
    [['2024-03-05', '17:00']],
    '17:00',
    ['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-05')],
 [('friday outage',
   ['2024-03-08',
    'electronic',
    [['2024-03-08', 'all']],
    '17:00',
    ['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'),
  ('outage before holiday',
   ['2024-07-03',
    'paper',
    [['2024-07-03', '10:00']],
    '17:00',
    ['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-07-05'),
  ('no closure on last day',
   ['2024-03-05',
    'paper',
    [['2024-03-04', 'all']],
    '17:00',
    ['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-05'),
  ('friday outage then monday closure',
   ['2024-03-08',
    'paper',
    [['2024-03-08', 'all'], ['2024-03-11', '09:00']],
    '16: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-12'),
  ('two partials same day',
   ['2024-04-10',
    'paper',
    [['2024-04-10', '16:45'], ['2024-04-10', '17:30']],
    '17:00',
    ['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-04-11'),
  ('electronic partial then full outage',
   ['2024-04-10',
    'electronic',
    [['2024-04-10', '15:00'], ['2024-04-10', 'all']],
    '17:00',
    ['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-04-11'),
  ('regression: partial then full outage same day',
   ['2024-03-05',
    'paper',
    [['2024-03-05', 'all'], ['2024-03-05', '15:00']],
    '17:00',
    ['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-06'),
  ('closure at office close',
   ['2024-03-05',
    'paper',
    [['2024-03-05', '17:00']],
    '17:00',
    ['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-05')],
 [('no closure on last day',
   ['2024-03-05',
    'paper',
    [['2024-03-04', 'all']],
    '17:00',
    ['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-05'),
  ('friday outage then monday closure',
   ['2024-03-08',
    'paper',
    [['2024-03-08', 'all'], ['2024-03-11', '09:00']],
    '16: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-12'),
  ('two partials same day',
   ['2024-04-10',
    'paper',
    [['2024-04-10', '16:45'], ['2024-04-10', '17:30']],
    '17:00',
    ['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-04-11'),
  ('electronic partial then full outage',
   ['2024-04-10',
    'electronic',
    [['2024-04-10', '15:00'], ['2024-04-10', 'all']],
    '17:00',
    ['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-04-11'),
  ('regression: partial then full outage same day',
   ['2024-03-05',
    'paper',
    [['2024-03-05', 'all'], ['2024-03-05', '15:00']],
    '17:00',
    ['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-06'),
  ('electronic partial closure',
   ['2024-03-05',
    'electronic',
    [['2024-03-05', '14:00']],
    '17:00',
    ['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-05'),
  ('fax partial closure',
   ['2024-03-05',
    'fax',
    [['2024-03-05', '14:00']],
    '17:00',
    ['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-06'),
  ('closure at office close',
   ['2024-03-05',
    'paper',
    [['2024-03-05', '17:00']],
    '17:00',
    ['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-05')]]
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: partial then full outage same day2024-03-062024-03-06Passed
electronic partial closure2024-03-052024-03-05Passed
fax partial closure2024-03-062024-03-06Passed
closure at office close2024-03-052024-03-05Passed
afternoon closure paper2024-03-062024-03-06Passed
two-day outage2024-03-072024-03-07Passed
friday outage2024-03-112024-03-11Passed

SHA-256 / 6eed45c03cd45d9c07536fe9b9186d03320249f04c7719b3c2b75892abcb94c9

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

Case digest / 496c47794ea54ddb35c82fc7e48e0655913bd04d161d6afdec1fbb902c43b3cb