FA-77306 / Calendar recurrence rules / Open access
Re-keying instance overrides after a series start or interval change: noop drop · case 01
A moved instance whose target now coincides with its new slot is kept as a redundant exception, and a former no-op is dropped although it now moves the instance.
ROOT CAUSE
The no-op test compares the target with the old key instead of the new key.
VERIFIED REPAIR
At the noop drop decision use `target == key.isoformat()`, leaving the other decision sites of the model unchanged.
Unsuccessful approach: The partial repair `target is not None and target == orig` adds a None guard but still compares with the old key.
Case contract
An all-day series (old_start, interval, count) is edited to start at new_start with new_interval. Each override [original, target] (target None = cancelled) is keyed by occurrence index i, where original = old_start + i*interval; overrides not on an old instance (before the series, misaligned or at i >= count) are dropped. The override is re-keyed to new_start + i*new_interval; moved targets are absolute and kept unchanged; an override whose target equals its new key is dropped as a no-op; the last override for a key wins. Return [[new_key, target]] sorted by new key.
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(old_start, interval, count, new_start, new_interval, overrides):
old = dt.date.fromisoformat(old_start)
new = dt.date.fromisoformat(new_start)
out = {}
for orig, target in overrides:
o = dt.date.fromisoformat(orig)
diff = (o - old).days
if diff < 0 or diff % interval != 0 or diff // interval >= count:
continue
i = diff // interval
key = new + dt.timedelta(days=i * new_interval)
if target == orig:
continue
out[key.isoformat()] = target
return [[k, out[k]] for k in sorted(out)]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: override before series start',
['2024-01-08', 7, 5, '2024-01-10', 7, [['2024-01-01', None], ['2024-01-15', '2024-01-20']]],
[['2024-01-17', '2024-01-20']]),
('interval change',
['2024-01-01', 7, 6, '2024-01-01', 14, [['2024-01-15', '2024-01-16']]],
[['2024-01-29', '2024-01-16']]),
('beyond count',
['2024-01-01', 1, 3, '2024-01-02', 1, [['2024-01-05', None], ['2024-01-02', '2024-01-10']]],
[['2024-01-03', '2024-01-10']]),
('target becomes new key', ['2024-01-01', 7, 4, '2024-01-02', 7, [['2024-01-08', '2024-01-09']]], []),
('former no-op now moves',
['2024-01-01', 7, 4, '2024-01-03', 7, [['2024-01-08', '2024-01-08']]],
[['2024-01-10', '2024-01-08']]),
('reverse edit order',
['2024-03-01', 1, 10, '2024-03-05', 1, [['2024-03-07', '2024-03-30'], ['2024-03-02', None]]],
[['2024-03-06', None], ['2024-03-11', '2024-03-30']]),
('shrinking interval',
['2024-03-01', 14, 5, '2024-03-01', 7, [['2024-03-29', None], ['2024-03-15', '2024-03-16']]],
[['2024-03-08', '2024-03-16'], ['2024-03-15', None]])],
[('beyond count',
['2024-01-01', 1, 3, '2024-01-02', 1, [['2024-01-05', None], ['2024-01-02', '2024-01-10']]],
[['2024-01-03', '2024-01-10']]),
('target becomes new key', ['2024-01-01', 7, 4, '2024-01-02', 7, [['2024-01-08', '2024-01-09']]], []),
('former no-op now moves',
['2024-01-01', 7, 4, '2024-01-03', 7, [['2024-01-08', '2024-01-08']]],
[['2024-01-10', '2024-01-08']]),
('reverse edit order',
['2024-03-01', 1, 10, '2024-03-05', 1, [['2024-03-07', '2024-03-30'], ['2024-03-02', None]]],
[['2024-03-06', None], ['2024-03-11', '2024-03-30']]),
('shrinking interval',
['2024-03-01', 14, 5, '2024-03-01', 7, [['2024-03-29', None], ['2024-03-15', '2024-03-16']]],
[['2024-03-08', '2024-03-16'], ['2024-03-15', None]]),
('misaligned override',
['2024-04-01', 3, 5, '2024-04-02', 3, [['2024-04-02', None], ['2024-04-04', '2024-04-30']]],
[['2024-04-05', '2024-04-30']]),
('last wins',
['2024-05-01', 2, 4, '2024-05-02', 2, [['2024-05-03', '2024-05-20'], ['2024-05-03', '2024-05-21']]],
[['2024-05-04', '2024-05-21']])],
[('former no-op now moves',
['2024-01-01', 7, 4, '2024-01-03', 7, [['2024-01-08', '2024-01-08']]],
[['2024-01-10', '2024-01-08']]),
('reverse edit order',
['2024-03-01', 1, 10, '2024-03-05', 1, [['2024-03-07', '2024-03-30'], ['2024-03-02', None]]],
[['2024-03-06', None], ['2024-03-11', '2024-03-30']]),
('shrinking interval',
['2024-03-01', 14, 5, '2024-03-01', 7, [['2024-03-29', None], ['2024-03-15', '2024-03-16']]],
[['2024-03-08', '2024-03-16'], ['2024-03-15', None]]),
('misaligned override',
['2024-04-01', 3, 5, '2024-04-02', 3, [['2024-04-02', None], ['2024-04-04', '2024-04-30']]],
[['2024-04-05', '2024-04-30']]),
('last wins',
['2024-05-01', 2, 4, '2024-05-02', 2, [['2024-05-03', '2024-05-20'], ['2024-05-03', '2024-05-21']]],
[['2024-05-04', '2024-05-21']]),
('moved forward past neighbour',
['2024-06-01',
1,
5,
'2024-06-11',
1,
[['2024-06-01', '2024-06-30'], ['2024-06-03', None], ['2024-06-04', '2024-06-12']]],
[['2024-06-11', '2024-06-30'], ['2024-06-13', None], ['2024-06-14', '2024-06-12']]),
('earlier-moved target',
['2024-07-10', 7, 3, '2024-07-12', 7, [['2024-07-17', '2024-07-01']]],
[['2024-07-19', '2024-07-01']])],
[('shrinking interval',
['2024-03-01', 14, 5, '2024-03-01', 7, [['2024-03-29', None], ['2024-03-15', '2024-03-16']]],
[['2024-03-08', '2024-03-16'], ['2024-03-15', None]]),
('misaligned override',
['2024-04-01', 3, 5, '2024-04-02', 3, [['2024-04-02', None], ['2024-04-04', '2024-04-30']]],
[['2024-04-05', '2024-04-30']]),
('last wins',
['2024-05-01', 2, 4, '2024-05-02', 2, [['2024-05-03', '2024-05-20'], ['2024-05-03', '2024-05-21']]],
[['2024-05-04', '2024-05-21']]),
('moved forward past neighbour',
['2024-06-01',
1,
5,
'2024-06-11',
1,
[['2024-06-01', '2024-06-30'], ['2024-06-03', None], ['2024-06-04', '2024-06-12']]],
[['2024-06-11', '2024-06-30'], ['2024-06-13', None], ['2024-06-14', '2024-06-12']]),
('earlier-moved target',
['2024-07-10', 7, 3, '2024-07-12', 7, [['2024-07-17', '2024-07-01']]],
[['2024-07-19', '2024-07-01']]),
('regression: override before series start',
['2024-01-08', 7, 5, '2024-01-10', 7, [['2024-01-01', None], ['2024-01-15', '2024-01-20']]],
[['2024-01-17', '2024-01-20']]),
('interval change',
['2024-01-01', 7, 6, '2024-01-01', 14, [['2024-01-15', '2024-01-16']]],
[['2024-01-29', '2024-01-16']]),
('former no-op now moves',
['2024-01-01', 7, 4, '2024-01-03', 7, [['2024-01-08', '2024-01-08']]],
[['2024-01-10', '2024-01-08']])],
[('last wins',
['2024-05-01', 2, 4, '2024-05-02', 2, [['2024-05-03', '2024-05-20'], ['2024-05-03', '2024-05-21']]],
[['2024-05-04', '2024-05-21']]),
('moved forward past neighbour',
['2024-06-01',
1,
5,
'2024-06-11',
1,
[['2024-06-01', '2024-06-30'], ['2024-06-03', None], ['2024-06-04', '2024-06-12']]],
[['2024-06-11', '2024-06-30'], ['2024-06-13', None], ['2024-06-14', '2024-06-12']]),
('earlier-moved target',
['2024-07-10', 7, 3, '2024-07-12', 7, [['2024-07-17', '2024-07-01']]],
[['2024-07-19', '2024-07-01']]),
('regression: override before series start',
['2024-01-08', 7, 5, '2024-01-10', 7, [['2024-01-01', None], ['2024-01-15', '2024-01-20']]],
[['2024-01-17', '2024-01-20']]),
('interval change',
['2024-01-01', 7, 6, '2024-01-01', 14, [['2024-01-15', '2024-01-16']]],
[['2024-01-29', '2024-01-16']]),
('beyond count',
['2024-01-01', 1, 3, '2024-01-02', 1, [['2024-01-05', None], ['2024-01-02', '2024-01-10']]],
[['2024-01-03', '2024-01-10']]),
('target becomes new key', ['2024-01-01', 7, 4, '2024-01-02', 7, [['2024-01-08', '2024-01-09']]], [])]]
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: override before series start | [['2024-01-17', '2024-01-20']] | [['2024-01-17', '2024-01-20']] | Passed |
| interval change | [['2024-01-29', '2024-01-16']] | [['2024-01-29', '2024-01-16']] | Passed |
| beyond count | [['2024-01-03', '2024-01-10']] | [['2024-01-03', '2024-01-10']] | Passed |
| target becomes new key | [['2024-01-09', '2024-01-09']] | [] | Failed |
| former no-op now moves | [] | [['2024-01-10', '2024-01-08']] | Failed |
| reverse edit order | [['2024-03-06', None], ['2024-03-11', '2024-03-30']] | [['2024-03-06', None], ['2024-03-11', '2024-03-30']] | Passed |
| shrinking interval | [['2024-03-08', '2024-03-16'], ['2024-03-15', None]] | [['2024-03-08', '2024-03-16'], ['2024-03-15', None]] | Passed |
SHA-256 / 3b9b49545bdb574098f301e16ac654b23cba413974cd540c6972fe9849b99670
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(old_start, interval, count, new_start, new_interval, overrides):
old = dt.date.fromisoformat(old_start)
new = dt.date.fromisoformat(new_start)
out = {}
for orig, target in overrides:
o = dt.date.fromisoformat(orig)
diff = (o - old).days
if diff < 0 or diff % interval != 0 or diff // interval >= count:
continue
i = diff // interval
key = new + dt.timedelta(days=i * new_interval)
if target is not None and target == orig:
continue
out[key.isoformat()] = target
return [[k, out[k]] for k in sorted(out)]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: override before series start',
['2024-01-08', 7, 5, '2024-01-10', 7, [['2024-01-01', None], ['2024-01-15', '2024-01-20']]],
[['2024-01-17', '2024-01-20']]),
('interval change',
['2024-01-01', 7, 6, '2024-01-01', 14, [['2024-01-15', '2024-01-16']]],
[['2024-01-29', '2024-01-16']]),
('beyond count',
['2024-01-01', 1, 3, '2024-01-02', 1, [['2024-01-05', None], ['2024-01-02', '2024-01-10']]],
[['2024-01-03', '2024-01-10']]),
('target becomes new key', ['2024-01-01', 7, 4, '2024-01-02', 7, [['2024-01-08', '2024-01-09']]], []),
('former no-op now moves',
['2024-01-01', 7, 4, '2024-01-03', 7, [['2024-01-08', '2024-01-08']]],
[['2024-01-10', '2024-01-08']]),
('reverse edit order',
['2024-03-01', 1, 10, '2024-03-05', 1, [['2024-03-07', '2024-03-30'], ['2024-03-02', None]]],
[['2024-03-06', None], ['2024-03-11', '2024-03-30']]),
('shrinking interval',
['2024-03-01', 14, 5, '2024-03-01', 7, [['2024-03-29', None], ['2024-03-15', '2024-03-16']]],
[['2024-03-08', '2024-03-16'], ['2024-03-15', None]])],
[('beyond count',
['2024-01-01', 1, 3, '2024-01-02', 1, [['2024-01-05', None], ['2024-01-02', '2024-01-10']]],
[['2024-01-03', '2024-01-10']]),
('target becomes new key', ['2024-01-01', 7, 4, '2024-01-02', 7, [['2024-01-08', '2024-01-09']]], []),
('former no-op now moves',
['2024-01-01', 7, 4, '2024-01-03', 7, [['2024-01-08', '2024-01-08']]],
[['2024-01-10', '2024-01-08']]),
('reverse edit order',
['2024-03-01', 1, 10, '2024-03-05', 1, [['2024-03-07', '2024-03-30'], ['2024-03-02', None]]],
[['2024-03-06', None], ['2024-03-11', '2024-03-30']]),
('shrinking interval',
['2024-03-01', 14, 5, '2024-03-01', 7, [['2024-03-29', None], ['2024-03-15', '2024-03-16']]],
[['2024-03-08', '2024-03-16'], ['2024-03-15', None]]),
('misaligned override',
['2024-04-01', 3, 5, '2024-04-02', 3, [['2024-04-02', None], ['2024-04-04', '2024-04-30']]],
[['2024-04-05', '2024-04-30']]),
('last wins',
['2024-05-01', 2, 4, '2024-05-02', 2, [['2024-05-03', '2024-05-20'], ['2024-05-03', '2024-05-21']]],
[['2024-05-04', '2024-05-21']])],
[('former no-op now moves',
['2024-01-01', 7, 4, '2024-01-03', 7, [['2024-01-08', '2024-01-08']]],
[['2024-01-10', '2024-01-08']]),
('reverse edit order',
['2024-03-01', 1, 10, '2024-03-05', 1, [['2024-03-07', '2024-03-30'], ['2024-03-02', None]]],
[['2024-03-06', None], ['2024-03-11', '2024-03-30']]),
('shrinking interval',
['2024-03-01', 14, 5, '2024-03-01', 7, [['2024-03-29', None], ['2024-03-15', '2024-03-16']]],
[['2024-03-08', '2024-03-16'], ['2024-03-15', None]]),
('misaligned override',
['2024-04-01', 3, 5, '2024-04-02', 3, [['2024-04-02', None], ['2024-04-04', '2024-04-30']]],
[['2024-04-05', '2024-04-30']]),
('last wins',
['2024-05-01', 2, 4, '2024-05-02', 2, [['2024-05-03', '2024-05-20'], ['2024-05-03', '2024-05-21']]],
[['2024-05-04', '2024-05-21']]),
('moved forward past neighbour',
['2024-06-01',
1,
5,
'2024-06-11',
1,
[['2024-06-01', '2024-06-30'], ['2024-06-03', None], ['2024-06-04', '2024-06-12']]],
[['2024-06-11', '2024-06-30'], ['2024-06-13', None], ['2024-06-14', '2024-06-12']]),
('earlier-moved target',
['2024-07-10', 7, 3, '2024-07-12', 7, [['2024-07-17', '2024-07-01']]],
[['2024-07-19', '2024-07-01']])],
[('shrinking interval',
['2024-03-01', 14, 5, '2024-03-01', 7, [['2024-03-29', None], ['2024-03-15', '2024-03-16']]],
[['2024-03-08', '2024-03-16'], ['2024-03-15', None]]),
('misaligned override',
['2024-04-01', 3, 5, '2024-04-02', 3, [['2024-04-02', None], ['2024-04-04', '2024-04-30']]],
[['2024-04-05', '2024-04-30']]),
('last wins',
['2024-05-01', 2, 4, '2024-05-02', 2, [['2024-05-03', '2024-05-20'], ['2024-05-03', '2024-05-21']]],
[['2024-05-04', '2024-05-21']]),
('moved forward past neighbour',
['2024-06-01',
1,
5,
'2024-06-11',
1,
[['2024-06-01', '2024-06-30'], ['2024-06-03', None], ['2024-06-04', '2024-06-12']]],
[['2024-06-11', '2024-06-30'], ['2024-06-13', None], ['2024-06-14', '2024-06-12']]),
('earlier-moved target',
['2024-07-10', 7, 3, '2024-07-12', 7, [['2024-07-17', '2024-07-01']]],
[['2024-07-19', '2024-07-01']]),
('regression: override before series start',
['2024-01-08', 7, 5, '2024-01-10', 7, [['2024-01-01', None], ['2024-01-15', '2024-01-20']]],
[['2024-01-17', '2024-01-20']]),
('interval change',
['2024-01-01', 7, 6, '2024-01-01', 14, [['2024-01-15', '2024-01-16']]],
[['2024-01-29', '2024-01-16']]),
('former no-op now moves',
['2024-01-01', 7, 4, '2024-01-03', 7, [['2024-01-08', '2024-01-08']]],
[['2024-01-10', '2024-01-08']])],
[('last wins',
['2024-05-01', 2, 4, '2024-05-02', 2, [['2024-05-03', '2024-05-20'], ['2024-05-03', '2024-05-21']]],
[['2024-05-04', '2024-05-21']]),
('moved forward past neighbour',
['2024-06-01',
1,
5,
'2024-06-11',
1,
[['2024-06-01', '2024-06-30'], ['2024-06-03', None], ['2024-06-04', '2024-06-12']]],
[['2024-06-11', '2024-06-30'], ['2024-06-13', None], ['2024-06-14', '2024-06-12']]),
('earlier-moved target',
['2024-07-10', 7, 3, '2024-07-12', 7, [['2024-07-17', '2024-07-01']]],
[['2024-07-19', '2024-07-01']]),
('regression: override before series start',
['2024-01-08', 7, 5, '2024-01-10', 7, [['2024-01-01', None], ['2024-01-15', '2024-01-20']]],
[['2024-01-17', '2024-01-20']]),
('interval change',
['2024-01-01', 7, 6, '2024-01-01', 14, [['2024-01-15', '2024-01-16']]],
[['2024-01-29', '2024-01-16']]),
('beyond count',
['2024-01-01', 1, 3, '2024-01-02', 1, [['2024-01-05', None], ['2024-01-02', '2024-01-10']]],
[['2024-01-03', '2024-01-10']]),
('target becomes new key', ['2024-01-01', 7, 4, '2024-01-02', 7, [['2024-01-08', '2024-01-09']]], [])]]
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: override before series start | [['2024-01-17', '2024-01-20']] | [['2024-01-17', '2024-01-20']] | Passed |
| interval change | [['2024-01-29', '2024-01-16']] | [['2024-01-29', '2024-01-16']] | Passed |
| beyond count | [['2024-01-03', '2024-01-10']] | [['2024-01-03', '2024-01-10']] | Passed |
| target becomes new key | [['2024-01-09', '2024-01-09']] | [] | Failed |
| former no-op now moves | [] | [['2024-01-10', '2024-01-08']] | Failed |
| reverse edit order | [['2024-03-06', None], ['2024-03-11', '2024-03-30']] | [['2024-03-06', None], ['2024-03-11', '2024-03-30']] | Passed |
| shrinking interval | [['2024-03-08', '2024-03-16'], ['2024-03-15', None]] | [['2024-03-08', '2024-03-16'], ['2024-03-15', None]] | Passed |
SHA-256 / 5048249fe27e39085ff832ea5080d8581dbd0f64c4cc214704de94ded9c0a5ba
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(old_start, interval, count, new_start, new_interval, overrides):
old = dt.date.fromisoformat(old_start)
new = dt.date.fromisoformat(new_start)
out = {}
for orig, target in overrides:
o = dt.date.fromisoformat(orig)
diff = (o - old).days
if diff < 0 or diff % interval != 0 or diff // interval >= count:
continue
i = diff // interval
key = new + dt.timedelta(days=i * new_interval)
if target == key.isoformat():
continue
out[key.isoformat()] = target
return [[k, out[k]] for k in sorted(out)]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: override before series start',
['2024-01-08', 7, 5, '2024-01-10', 7, [['2024-01-01', None], ['2024-01-15', '2024-01-20']]],
[['2024-01-17', '2024-01-20']]),
('interval change',
['2024-01-01', 7, 6, '2024-01-01', 14, [['2024-01-15', '2024-01-16']]],
[['2024-01-29', '2024-01-16']]),
('beyond count',
['2024-01-01', 1, 3, '2024-01-02', 1, [['2024-01-05', None], ['2024-01-02', '2024-01-10']]],
[['2024-01-03', '2024-01-10']]),
('target becomes new key', ['2024-01-01', 7, 4, '2024-01-02', 7, [['2024-01-08', '2024-01-09']]], []),
('former no-op now moves',
['2024-01-01', 7, 4, '2024-01-03', 7, [['2024-01-08', '2024-01-08']]],
[['2024-01-10', '2024-01-08']]),
('reverse edit order',
['2024-03-01', 1, 10, '2024-03-05', 1, [['2024-03-07', '2024-03-30'], ['2024-03-02', None]]],
[['2024-03-06', None], ['2024-03-11', '2024-03-30']]),
('shrinking interval',
['2024-03-01', 14, 5, '2024-03-01', 7, [['2024-03-29', None], ['2024-03-15', '2024-03-16']]],
[['2024-03-08', '2024-03-16'], ['2024-03-15', None]])],
[('beyond count',
['2024-01-01', 1, 3, '2024-01-02', 1, [['2024-01-05', None], ['2024-01-02', '2024-01-10']]],
[['2024-01-03', '2024-01-10']]),
('target becomes new key', ['2024-01-01', 7, 4, '2024-01-02', 7, [['2024-01-08', '2024-01-09']]], []),
('former no-op now moves',
['2024-01-01', 7, 4, '2024-01-03', 7, [['2024-01-08', '2024-01-08']]],
[['2024-01-10', '2024-01-08']]),
('reverse edit order',
['2024-03-01', 1, 10, '2024-03-05', 1, [['2024-03-07', '2024-03-30'], ['2024-03-02', None]]],
[['2024-03-06', None], ['2024-03-11', '2024-03-30']]),
('shrinking interval',
['2024-03-01', 14, 5, '2024-03-01', 7, [['2024-03-29', None], ['2024-03-15', '2024-03-16']]],
[['2024-03-08', '2024-03-16'], ['2024-03-15', None]]),
('misaligned override',
['2024-04-01', 3, 5, '2024-04-02', 3, [['2024-04-02', None], ['2024-04-04', '2024-04-30']]],
[['2024-04-05', '2024-04-30']]),
('last wins',
['2024-05-01', 2, 4, '2024-05-02', 2, [['2024-05-03', '2024-05-20'], ['2024-05-03', '2024-05-21']]],
[['2024-05-04', '2024-05-21']])],
[('former no-op now moves',
['2024-01-01', 7, 4, '2024-01-03', 7, [['2024-01-08', '2024-01-08']]],
[['2024-01-10', '2024-01-08']]),
('reverse edit order',
['2024-03-01', 1, 10, '2024-03-05', 1, [['2024-03-07', '2024-03-30'], ['2024-03-02', None]]],
[['2024-03-06', None], ['2024-03-11', '2024-03-30']]),
('shrinking interval',
['2024-03-01', 14, 5, '2024-03-01', 7, [['2024-03-29', None], ['2024-03-15', '2024-03-16']]],
[['2024-03-08', '2024-03-16'], ['2024-03-15', None]]),
('misaligned override',
['2024-04-01', 3, 5, '2024-04-02', 3, [['2024-04-02', None], ['2024-04-04', '2024-04-30']]],
[['2024-04-05', '2024-04-30']]),
('last wins',
['2024-05-01', 2, 4, '2024-05-02', 2, [['2024-05-03', '2024-05-20'], ['2024-05-03', '2024-05-21']]],
[['2024-05-04', '2024-05-21']]),
('moved forward past neighbour',
['2024-06-01',
1,
5,
'2024-06-11',
1,
[['2024-06-01', '2024-06-30'], ['2024-06-03', None], ['2024-06-04', '2024-06-12']]],
[['2024-06-11', '2024-06-30'], ['2024-06-13', None], ['2024-06-14', '2024-06-12']]),
('earlier-moved target',
['2024-07-10', 7, 3, '2024-07-12', 7, [['2024-07-17', '2024-07-01']]],
[['2024-07-19', '2024-07-01']])],
[('shrinking interval',
['2024-03-01', 14, 5, '2024-03-01', 7, [['2024-03-29', None], ['2024-03-15', '2024-03-16']]],
[['2024-03-08', '2024-03-16'], ['2024-03-15', None]]),
('misaligned override',
['2024-04-01', 3, 5, '2024-04-02', 3, [['2024-04-02', None], ['2024-04-04', '2024-04-30']]],
[['2024-04-05', '2024-04-30']]),
('last wins',
['2024-05-01', 2, 4, '2024-05-02', 2, [['2024-05-03', '2024-05-20'], ['2024-05-03', '2024-05-21']]],
[['2024-05-04', '2024-05-21']]),
('moved forward past neighbour',
['2024-06-01',
1,
5,
'2024-06-11',
1,
[['2024-06-01', '2024-06-30'], ['2024-06-03', None], ['2024-06-04', '2024-06-12']]],
[['2024-06-11', '2024-06-30'], ['2024-06-13', None], ['2024-06-14', '2024-06-12']]),
('earlier-moved target',
['2024-07-10', 7, 3, '2024-07-12', 7, [['2024-07-17', '2024-07-01']]],
[['2024-07-19', '2024-07-01']]),
('regression: override before series start',
['2024-01-08', 7, 5, '2024-01-10', 7, [['2024-01-01', None], ['2024-01-15', '2024-01-20']]],
[['2024-01-17', '2024-01-20']]),
('interval change',
['2024-01-01', 7, 6, '2024-01-01', 14, [['2024-01-15', '2024-01-16']]],
[['2024-01-29', '2024-01-16']]),
('former no-op now moves',
['2024-01-01', 7, 4, '2024-01-03', 7, [['2024-01-08', '2024-01-08']]],
[['2024-01-10', '2024-01-08']])],
[('last wins',
['2024-05-01', 2, 4, '2024-05-02', 2, [['2024-05-03', '2024-05-20'], ['2024-05-03', '2024-05-21']]],
[['2024-05-04', '2024-05-21']]),
('moved forward past neighbour',
['2024-06-01',
1,
5,
'2024-06-11',
1,
[['2024-06-01', '2024-06-30'], ['2024-06-03', None], ['2024-06-04', '2024-06-12']]],
[['2024-06-11', '2024-06-30'], ['2024-06-13', None], ['2024-06-14', '2024-06-12']]),
('earlier-moved target',
['2024-07-10', 7, 3, '2024-07-12', 7, [['2024-07-17', '2024-07-01']]],
[['2024-07-19', '2024-07-01']]),
('regression: override before series start',
['2024-01-08', 7, 5, '2024-01-10', 7, [['2024-01-01', None], ['2024-01-15', '2024-01-20']]],
[['2024-01-17', '2024-01-20']]),
('interval change',
['2024-01-01', 7, 6, '2024-01-01', 14, [['2024-01-15', '2024-01-16']]],
[['2024-01-29', '2024-01-16']]),
('beyond count',
['2024-01-01', 1, 3, '2024-01-02', 1, [['2024-01-05', None], ['2024-01-02', '2024-01-10']]],
[['2024-01-03', '2024-01-10']]),
('target becomes new key', ['2024-01-01', 7, 4, '2024-01-02', 7, [['2024-01-08', '2024-01-09']]], [])]]
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: override before series start | [['2024-01-17', '2024-01-20']] | [['2024-01-17', '2024-01-20']] | Passed |
| interval change | [['2024-01-29', '2024-01-16']] | [['2024-01-29', '2024-01-16']] | Passed |
| beyond count | [['2024-01-03', '2024-01-10']] | [['2024-01-03', '2024-01-10']] | Passed |
| target becomes new key | [] | [] | Passed |
| former no-op now moves | [['2024-01-10', '2024-01-08']] | [['2024-01-10', '2024-01-08']] | Passed |
| reverse edit order | [['2024-03-06', None], ['2024-03-11', '2024-03-30']] | [['2024-03-06', None], ['2024-03-11', '2024-03-30']] | Passed |
| shrinking interval | [['2024-03-08', '2024-03-16'], ['2024-03-15', None]] | [['2024-03-08', '2024-03-16'], ['2024-03-15', None]] | Passed |
SHA-256 / 400587aabab04ef4b64acd3c7f2ccb372902419a938be90f879a5a698b2c3562
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:24.408076+00:00.
Case digest / 78651bc49bc6f6cb0ec3df87819e0ec49aa39ddbc4cdc20b4c09dd3ea6c1251a