FAILURE MAP
← Case archive

FA-59721 / Subscription proration billing / Open access

Current billing period containing a date: boundary date ownership · case 01

A change on a renewal date is prorated against the period that just ended.

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

ROOT CAUSE

A date equal to the next period start is kept in the previous period.

VERIFIED REPAIR

Restore the contract rule at the boundary date ownership step: use `while shift(k + 1) <= t:`.

Unsuccessful approach: The attempt advances while the current start is before the date, overshooting by one period.

Case contract

Input {anchor, interval week|month|year, count, at >= anchor}. Period k starts at anchor + k*count intervals (weeks as 7 days; months/years by calendar month with the anchor day clamped to month length). Return [start ISO, end ISO] of the period with start <= at < end.

Why this case matters

Proration needs the exact period containing a change date; boundary dates belong to the new period.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import datetime
import calendar
N = 1
observations = []
def solve(x):
    a = datetime.date(*x['anchor'])
    t = datetime.date(*x['at'])
    def shift(k):
        if x['interval'] == 'week':
            return a + datetime.timedelta(days=7 * x['count'] * k)
        months = k * x['count'] * (12 if x['interval'] == 'year' else 1)
        tot = a.month - 1 + months
        y, m = a.year + tot // 12, tot % 12 + 1
        return datetime.date(y, m, min(a.day, calendar.monthrange(y, m)[1]))
    k = 0
    while shift(k + 1) < t:
        k += 1
    return [shift(k).isoformat(), shift(k + 1).isoformat()]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression (boundary)', {'anchor': [2024, 1, 31], 'interval': 'month', 'count': 1, 'at': [2024, 2, 29]}, ['2024-02-29', '2024-03-31']), ('regression (boundary)', {'anchor': [2024, 1, 10], 'interval': 'week', 'count': 2, 'at': [2024, 1, 24]}, ['2024-01-24', '2024-02-07']), ('partial-repair probe', {'anchor': [2020, 10, 31], 'interval': 'year', 'count': 1, 'at': [2022, 2, 15]}, ['2021-10-31', '2022-10-31']), ('partial-repair probe', {'anchor': [2023, 10, 31], 'interval': 'month', 'count': 2, 'at': [2024, 2, 3]}, ['2023-12-31', '2024-02-29']), ('normal control', {'anchor': [2020, 1, 1], 'interval': 'week', 'count': 2, 'at': [2020, 1, 1]}, ['2020-01-01', '2020-01-15']), ('additional oracle', {'anchor': [2022, 10, 31], 'interval': 'month', 'count': 2, 'at': [2023, 6, 30]}, ['2023-06-30', '2023-08-31']), ('additional oracle', {'anchor': [2023, 5, 19], 'interval': 'year', 'count': 1, 'at': [2025, 8, 18]}, ['2025-05-19', '2026-05-19'])], [('regression (boundary)', {'anchor': [2024, 1, 10], 'interval': 'week', 'count': 2, 'at': [2024, 1, 24]}, ['2024-01-24', '2024-02-07']), ('regression', {'anchor': [2022, 10, 31], 'interval': 'month', 'count': 2, 'at': [2023, 6, 30]}, ['2023-06-30', '2023-08-31']), ('partial-repair probe', {'anchor': [2023, 5, 19], 'interval': 'year', 'count': 1, 'at': [2025, 8, 18]}, ['2025-05-19', '2026-05-19']), ('partial-repair probe', {'anchor': [2020, 8, 2], 'interval': 'week', 'count': 3, 'at': [2020, 9, 4]}, ['2020-08-23', '2020-09-13']), ('normal control', {'anchor': [2020, 1, 1], 'interval': 'week', 'count': 2, 'at': [2020, 1, 1]}, ['2020-01-01', '2020-01-15']), ('additional oracle', {'anchor': [2020, 10, 31], 'interval': 'year', 'count': 1, 'at': [2022, 2, 15]}, ['2021-10-31', '2022-10-31']), ('additional oracle', {'anchor': [2023, 10, 31], 'interval': 'month', 'count': 2, 'at': [2024, 2, 3]}, ['2023-12-31', '2024-02-29'])], [('regression', {'anchor': [2022, 10, 31], 'interval': 'month', 'count': 2, 'at': [2023, 6, 30]}, ['2023-06-30', '2023-08-31']), ('regression', {'anchor': [2022, 10, 31], 'interval': 'month', 'count': 1, 'at': [2023, 11, 30]}, ['2023-11-30', '2023-12-31']), ('partial-repair probe', {'anchor': [2021, 11, 24], 'interval': 'year', 'count': 3, 'at': [2022, 4, 18]}, ['2021-11-24', '2024-11-24']), ('partial-repair probe', {'anchor': [2020, 8, 7], 'interval': 'week', 'count': 2, 'at': [2023, 10, 30]}, ['2023-10-27', '2023-11-10']), ('normal control', {'anchor': [2020, 1, 1], 'interval': 'week', 'count': 2, 'at': [2020, 1, 1]}, ['2020-01-01', '2020-01-15']), ('additional oracle', {'anchor': [2020, 10, 31], 'interval': 'year', 'count': 1, 'at': [2022, 2, 15]}, ['2021-10-31', '2022-10-31']), ('additional oracle', {'anchor': [2023, 10, 31], 'interval': 'month', 'count': 2, 'at': [2024, 2, 3]}, ['2023-12-31', '2024-02-29'])], [('regression', {'anchor': [2022, 10, 31], 'interval': 'month', 'count': 1, 'at': [2023, 11, 30]}, ['2023-11-30', '2023-12-31']), ('regression', {'anchor': [2022, 8, 21], 'interval': 'week', 'count': 1, 'at': [2025, 1, 26]}, ['2025-01-26', '2025-02-02']), ('partial-repair probe', {'anchor': [2021, 2, 28], 'interval': 'year', 'count': 2, 'at': [2021, 8, 29]}, ['2021-02-28', '2023-02-28']), ('partial-repair probe', {'anchor': [2020, 11, 28], 'interval': 'year', 'count': 2, 'at': [2023, 9, 6]}, ['2022-11-28', '2024-11-28']), ('normal control', {'anchor': [2020, 1, 1], 'interval': 'week', 'count': 2, 'at': [2020, 1, 1]}, ['2020-01-01', '2020-01-15']), ('additional oracle', {'anchor': [2023, 10, 31], 'interval': 'month', 'count': 2, 'at': [2024, 2, 3]}, ['2023-12-31', '2024-02-29']), ('additional oracle', {'anchor': [2022, 10, 31], 'interval': 'month', 'count': 2, 'at': [2023, 6, 30]}, ['2023-06-30', '2023-08-31'])], [('regression', {'anchor': [2022, 8, 21], 'interval': 'week', 'count': 1, 'at': [2025, 1, 26]}, ['2025-01-26', '2025-02-02']), ('regression', {'anchor': [2020, 7, 31], 'interval': 'month', 'count': 1, 'at': [2023, 5, 31]}, ['2023-05-31', '2023-06-30']), ('partial-repair probe', {'anchor': [2023, 12, 31], 'interval': 'month', 'count': 1, 'at': [2024, 7, 11]}, ['2024-06-30', '2024-07-31']), ('partial-repair probe', {'anchor': [2020, 2, 20], 'interval': 'month', 'count': 1, 'at': [2022, 12, 10]}, ['2022-11-20', '2022-12-20']), ('normal control', {'anchor': [2020, 1, 1], 'interval': 'week', 'count': 2, 'at': [2020, 1, 1]}, ['2020-01-01', '2020-01-15']), ('additional oracle', {'anchor': [2022, 10, 31], 'interval': 'month', 'count': 2, 'at': [2023, 6, 30]}, ['2023-06-30', '2023-08-31']), ('additional oracle', {'anchor': [2023, 5, 19], 'interval': 'year', 'count': 1, 'at': [2025, 8, 18]}, ['2025-05-19', '2026-05-19'])]]
