FAILURE MAP
← Case archive

FA-77171 / Calendar recurrence rules / Open access

Monthly BYDAY restricted by BYMONTHDAY (Friday the 13th): combine · case 01

BYDAY=FR;BYMONTHDAY=13 returns every Friday and every 13th.

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

ROOT CAUSE

BYDAY and BYMONTHDAY are combined as a union instead of a restriction.

VERIFIED REPAIR

At the combine decision use `day_ok and mday_ok`, leaving the other decision sites of the model unchanged.

Unsuccessful approach: The partial repair `(day_ok and mday_ok) if bymonthday else (day_ok or mday_ok)` falls back to a union when BYMONTHDAY is empty, which then accepts every day.

Case contract

FREQ=MONTHLY with BYDAY weekday codes (MO..SU) and BYMONTHDAY values (negative counts from month end). When both are present a day must satisfy both; an empty list imposes no restriction. Days are examined from dtstart forward. Return the first count ISO dates (search bounded to 50 years).

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, byday, bymonthday, count):
    start = dt.date.fromisoformat(dtstart)
    wanted = [['MO', 'TU', 'WE', 'TH', 'FR', 'SA', 'SU'].index(w) for w in byday]
    out = []
    d = start
    while len(out) < count and d.year < start.year + 50:
        dim = calendar.monthrange(d.year, d.month)[1]
        day_ok = not wanted or d.weekday() in wanted
        mday_ok = not bymonthday or (d.day in bymonthday or d.day - dim - 1 in bymonthday)
        if day_ok or mday_ok:
            out.append(d.isoformat())
        d += dt.timedelta(days=1)
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: friday the 13th',
   ['2024-01-01', ['FR'], [13], 3],
   ['2024-09-13', '2024-12-13', '2025-06-13']),
  ('last sunday via -1..-7',
   ['2024-01-01', ['SU'], [-1, -2, -3, -4, -5, -6, -7], 3],
   ['2024-01-28', '2024-02-25', '2024-03-31']),
  ('only bymonthday',
   ['2024-01-10', [], [1, 15], 4],
   ['2024-01-15', '2024-02-01', '2024-02-15', '2024-03-01']),
  ('only byday',
   ['2024-01-01', ['SA', 'SU'], [], 4],
   ['2024-01-06', '2024-01-07', '2024-01-13', '2024-01-14']),
  ('last day monday', ['2024-01-01', ['MO'], [-1], 2], ['2024-09-30', '2025-03-31']),
  ('first monday via 1..7',
   ['2024-02-01', ['MO'], [1, 2, 3, 4, 5, 6, 7], 3],
   ['2024-02-05', '2024-03-04', '2024-04-01']),
  ('sunday first of month', ['2024-01-01', ['SU'], [1], 2], ['2024-09-01', '2024-12-01'])],
 [('only bymonthday',
   ['2024-01-10', [], [1, 15], 4],
   ['2024-01-15', '2024-02-01', '2024-02-15', '2024-03-01']),
  ('only byday',
   ['2024-01-01', ['SA', 'SU'], [], 4],
   ['2024-01-06', '2024-01-07', '2024-01-13', '2024-01-14']),
  ('last day monday', ['2024-01-01', ['MO'], [-1], 2], ['2024-09-30', '2025-03-31']),
  ('first monday via 1..7',
   ['2024-02-01', ['MO'], [1, 2, 3, 4, 5, 6, 7], 3],
   ['2024-02-05', '2024-03-04', '2024-04-01']),
  ('sunday first of month', ['2024-01-01', ['SU'], [1], 2], ['2024-09-01', '2024-12-01']),
  ('tuesday 29th', ['2024-01-01', ['TU'], [29], 3], ['2024-10-29', '2025-04-29', '2025-07-29']),
  ('weekday 15th',
   ['2024-03-01', ['MO', 'TU', 'WE', 'TH', 'FR'], [15], 4],
   ['2024-03-15', '2024-04-15', '2024-05-15', '2024-07-15'])],
 [('last day monday', ['2024-01-01', ['MO'], [-1], 2], ['2024-09-30', '2025-03-31']),
  ('first monday via 1..7',
   ['2024-02-01', ['MO'], [1, 2, 3, 4, 5, 6, 7], 3],
   ['2024-02-05', '2024-03-04', '2024-04-01']),
  ('sunday first of month', ['2024-01-01', ['SU'], [1], 2], ['2024-09-01', '2024-12-01']),
  ('tuesday 29th', ['2024-01-01', ['TU'], [29], 3], ['2024-10-29', '2025-04-29', '2025-07-29']),
  ('weekday 15th',
   ['2024-03-01', ['MO', 'TU', 'WE', 'TH', 'FR'], [15], 4],
   ['2024-03-15', '2024-04-15', '2024-05-15', '2024-07-15']),
  ('thursday the 13th', ['2025-01-01', ['TH'], [13], 2], ['2025-02-13', '2025-03-13']),
  ('regression: friday the 13th',
   ['2024-01-01', ['FR'], [13], 3],
   ['2024-09-13', '2024-12-13', '2025-06-13']),
  ('only byday',
   ['2024-01-01', ['SA', 'SU'], [], 4],
   ['2024-01-06', '2024-01-07', '2024-01-13', '2024-01-14'])],
 [('sunday first of month', ['2024-01-01', ['SU'], [1], 2], ['2024-09-01', '2024-12-01']),
  ('tuesday 29th', ['2024-01-01', ['TU'], [29], 3], ['2024-10-29', '2025-04-29', '2025-07-29']),
  ('weekday 15th',
   ['2024-03-01', ['MO', 'TU', 'WE', 'TH', 'FR'], [15], 4],
   ['2024-03-15', '2024-04-15', '2024-05-15', '2024-07-15']),
  ('thursday the 13th', ['2025-01-01', ['TH'], [13], 2], ['2025-02-13', '2025-03-13']),
  ('regression: friday the 13th',
   ['2024-01-01', ['FR'], [13], 3],
   ['2024-09-13', '2024-12-13', '2025-06-13']),
  ('last sunday via -1..-7',
   ['2024-01-01', ['SU'], [-1, -2, -3, -4, -5, -6, -7], 3],
   ['2024-01-28', '2024-02-25', '2024-03-31']),
  ('only bymonthday',
   ['2024-01-10', [], [1, 15], 4],
   ['2024-01-15', '2024-02-01', '2024-02-15', '2024-03-01']),
  ('only byday',
   ['2024-01-01', ['SA', 'SU'], [], 4],
   ['2024-01-06', '2024-01-07', '2024-01-13', '2024-01-14'])],
 [('weekday 15th',
   ['2024-03-01', ['MO', 'TU', 'WE', 'TH', 'FR'], [15], 4],
   ['2024-03-15', '2024-04-15', '2024-05-15', '2024-07-15']),
  ('thursday the 13th', ['2025-01-01', ['TH'], [13], 2], ['2025-02-13', '2025-03-13']),
  ('regression: friday the 13th',
   ['2024-01-01', ['FR'], [13], 3],
   ['2024-09-13', '2024-12-13', '2025-06-13']),
  ('last sunday via -1..-7',
   ['2024-01-01', ['SU'], [-1, -2, -3, -4, -5, -6, -7], 3],
   ['2024-01-28', '2024-02-25', '2024-03-31']),
  ('only bymonthday',
   ['2024-01-10', [], [1, 15], 4],
   ['2024-01-15', '2024-02-01', '2024-02-15', '2024-03-01']),
  ('only byday',
   ['2024-01-01', ['SA', 'SU'], [], 4],
   ['2024-01-06', '2024-01-07', '2024-01-13', '2024-01-14']),
  ('last day monday', ['2024-01-01', ['MO'], [-1], 2], ['2024-09-30', '2025-03-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: friday the 13th['2024-01-05', '2024-01-12', '2024-01-13']['2024-09-13', '2024-12-13', '2025-06-13']Failed
last sunday via -1..-7['2024-01-07', '2024-01-14', '2024-01-21']['2024-01-28', '2024-02-25', '2024-03-31']Failed
only bymonthday['2024-01-10', '2024-01-11', '2024-01-12', '2024-01-13']['2024-01-15', '2024-02-01', '2024-02-15', '2024-03-01']Failed
only byday['2024-01-01', '2024-01-02', '2024-01-03', '2024-01-04']['2024-01-06', '2024-01-07', '2024-01-13', '2024-01-14']Failed
last day monday['2024-01-01', '2024-01-08']['2024-09-30', '2025-03-31']Failed
first monday via 1..7['2024-02-01', '2024-02-02', '2024-02-03']['2024-02-05', '2024-03-04', '2024-04-01']Failed
sunday first of month['2024-01-01', '2024-01-07']['2024-09-01', '2024-12-01']Failed

SHA-256 / 1b9c232aebcc365879896e4ab1948cc3631e723c421ce1a735634b12b62be28a

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, byday, bymonthday, count):
    start = dt.date.fromisoformat(dtstart)
    wanted = [['MO', 'TU', 'WE', 'TH', 'FR', 'SA', 'SU'].index(w) for w in byday]
    out = []
    d = start
    while len(out) < count and d.year < start.year + 50:
        dim = calendar.monthrange(d.year, d.month)[1]
        day_ok = not wanted or d.weekday() in wanted
        mday_ok = not bymonthday or (d.day in bymonthday or d.day - dim - 1 in bymonthday)
        if (day_ok and mday_ok) if bymonthday else (day_ok or mday_ok):
            out.append(d.isoformat())
        d += dt.timedelta(days=1)
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: friday the 13th',
   ['2024-01-01', ['FR'], [13], 3],
   ['2024-09-13', '2024-12-13', '2025-06-13']),
  ('last sunday via -1..-7',
   ['2024-01-01', ['SU'], [-1, -2, -3, -4, -5, -6, -7], 3],
   ['2024-01-28', '2024-02-25', '2024-03-31']),
  ('only bymonthday',
   ['2024-01-10', [], [1, 15], 4],
   ['2024-01-15', '2024-02-01', '2024-02-15', '2024-03-01']),
  ('only byday',
   ['2024-01-01', ['SA', 'SU'], [], 4],
   ['2024-01-06', '2024-01-07', '2024-01-13', '2024-01-14']),
  ('last day monday', ['2024-01-01', ['MO'], [-1], 2], ['2024-09-30', '2025-03-31']),
  ('first monday via 1..7',
   ['2024-02-01', ['MO'], [1, 2, 3, 4, 5, 6, 7], 3],
   ['2024-02-05', '2024-03-04', '2024-04-01']),
  ('sunday first of month', ['2024-01-01', ['SU'], [1], 2], ['2024-09-01', '2024-12-01'])],
 [('only bymonthday',
   ['2024-01-10', [], [1, 15], 4],
   ['2024-01-15', '2024-02-01', '2024-02-15', '2024-03-01']),
  ('only byday',
   ['2024-01-01', ['SA', 'SU'], [], 4],
   ['2024-01-06', '2024-01-07', '2024-01-13', '2024-01-14']),
  ('last day monday', ['2024-01-01', ['MO'], [-1], 2], ['2024-09-30', '2025-03-31']),
  ('first monday via 1..7',
   ['2024-02-01', ['MO'], [1, 2, 3, 4, 5, 6, 7], 3],
   ['2024-02-05', '2024-03-04', '2024-04-01']),
  ('sunday first of month', ['2024-01-01', ['SU'], [1], 2], ['2024-09-01', '2024-12-01']),
  ('tuesday 29th', ['2024-01-01', ['TU'], [29], 3], ['2024-10-29', '2025-04-29', '2025-07-29']),
  ('weekday 15th',
   ['2024-03-01', ['MO', 'TU', 'WE', 'TH', 'FR'], [15], 4],
   ['2024-03-15', '2024-04-15', '2024-05-15', '2024-07-15'])],
 [('last day monday', ['2024-01-01', ['MO'], [-1], 2], ['2024-09-30', '2025-03-31']),
  ('first monday via 1..7',
   ['2024-02-01', ['MO'], [1, 2, 3, 4, 5, 6, 7], 3],
   ['2024-02-05', '2024-03-04', '2024-04-01']),
  ('sunday first of month', ['2024-01-01', ['SU'], [1], 2], ['2024-09-01', '2024-12-01']),
  ('tuesday 29th', ['2024-01-01', ['TU'], [29], 3], ['2024-10-29', '2025-04-29', '2025-07-29']),
  ('weekday 15th',
   ['2024-03-01', ['MO', 'TU', 'WE', 'TH', 'FR'], [15], 4],
   ['2024-03-15', '2024-04-15', '2024-05-15', '2024-07-15']),
  ('thursday the 13th', ['2025-01-01', ['TH'], [13], 2], ['2025-02-13', '2025-03-13']),
  ('regression: friday the 13th',
   ['2024-01-01', ['FR'], [13], 3],
   ['2024-09-13', '2024-12-13', '2025-06-13']),
  ('only byday',
   ['2024-01-01', ['SA', 'SU'], [], 4],
   ['2024-01-06', '2024-01-07', '2024-01-13', '2024-01-14'])],
 [('sunday first of month', ['2024-01-01', ['SU'], [1], 2], ['2024-09-01', '2024-12-01']),
  ('tuesday 29th', ['2024-01-01', ['TU'], [29], 3], ['2024-10-29', '2025-04-29', '2025-07-29']),
  ('weekday 15th',
   ['2024-03-01', ['MO', 'TU', 'WE', 'TH', 'FR'], [15], 4],
   ['2024-03-15', '2024-04-15', '2024-05-15', '2024-07-15']),
  ('thursday the 13th', ['2025-01-01', ['TH'], [13], 2], ['2025-02-13', '2025-03-13']),
  ('regression: friday the 13th',
   ['2024-01-01', ['FR'], [13], 3],
   ['2024-09-13', '2024-12-13', '2025-06-13']),
  ('last sunday via -1..-7',
   ['2024-01-01', ['SU'], [-1, -2, -3, -4, -5, -6, -7], 3],
   ['2024-01-28', '2024-02-25', '2024-03-31']),
  ('only bymonthday',
   ['2024-01-10', [], [1, 15], 4],
   ['2024-01-15', '2024-02-01', '2024-02-15', '2024-03-01']),
  ('only byday',
   ['2024-01-01', ['SA', 'SU'], [], 4],
   ['2024-01-06', '2024-01-07', '2024-01-13', '2024-01-14'])],
 [('weekday 15th',
   ['2024-03-01', ['MO', 'TU', 'WE', 'TH', 'FR'], [15], 4],
   ['2024-03-15', '2024-04-15', '2024-05-15', '2024-07-15']),
  ('thursday the 13th', ['2025-01-01', ['TH'], [13], 2], ['2025-02-13', '2025-03-13']),
  ('regression: friday the 13th',
   ['2024-01-01', ['FR'], [13], 3],
   ['2024-09-13', '2024-12-13', '2025-06-13']),
  ('last sunday via -1..-7',
   ['2024-01-01', ['SU'], [-1, -2, -3, -4, -5, -6, -7], 3],
   ['2024-01-28', '2024-02-25', '2024-03-31']),
  ('only bymonthday',
   ['2024-01-10', [], [1, 15], 4],
   ['2024-01-15', '2024-02-01', '2024-02-15', '2024-03-01']),
  ('only byday',
   ['2024-01-01', ['SA', 'SU'], [], 4],
   ['2024-01-06', '2024-01-07', '2024-01-13', '2024-01-14']),
  ('last day monday', ['2024-01-01', ['MO'], [-1], 2], ['2024-09-30', '2025-03-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: friday the 13th['2024-09-13', '2024-12-13', '2025-06-13']['2024-09-13', '2024-12-13', '2025-06-13']Passed
last sunday via -1..-7['2024-01-28', '2024-02-25', '2024-03-31']['2024-01-28', '2024-02-25', '2024-03-31']Passed
only bymonthday['2024-01-15', '2024-02-01', '2024-02-15', '2024-03-01']['2024-01-15', '2024-02-01', '2024-02-15', '2024-03-01']Passed
only byday['2024-01-01', '2024-01-02', '2024-01-03', '2024-01-04']['2024-01-06', '2024-01-07', '2024-01-13', '2024-01-14']Failed
last day monday['2024-09-30', '2025-03-31']['2024-09-30', '2025-03-31']Passed
first monday via 1..7['2024-02-05', '2024-03-04', '2024-04-01']['2024-02-05', '2024-03-04', '2024-04-01']Passed
sunday first of month['2024-09-01', '2024-12-01']['2024-09-01', '2024-12-01']Passed

SHA-256 / 6b9b58daa58ad3e42443f3b614b821e2c7689c3edd62ff0a8eafbb3019a907bc

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, byday, bymonthday, count):
    start = dt.date.fromisoformat(dtstart)
    wanted = [['MO', 'TU', 'WE', 'TH', 'FR', 'SA', 'SU'].index(w) for w in byday]
    out = []
    d = start
    while len(out) < count and d.year < start.year + 50:
        dim = calendar.monthrange(d.year, d.month)[1]
        day_ok = not wanted or d.weekday() in wanted
        mday_ok = not bymonthday or (d.day in bymonthday or d.day - dim - 1 in bymonthday)
        if day_ok and mday_ok:
            out.append(d.isoformat())
        d += dt.timedelta(days=1)
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: friday the 13th',
   ['2024-01-01', ['FR'], [13], 3],
   ['2024-09-13', '2024-12-13', '2025-06-13']),
  ('last sunday via -1..-7',
   ['2024-01-01', ['SU'], [-1, -2, -3, -4, -5, -6, -7], 3],
   ['2024-01-28', '2024-02-25', '2024-03-31']),
  ('only bymonthday',
   ['2024-01-10', [], [1, 15], 4],
   ['2024-01-15', '2024-02-01', '2024-02-15', '2024-03-01']),
  ('only byday',
   ['2024-01-01', ['SA', 'SU'], [], 4],
   ['2024-01-06', '2024-01-07', '2024-01-13', '2024-01-14']),
  ('last day monday', ['2024-01-01', ['MO'], [-1], 2], ['2024-09-30', '2025-03-31']),
  ('first monday via 1..7',
   ['2024-02-01', ['MO'], [1, 2, 3, 4, 5, 6, 7], 3],
   ['2024-02-05', '2024-03-04', '2024-04-01']),
  ('sunday first of month', ['2024-01-01', ['SU'], [1], 2], ['2024-09-01', '2024-12-01'])],
 [('only bymonthday',
   ['2024-01-10', [], [1, 15], 4],
   ['2024-01-15', '2024-02-01', '2024-02-15', '2024-03-01']),
  ('only byday',
   ['2024-01-01', ['SA', 'SU'], [], 4],
   ['2024-01-06', '2024-01-07', '2024-01-13', '2024-01-14']),
  ('last day monday', ['2024-01-01', ['MO'], [-1], 2], ['2024-09-30', '2025-03-31']),
  ('first monday via 1..7',
   ['2024-02-01', ['MO'], [1, 2, 3, 4, 5, 6, 7], 3],
   ['2024-02-05', '2024-03-04', '2024-04-01']),
  ('sunday first of month', ['2024-01-01', ['SU'], [1], 2], ['2024-09-01', '2024-12-01']),
  ('tuesday 29th', ['2024-01-01', ['TU'], [29], 3], ['2024-10-29', '2025-04-29', '2025-07-29']),
  ('weekday 15th',
   ['2024-03-01', ['MO', 'TU', 'WE', 'TH', 'FR'], [15], 4],
   ['2024-03-15', '2024-04-15', '2024-05-15', '2024-07-15'])],
 [('last day monday', ['2024-01-01', ['MO'], [-1], 2], ['2024-09-30', '2025-03-31']),
  ('first monday via 1..7',
   ['2024-02-01', ['MO'], [1, 2, 3, 4, 5, 6, 7], 3],
   ['2024-02-05', '2024-03-04', '2024-04-01']),
  ('sunday first of month', ['2024-01-01', ['SU'], [1], 2], ['2024-09-01', '2024-12-01']),
  ('tuesday 29th', ['2024-01-01', ['TU'], [29], 3], ['2024-10-29', '2025-04-29', '2025-07-29']),
  ('weekday 15th',
   ['2024-03-01', ['MO', 'TU', 'WE', 'TH', 'FR'], [15], 4],
   ['2024-03-15', '2024-04-15', '2024-05-15', '2024-07-15']),
  ('thursday the 13th', ['2025-01-01', ['TH'], [13], 2], ['2025-02-13', '2025-03-13']),
  ('regression: friday the 13th',
   ['2024-01-01', ['FR'], [13], 3],
   ['2024-09-13', '2024-12-13', '2025-06-13']),
  ('only byday',
   ['2024-01-01', ['SA', 'SU'], [], 4],
   ['2024-01-06', '2024-01-07', '2024-01-13', '2024-01-14'])],
 [('sunday first of month', ['2024-01-01', ['SU'], [1], 2], ['2024-09-01', '2024-12-01']),
  ('tuesday 29th', ['2024-01-01', ['TU'], [29], 3], ['2024-10-29', '2025-04-29', '2025-07-29']),
  ('weekday 15th',
   ['2024-03-01', ['MO', 'TU', 'WE', 'TH', 'FR'], [15], 4],
   ['2024-03-15', '2024-04-15', '2024-05-15', '2024-07-15']),
  ('thursday the 13th', ['2025-01-01', ['TH'], [13], 2], ['2025-02-13', '2025-03-13']),
  ('regression: friday the 13th',
   ['2024-01-01', ['FR'], [13], 3],
   ['2024-09-13', '2024-12-13', '2025-06-13']),
  ('last sunday via -1..-7',
   ['2024-01-01', ['SU'], [-1, -2, -3, -4, -5, -6, -7], 3],
   ['2024-01-28', '2024-02-25', '2024-03-31']),
  ('only bymonthday',
   ['2024-01-10', [], [1, 15], 4],
   ['2024-01-15', '2024-02-01', '2024-02-15', '2024-03-01']),
  ('only byday',
   ['2024-01-01', ['SA', 'SU'], [], 4],
   ['2024-01-06', '2024-01-07', '2024-01-13', '2024-01-14'])],
 [('weekday 15th',
   ['2024-03-01', ['MO', 'TU', 'WE', 'TH', 'FR'], [15], 4],
   ['2024-03-15', '2024-04-15', '2024-05-15', '2024-07-15']),
  ('thursday the 13th', ['2025-01-01', ['TH'], [13], 2], ['2025-02-13', '2025-03-13']),
  ('regression: friday the 13th',
   ['2024-01-01', ['FR'], [13], 3],
   ['2024-09-13', '2024-12-13', '2025-06-13']),
  ('last sunday via -1..-7',
   ['2024-01-01', ['SU'], [-1, -2, -3, -4, -5, -6, -7], 3],
   ['2024-01-28', '2024-02-25', '2024-03-31']),
  ('only bymonthday',
   ['2024-01-10', [], [1, 15], 4],
   ['2024-01-15', '2024-02-01', '2024-02-15', '2024-03-01']),
  ('only byday',
   ['2024-01-01', ['SA', 'SU'], [], 4],
   ['2024-01-06', '2024-01-07', '2024-01-13', '2024-01-14']),
  ('last day monday', ['2024-01-01', ['MO'], [-1], 2], ['2024-09-30', '2025-03-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: friday the 13th['2024-09-13', '2024-12-13', '2025-06-13']['2024-09-13', '2024-12-13', '2025-06-13']Passed
last sunday via -1..-7['2024-01-28', '2024-02-25', '2024-03-31']['2024-01-28', '2024-02-25', '2024-03-31']Passed
only bymonthday['2024-01-15', '2024-02-01', '2024-02-15', '2024-03-01']['2024-01-15', '2024-02-01', '2024-02-15', '2024-03-01']Passed
only byday['2024-01-06', '2024-01-07', '2024-01-13', '2024-01-14']['2024-01-06', '2024-01-07', '2024-01-13', '2024-01-14']Passed
last day monday['2024-09-30', '2025-03-31']['2024-09-30', '2025-03-31']Passed
first monday via 1..7['2024-02-05', '2024-03-04', '2024-04-01']['2024-02-05', '2024-03-04', '2024-04-01']Passed
sunday first of month['2024-09-01', '2024-12-01']['2024-09-01', '2024-12-01']Passed

SHA-256 / 6971bef1efdc0625ebdd251ff33f27adf75b17c41fd97e31bb6d0289acaee0f5

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

Case digest / d1783f9e739196887b53b222a04d9f680172e94cadc4b057e31b5bdb79f084bf