FAILURE MAP
← Case archive

FA-77501 / Legal deadline computation / Open access

Limitations period with discovery accrual, tolling and repose cap: repose cap · case 01

Tolling extends a claim beyond the statute of repose.

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

ROOT CAUSE

The repose deadline is not applied as a cap.

THE FAILURE

The repose deadline is not applied as a cap.

Unsuccessful approach: The partial repair `min(base, repose) + dt.timedelta(days=tolled)` applies the cap before tolling, so the repose bar itself is tolled.

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(inj, repose_years)
    return (extended).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 fixtureActualExpectedOutcome
regression: discovery then overlapping tolls2021-06-212021-06-21Passed
leap day accrual2023-02-282023-02-28Passed
leap crossing two years2025-03-012025-03-01Passed
toll before discovery2019-05-062019-05-06Passed
one day toll2022-04-052022-04-05Passed
repose caps2022-11-302020-01-15Failed
repose with tolling beyond2022-09-302022-07-01Failed

SHA-256 / 82b97c7e8ed994f077df648d9b5d4e4810fbbef4b95e59d7e6c8c69cd7053a10

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(inj, repose_years)
    return (min(base, repose) + dt.timedelta(days=tolled)).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 fixtureActualExpectedOutcome
regression: discovery then overlapping tolls2021-06-212021-06-21Passed
leap day accrual2023-02-282023-02-28Passed
leap crossing two years2025-03-012025-03-01Passed
toll before discovery2019-05-062019-05-06Passed
one day toll2022-04-052022-04-05Passed
repose caps2020-07-152020-01-15Failed
repose with tolling beyond2022-09-302022-07-01Failed

SHA-256 / 028ab346182a59807bd339d09f26fc3d68673390e274d60c30e4cc416f5fb16d

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

Case digest / e0fbf7940d60483fd6c8da1288a2fc7553c3a9c26deae3c4b5ab9b39494fd8e1