FAILURE MAP
← Case archive

FA-59806 / Subscription proration billing / Open access

Renewal price with lock and increase cap: increase cap base · case 01

Renewal increases exceed the promised percentage cap.

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

ROOT CAUSE

The cap is computed from the list price, so it never binds.

VERIFIED REPAIR

Restore the contract rule at the increase cap base step: use `ceiling = x['last_paid'] * (100 + x['cap_pct']) // 100`.

Unsuccessful approach: The attempt adds the percentage as cents to the last price.

Case contract

Input {last_paid, list_price, locked|None, lock_until, renewal_day, cap_pct}. While the lock is active (renewal_day <= lock_until) the target is min(list_price, locked); otherwise list_price. The renewal price is min(target, last_paid*(100+cap_pct)//100). Return cents.

Why this case matters

Grandfathered prices and increase caps protect renewing subscribers; their interplay sets the renewal amount.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    if x['locked'] is not None and x['renewal_day'] <= x['lock_until']:
        target = min(x['list_price'], x['locked'])
    else:
        target = x['list_price']
    ceiling = x['list_price'] * (100 + x['cap_pct']) // 100
    return min(target, ceiling)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression', {'last_paid': 2000, 'list_price': 3312, 'locked': 2500, 'lock_until': 173, 'renewal_day': 173, 'cap_pct': 20}, 2400), ('regression', {'last_paid': 4900, 'list_price': 7407, 'locked': None, 'lock_until': 112, 'renewal_day': 113, 'cap_pct': 5}, 5145), ('partial-repair probe', {'last_paid': 485, 'list_price': 654, 'locked': None, 'lock_until': 58, 'renewal_day': 58, 'cap_pct': 20}, 582), ('partial-repair probe', {'last_paid': 4105, 'list_price': 4394, 'locked': 4005, 'lock_until': 133, 'renewal_day': 322, 'cap_pct': 20}, 4394), ('normal control', {'last_paid': 1000, 'list_price': 1000, 'locked': 1500, 'lock_until': 328, 'renewal_day': 201, 'cap_pct': 20}, 1000), ('normal control', {'last_paid': 4900, 'list_price': 4900, 'locked': None, 'lock_until': 83, 'renewal_day': 100, 'cap_pct': 20}, 4900), ('normal control', {'last_paid': 222, 'list_price': 222, 'locked': 222, 'lock_until': 231, 'renewal_day': 231, 'cap_pct': 5}, 222), ('normal control', {'last_paid': 4217, 'list_price': 4172, 'locked': 4217, 'lock_until': 1, 'renewal_day': 2, 'cap_pct': 0}, 4172)], [('regression', {'last_paid': 4900, 'list_price': 7407, 'locked': None, 'lock_until': 112, 'renewal_day': 113, 'cap_pct': 5}, 5145), ('regression', {'last_paid': 485, 'list_price': 654, 'locked': None, 'lock_until': 58, 'renewal_day': 58, 'cap_pct': 20}, 582), ('partial-repair probe', {'last_paid': 4105, 'list_price': 4394, 'locked': 4005, 'lock_until': 133, 'renewal_day': 322, 'cap_pct': 20}, 4394), ('partial-repair probe', {'last_paid': 4900, 'list_price': 5180, 'locked': 4900, 'lock_until': 0, 'renewal_day': 66, 'cap_pct': 20}, 5180), ('normal control', {'last_paid': 4900, 'list_price': 4441, 'locked': 4900, 'lock_until': 309, 'renewal_day': 310, 'cap_pct': 0}, 4441), ('normal control', {'last_paid': 2000, 'list_price': 2000, 'locked': 2000, 'lock_until': 91, 'renewal_day': 92, 'cap_pct': 5}, 2000), ('normal control', {'last_paid': 4900, 'list_price': 4900, 'locked': 4900, 'lock_until': 26, 'renewal_day': 27, 'cap_pct': 5}, 4900), ('normal control', {'last_paid': 1219, 'list_price': 1057, 'locked': 1119, 'lock_until': 293, 'renewal_day': 294, 'cap_pct': 10}, 1057)], [('regression', {'last_paid': 485, 'list_price': 654, 'locked': None, 'lock_until': 58, 'renewal_day': 58, 'cap_pct': 20}, 582), ('regression', {'last_paid': 2000, 'list_price': 3222, 'locked': 2500, 'lock_until': 57, 'renewal_day': 260, 'cap_pct': 0}, 2000), ('partial-repair probe', {'last_paid': 4900, 'list_price': 5180, 'locked': 4900, 'lock_until': 0, 'renewal_day': 66, 'cap_pct': 20}, 5180), ('partial-repair probe', {'last_paid': 2000, 'list_price': 2438, 'locked': 2500, 'lock_until': 146, 'renewal_day': 147, 'cap_pct': 20}, 2400), ('normal control', {'last_paid': 1000, 'list_price': 1000, 'locked': 1000, 'lock_until': 85, 'renewal_day': 85, 'cap_pct': 20}, 1000), ('normal control', {'last_paid': 1000, 'list_price': 1000, 'locked': 1500, 'lock_until': 110, 'renewal_day': 262, 'cap_pct': 10}, 1000), ('normal control', {'last_paid': 7522, 'list_price': 7059, 'locked': 8022, 'lock_until': 19, 'renewal_day': 388, 'cap_pct': 20}, 7059), ('normal control', {'last_paid': 2000, 'list_price': 2000, 'locked': None, 'lock_until': 285, 'renewal_day': 285, 'cap_pct': 20}, 2000)], [('regression', {'last_paid': 2000, 'list_price': 2438, 'locked': 2500, 'lock_until': 146, 'renewal_day': 147, 'cap_pct': 20}, 2400), ('regression', {'last_paid': 2000, 'list_price': 3222, 'locked': 2500, 'lock_until': 57, 'renewal_day': 260, 'cap_pct': 0}, 2000), ('partial-repair probe', {'last_paid': 2000, 'list_price': 3442, 'locked': 2000, 'lock_until': 83, 'renewal_day': 84, 'cap_pct': 5}, 2100), ('partial-repair probe', {'last_paid': 2000, 'list_price': 4561, 'locked': 1900, 'lock_until': 96, 'renewal_day': 97, 'cap_pct': 20}, 2400), ('normal control', {'last_paid': 6548, 'list_price': 6483, 'locked': 6448, 'lock_until': 196, 'renewal_day': 196, 'cap_pct': 5}, 6448), ('normal control', {'last_paid': 2000, 'list_price': 2000, 'locked': None, 'lock_until': 173, 'renewal_day': 263, 'cap_pct': 5}, 2000), ('normal control', {'last_paid': 2000, 'list_price': 2000, 'locked': 2500, 'lock_until': 167, 'renewal_day': 167, 'cap_pct': 10}, 2000), ('normal control', {'last_paid': 4900, 'list_price': 4900, 'locked': 5400, 'lock_until': 208, 'renewal_day': 260, 'cap_pct': 5}, 4900)], [('regression', {'last_paid': 2000, 'list_price': 3442, 'locked': 2000, 'lock_until': 83, 'renewal_day': 84, 'cap_pct': 5}, 2100), ('regression', {'last_paid': 2000, 'list_price': 2438, 'locked': 2500, 'lock_until': 146, 'renewal_day': 147, 'cap_pct': 20}, 2400), ('partial-repair probe', {'last_paid': 1000, 'list_price': 1465, 'locked': None, 'lock_until': 310, 'renewal_day': 310, 'cap_pct': 5}, 1050), ('partial-repair probe', {'last_paid': 4984, 'list_price': 7349, 'locked': 4984, 'lock_until': 94, 'renewal_day': 95, 'cap_pct': 20}, 5980), ('normal control', {'last_paid': 4900, 'list_price': 4900, 'locked': 5400, 'lock_until': 345, 'renewal_day': 345, 'cap_pct': 5}, 4900), ('normal control', {'last_paid': 1000, 'list_price': 754, 'locked': 900, 'lock_until': 155, 'renewal_day': 206, 'cap_pct': 10}, 754), ('normal control', {'last_paid': 2000, 'list_price': 3042, 'locked': 1900, 'lock_until': 55, 'renewal_day': 55, 'cap_pct': 5}, 1900), ('normal control', {'last_paid': 2000, 'list_price': 1532, 'locked': 2000, 'lock_until': 313, 'renewal_day': 57, 'cap_pct': 20}, 1532)]]
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 025002400Failed
regression 174075145Failed
partial-repair probe 2654582Failed
partial-repair probe 343944394Passed
normal control 410001000Passed
normal control 549004900Passed
normal control 6222222Passed
normal control 741724172Passed

SHA-256 / 0f9156ba88af9ab85d236579cd3a38d982e39bc5cd03baa6b2a87d7c91edc3f2

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    if x['locked'] is not None and x['renewal_day'] <= x['lock_until']:
        target = min(x['list_price'], x['locked'])
    else:
        target = x['list_price']
    ceiling = x['last_paid'] + x['cap_pct']
    return min(target, ceiling)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression', {'last_paid': 2000, 'list_price': 3312, 'locked': 2500, 'lock_until': 173, 'renewal_day': 173, 'cap_pct': 20}, 2400), ('regression', {'last_paid': 4900, 'list_price': 7407, 'locked': None, 'lock_until': 112, 'renewal_day': 113, 'cap_pct': 5}, 5145), ('partial-repair probe', {'last_paid': 485, 'list_price': 654, 'locked': None, 'lock_until': 58, 'renewal_day': 58, 'cap_pct': 20}, 582), ('partial-repair probe', {'last_paid': 4105, 'list_price': 4394, 'locked': 4005, 'lock_until': 133, 'renewal_day': 322, 'cap_pct': 20}, 4394), ('normal control', {'last_paid': 1000, 'list_price': 1000, 'locked': 1500, 'lock_until': 328, 'renewal_day': 201, 'cap_pct': 20}, 1000), ('normal control', {'last_paid': 4900, 'list_price': 4900, 'locked': None, 'lock_until': 83, 'renewal_day': 100, 'cap_pct': 20}, 4900), ('normal control', {'last_paid': 222, 'list_price': 222, 'locked': 222, 'lock_until': 231, 'renewal_day': 231, 'cap_pct': 5}, 222), ('normal control', {'last_paid': 4217, 'list_price': 4172, 'locked': 4217, 'lock_until': 1, 'renewal_day': 2, 'cap_pct': 0}, 4172)], [('regression', {'last_paid': 4900, 'list_price': 7407, 'locked': None, 'lock_until': 112, 'renewal_day': 113, 'cap_pct': 5}, 5145), ('regression', {'last_paid': 485, 'list_price': 654, 'locked': None, 'lock_until': 58, 'renewal_day': 58, 'cap_pct': 20}, 582), ('partial-repair probe', {'last_paid': 4105, 'list_price': 4394, 'locked': 4005, 'lock_until': 133, 'renewal_day': 322, 'cap_pct': 20}, 4394), ('partial-repair probe', {'last_paid': 4900, 'list_price': 5180, 'locked': 4900, 'lock_until': 0, 'renewal_day': 66, 'cap_pct': 20}, 5180), ('normal control', {'last_paid': 4900, 'list_price': 4441, 'locked': 4900, 'lock_until': 309, 'renewal_day': 310, 'cap_pct': 0}, 4441), ('normal control', {'last_paid': 2000, 'list_price': 2000, 'locked': 2000, 'lock_until': 91, 'renewal_day': 92, 'cap_pct': 5}, 2000), ('normal control', {'last_paid': 4900, 'list_price': 4900, 'locked': 4900, 'lock_until': 26, 'renewal_day': 27, 'cap_pct': 5}, 4900), ('normal control', {'last_paid': 1219, 'list_price': 1057, 'locked': 1119, 'lock_until': 293, 'renewal_day': 294, 'cap_pct': 10}, 1057)], [('regression', {'last_paid': 485, 'list_price': 654, 'locked': None, 'lock_until': 58, 'renewal_day': 58, 'cap_pct': 20}, 582), ('regression', {'last_paid': 2000, 'list_price': 3222, 'locked': 2500, 'lock_until': 57, 'renewal_day': 260, 'cap_pct': 0}, 2000), ('partial-repair probe', {'last_paid': 4900, 'list_price': 5180, 'locked': 4900, 'lock_until': 0, 'renewal_day': 66, 'cap_pct': 20}, 5180), ('partial-repair probe', {'last_paid': 2000, 'list_price': 2438, 'locked': 2500, 'lock_until': 146, 'renewal_day': 147, 'cap_pct': 20}, 2400), ('normal control', {'last_paid': 1000, 'list_price': 1000, 'locked': 1000, 'lock_until': 85, 'renewal_day': 85, 'cap_pct': 20}, 1000), ('normal control', {'last_paid': 1000, 'list_price': 1000, 'locked': 1500, 'lock_until': 110, 'renewal_day': 262, 'cap_pct': 10}, 1000), ('normal control', {'last_paid': 7522, 'list_price': 7059, 'locked': 8022, 'lock_until': 19, 'renewal_day': 388, 'cap_pct': 20}, 7059), ('normal control', {'last_paid': 2000, 'list_price': 2000, 'locked': None, 'lock_until': 285, 'renewal_day': 285, 'cap_pct': 20}, 2000)], [('regression', {'last_paid': 2000, 'list_price': 2438, 'locked': 2500, 'lock_until': 146, 'renewal_day': 147, 'cap_pct': 20}, 2400), ('regression', {'last_paid': 2000, 'list_price': 3222, 'locked': 2500, 'lock_until': 57, 'renewal_day': 260, 'cap_pct': 0}, 2000), ('partial-repair probe', {'last_paid': 2000, 'list_price': 3442, 'locked': 2000, 'lock_until': 83, 'renewal_day': 84, 'cap_pct': 5}, 2100), ('partial-repair probe', {'last_paid': 2000, 'list_price': 4561, 'locked': 1900, 'lock_until': 96, 'renewal_day': 97, 'cap_pct': 20}, 2400), ('normal control', {'last_paid': 6548, 'list_price': 6483, 'locked': 6448, 'lock_until': 196, 'renewal_day': 196, 'cap_pct': 5}, 6448), ('normal control', {'last_paid': 2000, 'list_price': 2000, 'locked': None, 'lock_until': 173, 'renewal_day': 263, 'cap_pct': 5}, 2000), ('normal control', {'last_paid': 2000, 'list_price': 2000, 'locked': 2500, 'lock_until': 167, 'renewal_day': 167, 'cap_pct': 10}, 2000), ('normal control', {'last_paid': 4900, 'list_price': 4900, 'locked': 5400, 'lock_until': 208, 'renewal_day': 260, 'cap_pct': 5}, 4900)], [('regression', {'last_paid': 2000, 'list_price': 3442, 'locked': 2000, 'lock_until': 83, 'renewal_day': 84, 'cap_pct': 5}, 2100), ('regression', {'last_paid': 2000, 'list_price': 2438, 'locked': 2500, 'lock_until': 146, 'renewal_day': 147, 'cap_pct': 20}, 2400), ('partial-repair probe', {'last_paid': 1000, 'list_price': 1465, 'locked': None, 'lock_until': 310, 'renewal_day': 310, 'cap_pct': 5}, 1050), ('partial-repair probe', {'last_paid': 4984, 'list_price': 7349, 'locked': 4984, 'lock_until': 94, 'renewal_day': 95, 'cap_pct': 20}, 5980), ('normal control', {'last_paid': 4900, 'list_price': 4900, 'locked': 5400, 'lock_until': 345, 'renewal_day': 345, 'cap_pct': 5}, 4900), ('normal control', {'last_paid': 1000, 'list_price': 754, 'locked': 900, 'lock_until': 155, 'renewal_day': 206, 'cap_pct': 10}, 754), ('normal control', {'last_paid': 2000, 'list_price': 3042, 'locked': 1900, 'lock_until': 55, 'renewal_day': 55, 'cap_pct': 5}, 1900), ('normal control', {'last_paid': 2000, 'list_price': 1532, 'locked': 2000, 'lock_until': 313, 'renewal_day': 57, 'cap_pct': 20}, 1532)]]
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 020202400Failed
regression 149055145Failed
partial-repair probe 2505582Failed
partial-repair probe 341254394Failed
normal control 410001000Passed
normal control 549004900Passed
normal control 6222222Passed
normal control 741724172Passed

SHA-256 / 248672a0e0ba67b14f93c0a73f6715b8b2cafd7ab013fa21eb603a83261eea74

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    if x['locked'] is not None and x['renewal_day'] <= x['lock_until']:
        target = min(x['list_price'], x['locked'])
    else:
        target = x['list_price']
    ceiling = x['last_paid'] * (100 + x['cap_pct']) // 100
    return min(target, ceiling)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression', {'last_paid': 2000, 'list_price': 3312, 'locked': 2500, 'lock_until': 173, 'renewal_day': 173, 'cap_pct': 20}, 2400), ('regression', {'last_paid': 4900, 'list_price': 7407, 'locked': None, 'lock_until': 112, 'renewal_day': 113, 'cap_pct': 5}, 5145), ('partial-repair probe', {'last_paid': 485, 'list_price': 654, 'locked': None, 'lock_until': 58, 'renewal_day': 58, 'cap_pct': 20}, 582), ('partial-repair probe', {'last_paid': 4105, 'list_price': 4394, 'locked': 4005, 'lock_until': 133, 'renewal_day': 322, 'cap_pct': 20}, 4394), ('normal control', {'last_paid': 1000, 'list_price': 1000, 'locked': 1500, 'lock_until': 328, 'renewal_day': 201, 'cap_pct': 20}, 1000), ('normal control', {'last_paid': 4900, 'list_price': 4900, 'locked': None, 'lock_until': 83, 'renewal_day': 100, 'cap_pct': 20}, 4900), ('normal control', {'last_paid': 222, 'list_price': 222, 'locked': 222, 'lock_until': 231, 'renewal_day': 231, 'cap_pct': 5}, 222), ('normal control', {'last_paid': 4217, 'list_price': 4172, 'locked': 4217, 'lock_until': 1, 'renewal_day': 2, 'cap_pct': 0}, 4172)], [('regression', {'last_paid': 4900, 'list_price': 7407, 'locked': None, 'lock_until': 112, 'renewal_day': 113, 'cap_pct': 5}, 5145), ('regression', {'last_paid': 485, 'list_price': 654, 'locked': None, 'lock_until': 58, 'renewal_day': 58, 'cap_pct': 20}, 582), ('partial-repair probe', {'last_paid': 4105, 'list_price': 4394, 'locked': 4005, 'lock_until': 133, 'renewal_day': 322, 'cap_pct': 20}, 4394), ('partial-repair probe', {'last_paid': 4900, 'list_price': 5180, 'locked': 4900, 'lock_until': 0, 'renewal_day': 66, 'cap_pct': 20}, 5180), ('normal control', {'last_paid': 4900, 'list_price': 4441, 'locked': 4900, 'lock_until': 309, 'renewal_day': 310, 'cap_pct': 0}, 4441), ('normal control', {'last_paid': 2000, 'list_price': 2000, 'locked': 2000, 'lock_until': 91, 'renewal_day': 92, 'cap_pct': 5}, 2000), ('normal control', {'last_paid': 4900, 'list_price': 4900, 'locked': 4900, 'lock_until': 26, 'renewal_day': 27, 'cap_pct': 5}, 4900), ('normal control', {'last_paid': 1219, 'list_price': 1057, 'locked': 1119, 'lock_until': 293, 'renewal_day': 294, 'cap_pct': 10}, 1057)], [('regression', {'last_paid': 485, 'list_price': 654, 'locked': None, 'lock_until': 58, 'renewal_day': 58, 'cap_pct': 20}, 582), ('regression', {'last_paid': 2000, 'list_price': 3222, 'locked': 2500, 'lock_until': 57, 'renewal_day': 260, 'cap_pct': 0}, 2000), ('partial-repair probe', {'last_paid': 4900, 'list_price': 5180, 'locked': 4900, 'lock_until': 0, 'renewal_day': 66, 'cap_pct': 20}, 5180), ('partial-repair probe', {'last_paid': 2000, 'list_price': 2438, 'locked': 2500, 'lock_until': 146, 'renewal_day': 147, 'cap_pct': 20}, 2400), ('normal control', {'last_paid': 1000, 'list_price': 1000, 'locked': 1000, 'lock_until': 85, 'renewal_day': 85, 'cap_pct': 20}, 1000), ('normal control', {'last_paid': 1000, 'list_price': 1000, 'locked': 1500, 'lock_until': 110, 'renewal_day': 262, 'cap_pct': 10}, 1000), ('normal control', {'last_paid': 7522, 'list_price': 7059, 'locked': 8022, 'lock_until': 19, 'renewal_day': 388, 'cap_pct': 20}, 7059), ('normal control', {'last_paid': 2000, 'list_price': 2000, 'locked': None, 'lock_until': 285, 'renewal_day': 285, 'cap_pct': 20}, 2000)], [('regression', {'last_paid': 2000, 'list_price': 2438, 'locked': 2500, 'lock_until': 146, 'renewal_day': 147, 'cap_pct': 20}, 2400), ('regression', {'last_paid': 2000, 'list_price': 3222, 'locked': 2500, 'lock_until': 57, 'renewal_day': 260, 'cap_pct': 0}, 2000), ('partial-repair probe', {'last_paid': 2000, 'list_price': 3442, 'locked': 2000, 'lock_until': 83, 'renewal_day': 84, 'cap_pct': 5}, 2100), ('partial-repair probe', {'last_paid': 2000, 'list_price': 4561, 'locked': 1900, 'lock_until': 96, 'renewal_day': 97, 'cap_pct': 20}, 2400), ('normal control', {'last_paid': 6548, 'list_price': 6483, 'locked': 6448, 'lock_until': 196, 'renewal_day': 196, 'cap_pct': 5}, 6448), ('normal control', {'last_paid': 2000, 'list_price': 2000, 'locked': None, 'lock_until': 173, 'renewal_day': 263, 'cap_pct': 5}, 2000), ('normal control', {'last_paid': 2000, 'list_price': 2000, 'locked': 2500, 'lock_until': 167, 'renewal_day': 167, 'cap_pct': 10}, 2000), ('normal control', {'last_paid': 4900, 'list_price': 4900, 'locked': 5400, 'lock_until': 208, 'renewal_day': 260, 'cap_pct': 5}, 4900)], [('regression', {'last_paid': 2000, 'list_price': 3442, 'locked': 2000, 'lock_until': 83, 'renewal_day': 84, 'cap_pct': 5}, 2100), ('regression', {'last_paid': 2000, 'list_price': 2438, 'locked': 2500, 'lock_until': 146, 'renewal_day': 147, 'cap_pct': 20}, 2400), ('partial-repair probe', {'last_paid': 1000, 'list_price': 1465, 'locked': None, 'lock_until': 310, 'renewal_day': 310, 'cap_pct': 5}, 1050), ('partial-repair probe', {'last_paid': 4984, 'list_price': 7349, 'locked': 4984, 'lock_until': 94, 'renewal_day': 95, 'cap_pct': 20}, 5980), ('normal control', {'last_paid': 4900, 'list_price': 4900, 'locked': 5400, 'lock_until': 345, 'renewal_day': 345, 'cap_pct': 5}, 4900), ('normal control', {'last_paid': 1000, 'list_price': 754, 'locked': 900, 'lock_until': 155, 'renewal_day': 206, 'cap_pct': 10}, 754), ('normal control', {'last_paid': 2000, 'list_price': 3042, 'locked': 1900, 'lock_until': 55, 'renewal_day': 55, 'cap_pct': 5}, 1900), ('normal control', {'last_paid': 2000, 'list_price': 1532, 'locked': 2000, 'lock_until': 313, 'renewal_day': 57, 'cap_pct': 20}, 1532)]]
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 024002400Passed
regression 151455145Passed
partial-repair probe 2582582Passed
partial-repair probe 343944394Passed
normal control 410001000Passed
normal control 549004900Passed
normal control 6222222Passed
normal control 741724172Passed

SHA-256 / 71868d0262154afe8d45d1beb54ae58d1a1cfe024ecb2383bbde3a04cbe278a6

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

Case digest / 9996de41cc6c7e9cfd7295e0e73d4a5ac05e36f02b8251466ade0a711cb3d242