FAILURE MAP
← Case archive

FA-59801 / Subscription proration billing / Open access

Renewal price with lock and increase cap: lock never raises price · case 01

When list prices drop below the locked price, locked customers pay more than new customers.

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

ROOT CAUSE

The locked price is used even when the list price is lower.

VERIFIED REPAIR

Restore the contract rule at the lock never raises price step: use `target = min(x['list_price'], x['locked'])`.

Unsuccessful approach: The attempt takes the higher of the two prices.

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 = 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': 1000, 'list_price': 1000, 'locked': 1500, 'lock_until': 328, 'renewal_day': 201, 'cap_pct': 20}, 1000), ('regression', {'last_paid': 2000, 'list_price': 2000, 'locked': 2500, 'lock_until': 167, 'renewal_day': 167, 'cap_pct': 10}, 2000), ('partial-repair probe', {'last_paid': 6548, 'list_price': 6483, 'locked': 6448, 'lock_until': 196, 'renewal_day': 196, 'cap_pct': 5}, 6448), ('partial-repair probe', {'last_paid': 4900, 'list_price': 4900, 'locked': 5400, 'lock_until': 345, 'renewal_day': 345, 'cap_pct': 5}, 4900), ('normal control', {'last_paid': 2000, 'list_price': 3312, 'locked': 2500, 'lock_until': 173, 'renewal_day': 173, 'cap_pct': 20}, 2400), ('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': 2000, 'list_price': 2000, 'locked': 2500, 'lock_until': 167, 'renewal_day': 167, 'cap_pct': 10}, 2000), ('regression', {'last_paid': 4900, 'list_price': 4900, 'locked': 5400, 'lock_until': 345, 'renewal_day': 345, 'cap_pct': 5}, 4900), ('partial-repair probe', {'last_paid': 2000, 'list_price': 3042, 'locked': 1900, 'lock_until': 55, 'renewal_day': 55, 'cap_pct': 5}, 1900), ('partial-repair probe', {'last_paid': 2000, 'list_price': 1532, 'locked': 2000, 'lock_until': 313, 'renewal_day': 57, 'cap_pct': 20}, 1532), ('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': 4900, 'list_price': 7407, 'locked': None, 'lock_until': 112, 'renewal_day': 113, 'cap_pct': 5}, 5145)], [('regression', {'last_paid': 4900, 'list_price': 4900, 'locked': 5400, 'lock_until': 345, 'renewal_day': 345, 'cap_pct': 5}, 4900), ('regression', {'last_paid': 2000, 'list_price': 1532, 'locked': 2000, 'lock_until': 313, 'renewal_day': 57, 'cap_pct': 20}, 1532), ('partial-repair probe', {'last_paid': 2000, 'list_price': 3042, 'locked': 1900, 'lock_until': 55, 'renewal_day': 55, 'cap_pct': 5}, 1900), ('partial-repair probe', {'last_paid': 5437, 'list_price': 5507, 'locked': 5337, 'lock_until': 225, 'renewal_day': 225, 'cap_pct': 5}, 5337), ('normal control', {'last_paid': 485, 'list_price': 654, 'locked': None, 'lock_until': 58, 'renewal_day': 58, 'cap_pct': 20}, 582), ('normal control', {'last_paid': 1219, 'list_price': 1057, 'locked': 1119, 'lock_until': 293, 'renewal_day': 294, 'cap_pct': 10}, 1057), ('normal control', {'last_paid': 1000, 'list_price': 1000, 'locked': 1000, 'lock_until': 85, 'renewal_day': 85, 'cap_pct': 20}, 1000), ('normal control', {'last_paid': 2000, 'list_price': 3222, 'locked': 2500, 'lock_until': 57, 'renewal_day': 260, 'cap_pct': 0}, 2000)], [('regression', {'last_paid': 2000, 'list_price': 1532, 'locked': 2000, 'lock_until': 313, 'renewal_day': 57, 'cap_pct': 20}, 1532), ('regression', {'last_paid': 2000, 'list_price': 1999, 'locked': 2500, 'lock_until': 365, 'renewal_day': 365, 'cap_pct': 20}, 1999), ('partial-repair probe', {'last_paid': 5437, 'list_price': 5507, 'locked': 5337, 'lock_until': 225, 'renewal_day': 225, 'cap_pct': 5}, 5337), ('partial-repair probe', {'last_paid': 2000, 'list_price': 3888, 'locked': 2000, 'lock_until': 333, 'renewal_day': 333, 'cap_pct': 10}, 2000), ('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), ('normal control', {'last_paid': 2000, 'list_price': 2000, 'locked': None, 'lock_until': 173, 'renewal_day': 263, 'cap_pct': 5}, 2000)], [('regression', {'last_paid': 2000, 'list_price': 1999, 'locked': 2500, 'lock_until': 365, 'renewal_day': 365, 'cap_pct': 20}, 1999), ('regression', {'last_paid': 4900, 'list_price': 4767, 'locked': 5400, 'lock_until': 335, 'renewal_day': 32, 'cap_pct': 10}, 4767), ('partial-repair probe', {'last_paid': 2000, 'list_price': 3888, 'locked': 2000, 'lock_until': 333, 'renewal_day': 333, 'cap_pct': 10}, 2000), ('partial-repair probe', {'last_paid': 6192, 'list_price': 7798, 'locked': 6092, 'lock_until': 169, 'renewal_day': 157, 'cap_pct': 0}, 6092), ('normal control', {'last_paid': 4105, 'list_price': 4394, 'locked': 4005, 'lock_until': 133, 'renewal_day': 322, 'cap_pct': 20}, 4394), ('normal control', {'last_paid': 4900, 'list_price': 5180, 'locked': 4900, 'lock_until': 0, 'renewal_day': 66, 'cap_pct': 20}, 5180), ('normal control', {'last_paid': 2000, 'list_price': 2438, 'locked': 2500, 'lock_until': 146, 'renewal_day': 147, 'cap_pct': 20}, 2400), ('normal control', {'last_paid': 4900, 'list_price': 4900, 'locked': 5400, 'lock_until': 208, 'renewal_day': 260, 'cap_pct': 5}, 4900)]]
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 012001000Failed
regression 122002000Failed
partial-repair probe 264486448Passed
partial-repair probe 351454900Failed
normal control 424002400Passed
normal control 549004900Passed
normal control 6222222Passed
normal control 741724172Passed

