FAILURE MAP
← Case archive

FA-77581 / Legal deadline computation / Open access

Regulatory review clock with stop-clock pauses: start exclusion · case 01

The review expires a day early because the submission day is counted.

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

ROOT CAUSE

Counting starts on the submission day.

VERIFIED REPAIR

At the start exclusion decision use `st`, leaving the other decision sites of the model unchanged.

Unsuccessful approach: The partial repair `st - dt.timedelta(days=1) if st.weekday() < 5 else st` still counts the submission day whenever it is a weekday.

Case contract

Stipulated: a review has days_allowed clock days, counted from the day after start. A pause [stop, resume] stops the clock on the stop day and every day before the resume day; the resume day counts. A pause with resume None is open-ended and starts on its stop day; if the clock would reach a day on or after the earliest open-ended stop before expiring, the result is None. Return the date of the last clock day.

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(start, days_allowed, pauses):
    st = dt.date.fromisoformat(start)
    paused = set()
    open_ended = None
    for a, b in pauses:
        a = dt.date.fromisoformat(a)
        if b is None:
            open_ended = a if open_ended is None else min(open_ended, a)
            continue
        b = dt.date.fromisoformat(b)
        for i in range((b - a).days):
            paused.add(a + dt.timedelta(days=i))
    d = st - dt.timedelta(days=1)
    counted = 0
    while counted < days_allowed:
        d += dt.timedelta(days=1)
        if open_ended is not None and d >= open_ended:
            return None
        if d in paused:
            continue
        counted += 1
    return d.isoformat()
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: pause resume day counts', ['2024-01-01', 10, [['2024-01-04', '2024-01-08']]], '2024-01-15'),
  ('no pauses', ['2024-01-01', 30, []], '2024-01-31'),
  ('two open-ended stops', ['2024-01-01', 30, [['2024-01-20', None], ['2024-01-10', None]]], None),
  ('earlier open-ended listed first', ['2024-01-01', 12, [['2024-01-10', None], ['2024-01-20', None]]], None),
  ('open-ended after expiry', ['2024-01-01', 10, [['2024-01-20', None]]], '2024-01-11'),
  ('open-ended on last day', ['2024-01-01', 10, [['2024-01-11', None]]], None),
  ('open-ended the day after', ['2024-01-01', 10, [['2024-01-12', None]]], '2024-01-11')],
 [('two open-ended stops', ['2024-01-01', 30, [['2024-01-20', None], ['2024-01-10', None]]], None),
  ('earlier open-ended listed first', ['2024-01-01', 12, [['2024-01-10', None], ['2024-01-20', None]]], None),
  ('open-ended after expiry', ['2024-01-01', 10, [['2024-01-20', None]]], '2024-01-11'),
  ('open-ended on last day', ['2024-01-01', 10, [['2024-01-11', None]]], None),
  ('open-ended the day after', ['2024-01-01', 10, [['2024-01-12', None]]], '2024-01-11'),
  ('overlapping pauses',
   ['2024-02-01', 15, [['2024-02-05', '2024-02-10'], ['2024-02-08', '2024-02-12']]],
   '2024-02-23'),
  ('pause before start', ['2024-03-10', 5, [['2024-03-01', '2024-03-05']]], '2024-03-15')],
 [('open-ended after expiry', ['2024-01-01', 10, [['2024-01-20', None]]], '2024-01-11'),
  ('open-ended on last day', ['2024-01-01', 10, [['2024-01-11', None]]], None),
  ('open-ended the day after', ['2024-01-01', 10, [['2024-01-12', None]]], '2024-01-11'),
  ('overlapping pauses',
   ['2024-02-01', 15, [['2024-02-05', '2024-02-10'], ['2024-02-08', '2024-02-12']]],
   '2024-02-23'),
  ('pause before start', ['2024-03-10', 5, [['2024-03-01', '2024-03-05']]], '2024-03-15'),
  ('weekday start', ['2024-04-02', 7, []], '2024-04-09'),
  ('saturday start', ['2024-04-06', 7, [['2024-04-08', '2024-04-09']]], '2024-04-14')],
 [('open-ended the day after', ['2024-01-01', 10, [['2024-01-12', None]]], '2024-01-11'),
  ('overlapping pauses',
   ['2024-02-01', 15, [['2024-02-05', '2024-02-10'], ['2024-02-08', '2024-02-12']]],
   '2024-02-23'),
  ('pause before start', ['2024-03-10', 5, [['2024-03-01', '2024-03-05']]], '2024-03-15'),
  ('weekday start', ['2024-04-02', 7, []], '2024-04-09'),
  ('saturday start', ['2024-04-06', 7, [['2024-04-08', '2024-04-09']]], '2024-04-14'),
  ('pause then open-ended', ['2024-05-01', 20, [['2024-05-05', '2024-05-15'], ['2024-05-25', None]]], None),
  ('open-ended pushed by pause',
   ['2024-06-01', 10, [['2024-06-03', '2024-06-06'], ['2024-06-14', None]]],
   None)],
 [('pause before start', ['2024-03-10', 5, [['2024-03-01', '2024-03-05']]], '2024-03-15'),
  ('weekday start', ['2024-04-02', 7, []], '2024-04-09'),
  ('saturday start', ['2024-04-06', 7, [['2024-04-08', '2024-04-09']]], '2024-04-14'),
  ('pause then open-ended', ['2024-05-01', 20, [['2024-05-05', '2024-05-15'], ['2024-05-25', None]]], None),
  ('open-ended pushed by pause',
   ['2024-06-01', 10, [['2024-06-03', '2024-06-06'], ['2024-06-14', None]]],
   None),
  ('regression: pause resume day counts', ['2024-01-01', 10, [['2024-01-04', '2024-01-08']]], '2024-01-15'),
  ('no pauses', ['2024-01-01', 30, []], '2024-01-31')]]
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: pause resume day counts2024-01-142024-01-15Failed
no pauses2024-01-302024-01-31Failed
two open-ended stopsNoneNonePassed
earlier open-ended listed firstNoneNonePassed
open-ended after expiry2024-01-102024-01-11Failed
open-ended on last day2024-01-10NoneFailed
open-ended the day after2024-01-102024-01-11Failed

