FA-59346 / Subscription proration billing / Open access
Daily plan-change proration: period length basis · case 01
Proration amounts are skewed in 31-day months and February, and exceed the plan price on annual plans.
ROOT CAUSE
Every period is assumed to be 30 days long instead of its actual length.
VERIFIED REPAIR
Restore the contract rule at the period length basis step: use `total = (e - s).days`.
Unsuccessful approach: The attempt uses real dates but counts the exclusive end date, shrinking every proration slightly.
Case contract
Input {old, new prices per period, start, end (exclusive), change} dates with start <= change < end. Remaining days = end - change; period days = end - start. Credit = old*remaining/period and charge = new*remaining/period, each rounded half-up. Net = charge - credit; a positive net is due now, a negative net becomes a credit balance. Return [credit, charge, amount_due, credit_balance].
Why this case matters
Mid-cycle plan changes must credit unused time on the old plan and charge the new plan for the same days.
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):
s = datetime.date(*x['start'])
e = datetime.date(*x['end'])
c = datetime.date(*x['change'])
total = 30
remaining = (e - c).days
def pr(p):
return (p * remaining * 2 + total) // (2 * total)
credit = pr(x['old'])
charge = pr(x['new'])
net = charge - credit
return [credit, charge, max(0, net), max(0, -net)]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression', {'old': 999, 'new': 1999, 'start': [2023, 10, 16], 'end': [2023, 11, 13], 'change': [2023, 11, 8]}, [178, 357, 179, 0]), ('regression', {'old': 12063, 'new': 1999, 'start': [2024, 10, 16], 'end': [2024, 11, 14], 'change': [2024, 11, 2]}, [4992, 827, 0, 4165]), ('partial-repair probe', {'old': 999, 'new': 1999, 'start': [2024, 9, 16], 'end': [2024, 12, 15], 'change': [2024, 12, 10]}, [56, 111, 55, 0]), ('partial-repair probe', {'old': 4900, 'new': 8489, 'start': [2024, 3, 22], 'end': [2024, 6, 20], 'change': [2024, 4, 18]}, [3430, 5942, 2512, 0]), ('additional oracle', {'old': 4900, 'new': 9900, 'start': [2024, 1, 10], 'end': [2024, 4, 9], 'change': [2024, 3, 7]}, [1797, 3630, 1833, 0]), ('additional oracle', {'old': 34933, 'new': 4900, 'start': [2024, 12, 28], 'end': [2025, 1, 28], 'change': [2025, 1, 22]}, [6761, 948, 0, 5813]), ('additional oracle', {'old': 38640, 'new': 36658, 'start': [2024, 12, 23], 'end': [2025, 1, 22], 'change': [2025, 1, 21]}, [1288, 1222, 0, 66])], [('regression', {'old': 12063, 'new': 1999, 'start': [2024, 10, 16], 'end': [2024, 11, 14], 'change': [2024, 11, 2]}, [4992, 827, 0, 4165]), ('regression', {'old': 999, 'new': 1999, 'start': [2024, 9, 16], 'end': [2024, 12, 15], 'change': [2024, 12, 10]}, [56, 111, 55, 0]), ('partial-repair probe', {'old': 4900, 'new': 8489, 'start': [2024, 3, 22], 'end': [2024, 6, 20], 'change': [2024, 4, 18]}, [3430, 5942, 2512, 0]), ('partial-repair probe', {'old': 4900, 'new': 9900, 'start': [2024, 1, 10], 'end': [2024, 4, 9], 'change': [2024, 3, 7]}, [1797, 3630, 1833, 0]), ('additional oracle', {'old': 34933, 'new': 4900, 'start': [2024, 12, 28], 'end': [2025, 1, 28], 'change': [2025, 1, 22]}, [6761, 948, 0, 5813]), ('additional oracle', {'old': 38640, 'new': 36658, 'start': [2024, 12, 23], 'end': [2025, 1, 22], 'change': [2025, 1, 21]}, [1288, 1222, 0, 66]), ('additional oracle', {'old': 4900, 'new': 9900, 'start': [2024, 6, 18], 'end': [2024, 7, 18], 'change': [2024, 6, 21]}, [4410, 8910, 4500, 0])], [('regression', {'old': 999, 'new': 1999, 'start': [2024, 9, 16], 'end': [2024, 12, 15], 'change': [2024, 12, 10]}, [56, 111, 55, 0]), ('regression', {'old': 4900, 'new': 8489, 'start': [2024, 3, 22], 'end': [2024, 6, 20], 'change': [2024, 4, 18]}, [3430, 5942, 2512, 0]), ('partial-repair probe', {'old': 4900, 'new': 9900, 'start': [2024, 1, 10], 'end': [2024, 4, 9], 'change': [2024, 3, 7]}, [1797, 3630, 1833, 0]), ('partial-repair probe', {'old': 34933, 'new': 4900, 'start': [2024, 12, 28], 'end': [2025, 1, 28], 'change': [2025, 1, 22]}, [6761, 948, 0, 5813]), ('additional oracle', {'old': 38640, 'new': 36658, 'start': [2024, 12, 23], 'end': [2025, 1, 22], 'change': [2025, 1, 21]}, [1288, 1222, 0, 66]), ('additional oracle', {'old': 4900, 'new': 9900, 'start': [2024, 6, 18], 'end': [2024, 7, 18], 'change': [2024, 6, 21]}, [4410, 8910, 4500, 0]), ('additional oracle', {'old': 999, 'new': 4900, 'start': [2025, 1, 22], 'end': [2025, 4, 22], 'change': [2025, 3, 8]}, [500, 2450, 1950, 0])], [('regression', {'old': 4900, 'new': 8489, 'start': [2024, 3, 22], 'end': [2024, 6, 20], 'change': [2024, 4, 18]}, [3430, 5942, 2512, 0]), ('regression', {'old': 4900, 'new': 9900, 'start': [2024, 1, 10], 'end': [2024, 4, 9], 'change': [2024, 3, 7]}, [1797, 3630, 1833, 0]), ('partial-repair probe', {'old': 38640, 'new': 36658, 'start': [2024, 12, 23], 'end': [2025, 1, 22], 'change': [2025, 1, 21]}, [1288, 1222, 0, 66]), ('partial-repair probe', {'old': 4900, 'new': 9900, 'start': [2024, 6, 18], 'end': [2024, 7, 18], 'change': [2024, 6, 21]}, [4410, 8910, 4500, 0]), ('additional oracle', {'old': 34933, 'new': 4900, 'start': [2024, 12, 28], 'end': [2025, 1, 28], 'change': [2025, 1, 22]}, [6761, 948, 0, 5813]), ('additional oracle', {'old': 999, 'new': 4900, 'start': [2025, 1, 22], 'end': [2025, 4, 22], 'change': [2025, 3, 8]}, [500, 2450, 1950, 0]), ('additional oracle', {'old': 7276, 'new': 43371, 'start': [2024, 5, 21], 'end': [2024, 8, 19], 'change': [2024, 6, 13]}, [5417, 32287, 26870, 0])], [('regression', {'old': 4900, 'new': 9900, 'start': [2024, 1, 10], 'end': [2024, 4, 9], 'change': [2024, 3, 7]}, [1797, 3630, 1833, 0]), ('regression', {'old': 34933, 'new': 4900, 'start': [2024, 12, 28], 'end': [2025, 1, 28], 'change': [2025, 1, 22]}, [6761, 948, 0, 5813]), ('partial-repair probe', {'old': 999, 'new': 4900, 'start': [2025, 1, 22], 'end': [2025, 4, 22], 'change': [2025, 3, 8]}, [500, 2450, 1950, 0]), ('partial-repair probe', {'old': 7276, 'new': 43371, 'start': [2024, 5, 21], 'end': [2024, 8, 19], 'change': [2024, 6, 13]}, [5417, 32287, 26870, 0]), ('additional oracle', {'old': 38640, 'new': 36658, 'start': [2024, 12, 23], 'end': [2025, 1, 22], 'change': [2025, 1, 21]}, [1288, 1222, 0, 66]), ('additional oracle', {'old': 4900, 'new': 9900, 'start': [2024, 6, 18], 'end': [2024, 7, 18], 'change': [2024, 6, 21]}, [4410, 8910, 4500, 0]), ('additional oracle', {'old': 4900, 'new': 14973, 'start': [2025, 4, 11], 'end': [2025, 5, 10], 'change': [2025, 4, 17]}, [3886, 11875, 7989, 0])]]
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression 0 | [167, 333, 166, 0] | [178, 357, 179, 0] | Failed |
| regression 1 | [4825, 800, 0, 4025] | [4992, 827, 0, 4165] | Failed |
| partial-repair probe 2 | [167, 333, 166, 0] | [56, 111, 55, 0] | Failed |
| partial-repair probe 3 | [10290, 17827, 7537, 0] | [3430, 5942, 2512, 0] | Failed |
| additional oracle 4 | [5390, 10890, 5500, 0] | [1797, 3630, 1833, 0] | Failed |
| additional oracle 5 | [6987, 980, 0, 6007] | [6761, 948, 0, 5813] | Failed |
| additional oracle 6 | [1288, 1222, 0, 66] | [1288, 1222, 0, 66] | Passed |
SHA-256 / 2ca8a2e3242d3eeb716a7a5f29a2f8bbdcdcb8b2df69e34302da4607dec2b3ba
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):
s = datetime.date(*x['start'])
e = datetime.date(*x['end'])
c = datetime.date(*x['change'])
total = (e - s).days + 1
remaining = (e - c).days
def pr(p):
return (p * remaining * 2 + total) // (2 * total)
credit = pr(x['old'])
charge = pr(x['new'])
net = charge - credit
return [credit, charge, max(0, net), max(0, -net)]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression', {'old': 999, 'new': 1999, 'start': [2023, 10, 16], 'end': [2023, 11, 13], 'change': [2023, 11, 8]}, [178, 357, 179, 0]), ('regression', {'old': 12063, 'new': 1999, 'start': [2024, 10, 16], 'end': [2024, 11, 14], 'change': [2024, 11, 2]}, [4992, 827, 0, 4165]), ('partial-repair probe', {'old': 999, 'new': 1999, 'start': [2024, 9, 16], 'end': [2024, 12, 15], 'change': [2024, 12, 10]}, [56, 111, 55, 0]), ('partial-repair probe', {'old': 4900, 'new': 8489, 'start': [2024, 3, 22], 'end': [2024, 6, 20], 'change': [2024, 4, 18]}, [3430, 5942, 2512, 0]), ('additional oracle', {'old': 4900, 'new': 9900, 'start': [2024, 1, 10], 'end': [2024, 4, 9], 'change': [2024, 3, 7]}, [1797, 3630, 1833, 0]), ('additional oracle', {'old': 34933, 'new': 4900, 'start': [2024, 12, 28], 'end': [2025, 1, 28], 'change': [2025, 1, 22]}, [6761, 948, 0, 5813]), ('additional oracle', {'old': 38640, 'new': 36658, 'start': [2024, 12, 23], 'end': [2025, 1, 22], 'change': [2025, 1, 21]}, [1288, 1222, 0, 66])], [('regression', {'old': 12063, 'new': 1999, 'start': [2024, 10, 16], 'end': [2024, 11, 14], 'change': [2024, 11, 2]}, [4992, 827, 0, 4165]), ('regression', {'old': 999, 'new': 1999, 'start': [2024, 9, 16], 'end': [2024, 12, 15], 'change': [2024, 12, 10]}, [56, 111, 55, 0]), ('partial-repair probe', {'old': 4900, 'new': 8489, 'start': [2024, 3, 22], 'end': [2024, 6, 20], 'change': [2024, 4, 18]}, [3430, 5942, 2512, 0]), ('partial-repair probe', {'old': 4900, 'new': 9900, 'start': [2024, 1, 10], 'end': [2024, 4, 9], 'change': [2024, 3, 7]}, [1797, 3630, 1833, 0]), ('additional oracle', {'old': 34933, 'new': 4900, 'start': [2024, 12, 28], 'end': [2025, 1, 28], 'change': [2025, 1, 22]}, [6761, 948, 0, 5813]), ('additional oracle', {'old': 38640, 'new': 36658, 'start': [2024, 12, 23], 'end': [2025, 1, 22], 'change': [2025, 1, 21]}, [1288, 1222, 0, 66]), ('additional oracle', {'old': 4900, 'new': 9900, 'start': [2024, 6, 18], 'end': [2024, 7, 18], 'change': [2024, 6, 21]}, [4410, 8910, 4500, 0])], [('regression', {'old': 999, 'new': 1999, 'start': [2024, 9, 16], 'end': [2024, 12, 15], 'change': [2024, 12, 10]}, [56, 111, 55, 0]), ('regression', {'old': 4900, 'new': 8489, 'start': [2024, 3, 22], 'end': [2024, 6, 20], 'change': [2024, 4, 18]}, [3430, 5942, 2512, 0]), ('partial-repair probe', {'old': 4900, 'new': 9900, 'start': [2024, 1, 10], 'end': [2024, 4, 9], 'change': [2024, 3, 7]}, [1797, 3630, 1833, 0]), ('partial-repair probe', {'old': 34933, 'new': 4900, 'start': [2024, 12, 28], 'end': [2025, 1, 28], 'change': [2025, 1, 22]}, [6761, 948, 0, 5813]), ('additional oracle', {'old': 38640, 'new': 36658, 'start': [2024, 12, 23], 'end': [2025, 1, 22], 'change': [2025, 1, 21]}, [1288, 1222, 0, 66]), ('additional oracle', {'old': 4900, 'new': 9900, 'start': [2024, 6, 18], 'end': [2024, 7, 18], 'change': [2024, 6, 21]}, [4410, 8910, 4500, 0]), ('additional oracle', {'old': 999, 'new': 4900, 'start': [2025, 1, 22], 'end': [2025, 4, 22], 'change': [2025, 3, 8]}, [500, 2450, 1950, 0])], [('regression', {'old': 4900, 'new': 8489, 'start': [2024, 3, 22], 'end': [2024, 6, 20], 'change': [2024, 4, 18]}, [3430, 5942, 2512, 0]), ('regression', {'old': 4900, 'new': 9900, 'start': [2024, 1, 10], 'end': [2024, 4, 9], 'change': [2024, 3, 7]}, [1797, 3630, 1833, 0]), ('partial-repair probe', {'old': 38640, 'new': 36658, 'start': [2024, 12, 23], 'end': [2025, 1, 22], 'change': [2025, 1, 21]}, [1288, 1222, 0, 66]), ('partial-repair probe', {'old': 4900, 'new': 9900, 'start': [2024, 6, 18], 'end': [2024, 7, 18], 'change': [2024, 6, 21]}, [4410, 8910, 4500, 0]), ('additional oracle', {'old': 34933, 'new': 4900, 'start': [2024, 12, 28], 'end': [2025, 1, 28], 'change': [2025, 1, 22]}, [6761, 948, 0, 5813]), ('additional oracle', {'old': 999, 'new': 4900, 'start': [2025, 1, 22], 'end': [2025, 4, 22], 'change': [2025, 3, 8]}, [500, 2450, 1950, 0]), ('additional oracle', {'old': 7276, 'new': 43371, 'start': [2024, 5, 21], 'end': [2024, 8, 19], 'change': [2024, 6, 13]}, [5417, 32287, 26870, 0])], [('regression', {'old': 4900, 'new': 9900, 'start': [2024, 1, 10], 'end': [2024, 4, 9], 'change': [2024, 3, 7]}, [1797, 3630, 1833, 0]), ('regression', {'old': 34933, 'new': 4900, 'start': [2024, 12, 28], 'end': [2025, 1, 28], 'change': [2025, 1, 22]}, [6761, 948, 0, 5813]), ('partial-repair probe', {'old': 999, 'new': 4900, 'start': [2025, 1, 22], 'end': [2025, 4, 22], 'change': [2025, 3, 8]}, [500, 2450, 1950, 0]), ('partial-repair probe', {'old': 7276, 'new': 43371, 'start': [2024, 5, 21], 'end': [2024, 8, 19], 'change': [2024, 6, 13]}, [5417, 32287, 26870, 0]), ('additional oracle', {'old': 38640, 'new': 36658, 'start': [2024, 12, 23], 'end': [2025, 1, 22], 'change': [2025, 1, 21]}, [1288, 1222, 0, 66]), ('additional oracle', {'old': 4900, 'new': 9900, 'start': [2024, 6, 18], 'end': [2024, 7, 18], 'change': [2024, 6, 21]}, [4410, 8910, 4500, 0]), ('additional oracle', {'old': 4900, 'new': 14973, 'start': [2025, 4, 11], 'end': [2025, 5, 10], 'change': [2025, 4, 17]}, [3886, 11875, 7989, 0])]]
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression 0 | [172, 345, 173, 0] | [178, 357, 179, 0] | Failed |
| regression 1 | [4825, 800, 0, 4025] | [4992, 827, 0, 4165] | Failed |
| partial-repair probe 2 | [55, 110, 55, 0] | [56, 111, 55, 0] | Failed |
| partial-repair probe 3 | [3392, 5877, 2485, 0] | [3430, 5942, 2512, 0] | Failed |
| additional oracle 4 | [1777, 3590, 1813, 0] | [1797, 3630, 1833, 0] | Failed |
| additional oracle 5 | [6550, 919, 0, 5631] | [6761, 948, 0, 5813] | Failed |
| additional oracle 6 | [1246, 1183, 0, 63] | [1288, 1222, 0, 66] | Failed |
SHA-256 / 992779eb5667b763982609d0e72a85b8ac075073ebef6ce1bada72e88c4288e0
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):
s = datetime.date(*x['start'])
e = datetime.date(*x['end'])
c = datetime.date(*x['change'])
total = (e - s).days
remaining = (e - c).days
def pr(p):
return (p * remaining * 2 + total) // (2 * total)
credit = pr(x['old'])
charge = pr(x['new'])
net = charge - credit
return [credit, charge, max(0, net), max(0, -net)]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression', {'old': 999, 'new': 1999, 'start': [2023, 10, 16], 'end': [2023, 11, 13], 'change': [2023, 11, 8]}, [178, 357, 179, 0]), ('regression', {'old': 12063, 'new': 1999, 'start': [2024, 10, 16], 'end': [2024, 11, 14], 'change': [2024, 11, 2]}, [4992, 827, 0, 4165]), ('partial-repair probe', {'old': 999, 'new': 1999, 'start': [2024, 9, 16], 'end': [2024, 12, 15], 'change': [2024, 12, 10]}, [56, 111, 55, 0]), ('partial-repair probe', {'old': 4900, 'new': 8489, 'start': [2024, 3, 22], 'end': [2024, 6, 20], 'change': [2024, 4, 18]}, [3430, 5942, 2512, 0]), ('additional oracle', {'old': 4900, 'new': 9900, 'start': [2024, 1, 10], 'end': [2024, 4, 9], 'change': [2024, 3, 7]}, [1797, 3630, 1833, 0]), ('additional oracle', {'old': 34933, 'new': 4900, 'start': [2024, 12, 28], 'end': [2025, 1, 28], 'change': [2025, 1, 22]}, [6761, 948, 0, 5813]), ('additional oracle', {'old': 38640, 'new': 36658, 'start': [2024, 12, 23], 'end': [2025, 1, 22], 'change': [2025, 1, 21]}, [1288, 1222, 0, 66])], [('regression', {'old': 12063, 'new': 1999, 'start': [2024, 10, 16], 'end': [2024, 11, 14], 'change': [2024, 11, 2]}, [4992, 827, 0, 4165]), ('regression', {'old': 999, 'new': 1999, 'start': [2024, 9, 16], 'end': [2024, 12, 15], 'change': [2024, 12, 10]}, [56, 111, 55, 0]), ('partial-repair probe', {'old': 4900, 'new': 8489, 'start': [2024, 3, 22], 'end': [2024, 6, 20], 'change': [2024, 4, 18]}, [3430, 5942, 2512, 0]), ('partial-repair probe', {'old': 4900, 'new': 9900, 'start': [2024, 1, 10], 'end': [2024, 4, 9], 'change': [2024, 3, 7]}, [1797, 3630, 1833, 0]), ('additional oracle', {'old': 34933, 'new': 4900, 'start': [2024, 12, 28], 'end': [2025, 1, 28], 'change': [2025, 1, 22]}, [6761, 948, 0, 5813]), ('additional oracle', {'old': 38640, 'new': 36658, 'start': [2024, 12, 23], 'end': [2025, 1, 22], 'change': [2025, 1, 21]}, [1288, 1222, 0, 66]), ('additional oracle', {'old': 4900, 'new': 9900, 'start': [2024, 6, 18], 'end': [2024, 7, 18], 'change': [2024, 6, 21]}, [4410, 8910, 4500, 0])], [('regression', {'old': 999, 'new': 1999, 'start': [2024, 9, 16], 'end': [2024, 12, 15], 'change': [2024, 12, 10]}, [56, 111, 55, 0]), ('regression', {'old': 4900, 'new': 8489, 'start': [2024, 3, 22], 'end': [2024, 6, 20], 'change': [2024, 4, 18]}, [3430, 5942, 2512, 0]), ('partial-repair probe', {'old': 4900, 'new': 9900, 'start': [2024, 1, 10], 'end': [2024, 4, 9], 'change': [2024, 3, 7]}, [1797, 3630, 1833, 0]), ('partial-repair probe', {'old': 34933, 'new': 4900, 'start': [2024, 12, 28], 'end': [2025, 1, 28], 'change': [2025, 1, 22]}, [6761, 948, 0, 5813]), ('additional oracle', {'old': 38640, 'new': 36658, 'start': [2024, 12, 23], 'end': [2025, 1, 22], 'change': [2025, 1, 21]}, [1288, 1222, 0, 66]), ('additional oracle', {'old': 4900, 'new': 9900, 'start': [2024, 6, 18], 'end': [2024, 7, 18], 'change': [2024, 6, 21]}, [4410, 8910, 4500, 0]), ('additional oracle', {'old': 999, 'new': 4900, 'start': [2025, 1, 22], 'end': [2025, 4, 22], 'change': [2025, 3, 8]}, [500, 2450, 1950, 0])], [('regression', {'old': 4900, 'new': 8489, 'start': [2024, 3, 22], 'end': [2024, 6, 20], 'change': [2024, 4, 18]}, [3430, 5942, 2512, 0]), ('regression', {'old': 4900, 'new': 9900, 'start': [2024, 1, 10], 'end': [2024, 4, 9], 'change': [2024, 3, 7]}, [1797, 3630, 1833, 0]), ('partial-repair probe', {'old': 38640, 'new': 36658, 'start': [2024, 12, 23], 'end': [2025, 1, 22], 'change': [2025, 1, 21]}, [1288, 1222, 0, 66]), ('partial-repair probe', {'old': 4900, 'new': 9900, 'start': [2024, 6, 18], 'end': [2024, 7, 18], 'change': [2024, 6, 21]}, [4410, 8910, 4500, 0]), ('additional oracle', {'old': 34933, 'new': 4900, 'start': [2024, 12, 28], 'end': [2025, 1, 28], 'change': [2025, 1, 22]}, [6761, 948, 0, 5813]), ('additional oracle', {'old': 999, 'new': 4900, 'start': [2025, 1, 22], 'end': [2025, 4, 22], 'change': [2025, 3, 8]}, [500, 2450, 1950, 0]), ('additional oracle', {'old': 7276, 'new': 43371, 'start': [2024, 5, 21], 'end': [2024, 8, 19], 'change': [2024, 6, 13]}, [5417, 32287, 26870, 0])], [('regression', {'old': 4900, 'new': 9900, 'start': [2024, 1, 10], 'end': [2024, 4, 9], 'change': [2024, 3, 7]}, [1797, 3630, 1833, 0]), ('regression', {'old': 34933, 'new': 4900, 'start': [2024, 12, 28], 'end': [2025, 1, 28], 'change': [2025, 1, 22]}, [6761, 948, 0, 5813]), ('partial-repair probe', {'old': 999, 'new': 4900, 'start': [2025, 1, 22], 'end': [2025, 4, 22], 'change': [2025, 3, 8]}, [500, 2450, 1950, 0]), ('partial-repair probe', {'old': 7276, 'new': 43371, 'start': [2024, 5, 21], 'end': [2024, 8, 19], 'change': [2024, 6, 13]}, [5417, 32287, 26870, 0]), ('additional oracle', {'old': 38640, 'new': 36658, 'start': [2024, 12, 23], 'end': [2025, 1, 22], 'change': [2025, 1, 21]}, [1288, 1222, 0, 66]), ('additional oracle', {'old': 4900, 'new': 9900, 'start': [2024, 6, 18], 'end': [2024, 7, 18], 'change': [2024, 6, 21]}, [4410, 8910, 4500, 0]), ('additional oracle', {'old': 4900, 'new': 14973, 'start': [2025, 4, 11], 'end': [2025, 5, 10], 'change': [2025, 4, 17]}, [3886, 11875, 7989, 0])]]
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression 0 | [178, 357, 179, 0] | [178, 357, 179, 0] | Passed |
| regression 1 | [4992, 827, 0, 4165] | [4992, 827, 0, 4165] | Passed |
| partial-repair probe 2 | [56, 111, 55, 0] | [56, 111, 55, 0] | Passed |
| partial-repair probe 3 | [3430, 5942, 2512, 0] | [3430, 5942, 2512, 0] | Passed |
| additional oracle 4 | [1797, 3630, 1833, 0] | [1797, 3630, 1833, 0] | Passed |
| additional oracle 5 | [6761, 948, 0, 5813] | [6761, 948, 0, 5813] | Passed |
| additional oracle 6 | [1288, 1222, 0, 66] | [1288, 1222, 0, 66] | Passed |
SHA-256 / b2504556f4f3a66558183a368adb1680e3759dcdd8c4a29e07e2990c1955581c
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:35.484850+00:00.
Case digest / f12d44c6801a449f5d1e811d22e2dc79b1f821daafb19b6eac56e9b58826b68e