SHA-256 / 993c87bbf6b50bf719cea63bacc7db246a92ee3ee9337f8898fcda3054c8215a

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 = max(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': 1000, 'list_price': 1000, 'locked': 1500, 'lock_until': 328, 'renewal_day': 201, 'cap_pct': 20}, 1000), ('regression', {'last_paid': 2000, 'list_price': 2000, 'locked': 2500, 'lock_until': 167, 'renewal_day': 167, 'cap_pct': 10}, 2000), ('partial-repair probe', {'last_paid': 6548, 'list_price': 6483, 'locked': 6448, 'lock_until': 196, 'renewal_day': 196, 'cap_pct': 5}, 6448), ('partial-repair probe', {'last_paid': 4900, 'list_price': 4900, 'locked': 5400, 'lock_until': 345, 'renewal_day': 345, 'cap_pct': 5}, 4900), ('normal control', {'last_paid': 2000, 'list_price': 3312, 'locked': 2500, 'lock_until': 173, 'renewal_day': 173, 'cap_pct': 20}, 2400), ('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': 2000, 'list_price': 2000, 'locked': 2500, 'lock_until': 167, 'renewal_day': 167, 'cap_pct': 10}, 2000), ('regression', {'last_paid': 4900, 'list_price': 4900, 'locked': 5400, 'lock_until': 345, 'renewal_day': 345, 'cap_pct': 5}, 4900), ('partial-repair probe', {'last_paid': 2000, 'list_price': 3042, 'locked': 1900, 'lock_until': 55, 'renewal_day': 55, 'cap_pct': 5}, 1900), ('partial-repair probe', {'last_paid': 2000, 'list_price': 1532, 'locked': 2000, 'lock_until': 313, 'renewal_day': 57, 'cap_pct': 20}, 1532), ('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': 4900, 'list_price': 7407, 'locked': None, 'lock_until': 112, 'renewal_day': 113, 'cap_pct': 5}, 5145)], [('regression', {'last_paid': 4900, 'list_price': 4900, 'locked': 5400, 'lock_until': 345, 'renewal_day': 345, 'cap_pct': 5}, 4900), ('regression', {'last_paid': 2000, 'list_price': 1532, 'locked': 2000, 'lock_until': 313, 'renewal_day': 57, 'cap_pct': 20}, 1532), ('partial-repair probe', {'last_paid': 2000, 'list_price': 3042, 'locked': 1900, 'lock_until': 55, 'renewal_day': 55, 'cap_pct': 5}, 1900), ('partial-repair probe', {'last_paid': 5437, 'list_price': 5507, 'locked': 5337, 'lock_until': 225, 'renewal_day': 225, 'cap_pct': 5}, 5337), ('normal control', {'last_paid': 485, 'list_price': 654, 'locked': None, 'lock_until': 58, 'renewal_day': 58, 'cap_pct': 20}, 582), ('normal control', {'last_paid': 1219, 'list_price': 1057, 'locked': 1119, 'lock_until': 293, 'renewal_day': 294, 'cap_pct': 10}, 1057), ('normal control', {'last_paid': 1000, 'list_price': 1000, 'locked': 1000, 'lock_until': 85, 'renewal_day': 85, 'cap_pct': 20}, 1000), ('normal control', {'last_paid': 2000, 'list_price': 3222, 'locked': 2500, 'lock_until': 57, 'renewal_day': 260, 'cap_pct': 0}, 2000)], [('regression', {'last_paid': 2000, 'list_price': 1532, 'locked': 2000, 'lock_until': 313, 'renewal_day': 57, 'cap_pct': 20}, 1532), ('regression', {'last_paid': 2000, 'list_price': 1999, 'locked': 2500, 'lock_until': 365, 'renewal_day': 365, 'cap_pct': 20}, 1999), ('partial-repair probe', {'last_paid': 5437, 'list_price': 5507, 'locked': 5337, 'lock_until': 225, 'renewal_day': 225, 'cap_pct': 5}, 5337), ('partial-repair probe', {'last_paid': 2000, 'list_price': 3888, 'locked': 2000, 'lock_until': 333, 'renewal_day': 333, 'cap_pct': 10}, 2000), ('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), ('normal control', {'last_paid': 2000, 'list_price': 2000, 'locked': None, 'lock_until': 173, 'renewal_day': 263, 'cap_pct': 5}, 2000)], [('regression', {'last_paid': 2000, 'list_price': 1999, 'locked': 2500, 'lock_until': 365, 'renewal_day': 365, 'cap_pct': 20}, 1999), ('regression', {'last_paid': 4900, 'list_price': 4767, 'locked': 5400, 'lock_until': 335, 'renewal_day': 32, 'cap_pct': 10}, 4767), ('partial-repair probe', {'last_paid': 2000, 'list_price': 3888, 'locked': 2000, 'lock_until': 333, 'renewal_day': 333, 'cap_pct': 10}, 2000), ('partial-repair probe', {'last_paid': 6192, 'list_price': 7798, 'locked': 6092, 'lock_until': 169, 'renewal_day': 157, 'cap_pct': 0}, 6092), ('normal control', {'last_paid': 4105, 'list_price': 4394, 'locked': 4005, 'lock_until': 133, 'renewal_day': 322, 'cap_pct': 20}, 4394), ('normal control', {'last_paid': 4900, 'list_price': 5180, 'locked': 4900, 'lock_until': 0, 'renewal_day': 66, 'cap_pct': 20}, 5180), ('normal control', {'last_paid': 2000, 'list_price': 2438, 'locked': 2500, 'lock_until': 146, 'renewal_day': 147, 'cap_pct': 20}, 2400), ('normal control', {'last_paid': 4900, 'list_price': 4900, 'locked': 5400, 'lock_until': 208, 'renewal_day': 260, 'cap_pct': 5}, 4900)]]
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 012001000Failed
regression 122002000Failed
partial-repair probe 264836448Failed
partial-repair probe 351454900Failed
normal control 424002400Passed
normal control 549004900Passed
normal control 6222222Passed
normal control 741724172Passed