SHA-256 / 369d0daa87022220365037bf3221b7261530b9884eaad4743481646394beb951

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(start, days_allowed, pauses):
    st = dt.date.fromisoformat(start)
    paused = set()
    open_ended = None
    for a, b in pauses:
        a = dt.date.fromisoformat(a)
        if b is None:
            open_ended = a if open_ended is None else min(open_ended, a)
            continue
        b = dt.date.fromisoformat(b)
        for i in range((b - a).days):
            paused.add(a + dt.timedelta(days=i))
    d = st - dt.timedelta(days=1) if st.weekday() < 5 else st
    counted = 0
    while counted < days_allowed:
        d += dt.timedelta(days=1)
        if open_ended is not None and d >= open_ended:
            return None
        if d in paused:
            continue
        counted += 1
    return d.isoformat()
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: pause resume day counts', ['2024-01-01', 10, [['2024-01-04', '2024-01-08']]], '2024-01-15'),
  ('no pauses', ['2024-01-01', 30, []], '2024-01-31'),
  ('two open-ended stops', ['2024-01-01', 30, [['2024-01-20', None], ['2024-01-10', None]]], None),
  ('earlier open-ended listed first', ['2024-01-01', 12, [['2024-01-10', None], ['2024-01-20', None]]], None),
  ('open-ended after expiry', ['2024-01-01', 10, [['2024-01-20', None]]], '2024-01-11'),
  ('open-ended on last day', ['2024-01-01', 10, [['2024-01-11', None]]], None),
  ('open-ended the day after', ['2024-01-01', 10, [['2024-01-12', None]]], '2024-01-11')],
 [('two open-ended stops', ['2024-01-01', 30, [['2024-01-20', None], ['2024-01-10', None]]], None),
  ('earlier open-ended listed first', ['2024-01-01', 12, [['2024-01-10', None], ['2024-01-20', None]]], None),
  ('open-ended after expiry', ['2024-01-01', 10, [['2024-01-20', None]]], '2024-01-11'),
  ('open-ended on last day', ['2024-01-01', 10, [['2024-01-11', None]]], None),
  ('open-ended the day after', ['2024-01-01', 10, [['2024-01-12', None]]], '2024-01-11'),
  ('overlapping pauses',
   ['2024-02-01', 15, [['2024-02-05', '2024-02-10'], ['2024-02-08', '2024-02-12']]],
   '2024-02-23'),
  ('pause before start', ['2024-03-10', 5, [['2024-03-01', '2024-03-05']]], '2024-03-15')],
 [('open-ended after expiry', ['2024-01-01', 10, [['2024-01-20', None]]], '2024-01-11'),
  ('open-ended on last day', ['2024-01-01', 10, [['2024-01-11', None]]], None),
  ('open-ended the day after', ['2024-01-01', 10, [['2024-01-12', None]]], '2024-01-11'),
  ('overlapping pauses',
   ['2024-02-01', 15, [['2024-02-05', '2024-02-10'], ['2024-02-08', '2024-02-12']]],
   '2024-02-23'),
  ('pause before start', ['2024-03-10', 5, [['2024-03-01', '2024-03-05']]], '2024-03-15'),
  ('weekday start', ['2024-04-02', 7, []], '2024-04-09'),
  ('saturday start', ['2024-04-06', 7, [['2024-04-08', '2024-04-09']]], '2024-04-14')],
 [('open-ended the day after', ['2024-01-01', 10, [['2024-01-12', None]]], '2024-01-11'),
  ('overlapping pauses',
   ['2024-02-01', 15, [['2024-02-05', '2024-02-10'], ['2024-02-08', '2024-02-12']]],
   '2024-02-23'),
  ('pause before start', ['2024-03-10', 5, [['2024-03-01', '2024-03-05']]], '2024-03-15'),
  ('weekday start', ['2024-04-02', 7, []], '2024-04-09'),
  ('saturday start', ['2024-04-06', 7, [['2024-04-08', '2024-04-09']]], '2024-04-14'),
  ('pause then open-ended', ['2024-05-01', 20, [['2024-05-05', '2024-05-15'], ['2024-05-25', None]]], None),
  ('open-ended pushed by pause',
   ['2024-06-01', 10, [['2024-06-03', '2024-06-06'], ['2024-06-14', None]]],
   None)],
 [('pause before start', ['2024-03-10', 5, [['2024-03-01', '2024-03-05']]], '2024-03-15'),
  ('weekday start', ['2024-04-02', 7, []], '2024-04-09'),
  ('saturday start', ['2024-04-06', 7, [['2024-04-08', '2024-04-09']]], '2024-04-14'),
  ('pause then open-ended', ['2024-05-01', 20, [['2024-05-05', '2024-05-15'], ['2024-05-25', None]]], None),
  ('open-ended pushed by pause',
   ['2024-06-01', 10, [['2024-06-03', '2024-06-06'], ['2024-06-14', None]]],
   None),
  ('regression: pause resume day counts', ['2024-01-01', 10, [['2024-01-04', '2024-01-08']]], '2024-01-15'),
  ('no pauses', ['2024-01-01', 30, []], '2024-01-31')]]
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: pause resume day counts2024-01-142024-01-15Failed
no pauses2024-01-302024-01-31Failed
two open-ended stopsNoneNonePassed
earlier open-ended listed firstNoneNonePassed
open-ended after expiry2024-01-102024-01-11Failed
open-ended on last day2024-01-10NoneFailed
open-ended the day after2024-01-102024-01-11Failed

