FA-77696 / Legal deadline computation / Open access
Service by publication: schedule validity and completion date: completion base · case 01
Completion is computed from the last publication, delaying the response deadline.
ROOT CAUSE
The 28 days run from the final publication instead of the first.
THE FAILURE
The 28 days run from the final publication instead of the first.
Unsuccessful approach: The partial repair `pubs[3]` uses the fourth publication, which is still not the first.
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(weeks)) != len(weeks):
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[-1] + 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'})],
[('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-25', 'respond': '2024-05-28', 'valid': True} | {'complete': '2024-04-04', 'respond': '2024-05-06', 'valid': True} | Failed |
| two in one week | {'valid': False} | {'valid': False} | Passed |
| two in one week of five | {'valid': False} | {'valid': False} | Passed |
| uneven successive weeks | {'complete': '2024-05-24', 'respond': '2024-06-24', 'valid': True} | {'complete': '2024-04-29', 'respond': '2024-05-29', 'valid': True} | Failed |
| gap week | {'valid': False} | {'valid': False} | Passed |
| only three | {'valid': False} | {'valid': False} | Passed |
SHA-256 / a5dcd7cfba404fc4628b88d43df215ccec6ee595986d5a7875a34785f8938786
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):
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[3] + 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'})],
[('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-25', 'respond': '2024-05-28', 'valid': True} | {'complete': '2024-04-04', 'respond': '2024-05-06', 'valid': True} | Failed |
| two in one week | {'valid': False} | {'valid': False} | Passed |
| two in one week of five | {'valid': False} | {'valid': False} | Passed |
| uneven successive weeks | {'complete': '2024-05-24', 'respond': '2024-06-24', 'valid': True} | {'complete': '2024-04-29', 'respond': '2024-05-29', 'valid': True} | Failed |
| gap week | {'valid': False} | {'valid': False} | Passed |
| only three | {'valid': False} | {'valid': False} | Passed |
SHA-256 / 042320e8fd050b9cbfc59eedf3edc5f7014e222010a71245e6b3e75846828c5d
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.976187+00:00.
Case digest / e2a8235a07d780951312d73ce1689594342803ca013c77052b454e394af791ea