FA-59341 / Subscription proration billing / Open access
Daily plan-change proration: remaining day count · case 01
Customers who upgrade are charged and credited for one day fewer than remain in the period.
ROOT CAUSE
The change day itself is excluded from the remaining days although service on the new plan starts that day.
VERIFIED REPAIR
Restore the contract rule at the remaining day count step: use `remaining = (e - c).days`.
Unsuccessful approach: The attempt counts the exclusive period end as a service day, prorating one day too many.
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 = (e - s).days
remaining = (e - c).days - 1
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 | [143, 286, 143, 0] | [178, 357, 179, 0] | Failed |
| regression 1 | [4576, 758, 0, 3818] | [4992, 827, 0, 4165] | Failed |
| partial-repair probe 2 | [44, 89, 45, 0] | [56, 111, 55, 0] | Failed |
| partial-repair probe 3 | [3376, 5848, 2472, 0] | [3430, 5942, 2512, 0] | Failed |
| additional oracle 4 | [1742, 3520, 1778, 0] | [1797, 3630, 1833, 0] | Failed |
| additional oracle 5 | [5634, 790, 0, 4844] | [6761, 948, 0, 5813] | Failed |
| additional oracle 6 | [0, 0, 0, 0] | [1288, 1222, 0, 66] | Failed |
SHA-256 / 1c7c2d49171d25e851a1d32175b65f7943c14ccdcac0710caba50f9b3ac6e694
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
remaining = (e - c).days + 1
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 | [214, 428, 214, 0] | [178, 357, 179, 0] | Failed |
| regression 1 | [5408, 896, 0, 4512] | [4992, 827, 0, 4165] | Failed |
| partial-repair probe 2 | [67, 133, 66, 0] | [56, 111, 55, 0] | Failed |
| partial-repair probe 3 | [3484, 6037, 2553, 0] | [3430, 5942, 2512, 0] | Failed |
| additional oracle 4 | [1851, 3740, 1889, 0] | [1797, 3630, 1833, 0] | Failed |
| additional oracle 5 | [7888, 1106, 0, 6782] | [6761, 948, 0, 5813] | Failed |
| additional oracle 6 | [2576, 2444, 0, 132] | [1288, 1222, 0, 66] | Failed |
SHA-256 / 91b668170d2bbc58a18120364cd07df73be6e792cbafe2345b48e36549987402
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.447918+00:00.
Case digest / 46f28cbb019e959ef5bc83cef4949d30c43c8fcd03d121694c1b4550d2aa4123