SHA-256 / 28fcb6738627ba680b03c8564415b7fdbd8ac1425d552cd2fc7eeabaedcaf433

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(start, days_allowed, pauses):
    st = dt.date.fromisoformat(start)
    paused = set()
    open_ended = None
    for a, b in pauses:
        a = dt.date.fromisoformat(a)
        if b is None:
            open_ended = a if open_ended is None else min(open_ended, a)
            continue
        b = dt.date.fromisoformat(b)
        for i in range((b - a).days):
            paused.add(a + dt.timedelta(days=i))
    d = st
    counted = 0
    while counted < days_allowed:
        d += dt.timedelta(days=1)
        if open_ended is not None and d >= open_ended:
            return None
        if d in paused:
            continue
        counted += 1
    return d.isoformat()
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: pause resume day counts', ['2024-01-01', 10, [['2024-01-04', '2024-01-08']]], '2024-01-15'),
  ('no pauses', ['2024-01-01', 30, []], '2024-01-31'),
  ('two open-ended stops', ['2024-01-01', 30, [['2024-01-20', None], ['2024-01-10', None]]], None),
  ('earlier open-ended listed first', ['2024-01-01', 12, [['2024-01-10', None], ['2024-01-20', None]]], None),
  ('open-ended after expiry', ['2024-01-01', 10, [['2024-01-20', None]]], '2024-01-11'),
  ('open-ended on last day', ['2024-01-01', 10, [['2024-01-11', None]]], None),
  ('open-ended the day after', ['2024-01-01', 10, [['2024-01-12', None]]], '2024-01-11')],
 [('two open-ended stops', ['2024-01-01', 30, [['2024-01-20', None], ['2024-01-10', None]]], None),
  ('earlier open-ended listed first', ['2024-01-01', 12, [['2024-01-10', None], ['2024-01-20', None]]], None),
  ('open-ended after expiry', ['2024-01-01', 10, [['2024-01-20', None]]], '2024-01-11'),
  ('open-ended on last day', ['2024-01-01', 10, [['2024-01-11', None]]], None),
  ('open-ended the day after', ['2024-01-01', 10, [['2024-01-12', None]]], '2024-01-11'),
  ('overlapping pauses',
   ['2024-02-01', 15, [['2024-02-05', '2024-02-10'], ['2024-02-08', '2024-02-12']]],
   '2024-02-23'),
  ('pause before start', ['2024-03-10', 5, [['2024-03-01', '2024-03-05']]], '2024-03-15')],
 [('open-ended after expiry', ['2024-01-01', 10, [['2024-01-20', None]]], '2024-01-11'),
  ('open-ended on last day', ['2024-01-01', 10, [['2024-01-11', None]]], None),
  ('open-ended the day after', ['2024-01-01', 10, [['2024-01-12', None]]], '2024-01-11'),
  ('overlapping pauses',
   ['2024-02-01', 15, [['2024-02-05', '2024-02-10'], ['2024-02-08', '2024-02-12']]],
   '2024-02-23'),
  ('pause before start', ['2024-03-10', 5, [['2024-03-01', '2024-03-05']]], '2024-03-15'),
  ('weekday start', ['2024-04-02', 7, []], '2024-04-09'),
  ('saturday start', ['2024-04-06', 7, [['2024-04-08', '2024-04-09']]], '2024-04-14')],
 [('open-ended the day after', ['2024-01-01', 10, [['2024-01-12', None]]], '2024-01-11'),
  ('overlapping pauses',
   ['2024-02-01', 15, [['2024-02-05', '2024-02-10'], ['2024-02-08', '2024-02-12']]],
   '2024-02-23'),
  ('pause before start', ['2024-03-10', 5, [['2024-03-01', '2024-03-05']]], '2024-03-15'),
  ('weekday start', ['2024-04-02', 7, []], '2024-04-09'),
  ('saturday start', ['2024-04-06', 7, [['2024-04-08', '2024-04-09']]], '2024-04-14'),
  ('pause then open-ended', ['2024-05-01', 20, [['2024-05-05', '2024-05-15'], ['2024-05-25', None]]], None),
  ('open-ended pushed by pause',
   ['2024-06-01', 10, [['2024-06-03', '2024-06-06'], ['2024-06-14', None]]],
   None)],
 [('pause before start', ['2024-03-10', 5, [['2024-03-01', '2024-03-05']]], '2024-03-15'),
  ('weekday start', ['2024-04-02', 7, []], '2024-04-09'),
  ('saturday start', ['2024-04-06', 7, [['2024-04-08', '2024-04-09']]], '2024-04-14'),
  ('pause then open-ended', ['2024-05-01', 20, [['2024-05-05', '2024-05-15'], ['2024-05-25', None]]], None),
  ('open-ended pushed by pause',
   ['2024-06-01', 10, [['2024-06-03', '2024-06-06'], ['2024-06-14', None]]],
   None),
  ('regression: pause resume day counts', ['2024-01-01', 10, [['2024-01-04', '2024-01-08']]], '2024-01-15'),
  ('no pauses', ['2024-01-01', 30, []], '2024-01-31')]]
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: pause resume day counts2024-01-152024-01-15Passed
no pauses2024-01-312024-01-31Passed
two open-ended stopsNoneNonePassed
earlier open-ended listed firstNoneNonePassed
open-ended after expiry2024-01-112024-01-11Passed
open-ended on last dayNoneNonePassed
open-ended the day after2024-01-112024-01-11Passed

SHA-256 / 1883e514e522c711910e6d8dd8ec4d2fea0c80f39e1b89429d7116c337ef878c

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

Case digest / 21b1a2498a1206410afeb5c4c0ac507d9b88c057331057eae20f3bb4a799a507