FA-77046 / Calendar recurrence rules / Open access
Window query for recurring instances with duration: count limit · case 01
A window late in a COUNT-limited series returns instances beyond the last occurrence.
ROOT CAUSE
COUNT is restarted from the skip-ahead index instead of from dtstart.
VERIFIED REPAIR
At the count limit decision use `count`, leaving the other decision sites of the model unchanged.
Unsuccessful approach: The partial repair `count - k0` subtracts the skipped instances again and truncates the series early.
Case contract
Instances start at dtstart + k*interval_hours for k < count and last duration_min minutes. A window [window_start, window_end) returns every instance whose half-open span [s, s+duration) overlaps it; a zero-duration instance is returned when window_start <= s < window_end. The query may skip ahead but COUNT is always counted from dtstart. Return ISO start times (minutes).
Why this case matters
Recurring calendar series are expanded into concrete instances for display, reminders and conflict checks.
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(dtstart, interval_hours, duration_min, count, window_start, window_end):
first = dt.datetime.fromisoformat(dtstart)
ws = dt.datetime.fromisoformat(window_start)
we = dt.datetime.fromisoformat(window_end)
dur = dt.timedelta(minutes=duration_min)
step = dt.timedelta(hours=interval_hours)
k0 = max(0, (ws - dur - first) // step)
out = []
for k in range(k0, k0 + count):
s = first + k * step
if s >= we:
break
if (s + dur > ws) if duration_min else s >= ws:
out.append(s.isoformat(timespec='minutes'))
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: in-progress long meeting',
['2024-01-01T00:00', 1, 180, 20, '2024-01-01T10:30', '2024-01-01T12:00'],
['2024-01-01T08:00', '2024-01-01T09:00', '2024-01-01T10:00', '2024-01-01T11:00']),
('touching end excluded',
['2024-01-01T08:00', 2, 60, 10, '2024-01-01T09:00', '2024-01-01T12:00'],
['2024-01-01T10:00']),
('window end exclusive',
['2024-01-01T08:00', 2, 30, 10, '2024-01-01T08:15', '2024-01-01T12:00'],
['2024-01-01T08:00', '2024-01-01T10:00']),
('zero duration instants',
['2024-01-01T00:00', 6, 0, 10, '2024-01-01T12:00', '2024-01-02T00:00'],
['2024-01-01T12:00', '2024-01-01T18:00']),
('late window beyond count',
['2024-01-01T00:00', 24, 60, 5, '2024-01-04T00:00', '2024-01-10T00:00'],
['2024-01-04T00:00', '2024-01-05T00:00']),
('window before dtstart',
['2024-01-05T09:00', 24, 90, 3, '2024-01-01T00:00', '2024-01-06T12:00'],
['2024-01-05T09:00', '2024-01-06T09:00']),
('duration longer than interval',
['2024-02-01T00:00', 2, 300, 12, '2024-02-01T09:00', '2024-02-01T10:00'],
['2024-02-01T06:00', '2024-02-01T08:00'])],
[('window end exclusive',
['2024-01-01T08:00', 2, 30, 10, '2024-01-01T08:15', '2024-01-01T12:00'],
['2024-01-01T08:00', '2024-01-01T10:00']),
('zero duration instants',
['2024-01-01T00:00', 6, 0, 10, '2024-01-01T12:00', '2024-01-02T00:00'],
['2024-01-01T12:00', '2024-01-01T18:00']),
('late window beyond count',
['2024-01-01T00:00', 24, 60, 5, '2024-01-04T00:00', '2024-01-10T00:00'],
['2024-01-04T00:00', '2024-01-05T00:00']),
('window before dtstart',
['2024-01-05T09:00', 24, 90, 3, '2024-01-01T00:00', '2024-01-06T12:00'],
['2024-01-05T09:00', '2024-01-06T09:00']),
('duration longer than interval',
['2024-02-01T00:00', 2, 300, 12, '2024-02-01T09:00', '2024-02-01T10:00'],
['2024-02-01T06:00', '2024-02-01T08:00']),
('window mid series',
['2024-03-01T06:00', 4, 120, 30, '2024-03-02T07:00', '2024-03-02T15:00'],
['2024-03-02T06:00', '2024-03-02T10:00', '2024-03-02T14:00']),
('instance ends at window start',
['2024-03-01T00:00', 3, 180, 8, '2024-03-01T06:00', '2024-03-01T07:00'],
['2024-03-01T06:00'])],
[('late window beyond count',
['2024-01-01T00:00', 24, 60, 5, '2024-01-04T00:00', '2024-01-10T00:00'],
['2024-01-04T00:00', '2024-01-05T00:00']),
('window before dtstart',
['2024-01-05T09:00', 24, 90, 3, '2024-01-01T00:00', '2024-01-06T12:00'],
['2024-01-05T09:00', '2024-01-06T09:00']),
('duration longer than interval',
['2024-02-01T00:00', 2, 300, 12, '2024-02-01T09:00', '2024-02-01T10:00'],
['2024-02-01T06:00', '2024-02-01T08:00']),
('window mid series',
['2024-03-01T06:00', 4, 120, 30, '2024-03-02T07:00', '2024-03-02T15:00'],
['2024-03-02T06:00', '2024-03-02T10:00', '2024-03-02T14:00']),
('instance ends at window start',
['2024-03-01T00:00', 3, 180, 8, '2024-03-01T06:00', '2024-03-01T07:00'],
['2024-03-01T06:00']),
('count exactly reaches window',
['2024-04-01T00:00', 12, 60, 4, '2024-04-02T11:30', '2024-04-03T00:00'],
['2024-04-02T12:00']),
('long instance from before window, short count',
['2024-05-01T00:00', 1, 600, 3, '2024-05-01T05:00', '2024-05-01T06:00'],
['2024-05-01T00:00', '2024-05-01T01:00', '2024-05-01T02:00'])],
[('duration longer than interval',
['2024-02-01T00:00', 2, 300, 12, '2024-02-01T09:00', '2024-02-01T10:00'],
['2024-02-01T06:00', '2024-02-01T08:00']),
('window mid series',
['2024-03-01T06:00', 4, 120, 30, '2024-03-02T07:00', '2024-03-02T15:00'],
['2024-03-02T06:00', '2024-03-02T10:00', '2024-03-02T14:00']),
('instance ends at window start',
['2024-03-01T00:00', 3, 180, 8, '2024-03-01T06:00', '2024-03-01T07:00'],
['2024-03-01T06:00']),
('count exactly reaches window',
['2024-04-01T00:00', 12, 60, 4, '2024-04-02T11:30', '2024-04-03T00:00'],
['2024-04-02T12:00']),
('long instance from before window, short count',
['2024-05-01T00:00', 1, 600, 3, '2024-05-01T05:00', '2024-05-01T06:00'],
['2024-05-01T00:00', '2024-05-01T01:00', '2024-05-01T02:00']),
('regression: in-progress long meeting',
['2024-01-01T00:00', 1, 180, 20, '2024-01-01T10:30', '2024-01-01T12:00'],
['2024-01-01T08:00', '2024-01-01T09:00', '2024-01-01T10:00', '2024-01-01T11:00']),
('touching end excluded',
['2024-01-01T08:00', 2, 60, 10, '2024-01-01T09:00', '2024-01-01T12:00'],
['2024-01-01T10:00']),
('late window beyond count',
['2024-01-01T00:00', 24, 60, 5, '2024-01-04T00:00', '2024-01-10T00:00'],
['2024-01-04T00:00', '2024-01-05T00:00'])],
[('instance ends at window start',
['2024-03-01T00:00', 3, 180, 8, '2024-03-01T06:00', '2024-03-01T07:00'],
['2024-03-01T06:00']),
('count exactly reaches window',
['2024-04-01T00:00', 12, 60, 4, '2024-04-02T11:30', '2024-04-03T00:00'],
['2024-04-02T12:00']),
('long instance from before window, short count',
['2024-05-01T00:00', 1, 600, 3, '2024-05-01T05:00', '2024-05-01T06:00'],
['2024-05-01T00:00', '2024-05-01T01:00', '2024-05-01T02:00']),
('regression: in-progress long meeting',
['2024-01-01T00:00', 1, 180, 20, '2024-01-01T10:30', '2024-01-01T12:00'],
['2024-01-01T08:00', '2024-01-01T09:00', '2024-01-01T10:00', '2024-01-01T11:00']),
('touching end excluded',
['2024-01-01T08:00', 2, 60, 10, '2024-01-01T09:00', '2024-01-01T12:00'],
['2024-01-01T10:00']),
('window end exclusive',
['2024-01-01T08:00', 2, 30, 10, '2024-01-01T08:15', '2024-01-01T12:00'],
['2024-01-01T08:00', '2024-01-01T10:00']),
('zero duration instants',
['2024-01-01T00:00', 6, 0, 10, '2024-01-01T12:00', '2024-01-02T00:00'],
['2024-01-01T12:00', '2024-01-01T18:00']),
('late window beyond count',
['2024-01-01T00:00', 24, 60, 5, '2024-01-04T00:00', '2024-01-10T00:00'],
['2024-01-04T00:00', '2024-01-05T00:00'])]]
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: in-progress long meeting | ['2024-01-01T08:00', '2024-01-01T09:00', '2024-01-01T10:00', '2024-01-01T11:00'] | ['2024-01-01T08:00', '2024-01-01T09:00', '2024-01-01T10:00', '2024-01-01T11:00'] | Passed |
| touching end excluded | ['2024-01-01T10:00'] | ['2024-01-01T10:00'] | Passed |
| window end exclusive | ['2024-01-01T08:00', '2024-01-01T10:00'] | ['2024-01-01T08:00', '2024-01-01T10:00'] | Passed |
| zero duration instants | ['2024-01-01T12:00', '2024-01-01T18:00'] | ['2024-01-01T12:00', '2024-01-01T18:00'] | Passed |
| late window beyond count | ['2024-01-04T00:00', '2024-01-05T00:00', '2024-01-06T00:00', '2024-01-07T00:00'] | ['2024-01-04T00:00', '2024-01-05T00:00'] | Failed |
| window before dtstart | ['2024-01-05T09:00', '2024-01-06T09:00'] | ['2024-01-05T09:00', '2024-01-06T09:00'] | Passed |
| duration longer than interval | ['2024-02-01T06:00', '2024-02-01T08:00'] | ['2024-02-01T06:00', '2024-02-01T08:00'] | Passed |
SHA-256 / 734d25dc5285fcfd3bce0fb89353e0227102a35cfea28e209c3537bbfb16cb3b
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(dtstart, interval_hours, duration_min, count, window_start, window_end):
first = dt.datetime.fromisoformat(dtstart)
ws = dt.datetime.fromisoformat(window_start)
we = dt.datetime.fromisoformat(window_end)
dur = dt.timedelta(minutes=duration_min)
step = dt.timedelta(hours=interval_hours)
k0 = max(0, (ws - dur - first) // step)
out = []
for k in range(k0, count - k0):
s = first + k * step
if s >= we:
break
if (s + dur > ws) if duration_min else s >= ws:
out.append(s.isoformat(timespec='minutes'))
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: in-progress long meeting',
['2024-01-01T00:00', 1, 180, 20, '2024-01-01T10:30', '2024-01-01T12:00'],
['2024-01-01T08:00', '2024-01-01T09:00', '2024-01-01T10:00', '2024-01-01T11:00']),
('touching end excluded',
['2024-01-01T08:00', 2, 60, 10, '2024-01-01T09:00', '2024-01-01T12:00'],
['2024-01-01T10:00']),
('window end exclusive',
['2024-01-01T08:00', 2, 30, 10, '2024-01-01T08:15', '2024-01-01T12:00'],
['2024-01-01T08:00', '2024-01-01T10:00']),
('zero duration instants',
['2024-01-01T00:00', 6, 0, 10, '2024-01-01T12:00', '2024-01-02T00:00'],
['2024-01-01T12:00', '2024-01-01T18:00']),
('late window beyond count',
['2024-01-01T00:00', 24, 60, 5, '2024-01-04T00:00', '2024-01-10T00:00'],
['2024-01-04T00:00', '2024-01-05T00:00']),
('window before dtstart',
['2024-01-05T09:00', 24, 90, 3, '2024-01-01T00:00', '2024-01-06T12:00'],
['2024-01-05T09:00', '2024-01-06T09:00']),
('duration longer than interval',
['2024-02-01T00:00', 2, 300, 12, '2024-02-01T09:00', '2024-02-01T10:00'],
['2024-02-01T06:00', '2024-02-01T08:00'])],
[('window end exclusive',
['2024-01-01T08:00', 2, 30, 10, '2024-01-01T08:15', '2024-01-01T12:00'],
['2024-01-01T08:00', '2024-01-01T10:00']),
('zero duration instants',
['2024-01-01T00:00', 6, 0, 10, '2024-01-01T12:00', '2024-01-02T00:00'],
['2024-01-01T12:00', '2024-01-01T18:00']),
('late window beyond count',
['2024-01-01T00:00', 24, 60, 5, '2024-01-04T00:00', '2024-01-10T00:00'],
['2024-01-04T00:00', '2024-01-05T00:00']),
('window before dtstart',
['2024-01-05T09:00', 24, 90, 3, '2024-01-01T00:00', '2024-01-06T12:00'],
['2024-01-05T09:00', '2024-01-06T09:00']),
('duration longer than interval',
['2024-02-01T00:00', 2, 300, 12, '2024-02-01T09:00', '2024-02-01T10:00'],
['2024-02-01T06:00', '2024-02-01T08:00']),
('window mid series',
['2024-03-01T06:00', 4, 120, 30, '2024-03-02T07:00', '2024-03-02T15:00'],
['2024-03-02T06:00', '2024-03-02T10:00', '2024-03-02T14:00']),
('instance ends at window start',
['2024-03-01T00:00', 3, 180, 8, '2024-03-01T06:00', '2024-03-01T07:00'],
['2024-03-01T06:00'])],
[('late window beyond count',
['2024-01-01T00:00', 24, 60, 5, '2024-01-04T00:00', '2024-01-10T00:00'],
['2024-01-04T00:00', '2024-01-05T00:00']),
('window before dtstart',
['2024-01-05T09:00', 24, 90, 3, '2024-01-01T00:00', '2024-01-06T12:00'],
['2024-01-05T09:00', '2024-01-06T09:00']),
('duration longer than interval',
['2024-02-01T00:00', 2, 300, 12, '2024-02-01T09:00', '2024-02-01T10:00'],
['2024-02-01T06:00', '2024-02-01T08:00']),
('window mid series',
['2024-03-01T06:00', 4, 120, 30, '2024-03-02T07:00', '2024-03-02T15:00'],
['2024-03-02T06:00', '2024-03-02T10:00', '2024-03-02T14:00']),
('instance ends at window start',
['2024-03-01T00:00', 3, 180, 8, '2024-03-01T06:00', '2024-03-01T07:00'],
['2024-03-01T06:00']),
('count exactly reaches window',
['2024-04-01T00:00', 12, 60, 4, '2024-04-02T11:30', '2024-04-03T00:00'],
['2024-04-02T12:00']),
('long instance from before window, short count',
['2024-05-01T00:00', 1, 600, 3, '2024-05-01T05:00', '2024-05-01T06:00'],
['2024-05-01T00:00', '2024-05-01T01:00', '2024-05-01T02:00'])],
[('duration longer than interval',
['2024-02-01T00:00', 2, 300, 12, '2024-02-01T09:00', '2024-02-01T10:00'],
['2024-02-01T06:00', '2024-02-01T08:00']),
('window mid series',
['2024-03-01T06:00', 4, 120, 30, '2024-03-02T07:00', '2024-03-02T15:00'],
['2024-03-02T06:00', '2024-03-02T10:00', '2024-03-02T14:00']),
('instance ends at window start',
['2024-03-01T00:00', 3, 180, 8, '2024-03-01T06:00', '2024-03-01T07:00'],
['2024-03-01T06:00']),
('count exactly reaches window',
['2024-04-01T00:00', 12, 60, 4, '2024-04-02T11:30', '2024-04-03T00:00'],
['2024-04-02T12:00']),
('long instance from before window, short count',
['2024-05-01T00:00', 1, 600, 3, '2024-05-01T05:00', '2024-05-01T06:00'],
['2024-05-01T00:00', '2024-05-01T01:00', '2024-05-01T02:00']),
('regression: in-progress long meeting',
['2024-01-01T00:00', 1, 180, 20, '2024-01-01T10:30', '2024-01-01T12:00'],
['2024-01-01T08:00', '2024-01-01T09:00', '2024-01-01T10:00', '2024-01-01T11:00']),
('touching end excluded',
['2024-01-01T08:00', 2, 60, 10, '2024-01-01T09:00', '2024-01-01T12:00'],
['2024-01-01T10:00']),
('late window beyond count',
['2024-01-01T00:00', 24, 60, 5, '2024-01-04T00:00', '2024-01-10T00:00'],
['2024-01-04T00:00', '2024-01-05T00:00'])],
[('instance ends at window start',
['2024-03-01T00:00', 3, 180, 8, '2024-03-01T06:00', '2024-03-01T07:00'],
['2024-03-01T06:00']),
('count exactly reaches window',
['2024-04-01T00:00', 12, 60, 4, '2024-04-02T11:30', '2024-04-03T00:00'],
['2024-04-02T12:00']),
('long instance from before window, short count',
['2024-05-01T00:00', 1, 600, 3, '2024-05-01T05:00', '2024-05-01T06:00'],
['2024-05-01T00:00', '2024-05-01T01:00', '2024-05-01T02:00']),
('regression: in-progress long meeting',
['2024-01-01T00:00', 1, 180, 20, '2024-01-01T10:30', '2024-01-01T12:00'],
['2024-01-01T08:00', '2024-01-01T09:00', '2024-01-01T10:00', '2024-01-01T11:00']),
('touching end excluded',
['2024-01-01T08:00', 2, 60, 10, '2024-01-01T09:00', '2024-01-01T12:00'],
['2024-01-01T10:00']),
('window end exclusive',
['2024-01-01T08:00', 2, 30, 10, '2024-01-01T08:15', '2024-01-01T12:00'],
['2024-01-01T08:00', '2024-01-01T10:00']),
('zero duration instants',
['2024-01-01T00:00', 6, 0, 10, '2024-01-01T12:00', '2024-01-02T00:00'],
['2024-01-01T12:00', '2024-01-01T18:00']),
('late window beyond count',
['2024-01-01T00:00', 24, 60, 5, '2024-01-04T00:00', '2024-01-10T00:00'],
['2024-01-04T00:00', '2024-01-05T00:00'])]]
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: in-progress long meeting | ['2024-01-01T08:00', '2024-01-01T09:00', '2024-01-01T10:00', '2024-01-01T11:00'] | ['2024-01-01T08:00', '2024-01-01T09:00', '2024-01-01T10:00', '2024-01-01T11:00'] | Passed |
| touching end excluded | ['2024-01-01T10:00'] | ['2024-01-01T10:00'] | Passed |
| window end exclusive | ['2024-01-01T08:00', '2024-01-01T10:00'] | ['2024-01-01T08:00', '2024-01-01T10:00'] | Passed |
| zero duration instants | ['2024-01-01T12:00', '2024-01-01T18:00'] | ['2024-01-01T12:00', '2024-01-01T18:00'] | Passed |
| late window beyond count | [] | ['2024-01-04T00:00', '2024-01-05T00:00'] | Failed |
| window before dtstart | ['2024-01-05T09:00', '2024-01-06T09:00'] | ['2024-01-05T09:00', '2024-01-06T09:00'] | Passed |
| duration longer than interval | ['2024-02-01T06:00', '2024-02-01T08:00'] | ['2024-02-01T06:00', '2024-02-01T08:00'] | Passed |
SHA-256 / 650ced9036f19ddd6b67a24f6ebcd7dd56c2dace73b0340422c742d57114b77e
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(dtstart, interval_hours, duration_min, count, window_start, window_end):
first = dt.datetime.fromisoformat(dtstart)
ws = dt.datetime.fromisoformat(window_start)
we = dt.datetime.fromisoformat(window_end)
dur = dt.timedelta(minutes=duration_min)
step = dt.timedelta(hours=interval_hours)
k0 = max(0, (ws - dur - first) // step)
out = []
for k in range(k0, count):
s = first + k * step
if s >= we:
break
if (s + dur > ws) if duration_min else s >= ws:
out.append(s.isoformat(timespec='minutes'))
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: in-progress long meeting',
['2024-01-01T00:00', 1, 180, 20, '2024-01-01T10:30', '2024-01-01T12:00'],
['2024-01-01T08:00', '2024-01-01T09:00', '2024-01-01T10:00', '2024-01-01T11:00']),
('touching end excluded',
['2024-01-01T08:00', 2, 60, 10, '2024-01-01T09:00', '2024-01-01T12:00'],
['2024-01-01T10:00']),
('window end exclusive',
['2024-01-01T08:00', 2, 30, 10, '2024-01-01T08:15', '2024-01-01T12:00'],
['2024-01-01T08:00', '2024-01-01T10:00']),
('zero duration instants',
['2024-01-01T00:00', 6, 0, 10, '2024-01-01T12:00', '2024-01-02T00:00'],
['2024-01-01T12:00', '2024-01-01T18:00']),
('late window beyond count',
['2024-01-01T00:00', 24, 60, 5, '2024-01-04T00:00', '2024-01-10T00:00'],
['2024-01-04T00:00', '2024-01-05T00:00']),
('window before dtstart',
['2024-01-05T09:00', 24, 90, 3, '2024-01-01T00:00', '2024-01-06T12:00'],
['2024-01-05T09:00', '2024-01-06T09:00']),
('duration longer than interval',
['2024-02-01T00:00', 2, 300, 12, '2024-02-01T09:00', '2024-02-01T10:00'],
['2024-02-01T06:00', '2024-02-01T08:00'])],
[('window end exclusive',
['2024-01-01T08:00', 2, 30, 10, '2024-01-01T08:15', '2024-01-01T12:00'],
['2024-01-01T08:00', '2024-01-01T10:00']),
('zero duration instants',
['2024-01-01T00:00', 6, 0, 10, '2024-01-01T12:00', '2024-01-02T00:00'],
['2024-01-01T12:00', '2024-01-01T18:00']),
('late window beyond count',
['2024-01-01T00:00', 24, 60, 5, '2024-01-04T00:00', '2024-01-10T00:00'],
['2024-01-04T00:00', '2024-01-05T00:00']),
('window before dtstart',
['2024-01-05T09:00', 24, 90, 3, '2024-01-01T00:00', '2024-01-06T12:00'],
['2024-01-05T09:00', '2024-01-06T09:00']),
('duration longer than interval',
['2024-02-01T00:00', 2, 300, 12, '2024-02-01T09:00', '2024-02-01T10:00'],
['2024-02-01T06:00', '2024-02-01T08:00']),
('window mid series',
['2024-03-01T06:00', 4, 120, 30, '2024-03-02T07:00', '2024-03-02T15:00'],
['2024-03-02T06:00', '2024-03-02T10:00', '2024-03-02T14:00']),
('instance ends at window start',
['2024-03-01T00:00', 3, 180, 8, '2024-03-01T06:00', '2024-03-01T07:00'],
['2024-03-01T06:00'])],
[('late window beyond count',
['2024-01-01T00:00', 24, 60, 5, '2024-01-04T00:00', '2024-01-10T00:00'],
['2024-01-04T00:00', '2024-01-05T00:00']),
('window before dtstart',
['2024-01-05T09:00', 24, 90, 3, '2024-01-01T00:00', '2024-01-06T12:00'],
['2024-01-05T09:00', '2024-01-06T09:00']),
('duration longer than interval',
['2024-02-01T00:00', 2, 300, 12, '2024-02-01T09:00', '2024-02-01T10:00'],
['2024-02-01T06:00', '2024-02-01T08:00']),
('window mid series',
['2024-03-01T06:00', 4, 120, 30, '2024-03-02T07:00', '2024-03-02T15:00'],
['2024-03-02T06:00', '2024-03-02T10:00', '2024-03-02T14:00']),
('instance ends at window start',
['2024-03-01T00:00', 3, 180, 8, '2024-03-01T06:00', '2024-03-01T07:00'],
['2024-03-01T06:00']),
('count exactly reaches window',
['2024-04-01T00:00', 12, 60, 4, '2024-04-02T11:30', '2024-04-03T00:00'],
['2024-04-02T12:00']),
('long instance from before window, short count',
['2024-05-01T00:00', 1, 600, 3, '2024-05-01T05:00', '2024-05-01T06:00'],
['2024-05-01T00:00', '2024-05-01T01:00', '2024-05-01T02:00'])],
[('duration longer than interval',
['2024-02-01T00:00', 2, 300, 12, '2024-02-01T09:00', '2024-02-01T10:00'],
['2024-02-01T06:00', '2024-02-01T08:00']),
('window mid series',
['2024-03-01T06:00', 4, 120, 30, '2024-03-02T07:00', '2024-03-02T15:00'],
['2024-03-02T06:00', '2024-03-02T10:00', '2024-03-02T14:00']),
('instance ends at window start',
['2024-03-01T00:00', 3, 180, 8, '2024-03-01T06:00', '2024-03-01T07:00'],
['2024-03-01T06:00']),
('count exactly reaches window',
['2024-04-01T00:00', 12, 60, 4, '2024-04-02T11:30', '2024-04-03T00:00'],
['2024-04-02T12:00']),
('long instance from before window, short count',
['2024-05-01T00:00', 1, 600, 3, '2024-05-01T05:00', '2024-05-01T06:00'],
['2024-05-01T00:00', '2024-05-01T01:00', '2024-05-01T02:00']),
('regression: in-progress long meeting',
['2024-01-01T00:00', 1, 180, 20, '2024-01-01T10:30', '2024-01-01T12:00'],
['2024-01-01T08:00', '2024-01-01T09:00', '2024-01-01T10:00', '2024-01-01T11:00']),
('touching end excluded',
['2024-01-01T08:00', 2, 60, 10, '2024-01-01T09:00', '2024-01-01T12:00'],
['2024-01-01T10:00']),
('late window beyond count',
['2024-01-01T00:00', 24, 60, 5, '2024-01-04T00:00', '2024-01-10T00:00'],
['2024-01-04T00:00', '2024-01-05T00:00'])],
[('instance ends at window start',
['2024-03-01T00:00', 3, 180, 8, '2024-03-01T06:00', '2024-03-01T07:00'],
['2024-03-01T06:00']),
('count exactly reaches window',
['2024-04-01T00:00', 12, 60, 4, '2024-04-02T11:30', '2024-04-03T00:00'],
['2024-04-02T12:00']),
('long instance from before window, short count',
['2024-05-01T00:00', 1, 600, 3, '2024-05-01T05:00', '2024-05-01T06:00'],
['2024-05-01T00:00', '2024-05-01T01:00', '2024-05-01T02:00']),
('regression: in-progress long meeting',
['2024-01-01T00:00', 1, 180, 20, '2024-01-01T10:30', '2024-01-01T12:00'],
['2024-01-01T08:00', '2024-01-01T09:00', '2024-01-01T10:00', '2024-01-01T11:00']),
('touching end excluded',
['2024-01-01T08:00', 2, 60, 10, '2024-01-01T09:00', '2024-01-01T12:00'],
['2024-01-01T10:00']),
('window end exclusive',
['2024-01-01T08:00', 2, 30, 10, '2024-01-01T08:15', '2024-01-01T12:00'],
['2024-01-01T08:00', '2024-01-01T10:00']),
('zero duration instants',
['2024-01-01T00:00', 6, 0, 10, '2024-01-01T12:00', '2024-01-02T00:00'],
['2024-01-01T12:00', '2024-01-01T18:00']),
('late window beyond count',
['2024-01-01T00:00', 24, 60, 5, '2024-01-04T00:00', '2024-01-10T00:00'],
['2024-01-04T00:00', '2024-01-05T00:00'])]]
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: in-progress long meeting | ['2024-01-01T08:00', '2024-01-01T09:00', '2024-01-01T10:00', '2024-01-01T11:00'] | ['2024-01-01T08:00', '2024-01-01T09:00', '2024-01-01T10:00', '2024-01-01T11:00'] | Passed |
| touching end excluded | ['2024-01-01T10:00'] | ['2024-01-01T10:00'] | Passed |
| window end exclusive | ['2024-01-01T08:00', '2024-01-01T10:00'] | ['2024-01-01T08:00', '2024-01-01T10:00'] | Passed |
| zero duration instants | ['2024-01-01T12:00', '2024-01-01T18:00'] | ['2024-01-01T12:00', '2024-01-01T18:00'] | Passed |
| late window beyond count | ['2024-01-04T00:00', '2024-01-05T00:00'] | ['2024-01-04T00:00', '2024-01-05T00:00'] | Passed |
| window before dtstart | ['2024-01-05T09:00', '2024-01-06T09:00'] | ['2024-01-05T09:00', '2024-01-06T09:00'] | Passed |
| duration longer than interval | ['2024-02-01T06:00', '2024-02-01T08:00'] | ['2024-02-01T06:00', '2024-02-01T08:00'] | Passed |
SHA-256 / e1916d8062d45d00e3226e140d2f9112e3b29b46f159510640eef9984ff45fd9
Verification & scope
Stipulated, bounded recurrence-expansion model evaluated offline on explicit fixtures; it is not a complete iCalendar implementation and makes no claim of standards conformance. 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:21.893044+00:00.
Case digest / 1b6477aee1efacb2fee5a763007ff5d606b1e710a0eb4f5fc84cd47dccff954a