for i, (label, args, expected) in enumerate(fixtures[N-1]):
    check("%s %d" % (label, i), 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 (boundary) 0['2024-01-31', '2024-02-29']['2024-02-29', '2024-03-31']Failed
regression (boundary) 1['2024-01-10', '2024-01-24']['2024-01-24', '2024-02-07']Failed
partial-repair probe 2['2021-10-31', '2022-10-31']['2021-10-31', '2022-10-31']Passed
partial-repair probe 3['2023-12-31', '2024-02-29']['2023-12-31', '2024-02-29']Passed
normal control 4['2020-01-01', '2020-01-15']['2020-01-01', '2020-01-15']Passed
additional oracle 5['2023-04-30', '2023-06-30']['2023-06-30', '2023-08-31']Failed
additional oracle 6['2025-05-19', '2026-05-19']['2025-05-19', '2026-05-19']Passed

SHA-256 / d41b23141488d8634e1f0cfe4342897dbeb87c260fa55f44e97bfde715d37d53

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import datetime
import calendar
N = 1
observations = []
def solve(x):
    a = datetime.date(*x['anchor'])
    t = datetime.date(*x['at'])
    def shift(k):
        if x['interval'] == 'week':
            return a + datetime.timedelta(days=7 * x['count'] * k)
        months = k * x['count'] * (12 if x['interval'] == 'year' else 1)
        tot = a.month - 1 + months
        y, m = a.year + tot // 12, tot % 12 + 1
        return datetime.date(y, m, min(a.day, calendar.monthrange(y, m)[1]))
    k = 0
    while shift(k) < t:
        k += 1
    return [shift(k).isoformat(), shift(k + 1).isoformat()]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression (boundary)', {'anchor': [2024, 1, 31], 'interval': 'month', 'count': 1, 'at': [2024, 2, 29]}, ['2024-02-29', '2024-03-31']), ('regression (boundary)', {'anchor': [2024, 1, 10], 'interval': 'week', 'count': 2, 'at': [2024, 1, 24]}, ['2024-01-24', '2024-02-07']), ('partial-repair probe', {'anchor': [2020, 10, 31], 'interval': 'year', 'count': 1, 'at': [2022, 2, 15]}, ['2021-10-31', '2022-10-31']), ('partial-repair probe', {'anchor': [2023, 10, 31], 'interval': 'month', 'count': 2, 'at': [2024, 2, 3]}, ['2023-12-31', '2024-02-29']), ('normal control', {'anchor': [2020, 1, 1], 'interval': 'week', 'count': 2, 'at': [2020, 1, 1]}, ['2020-01-01', '2020-01-15']), ('additional oracle', {'anchor': [2022, 10, 31], 'interval': 'month', 'count': 2, 'at': [2023, 6, 30]}, ['2023-06-30', '2023-08-31']), ('additional oracle', {'anchor': [2023, 5, 19], 'interval': 'year', 'count': 1, 'at': [2025, 8, 18]}, ['2025-05-19', '2026-05-19'])], [('regression (boundary)', {'anchor': [2024, 1, 10], 'interval': 'week', 'count': 2, 'at': [2024, 1, 24]}, ['2024-01-24', '2024-02-07']), ('regression', {'anchor': [2022, 10, 31], 'interval': 'month', 'count': 2, 'at': [2023, 6, 30]}, ['2023-06-30', '2023-08-31']), ('partial-repair probe', {'anchor': [2023, 5, 19], 'interval': 'year', 'count': 1, 'at': [2025, 8, 18]}, ['2025-05-19', '2026-05-19']), ('partial-repair probe', {'anchor': [2020, 8, 2], 'interval': 'week', 'count': 3, 'at': [2020, 9, 4]}, ['2020-08-23', '2020-09-13']), ('normal control', {'anchor': [2020, 1, 1], 'interval': 'week', 'count': 2, 'at': [2020, 1, 1]}, ['2020-01-01', '2020-01-15']), ('additional oracle', {'anchor': [2020, 10, 31], 'interval': 'year', 'count': 1, 'at': [2022, 2, 15]}, ['2021-10-31', '2022-10-31']), ('additional oracle', {'anchor': [2023, 10, 31], 'interval': 'month', 'count': 2, 'at': [2024, 2, 3]}, ['2023-12-31', '2024-02-29'])], [('regression', {'anchor': [2022, 10, 31], 'interval': 'month', 'count': 2, 'at': [2023, 6, 30]}, ['2023-06-30', '2023-08-31']), ('regression', {'anchor': [2022, 10, 31], 'interval': 'month', 'count': 1, 'at': [2023, 11, 30]}, ['2023-11-30', '2023-12-31']), ('partial-repair probe', {'anchor': [2021, 11, 24], 'interval': 'year', 'count': 3, 'at': [2022, 4, 18]}, ['2021-11-24', '2024-11-24']), ('partial-repair probe', {'anchor': [2020, 8, 7], 'interval': 'week', 'count': 2, 'at': [2023, 10, 30]}, ['2023-10-27', '2023-11-10']), ('normal control', {'anchor': [2020, 1, 1], 'interval': 'week', 'count': 2, 'at': [2020, 1, 1]}, ['2020-01-01', '2020-01-15']), ('additional oracle', {'anchor': [2020, 10, 31], 'interval': 'year', 'count': 1, 'at': [2022, 2, 15]}, ['2021-10-31', '2022-10-31']), ('additional oracle', {'anchor': [2023, 10, 31], 'interval': 'month', 'count': 2, 'at': [2024, 2, 3]}, ['2023-12-31', '2024-02-29'])], [('regression', {'anchor': [2022, 10, 31], 'interval': 'month', 'count': 1, 'at': [2023, 11, 30]}, ['2023-11-30', '2023-12-31']), ('regression', {'anchor': [2022, 8, 21], 'interval': 'week', 'count': 1, 'at': [2025, 1, 26]}, ['2025-01-26', '2025-02-02']), ('partial-repair probe', {'anchor': [2021, 2, 28], 'interval': 'year', 'count': 2, 'at': [2021, 8, 29]}, ['2021-02-28', '2023-02-28']), ('partial-repair probe', {'anchor': [2020, 11, 28], 'interval': 'year', 'count': 2, 'at': [2023, 9, 6]}, ['2022-11-28', '2024-11-28']), ('normal control', {'anchor': [2020, 1, 1], 'interval': 'week', 'count': 2, 'at': [2020, 1, 1]}, ['2020-01-01', '2020-01-15']), ('additional oracle', {'anchor': [2023, 10, 31], 'interval': 'month', 'count': 2, 'at': [2024, 2, 3]}, ['2023-12-31', '2024-02-29']), ('additional oracle', {'anchor': [2022, 10, 31], 'interval': 'month', 'count': 2, 'at': [2023, 6, 30]}, ['2023-06-30', '2023-08-31'])], [('regression', {'anchor': [2022, 8, 21], 'interval': 'week', 'count': 1, 'at': [2025, 1, 26]}, ['2025-01-26', '2025-02-02']), ('regression', {'anchor': [2020, 7, 31], 'interval': 'month', 'count': 1, 'at': [2023, 5, 31]}, ['2023-05-31', '2023-06-30']), ('partial-repair probe', {'anchor': [2023, 12, 31], 'interval': 'month', 'count': 1, 'at': [2024, 7, 11]}, ['2024-06-30', '2024-07-31']), ('partial-repair probe', {'anchor': [2020, 2, 20], 'interval': 'month', 'count': 1, 'at': [2022, 12, 10]}, ['2022-11-20', '2022-12-20']), ('normal control', {'anchor': [2020, 1, 1], 'interval': 'week', 'count': 2, 'at': [2020, 1, 1]}, ['2020-01-01', '2020-01-15']), ('additional oracle', {'anchor': [2022, 10, 31], 'interval': 'month', 'count': 2, 'at': [2023, 6, 30]}, ['2023-06-30', '2023-08-31']), ('additional oracle', {'anchor': [2023, 5, 19], 'interval': 'year', 'count': 1, 'at': [2025, 8, 18]}, ['2025-05-19', '2026-05-19'])]]
for i, (label, args, expected) in enumerate(fixtures[N-1]):
    check("%s %d" % (label, i), 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 (boundary) 0['2024-02-29', '2024-03-31']['2024-02-29', '2024-03-31']Passed
regression (boundary) 1['2024-01-24', '2024-02-07']['2024-01-24', '2024-02-07']Passed
partial-repair probe 2['2022-10-31', '2023-10-31']['2021-10-31', '2022-10-31']Failed
partial-repair probe 3['2024-02-29', '2024-04-30']['2023-12-31', '2024-02-29']Failed
normal control 4['2020-01-01', '2020-01-15']['2020-01-01', '2020-01-15']Passed
additional oracle 5['2023-06-30', '2023-08-31']['2023-06-30', '2023-08-31']Passed
additional oracle 6['2026-05-19', '2027-05-19']['2025-05-19', '2026-05-19']Failed

SHA-256 / 972331d3ea0763b7f21605f9def1368904203e20532ee8ff6bfbbe04c53e1adc

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json
import datetime
import calendar
N = 1
observations = []
def solve(x):
    a = datetime.date(*x['anchor'])
    t = datetime.date(*x['at'])
    def shift(k):
        if x['interval'] == 'week':
            return a + datetime.timedelta(days=7 * x['count'] * k)
        months = k * x['count'] * (12 if x['interval'] == 'year' else 1)
        tot = a.month - 1 + months
        y, m = a.year + tot // 12, tot % 12 + 1
        return datetime.date(y, m, min(a.day, calendar.monthrange(y, m)[1]))
    k = 0
    while shift(k + 1) <= t:
        k += 1
    return [shift(k).isoformat(), shift(k + 1).isoformat()]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression (boundary)', {'anchor': [2024, 1, 31], 'interval': 'month', 'count': 1, 'at': [2024, 2, 29]}, ['2024-02-29', '2024-03-31']), ('regression (boundary)', {'anchor': [2024, 1, 10], 'interval': 'week', 'count': 2, 'at': [2024, 1, 24]}, ['2024-01-24', '2024-02-07']), ('partial-repair probe', {'anchor': [2020, 10, 31], 'interval': 'year', 'count': 1, 'at': [2022, 2, 15]}, ['2021-10-31', '2022-10-31']), ('partial-repair probe', {'anchor': [2023, 10, 31], 'interval': 'month', 'count': 2, 'at': [2024, 2, 3]}, ['2023-12-31', '2024-02-29']), ('normal control', {'anchor': [2020, 1, 1], 'interval': 'week', 'count': 2, 'at': [2020, 1, 1]}, ['2020-01-01', '2020-01-15']), ('additional oracle', {'anchor': [2022, 10, 31], 'interval': 'month', 'count': 2, 'at': [2023, 6, 30]}, ['2023-06-30', '2023-08-31']), ('additional oracle', {'anchor': [2023, 5, 19], 'interval': 'year', 'count': 1, 'at': [2025, 8, 18]}, ['2025-05-19', '2026-05-19'])], [('regression (boundary)', {'anchor': [2024, 1, 10], 'interval': 'week', 'count': 2, 'at': [2024, 1, 24]}, ['2024-01-24', '2024-02-07']), ('regression', {'anchor': [2022, 10, 31], 'interval': 'month', 'count': 2, 'at': [2023, 6, 30]}, ['2023-06-30', '2023-08-31']), ('partial-repair probe', {'anchor': [2023, 5, 19], 'interval': 'year', 'count': 1, 'at': [2025, 8, 18]}, ['2025-05-19', '2026-05-19']), ('partial-repair probe', {'anchor': [2020, 8, 2], 'interval': 'week', 'count': 3, 'at': [2020, 9, 4]}, ['2020-08-23', '2020-09-13']), ('normal control', {'anchor': [2020, 1, 1], 'interval': 'week', 'count': 2, 'at': [2020, 1, 1]}, ['2020-01-01', '2020-01-15']), ('additional oracle', {'anchor': [2020, 10, 31], 'interval': 'year', 'count': 1, 'at': [2022, 2, 15]}, ['2021-10-31', '2022-10-31']), ('additional oracle', {'anchor': [2023, 10, 31], 'interval': 'month', 'count': 2, 'at': [2024, 2, 3]}, ['2023-12-31', '2024-02-29'])], [('regression', {'anchor': [2022, 10, 31], 'interval': 'month', 'count': 2, 'at': [2023, 6, 30]}, ['2023-06-30', '2023-08-31']), ('regression', {'anchor': [2022, 10, 31], 'interval': 'month', 'count': 1, 'at': [2023, 11, 30]}, ['2023-11-30', '2023-12-31']), ('partial-repair probe', {'anchor': [2021, 11, 24], 'interval': 'year', 'count': 3, 'at': [2022, 4, 18]}, ['2021-11-24', '2024-11-24']), ('partial-repair probe', {'anchor': [2020, 8, 7], 'interval': 'week', 'count': 2, 'at': [2023, 10, 30]}, ['2023-10-27', '2023-11-10']), ('normal control', {'anchor': [2020, 1, 1], 'interval': 'week', 'count': 2, 'at': [2020, 1, 1]}, ['2020-01-01', '2020-01-15']), ('additional oracle', {'anchor': [2020, 10, 31], 'interval': 'year', 'count': 1, 'at': [2022, 2, 15]}, ['2021-10-31', '2022-10-31']), ('additional oracle', {'anchor': [2023, 10, 31], 'interval': 'month', 'count': 2, 'at': [2024, 2, 3]}, ['2023-12-31', '2024-02-29'])], [('regression', {'anchor': [2022, 10, 31], 'interval': 'month', 'count': 1, 'at': [2023, 11, 30]}, ['2023-11-30', '2023-12-31']), ('regression', {'anchor': [2022, 8, 21], 'interval': 'week', 'count': 1, 'at': [2025, 1, 26]}, ['2025-01-26', '2025-02-02']), ('partial-repair probe', {'anchor': [2021, 2, 28], 'interval': 'year', 'count': 2, 'at': [2021, 8, 29]}, ['2021-02-28', '2023-02-28']), ('partial-repair probe', {'anchor': [2020, 11, 28], 'interval': 'year', 'count': 2, 'at': [2023, 9, 6]}, ['2022-11-28', '2024-11-28']), ('normal control', {'anchor': [2020, 1, 1], 'interval': 'week', 'count': 2, 'at': [2020, 1, 1]}, ['2020-01-01', '2020-01-15']), ('additional oracle', {'anchor': [2023, 10, 31], 'interval': 'month', 'count': 2, 'at': [2024, 2, 3]}, ['2023-12-31', '2024-02-29']), ('additional oracle', {'anchor': [2022, 10, 31], 'interval': 'month', 'count': 2, 'at': [2023, 6, 30]}, ['2023-06-30', '2023-08-31'])], [('regression', {'anchor': [2022, 8, 21], 'interval': 'week', 'count': 1, 'at': [2025, 1, 26]}, ['2025-01-26', '2025-02-02']), ('regression', {'anchor': [2020, 7, 31], 'interval': 'month', 'count': 1, 'at': [2023, 5, 31]}, ['2023-05-31', '2023-06-30']), ('partial-repair probe', {'anchor': [2023, 12, 31], 'interval': 'month', 'count': 1, 'at': [2024, 7, 11]}, ['2024-06-30', '2024-07-31']), ('partial-repair probe', {'anchor': [2020, 2, 20], 'interval': 'month', 'count': 1, 'at': [2022, 12, 10]}, ['2022-11-20', '2022-12-20']), ('normal control', {'anchor': [2020, 1, 1], 'interval': 'week', 'count': 2, 'at': [2020, 1, 1]}, ['2020-01-01', '2020-01-15']), ('additional oracle', {'anchor': [2022, 10, 31], 'interval': 'month', 'count': 2, 'at': [2023, 6, 30]}, ['2023-06-30', '2023-08-31']), ('additional oracle', {'anchor': [2023, 5, 19], 'interval': 'year', 'count': 1, 'at': [2025, 8, 18]}, ['2025-05-19', '2026-05-19'])]]
for i, (label, args, expected) in enumerate(fixtures[N-1]):
    check("%s %d" % (label, i), 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 (boundary) 0['2024-02-29', '2024-03-31']['2024-02-29', '2024-03-31']Passed
regression (boundary) 1['2024-01-24', '2024-02-07']['2024-01-24', '2024-02-07']Passed
partial-repair probe 2['2021-10-31', '2022-10-31']['2021-10-31', '2022-10-31']Passed
partial-repair probe 3['2023-12-31', '2024-02-29']['2023-12-31', '2024-02-29']Passed
normal control 4['2020-01-01', '2020-01-15']['2020-01-01', '2020-01-15']Passed
additional oracle 5['2023-06-30', '2023-08-31']['2023-06-30', '2023-08-31']Passed
additional oracle 6['2025-05-19', '2026-05-19']['2025-05-19', '2026-05-19']Passed

SHA-256 / 9f4fc47716d9b58fd0eac9503bd482053c4034be156da8b5af1783f486e466f6

Verification & scope

A deterministic teaching model of a stipulated billing rule. It makes no claim to reproduce any billing provider's exact behaviour and is not billing software. 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:46:38.871657+00:00.

Case digest / 697a451b8f05ea9c63b05bb7ff806fec68070dbd5b2e6515909dd432c526fd8c