FA-77686 / Legal deadline computation / Open access
Service by publication: schedule validity and completion date: one per week · case 01
Two publications in the same week are accepted as covering two weeks.
ROOT CAUSE
Only identical publication dates are rejected.
THE FAILURE
Only identical publication dates are rejected.
Unsuccessful approach: The partial repair `len(set(weeks)) < len(weeks) - 1` tolerates one duplicated week.
Case contract
Stipulated: service by publication requires at least four publications, one in each of successive calendar weeks (weeks run Sunday to Saturday), with no two in the same week. Service is complete on the 28th day after the first publication, and the response is due 30 days after completion (a closed last day moves to the next open day). Return {"valid": false} or {"valid": true, "complete", "respond"}.
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(publications, holidays):
pubs = sorted(dt.date.fromisoformat(p) for p in publications)
hol = {dt.date.fromisoformat(x) for x in holidays}
weeks = [p - dt.timedelta(days=(p.weekday() + 1) % 7) for p in pubs]
uw = sorted(set(weeks))
if len(set(pubs)) != len(pubs):
return {'valid': False}
if len(pubs) < 4 or any((uw[i + 1] - uw[i]).days != 7 for i in range(len(uw) - 1)):
return {'valid': False}
complete = pubs[0] + dt.timedelta(days=28)
respond = complete + dt.timedelta(days=30)
while respond.weekday() >= 5 or respond in hol:
respond += dt.timedelta(days=1)
return {'valid': True, 'complete': complete.isoformat(), 'respond': respond.isoformat()}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: saturday then sunday publications',
[['2024-03-02', '2024-03-10', '2024-03-17', '2024-03-24'],
['2024-01-01',
'2024-01-15',
'2024-02-19',
'2024-05-27',
'2024-06-19',
'2024-07-04',
'2024-09-02',
'2024-10-14',
'2024-11-11',
'2024-11-28',
'2024-12-25']],
{'valid': False}),
('weekly thursdays',
[['2024-03-07', '2024-03-14', '2024-03-21', '2024-03-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']],
{'valid': True, 'complete': '2024-04-04', 'respond': '2024-05-06'}),
('two in one week',
[['2024-03-04', '2024-03-08', '2024-03-12', '2024-03-19', '2024-03-26'],
['2024-01-01',
'2024-01-15',
'2024-02-19',
'2024-05-27',
'2024-06-19',
'2024-07-04',
'2024-09-02',
'2024-10-14',
'2024-11-11',
'2024-11-28',
'2024-12-25']],
{'valid': False}),
('two in one week of five',
[['2024-03-04', '2024-03-08', '2024-03-12', '2024-03-19', '2024-03-26', '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']],
{'valid': False}),
('uneven successive weeks',
[['2024-04-01', '2024-04-12', '2024-04-15', '2024-04-26'],
['2024-01-01',
'2024-01-15',
'2024-02-19',
'2024-05-27',
'2024-06-19',
'2024-07-04',
'2024-09-02',
'2024-10-14',
'2024-11-11',
'2024-11-28',
'2024-12-25']],
{'valid': True, 'complete': '2024-04-29', 'respond': '2024-05-29'}),
('gap week',
[['2024-04-01', '2024-04-08', '2024-04-22', '2024-04-29'],
['2024-01-01',
'2024-01-15',
'2024-02-19',
'2024-05-27',
'2024-06-19',
'2024-07-04',
'2024-09-02',
'2024-10-14',
'2024-11-11',
'2024-11-28',
'2024-12-25']],
{'valid': False}),
('only three',
[['2024-05-01', '2024-05-08', '2024-05-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']],
{'valid': False})],
[('two in one week',
[['2024-03-04', '2024-03-08', '2024-03-12', '2024-03-19', '2024-03-26'],
['2024-01-01',
'2024-01-15',
'2024-02-19',
'2024-05-27',
'2024-06-19',
'2024-07-04',
'2024-09-02',
'2024-10-14',
'2024-11-11',
'2024-11-28',
'2024-12-25']],
{'valid': False}),
('two in one week of five',
[['2024-03-04', '2024-03-08', '2024-03-12', '2024-03-19', '2024-03-26', '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']],
{'valid': False}),
('uneven successive weeks',
[['2024-04-01', '2024-04-12', '2024-04-15', '2024-04-26'],
['2024-01-01',
'2024-01-15',
'2024-02-19',
'2024-05-27',
'2024-06-19',
'2024-07-04',
'2024-09-02',
'2024-10-14',
'2024-11-11',
'2024-11-28',
'2024-12-25']],
{'valid': True, 'complete': '2024-04-29', 'respond': '2024-05-29'}),
('gap week',
[['2024-04-01', '2024-04-08', '2024-04-22', '2024-04-29'],
['2024-01-01',
'2024-01-15',
'2024-02-19',
'2024-05-27',
'2024-06-19',
'2024-07-04',
'2024-09-02',
'2024-10-14',
'2024-11-11',
'2024-11-28',
'2024-12-25']],
{'valid': False}),
('only three',
[['2024-05-01', '2024-05-08', '2024-05-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']],
{'valid': False}),
('five publications',
[['2024-05-02', '2024-05-09', '2024-05-16', '2024-05-23', '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']],
{'valid': True, 'complete': '2024-05-30', 'respond': '2024-07-01'}),
('sunday saturday pairs',
[['2024-06-02', '2024-06-15', '2024-06-16', '2024-06-29'],
['2024-01-01',
'2024-01-15',
'2024-02-19',
'2024-05-27',
'2024-06-19',
'2024-07-04',
'2024-09-02',
'2024-10-14',
'2024-11-11',
'2024-11-28',
'2024-12-25']],
{'valid': True, 'complete': '2024-06-30', 'respond': '2024-07-30'})],
[('uneven successive weeks',
[['2024-04-01', '2024-04-12', '2024-04-15', '2024-04-26'],
['2024-01-01',
'2024-01-15',
'2024-02-19',
'2024-05-27',
'2024-06-19',
'2024-07-04',
'2024-09-02',
'2024-10-14',
'2024-11-11',
'2024-11-28',
'2024-12-25']],
{'valid': True, 'complete': '2024-04-29', 'respond': '2024-05-29'}),
('gap week',
[['2024-04-01', '2024-04-08', '2024-04-22', '2024-04-29'],
['2024-01-01',
'2024-01-15',
'2024-02-19',
'2024-05-27',
'2024-06-19',
'2024-07-04',
'2024-09-02',
'2024-10-14',
'2024-11-11',
'2024-11-28',
'2024-12-25']],
{'valid': False}),
('only three',
[['2024-05-01', '2024-05-08', '2024-05-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']],
{'valid': False}),
('five publications',
[['2024-05-02', '2024-05-09', '2024-05-16', '2024-05-23', '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']],
{'valid': True, 'complete': '2024-05-30', 'respond': '2024-07-01'}),
('sunday saturday pairs',
[['2024-06-02', '2024-06-15', '2024-06-16', '2024-06-29'],
['2024-01-01',
'2024-01-15',
'2024-02-19',
'2024-05-27',
'2024-06-19',
'2024-07-04',
'2024-09-02',
'2024-10-14',
'2024-11-11',
'2024-11-28',
'2024-12-25']],
{'valid': True, 'complete': '2024-06-30', 'respond': '2024-07-30'}),
('respond lands holiday',
[['2024-08-07', '2024-08-14', '2024-08-21', '2024-08-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']],
{'valid': True, 'complete': '2024-09-04', 'respond': '2024-10-04'}),
('unsorted input',
[['2024-09-24', '2024-09-03', '2024-09-17', '2024-09-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']],
{'valid': True, 'complete': '2024-10-01', 'respond': '2024-10-31'}),
('two in one week of five',
[['2024-03-04', '2024-03-08', '2024-03-12', '2024-03-19', '2024-03-26', '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']],
{'valid': False})],
[('only three',
[['2024-05-01', '2024-05-08', '2024-05-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']],
{'valid': False}),
('five publications',
[['2024-05-02', '2024-05-09', '2024-05-16', '2024-05-23', '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']],
{'valid': True, 'complete': '2024-05-30', 'respond': '2024-07-01'}),
('sunday saturday pairs',
[['2024-06-02', '2024-06-15', '2024-06-16', '2024-06-29'],
['2024-01-01',
'2024-01-15',
'2024-02-19',
'2024-05-27',
'2024-06-19',
'2024-07-04',
'2024-09-02',
'2024-10-14',
'2024-11-11',
'2024-11-28',
'2024-12-25']],
{'valid': True, 'complete': '2024-06-30', 'respond': '2024-07-30'}),
('respond lands holiday',
[['2024-08-07', '2024-08-14', '2024-08-21', '2024-08-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']],
{'valid': True, 'complete': '2024-09-04', 'respond': '2024-10-04'}),
('unsorted input',
[['2024-09-24', '2024-09-03', '2024-09-17', '2024-09-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']],
{'valid': True, 'complete': '2024-10-01', 'respond': '2024-10-31'}),
('monday sunday same week',
[['2024-10-06', '2024-10-07', '2024-10-14', '2024-10-21', '2024-10-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']],
{'valid': False}),
('regression: saturday then sunday publications',
[['2024-03-02', '2024-03-10', '2024-03-17', '2024-03-24'],
['2024-01-01',
'2024-01-15',
'2024-02-19',
'2024-05-27',
'2024-06-19',
'2024-07-04',
'2024-09-02',
'2024-10-14',
'2024-11-11',
'2024-11-28',
'2024-12-25']],
{'valid': False})],
[('sunday saturday pairs',
[['2024-06-02', '2024-06-15', '2024-06-16', '2024-06-29'],
['2024-01-01',
'2024-01-15',
'2024-02-19',
'2024-05-27',
'2024-06-19',
'2024-07-04',
'2024-09-02',
'2024-10-14',
'2024-11-11',
'2024-11-28',
'2024-12-25']],
{'valid': True, 'complete': '2024-06-30', 'respond': '2024-07-30'}),
('respond lands holiday',
[['2024-08-07', '2024-08-14', '2024-08-21', '2024-08-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']],
{'valid': True, 'complete': '2024-09-04', 'respond': '2024-10-04'}),
('unsorted input',
[['2024-09-24', '2024-09-03', '2024-09-17', '2024-09-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']],
{'valid': True, 'complete': '2024-10-01', 'respond': '2024-10-31'}),
('monday sunday same week',
[['2024-10-06', '2024-10-07', '2024-10-14', '2024-10-21', '2024-10-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']],
{'valid': False}),
('regression: saturday then sunday publications',
[['2024-03-02', '2024-03-10', '2024-03-17', '2024-03-24'],
['2024-01-01',
'2024-01-15',
'2024-02-19',
'2024-05-27',
'2024-06-19',
'2024-07-04',
'2024-09-02',
'2024-10-14',
'2024-11-11',
'2024-11-28',
'2024-12-25']],
{'valid': False}),
('weekly thursdays',
[['2024-03-07', '2024-03-14', '2024-03-21', '2024-03-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']],
{'valid': True, 'complete': '2024-04-04', 'respond': '2024-05-06'}),
('two in one week',
[['2024-03-04', '2024-03-08', '2024-03-12', '2024-03-19', '2024-03-26'],
['2024-01-01',
'2024-01-15',
'2024-02-19',
'2024-05-27',
'2024-06-19',
'2024-07-04',
'2024-09-02',
'2024-10-14',
'2024-11-11',
'2024-11-28',
'2024-12-25']],
{'valid': False})]]
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression: saturday then sunday publications | {'valid': False} | {'valid': False} | Passed |
| weekly thursdays | {'complete': '2024-04-04', 'respond': '2024-05-06', 'valid': True} | {'complete': '2024-04-04', 'respond': '2024-05-06', 'valid': True} | Passed |
| two in one week | {'complete': '2024-04-01', 'respond': '2024-05-01', 'valid': True} | {'valid': False} | Failed |
| two in one week of five | {'complete': '2024-04-01', 'respond': '2024-05-01', 'valid': True} | {'valid': False} | Failed |
| uneven successive weeks | {'complete': '2024-04-29', 'respond': '2024-05-29', 'valid': True} | {'complete': '2024-04-29', 'respond': '2024-05-29', 'valid': True} | Passed |
| gap week | {'valid': False} | {'valid': False} | Passed |
| only three | {'valid': False} | {'valid': False} | Passed |
SHA-256 / d46dad13952d3462cea289f982b500a23d2b31d1a11d428d0234a543e79b0474
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(publications, holidays):
pubs = sorted(dt.date.fromisoformat(p) for p in publications)
hol = {dt.date.fromisoformat(x) for x in holidays}
weeks = [p - dt.timedelta(days=(p.weekday() + 1) % 7) for p in pubs]
uw = sorted(set(weeks))
if len(set(weeks)) < len(weeks) - 1:
return {'valid': False}
if len(pubs) < 4 or any((uw[i + 1] - uw[i]).days != 7 for i in range(len(uw) - 1)):
return {'valid': False}
complete = pubs[0] + dt.timedelta(days=28)
respond = complete + dt.timedelta(days=30)
while respond.weekday() >= 5 or respond in hol:
respond += dt.timedelta(days=1)
return {'valid': True, 'complete': complete.isoformat(), 'respond': respond.isoformat()}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: saturday then sunday publications',
[['2024-03-02', '2024-03-10', '2024-03-17', '2024-03-24'],
['2024-01-01',
'2024-01-15',
'2024-02-19',
'2024-05-27',
'2024-06-19',
'2024-07-04',
'2024-09-02',
'2024-10-14',
'2024-11-11',
'2024-11-28',
'2024-12-25']],
{'valid': False}),
('weekly thursdays',
[['2024-03-07', '2024-03-14', '2024-03-21', '2024-03-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']],
{'valid': True, 'complete': '2024-04-04', 'respond': '2024-05-06'}),
('two in one week',
[['2024-03-04', '2024-03-08', '2024-03-12', '2024-03-19', '2024-03-26'],
['2024-01-01',
'2024-01-15',
'2024-02-19',
'2024-05-27',
'2024-06-19',
'2024-07-04',
'2024-09-02',
'2024-10-14',
'2024-11-11',
'2024-11-28',
'2024-12-25']],
{'valid': False}),
('two in one week of five',
[['2024-03-04', '2024-03-08', '2024-03-12', '2024-03-19', '2024-03-26', '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']],
{'valid': False}),
('uneven successive weeks',
[['2024-04-01', '2024-04-12', '2024-04-15', '2024-04-26'],
['2024-01-01',
'2024-01-15',
'2024-02-19',
'2024-05-27',
'2024-06-19',
'2024-07-04',
'2024-09-02',
'2024-10-14',
'2024-11-11',
'2024-11-28',
'2024-12-25']],
{'valid': True, 'complete': '2024-04-29', 'respond': '2024-05-29'}),
('gap week',
[['2024-04-01', '2024-04-08', '2024-04-22', '2024-04-29'],
['2024-01-01',
'2024-01-15',
'2024-02-19',
'2024-05-27',
'2024-06-19',
'2024-07-04',
'2024-09-02',
'2024-10-14',
'2024-11-11',
'2024-11-28',
'2024-12-25']],
{'valid': False}),
('only three',
[['2024-05-01', '2024-05-08', '2024-05-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']],
{'valid': False})],
[('two in one week',
[['2024-03-04', '2024-03-08', '2024-03-12', '2024-03-19', '2024-03-26'],
['2024-01-01',
'2024-01-15',
'2024-02-19',
'2024-05-27',
'2024-06-19',
'2024-07-04',
'2024-09-02',
'2024-10-14',
'2024-11-11',
'2024-11-28',
'2024-12-25']],
{'valid': False}),
('two in one week of five',
[['2024-03-04', '2024-03-08', '2024-03-12', '2024-03-19', '2024-03-26', '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']],
{'valid': False}),
('uneven successive weeks',
[['2024-04-01', '2024-04-12', '2024-04-15', '2024-04-26'],
['2024-01-01',
'2024-01-15',
'2024-02-19',
'2024-05-27',
'2024-06-19',
'2024-07-04',
'2024-09-02',
'2024-10-14',
'2024-11-11',
'2024-11-28',
'2024-12-25']],
{'valid': True, 'complete': '2024-04-29', 'respond': '2024-05-29'}),
('gap week',
[['2024-04-01', '2024-04-08', '2024-04-22', '2024-04-29'],
['2024-01-01',
'2024-01-15',
'2024-02-19',
'2024-05-27',
'2024-06-19',
'2024-07-04',
'2024-09-02',
'2024-10-14',
'2024-11-11',
'2024-11-28',
'2024-12-25']],
{'valid': False}),
('only three',
[['2024-05-01', '2024-05-08', '2024-05-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']],
{'valid': False}),
('five publications',
[['2024-05-02', '2024-05-09', '2024-05-16', '2024-05-23', '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']],
{'valid': True, 'complete': '2024-05-30', 'respond': '2024-07-01'}),
('sunday saturday pairs',
[['2024-06-02', '2024-06-15', '2024-06-16', '2024-06-29'],
['2024-01-01',
'2024-01-15',
'2024-02-19',
'2024-05-27',
'2024-06-19',
'2024-07-04',
'2024-09-02',
'2024-10-14',
'2024-11-11',
'2024-11-28',
'2024-12-25']],
{'valid': True, 'complete': '2024-06-30', 'respond': '2024-07-30'})],
[('uneven successive weeks',
[['2024-04-01', '2024-04-12', '2024-04-15', '2024-04-26'],
['2024-01-01',
'2024-01-15',
'2024-02-19',
'2024-05-27',
'2024-06-19',
'2024-07-04',
'2024-09-02',
'2024-10-14',
'2024-11-11',
'2024-11-28',
'2024-12-25']],
{'valid': True, 'complete': '2024-04-29', 'respond': '2024-05-29'}),
('gap week',
[['2024-04-01', '2024-04-08', '2024-04-22', '2024-04-29'],
['2024-01-01',
'2024-01-15',
'2024-02-19',
'2024-05-27',
'2024-06-19',
'2024-07-04',
'2024-09-02',
'2024-10-14',
'2024-11-11',
'2024-11-28',
'2024-12-25']],
{'valid': False}),
('only three',
[['2024-05-01', '2024-05-08', '2024-05-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']],
{'valid': False}),
('five publications',
[['2024-05-02', '2024-05-09', '2024-05-16', '2024-05-23', '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']],
{'valid': True, 'complete': '2024-05-30', 'respond': '2024-07-01'}),
('sunday saturday pairs',
[['2024-06-02', '2024-06-15', '2024-06-16', '2024-06-29'],
['2024-01-01',
'2024-01-15',
'2024-02-19',
'2024-05-27',
'2024-06-19',
'2024-07-04',
'2024-09-02',
'2024-10-14',
'2024-11-11',
'2024-11-28',
'2024-12-25']],
{'valid': True, 'complete': '2024-06-30', 'respond': '2024-07-30'}),
('respond lands holiday',
[['2024-08-07', '2024-08-14', '2024-08-21', '2024-08-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']],
{'valid': True, 'complete': '2024-09-04', 'respond': '2024-10-04'}),
('unsorted input',
[['2024-09-24', '2024-09-03', '2024-09-17', '2024-09-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']],
{'valid': True, 'complete': '2024-10-01', 'respond': '2024-10-31'}),
('two in one week of five',
[['2024-03-04', '2024-03-08', '2024-03-12', '2024-03-19', '2024-03-26', '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']],
{'valid': False})],
[('only three',
[['2024-05-01', '2024-05-08', '2024-05-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']],
{'valid': False}),
('five publications',
[['2024-05-02', '2024-05-09', '2024-05-16', '2024-05-23', '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']],
{'valid': True, 'complete': '2024-05-30', 'respond': '2024-07-01'}),
('sunday saturday pairs',
[['2024-06-02', '2024-06-15', '2024-06-16', '2024-06-29'],
['2024-01-01',
'2024-01-15',
'2024-02-19',
'2024-05-27',
'2024-06-19',
'2024-07-04',
'2024-09-02',
'2024-10-14',
'2024-11-11',
'2024-11-28',
'2024-12-25']],
{'valid': True, 'complete': '2024-06-30', 'respond': '2024-07-30'}),
('respond lands holiday',
[['2024-08-07', '2024-08-14', '2024-08-21', '2024-08-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']],
{'valid': True, 'complete': '2024-09-04', 'respond': '2024-10-04'}),
('unsorted input',
[['2024-09-24', '2024-09-03', '2024-09-17', '2024-09-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']],
{'valid': True, 'complete': '2024-10-01', 'respond': '2024-10-31'}),
('monday sunday same week',
[['2024-10-06', '2024-10-07', '2024-10-14', '2024-10-21', '2024-10-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']],
{'valid': False}),
('regression: saturday then sunday publications',
[['2024-03-02', '2024-03-10', '2024-03-17', '2024-03-24'],
['2024-01-01',
'2024-01-15',
'2024-02-19',
'2024-05-27',
'2024-06-19',
'2024-07-04',
'2024-09-02',
'2024-10-14',
'2024-11-11',
'2024-11-28',
'2024-12-25']],
{'valid': False})],
[('sunday saturday pairs',
[['2024-06-02', '2024-06-15', '2024-06-16', '2024-06-29'],
['2024-01-01',
'2024-01-15',
'2024-02-19',
'2024-05-27',
'2024-06-19',
'2024-07-04',
'2024-09-02',
'2024-10-14',
'2024-11-11',
'2024-11-28',
'2024-12-25']],
{'valid': True, 'complete': '2024-06-30', 'respond': '2024-07-30'}),
('respond lands holiday',
[['2024-08-07', '2024-08-14', '2024-08-21', '2024-08-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']],
{'valid': True, 'complete': '2024-09-04', 'respond': '2024-10-04'}),
('unsorted input',
[['2024-09-24', '2024-09-03', '2024-09-17', '2024-09-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']],
{'valid': True, 'complete': '2024-10-01', 'respond': '2024-10-31'}),
('monday sunday same week',
[['2024-10-06', '2024-10-07', '2024-10-14', '2024-10-21', '2024-10-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']],
{'valid': False}),
('regression: saturday then sunday publications',
[['2024-03-02', '2024-03-10', '2024-03-17', '2024-03-24'],
['2024-01-01',
'2024-01-15',
'2024-02-19',
'2024-05-27',
'2024-06-19',
'2024-07-04',
'2024-09-02',
'2024-10-14',
'2024-11-11',
'2024-11-28',
'2024-12-25']],
{'valid': False}),
('weekly thursdays',
[['2024-03-07', '2024-03-14', '2024-03-21', '2024-03-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']],
{'valid': True, 'complete': '2024-04-04', 'respond': '2024-05-06'}),
('two in one week',
[['2024-03-04', '2024-03-08', '2024-03-12', '2024-03-19', '2024-03-26'],
['2024-01-01',
'2024-01-15',
'2024-02-19',
'2024-05-27',
'2024-06-19',
'2024-07-04',
'2024-09-02',
'2024-10-14',
'2024-11-11',
'2024-11-28',
'2024-12-25']],
{'valid': False})]]
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression: saturday then sunday publications | {'valid': False} | {'valid': False} | Passed |
| weekly thursdays | {'complete': '2024-04-04', 'respond': '2024-05-06', 'valid': True} | {'complete': '2024-04-04', 'respond': '2024-05-06', 'valid': True} | Passed |
| two in one week | {'complete': '2024-04-01', 'respond': '2024-05-01', 'valid': True} | {'valid': False} | Failed |
| two in one week of five | {'complete': '2024-04-01', 'respond': '2024-05-01', 'valid': True} | {'valid': False} | Failed |
| uneven successive weeks | {'complete': '2024-04-29', 'respond': '2024-05-29', 'valid': True} | {'complete': '2024-04-29', 'respond': '2024-05-29', 'valid': True} | Passed |
| gap week | {'valid': False} | {'valid': False} | Passed |
| only three | {'valid': False} | {'valid': False} | Passed |
SHA-256 / fe0adc77e33da27cb20e32a59fbd807377a51b7675c5611a2e889ee50da1dbdb
HELD IN THE MEMBER ARCHIVE
The verified repair and its recorded checks are member-only.
This mechanism has 7 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.
Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.
Member access is invitation-based. Sign in with your invited account to inspect the repair.
Sign in to the archive ↗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.928657+00:00.
Case digest / 807935ce679d43b7a4b130e6dd77a95f642bc47f4cfe91211c1885b10f6565d9