FAILURE MAP
← Case archive

FA-77316 / Calendar recurrence rules / Open access

Re-keying instance overrides after a series start or interval change: output order · case 01

Exceptions are returned in edit order, not by occurrence.

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

ROOT CAUSE

The re-keyed overrides are returned in insertion order.

VERIFIED REPAIR

At the output order decision use `sorted(out)`, leaving the other decision sites of the model unchanged.

Unsuccessful approach: The partial repair `sorted(out, key=lambda k: out[k] or '')` sorts by target, which differs from key order when instances are moved past each other or cancelled.

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 == key.isoformat():
            continue
        out[key.isoformat()] = target
    return [[k, out[k]] for k in 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']])],
 [('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']]], []),
  ('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']])]]
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: 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-11', '2024-03-30'], ['2024-03-06', None]][['2024-03-06', None], ['2024-03-11', '2024-03-30']]Failed
shrinking interval[['2024-03-15', None], ['2024-03-08', '2024-03-16']][['2024-03-08', '2024-03-16'], ['2024-03-15', None]]Failed

SHA-256 / ce9e9faa450f678baba0d8de145d9eb0d0d947d30ca7f31633ee88a7156bacab

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 == key.isoformat():
            continue
        out[key.isoformat()] = target
    return [[k, out[k]] for k in sorted(out, key=lambda k: out[k] or '')]
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']])],
 [('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']]], []),
  ('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']])]]
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: 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-15', None], ['2024-03-08', '2024-03-16']][['2024-03-08', '2024-03-16'], ['2024-03-15', None]]Failed

SHA-256 / 3256ef9ce7569ee197ff083e7e9560de6e1118f36048756b7a1ffc58415bc858

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']])],
 [('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']]], []),
  ('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']])]]
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: 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 / 6515d4b919348a4b729c85d1cb60f35a63eb5d3ff94bf059734497c693e2226d

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

Case digest / e6067cc840e2bbd3f193bc4dad3a6df41472dcc4612a78ec54129725d76a08e1