SHA-256 / de0fc8910e896b847b1e08a20996a58f0f7caa44f04cd0192cf810e4495bba91

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': 1000, 'list_price': 1000, 'locked': 1500, 'lock_until': 328, 'renewal_day': 201, 'cap_pct': 20}, 1000), ('regression', {'last_paid': 2000, 'list_price': 2000, 'locked': 2500, 'lock_until': 167, 'renewal_day': 167, 'cap_pct': 10}, 2000), ('partial-repair probe', {'last_paid': 6548, 'list_price': 6483, 'locked': 6448, 'lock_until': 196, 'renewal_day': 196, 'cap_pct': 5}, 6448), ('partial-repair probe', {'last_paid': 4900, 'list_price': 4900, 'locked': 5400, 'lock_until': 345, 'renewal_day': 345, 'cap_pct': 5}, 4900), ('normal control', {'last_paid': 2000, 'list_price': 3312, 'locked': 2500, 'lock_until': 173, 'renewal_day': 173, 'cap_pct': 20}, 2400), ('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': 2000, 'list_price': 2000, 'locked': 2500, 'lock_until': 167, 'renewal_day': 167, 'cap_pct': 10}, 2000), ('regression', {'last_paid': 4900, 'list_price': 4900, 'locked': 5400, 'lock_until': 345, 'renewal_day': 345, 'cap_pct': 5}, 4900), ('partial-repair probe', {'last_paid': 2000, 'list_price': 3042, 'locked': 1900, 'lock_until': 55, 'renewal_day': 55, 'cap_pct': 5}, 1900), ('partial-repair probe', {'last_paid': 2000, 'list_price': 1532, 'locked': 2000, 'lock_until': 313, 'renewal_day': 57, 'cap_pct': 20}, 1532), ('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': 4900, 'list_price': 7407, 'locked': None, 'lock_until': 112, 'renewal_day': 113, 'cap_pct': 5}, 5145)], [('regression', {'last_paid': 4900, 'list_price': 4900, 'locked': 5400, 'lock_until': 345, 'renewal_day': 345, 'cap_pct': 5}, 4900), ('regression', {'last_paid': 2000, 'list_price': 1532, 'locked': 2000, 'lock_until': 313, 'renewal_day': 57, 'cap_pct': 20}, 1532), ('partial-repair probe', {'last_paid': 2000, 'list_price': 3042, 'locked': 1900, 'lock_until': 55, 'renewal_day': 55, 'cap_pct': 5}, 1900), ('partial-repair probe', {'last_paid': 5437, 'list_price': 5507, 'locked': 5337, 'lock_until': 225, 'renewal_day': 225, 'cap_pct': 5}, 5337), ('normal control', {'last_paid': 485, 'list_price': 654, 'locked': None, 'lock_until': 58, 'renewal_day': 58, 'cap_pct': 20}, 582), ('normal control', {'last_paid': 1219, 'list_price': 1057, 'locked': 1119, 'lock_until': 293, 'renewal_day': 294, 'cap_pct': 10}, 1057), ('normal control', {'last_paid': 1000, 'list_price': 1000, 'locked': 1000, 'lock_until': 85, 'renewal_day': 85, 'cap_pct': 20}, 1000), ('normal control', {'last_paid': 2000, 'list_price': 3222, 'locked': 2500, 'lock_until': 57, 'renewal_day': 260, 'cap_pct': 0}, 2000)], [('regression', {'last_paid': 2000, 'list_price': 1532, 'locked': 2000, 'lock_until': 313, 'renewal_day': 57, 'cap_pct': 20}, 1532), ('regression', {'last_paid': 2000, 'list_price': 1999, 'locked': 2500, 'lock_until': 365, 'renewal_day': 365, 'cap_pct': 20}, 1999), ('partial-repair probe', {'last_paid': 5437, 'list_price': 5507, 'locked': 5337, 'lock_until': 225, 'renewal_day': 225, 'cap_pct': 5}, 5337), ('partial-repair probe', {'last_paid': 2000, 'list_price': 3888, 'locked': 2000, 'lock_until': 333, 'renewal_day': 333, 'cap_pct': 10}, 2000), ('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), ('normal control', {'last_paid': 2000, 'list_price': 2000, 'locked': None, 'lock_until': 173, 'renewal_day': 263, 'cap_pct': 5}, 2000)], [('regression', {'last_paid': 2000, 'list_price': 1999, 'locked': 2500, 'lock_until': 365, 'renewal_day': 365, 'cap_pct': 20}, 1999), ('regression', {'last_paid': 4900, 'list_price': 4767, 'locked': 5400, 'lock_until': 335, 'renewal_day': 32, 'cap_pct': 10}, 4767), ('partial-repair probe', {'last_paid': 2000, 'list_price': 3888, 'locked': 2000, 'lock_until': 333, 'renewal_day': 333, 'cap_pct': 10}, 2000), ('partial-repair probe', {'last_paid': 6192, 'list_price': 7798, 'locked': 6092, 'lock_until': 169, 'renewal_day': 157, 'cap_pct': 0}, 6092), ('normal control', {'last_paid': 4105, 'list_price': 4394, 'locked': 4005, 'lock_until': 133, 'renewal_day': 322, 'cap_pct': 20}, 4394), ('normal control', {'last_paid': 4900, 'list_price': 5180, 'locked': 4900, 'lock_until': 0, 'renewal_day': 66, 'cap_pct': 20}, 5180), ('normal control', {'last_paid': 2000, 'list_price': 2438, 'locked': 2500, 'lock_until': 146, 'renewal_day': 147, 'cap_pct': 20}, 2400), ('normal control', {'last_paid': 4900, 'list_price': 4900, 'locked': 5400, 'lock_until': 208, 'renewal_day': 260, 'cap_pct': 5}, 4900)]]
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 010001000Passed
regression 120002000Passed
partial-repair probe 264486448Passed
partial-repair probe 349004900Passed
normal control 424002400Passed
normal control 549004900Passed
normal control 6222222Passed
normal control 741724172Passed

SHA-256 / eadfb5bca7d2f0439ee682c483b3b84ee2e94e3b337abe7c54d9dfcf28fc5ce1

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

Case digest / ca6c85c8e20fb855be245b0c11dc3ff92cf211d9cff60723f76c90331b0ccda7