FA-77496 / Legal deadline computation / Open access
Limitations period with discovery accrual, tolling and repose cap: repose base · case 01
The repose cap runs from discovery, allowing claims beyond the absolute bar.
ROOT CAUSE
The repose period is measured from accrual instead of injury.
VERIFIED REPAIR
At the repose base decision use `inj`, leaving the other decision sites of the model unchanged.
Unsuccessful approach: The partial repair `disc` measures repose from discovery, which is still not the injury date.
Case contract
Stipulated: the claim accrues on the later of injury and discovery. The base deadline is the anniversary of accrual after years (a February 29 anniversary in a common year becomes February 28). Tolling intervals [start, end] are inclusive of both days, days before accrual do not count, and overlapping intervals count each day once; the tolled day count is added to the base deadline. A repose deadline of repose_years from the injury (same anniversary rule, never tolled) caps the result.
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(injury, discovery, years, tolls, repose_years):
inj = dt.date.fromisoformat(injury)
disc = dt.date.fromisoformat(discovery)
accrual = max(inj, disc)
def add_years(d, n):
y = d.year + n
return dt.date(y, d.month, min(d.day, calendar.monthrange(y, d.month)[1]))
base = add_years(accrual, years)
covered = set()
total = 0
for a, b in tolls:
a = dt.date.fromisoformat(a)
b = dt.date.fromisoformat(b)
a = max(a, accrual)
span = max(0, (b - a).days + 1)
total += span
for i in range(span):
covered.add(a + dt.timedelta(days=i))
tolled = len(covered)
extended = base + dt.timedelta(days=tolled)
repose = add_years(accrual, repose_years)
return (min(extended, repose)).isoformat()
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: discovery then overlapping tolls',
['2018-03-10', '2019-06-01', 2, [['2019-07-01', '2019-07-10'], ['2019-07-05', '2019-07-20']], 10],
'2021-06-21'),
('leap day accrual', ['2020-02-29', '2020-02-29', 3, [], 10], '2023-02-28'),
('leap crossing two years', ['2023-03-01', '2023-03-01', 2, [], 10], '2025-03-01'),
('toll before discovery',
['2015-01-10', '2016-05-05', 3, [['2015-06-01', '2015-12-31'], ['2017-01-01', '2017-01-01']], 10],
'2019-05-06'),
('one day toll', ['2021-04-04', '2021-04-04', 1, [['2021-05-05', '2021-05-05']], 5], '2022-04-05'),
('repose caps', ['2010-01-15', '2019-06-01', 3, [['2020-01-01', '2020-06-30']], 10], '2020-01-15'),
('repose with tolling beyond',
['2014-07-01', '2015-07-01', 7, [['2016-01-01', '2016-03-31']], 8],
'2022-07-01')],
[('leap crossing two years', ['2023-03-01', '2023-03-01', 2, [], 10], '2025-03-01'),
('toll before discovery',
['2015-01-10', '2016-05-05', 3, [['2015-06-01', '2015-12-31'], ['2017-01-01', '2017-01-01']], 10],
'2019-05-06'),
('one day toll', ['2021-04-04', '2021-04-04', 1, [['2021-05-05', '2021-05-05']], 5], '2022-04-05'),
('repose caps', ['2010-01-15', '2019-06-01', 3, [['2020-01-01', '2020-06-30']], 10], '2020-01-15'),
('repose with tolling beyond',
['2014-07-01', '2015-07-01', 7, [['2016-01-01', '2016-03-31']], 8],
'2022-07-01'),
('toll straddles accrual',
['2019-01-01', '2019-02-01', 1, [['2019-01-20', '2019-02-10']], 4],
'2020-02-11'),
('three overlapping tolls',
['2022-05-05',
'2022-05-05',
2,
[['2022-06-01', '2022-06-30'], ['2022-06-15', '2022-07-15'], ['2022-07-10', '2022-07-12']],
6],
'2024-06-19')],
[('one day toll', ['2021-04-04', '2021-04-04', 1, [['2021-05-05', '2021-05-05']], 5], '2022-04-05'),
('repose caps', ['2010-01-15', '2019-06-01', 3, [['2020-01-01', '2020-06-30']], 10], '2020-01-15'),
('repose with tolling beyond',
['2014-07-01', '2015-07-01', 7, [['2016-01-01', '2016-03-31']], 8],
'2022-07-01'),
('toll straddles accrual',
['2019-01-01', '2019-02-01', 1, [['2019-01-20', '2019-02-10']], 4],
'2020-02-11'),
('three overlapping tolls',
['2022-05-05',
'2022-05-05',
2,
[['2022-06-01', '2022-06-30'], ['2022-06-15', '2022-07-15'], ['2022-07-10', '2022-07-12']],
6],
'2024-06-19'),
('discovery earlier than injury input', ['2021-09-09', '2021-08-01', 2, [], 4], '2023-09-09'),
('toll wholly before injury',
['2020-10-10', '2020-10-10', 1, [['2019-01-01', '2019-02-01']], 3],
'2021-10-10')],
[('repose with tolling beyond',
['2014-07-01', '2015-07-01', 7, [['2016-01-01', '2016-03-31']], 8],
'2022-07-01'),
('toll straddles accrual',
['2019-01-01', '2019-02-01', 1, [['2019-01-20', '2019-02-10']], 4],
'2020-02-11'),
('three overlapping tolls',
['2022-05-05',
'2022-05-05',
2,
[['2022-06-01', '2022-06-30'], ['2022-06-15', '2022-07-15'], ['2022-07-10', '2022-07-12']],
6],
'2024-06-19'),
('discovery earlier than injury input', ['2021-09-09', '2021-08-01', 2, [], 4], '2023-09-09'),
('toll wholly before injury',
['2020-10-10', '2020-10-10', 1, [['2019-01-01', '2019-02-01']], 3],
'2021-10-10'),
('regression: discovery then overlapping tolls',
['2018-03-10', '2019-06-01', 2, [['2019-07-01', '2019-07-10'], ['2019-07-05', '2019-07-20']], 10],
'2021-06-21'),
('leap day accrual', ['2020-02-29', '2020-02-29', 3, [], 10], '2023-02-28')],
[('three overlapping tolls',
['2022-05-05',
'2022-05-05',
2,
[['2022-06-01', '2022-06-30'], ['2022-06-15', '2022-07-15'], ['2022-07-10', '2022-07-12']],
6],
'2024-06-19'),
('discovery earlier than injury input', ['2021-09-09', '2021-08-01', 2, [], 4], '2023-09-09'),
('toll wholly before injury',
['2020-10-10', '2020-10-10', 1, [['2019-01-01', '2019-02-01']], 3],
'2021-10-10'),
('regression: discovery then overlapping tolls',
['2018-03-10', '2019-06-01', 2, [['2019-07-01', '2019-07-10'], ['2019-07-05', '2019-07-20']], 10],
'2021-06-21'),
('leap day accrual', ['2020-02-29', '2020-02-29', 3, [], 10], '2023-02-28'),
('leap crossing two years', ['2023-03-01', '2023-03-01', 2, [], 10], '2025-03-01'),
('toll before discovery',
['2015-01-10', '2016-05-05', 3, [['2015-06-01', '2015-12-31'], ['2017-01-01', '2017-01-01']], 10],
'2019-05-06'),
('repose caps', ['2010-01-15', '2019-06-01', 3, [['2020-01-01', '2020-06-30']], 10], '2020-01-15')]]
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: discovery then overlapping tolls | 2021-06-21 | 2021-06-21 | Passed |
| leap day accrual | 2023-02-28 | 2023-02-28 | Passed |
| leap crossing two years | 2025-03-01 | 2025-03-01 | Passed |
| toll before discovery | 2019-05-06 | 2019-05-06 | Passed |
| one day toll | 2022-04-05 | 2022-04-05 | Passed |
| repose caps | 2022-11-30 | 2020-01-15 | Failed |
| repose with tolling beyond | 2022-09-30 | 2022-07-01 | Failed |
SHA-256 / 14c90a8210959f18cd3bd1b8c9aa284e7b46a0b692cebf198f31bd46d9429a92
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(injury, discovery, years, tolls, repose_years):
inj = dt.date.fromisoformat(injury)
disc = dt.date.fromisoformat(discovery)
accrual = max(inj, disc)
def add_years(d, n):
y = d.year + n
return dt.date(y, d.month, min(d.day, calendar.monthrange(y, d.month)[1]))
base = add_years(accrual, years)
covered = set()
total = 0
for a, b in tolls:
a = dt.date.fromisoformat(a)
b = dt.date.fromisoformat(b)
a = max(a, accrual)
span = max(0, (b - a).days + 1)
total += span
for i in range(span):
covered.add(a + dt.timedelta(days=i))
tolled = len(covered)
extended = base + dt.timedelta(days=tolled)
repose = add_years(disc, repose_years)
return (min(extended, repose)).isoformat()
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: discovery then overlapping tolls',
['2018-03-10', '2019-06-01', 2, [['2019-07-01', '2019-07-10'], ['2019-07-05', '2019-07-20']], 10],
'2021-06-21'),
('leap day accrual', ['2020-02-29', '2020-02-29', 3, [], 10], '2023-02-28'),
('leap crossing two years', ['2023-03-01', '2023-03-01', 2, [], 10], '2025-03-01'),
('toll before discovery',
['2015-01-10', '2016-05-05', 3, [['2015-06-01', '2015-12-31'], ['2017-01-01', '2017-01-01']], 10],
'2019-05-06'),
('one day toll', ['2021-04-04', '2021-04-04', 1, [['2021-05-05', '2021-05-05']], 5], '2022-04-05'),
('repose caps', ['2010-01-15', '2019-06-01', 3, [['2020-01-01', '2020-06-30']], 10], '2020-01-15'),
('repose with tolling beyond',
['2014-07-01', '2015-07-01', 7, [['2016-01-01', '2016-03-31']], 8],
'2022-07-01')],
[('leap crossing two years', ['2023-03-01', '2023-03-01', 2, [], 10], '2025-03-01'),
('toll before discovery',
['2015-01-10', '2016-05-05', 3, [['2015-06-01', '2015-12-31'], ['2017-01-01', '2017-01-01']], 10],
'2019-05-06'),
('one day toll', ['2021-04-04', '2021-04-04', 1, [['2021-05-05', '2021-05-05']], 5], '2022-04-05'),
('repose caps', ['2010-01-15', '2019-06-01', 3, [['2020-01-01', '2020-06-30']], 10], '2020-01-15'),
('repose with tolling beyond',
['2014-07-01', '2015-07-01', 7, [['2016-01-01', '2016-03-31']], 8],
'2022-07-01'),
('toll straddles accrual',
['2019-01-01', '2019-02-01', 1, [['2019-01-20', '2019-02-10']], 4],
'2020-02-11'),
('three overlapping tolls',
['2022-05-05',
'2022-05-05',
2,
[['2022-06-01', '2022-06-30'], ['2022-06-15', '2022-07-15'], ['2022-07-10', '2022-07-12']],
6],
'2024-06-19')],
[('one day toll', ['2021-04-04', '2021-04-04', 1, [['2021-05-05', '2021-05-05']], 5], '2022-04-05'),
('repose caps', ['2010-01-15', '2019-06-01', 3, [['2020-01-01', '2020-06-30']], 10], '2020-01-15'),
('repose with tolling beyond',
['2014-07-01', '2015-07-01', 7, [['2016-01-01', '2016-03-31']], 8],
'2022-07-01'),
('toll straddles accrual',
['2019-01-01', '2019-02-01', 1, [['2019-01-20', '2019-02-10']], 4],
'2020-02-11'),
('three overlapping tolls',
['2022-05-05',
'2022-05-05',
2,
[['2022-06-01', '2022-06-30'], ['2022-06-15', '2022-07-15'], ['2022-07-10', '2022-07-12']],
6],
'2024-06-19'),
('discovery earlier than injury input', ['2021-09-09', '2021-08-01', 2, [], 4], '2023-09-09'),
('toll wholly before injury',
['2020-10-10', '2020-10-10', 1, [['2019-01-01', '2019-02-01']], 3],
'2021-10-10')],
[('repose with tolling beyond',
['2014-07-01', '2015-07-01', 7, [['2016-01-01', '2016-03-31']], 8],
'2022-07-01'),
('toll straddles accrual',
['2019-01-01', '2019-02-01', 1, [['2019-01-20', '2019-02-10']], 4],
'2020-02-11'),
('three overlapping tolls',
['2022-05-05',
'2022-05-05',
2,
[['2022-06-01', '2022-06-30'], ['2022-06-15', '2022-07-15'], ['2022-07-10', '2022-07-12']],
6],
'2024-06-19'),
('discovery earlier than injury input', ['2021-09-09', '2021-08-01', 2, [], 4], '2023-09-09'),
('toll wholly before injury',
['2020-10-10', '2020-10-10', 1, [['2019-01-01', '2019-02-01']], 3],
'2021-10-10'),
('regression: discovery then overlapping tolls',
['2018-03-10', '2019-06-01', 2, [['2019-07-01', '2019-07-10'], ['2019-07-05', '2019-07-20']], 10],
'2021-06-21'),
('leap day accrual', ['2020-02-29', '2020-02-29', 3, [], 10], '2023-02-28')],
[('three overlapping tolls',
['2022-05-05',
'2022-05-05',
2,
[['2022-06-01', '2022-06-30'], ['2022-06-15', '2022-07-15'], ['2022-07-10', '2022-07-12']],
6],
'2024-06-19'),
('discovery earlier than injury input', ['2021-09-09', '2021-08-01', 2, [], 4], '2023-09-09'),
('toll wholly before injury',
['2020-10-10', '2020-10-10', 1, [['2019-01-01', '2019-02-01']], 3],
'2021-10-10'),
('regression: discovery then overlapping tolls',
['2018-03-10', '2019-06-01', 2, [['2019-07-01', '2019-07-10'], ['2019-07-05', '2019-07-20']], 10],
'2021-06-21'),
('leap day accrual', ['2020-02-29', '2020-02-29', 3, [], 10], '2023-02-28'),
('leap crossing two years', ['2023-03-01', '2023-03-01', 2, [], 10], '2025-03-01'),
('toll before discovery',
['2015-01-10', '2016-05-05', 3, [['2015-06-01', '2015-12-31'], ['2017-01-01', '2017-01-01']], 10],
'2019-05-06'),
('repose caps', ['2010-01-15', '2019-06-01', 3, [['2020-01-01', '2020-06-30']], 10], '2020-01-15')]]
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: discovery then overlapping tolls | 2021-06-21 | 2021-06-21 | Passed |
| leap day accrual | 2023-02-28 | 2023-02-28 | Passed |
| leap crossing two years | 2025-03-01 | 2025-03-01 | Passed |
| toll before discovery | 2019-05-06 | 2019-05-06 | Passed |
| one day toll | 2022-04-05 | 2022-04-05 | Passed |
| repose caps | 2022-11-30 | 2020-01-15 | Failed |
| repose with tolling beyond | 2022-09-30 | 2022-07-01 | Failed |
SHA-256 / d76ba8d436450cdac030992eb7eb99968948ab18ac86fe8453631dc40cb455aa
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(injury, discovery, years, tolls, repose_years):
inj = dt.date.fromisoformat(injury)
disc = dt.date.fromisoformat(discovery)
accrual = max(inj, disc)
def add_years(d, n):
y = d.year + n
return dt.date(y, d.month, min(d.day, calendar.monthrange(y, d.month)[1]))
base = add_years(accrual, years)
covered = set()
total = 0
for a, b in tolls:
a = dt.date.fromisoformat(a)
b = dt.date.fromisoformat(b)
a = max(a, accrual)
span = max(0, (b - a).days + 1)
total += span
for i in range(span):
covered.add(a + dt.timedelta(days=i))
tolled = len(covered)
extended = base + dt.timedelta(days=tolled)
repose = add_years(inj, repose_years)
return (min(extended, repose)).isoformat()
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: discovery then overlapping tolls',
['2018-03-10', '2019-06-01', 2, [['2019-07-01', '2019-07-10'], ['2019-07-05', '2019-07-20']], 10],
'2021-06-21'),
('leap day accrual', ['2020-02-29', '2020-02-29', 3, [], 10], '2023-02-28'),
('leap crossing two years', ['2023-03-01', '2023-03-01', 2, [], 10], '2025-03-01'),
('toll before discovery',
['2015-01-10', '2016-05-05', 3, [['2015-06-01', '2015-12-31'], ['2017-01-01', '2017-01-01']], 10],
'2019-05-06'),
('one day toll', ['2021-04-04', '2021-04-04', 1, [['2021-05-05', '2021-05-05']], 5], '2022-04-05'),
('repose caps', ['2010-01-15', '2019-06-01', 3, [['2020-01-01', '2020-06-30']], 10], '2020-01-15'),
('repose with tolling beyond',
['2014-07-01', '2015-07-01', 7, [['2016-01-01', '2016-03-31']], 8],
'2022-07-01')],
[('leap crossing two years', ['2023-03-01', '2023-03-01', 2, [], 10], '2025-03-01'),
('toll before discovery',
['2015-01-10', '2016-05-05', 3, [['2015-06-01', '2015-12-31'], ['2017-01-01', '2017-01-01']], 10],
'2019-05-06'),
('one day toll', ['2021-04-04', '2021-04-04', 1, [['2021-05-05', '2021-05-05']], 5], '2022-04-05'),
('repose caps', ['2010-01-15', '2019-06-01', 3, [['2020-01-01', '2020-06-30']], 10], '2020-01-15'),
('repose with tolling beyond',
['2014-07-01', '2015-07-01', 7, [['2016-01-01', '2016-03-31']], 8],
'2022-07-01'),
('toll straddles accrual',
['2019-01-01', '2019-02-01', 1, [['2019-01-20', '2019-02-10']], 4],
'2020-02-11'),
('three overlapping tolls',
['2022-05-05',
'2022-05-05',
2,
[['2022-06-01', '2022-06-30'], ['2022-06-15', '2022-07-15'], ['2022-07-10', '2022-07-12']],
6],
'2024-06-19')],
[('one day toll', ['2021-04-04', '2021-04-04', 1, [['2021-05-05', '2021-05-05']], 5], '2022-04-05'),
('repose caps', ['2010-01-15', '2019-06-01', 3, [['2020-01-01', '2020-06-30']], 10], '2020-01-15'),
('repose with tolling beyond',
['2014-07-01', '2015-07-01', 7, [['2016-01-01', '2016-03-31']], 8],
'2022-07-01'),
('toll straddles accrual',
['2019-01-01', '2019-02-01', 1, [['2019-01-20', '2019-02-10']], 4],
'2020-02-11'),
('three overlapping tolls',
['2022-05-05',
'2022-05-05',
2,
[['2022-06-01', '2022-06-30'], ['2022-06-15', '2022-07-15'], ['2022-07-10', '2022-07-12']],
6],
'2024-06-19'),
('discovery earlier than injury input', ['2021-09-09', '2021-08-01', 2, [], 4], '2023-09-09'),
('toll wholly before injury',
['2020-10-10', '2020-10-10', 1, [['2019-01-01', '2019-02-01']], 3],
'2021-10-10')],
[('repose with tolling beyond',
['2014-07-01', '2015-07-01', 7, [['2016-01-01', '2016-03-31']], 8],
'2022-07-01'),
('toll straddles accrual',
['2019-01-01', '2019-02-01', 1, [['2019-01-20', '2019-02-10']], 4],
'2020-02-11'),
('three overlapping tolls',
['2022-05-05',
'2022-05-05',
2,
[['2022-06-01', '2022-06-30'], ['2022-06-15', '2022-07-15'], ['2022-07-10', '2022-07-12']],
6],
'2024-06-19'),
('discovery earlier than injury input', ['2021-09-09', '2021-08-01', 2, [], 4], '2023-09-09'),
('toll wholly before injury',
['2020-10-10', '2020-10-10', 1, [['2019-01-01', '2019-02-01']], 3],
'2021-10-10'),
('regression: discovery then overlapping tolls',
['2018-03-10', '2019-06-01', 2, [['2019-07-01', '2019-07-10'], ['2019-07-05', '2019-07-20']], 10],
'2021-06-21'),
('leap day accrual', ['2020-02-29', '2020-02-29', 3, [], 10], '2023-02-28')],
[('three overlapping tolls',
['2022-05-05',
'2022-05-05',
2,
[['2022-06-01', '2022-06-30'], ['2022-06-15', '2022-07-15'], ['2022-07-10', '2022-07-12']],
6],
'2024-06-19'),
('discovery earlier than injury input', ['2021-09-09', '2021-08-01', 2, [], 4], '2023-09-09'),
('toll wholly before injury',
['2020-10-10', '2020-10-10', 1, [['2019-01-01', '2019-02-01']], 3],
'2021-10-10'),
('regression: discovery then overlapping tolls',
['2018-03-10', '2019-06-01', 2, [['2019-07-01', '2019-07-10'], ['2019-07-05', '2019-07-20']], 10],
'2021-06-21'),
('leap day accrual', ['2020-02-29', '2020-02-29', 3, [], 10], '2023-02-28'),
('leap crossing two years', ['2023-03-01', '2023-03-01', 2, [], 10], '2025-03-01'),
('toll before discovery',
['2015-01-10', '2016-05-05', 3, [['2015-06-01', '2015-12-31'], ['2017-01-01', '2017-01-01']], 10],
'2019-05-06'),
('repose caps', ['2010-01-15', '2019-06-01', 3, [['2020-01-01', '2020-06-30']], 10], '2020-01-15')]]
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: discovery then overlapping tolls | 2021-06-21 | 2021-06-21 | Passed |
| leap day accrual | 2023-02-28 | 2023-02-28 | Passed |
| leap crossing two years | 2025-03-01 | 2025-03-01 | Passed |
| toll before discovery | 2019-05-06 | 2019-05-06 | Passed |
| one day toll | 2022-04-05 | 2022-04-05 | Passed |
| repose caps | 2020-01-15 | 2020-01-15 | Passed |
| repose with tolling beyond | 2022-07-01 | 2022-07-01 | Passed |
SHA-256 / de91718afae6e55da0bfb691f348228e879d40cb87d55da4f550145a5e3c221d
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:26.208417+00:00.
Case digest / b180ef1d19b6785bfdac67c0bf00d2fc87cdf3c84302b7202c0e8f1418fd5480