FAILURE MAP
← Case archive

FA-68836 / Toll and parking fee computation / Open access

Parking tax and fee composition: the resident percentage is kept instead of removed · case 01

Parking tax and fee composition returns a wrong result when the resident percentage is kept instead of removed.

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

ROOT CAUSE

Residents are charged the discount percentage rather than the discounted price.

VERIFIED REPAIR

Restore the resident discount rule so that the step reads `base -= base * x['resident_pct'] // 100`.

Unsuccessful approach: Subtracting the percentage as cents gives residents almost no discount.

Case contract

Input {base, resident, resident_pct, tax_bp (basis points), surcharge, app, app_fee}. Residents get resident_pct off (discount floored). Parking tax on the discounted base is rounded half up per transaction. The surcharge is untaxed. App payments add app_fee plus its own tax rounded half up. Return {base, tax, total}.

Why this case matters

Fee engines bill customers in integer cents; a wrong boundary, rounding stage or cap scope silently over- or under-charges.

1 / The failure

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

N = 1
observations = []
def solve(x):
    base = x['base']
    if x['resident']:
        base = base * x['resident_pct'] // 100
    tax = (base * x['tax_bp'] + 5000) // 10000
    total = base + tax + x['surcharge']
    if x['app']:
        total += x['app_fee'] + (x['app_fee'] * x['tax_bp'] + 5000) // 10000
    return {'base': base, 'tax': tax, 'total': total}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[({'base': 2437, 'resident': True, 'resident_pct': 50, 'tax_bp': 1000, 'surcharge': 150, 'app': False, 'app_fee': 35}, {'base': 1219, 'tax': 122, 'total': 1491}), ({'base': 122, 'resident': True, 'resident_pct': 20, 'tax_bp': 1850, 'surcharge': 150, 'app': False, 'app_fee': 25}, {'base': 98, 'tax': 18, 'total': 266}), ({'base': 4927, 'resident': False, 'resident_pct': 25, 'tax_bp': 1850, 'surcharge': 0, 'app': False, 'app_fee': 35}, {'base': 4927, 'tax': 911, 'total': 5838}), ({'base': 2805, 'resident': False, 'resident_pct': 20, 'tax_bp': 1000, 'surcharge': 0, 'app': True, 'app_fee': 35}, {'base': 2805, 'tax': 281, 'total': 3125}), ({'base': 1795, 'resident': False, 'resident_pct': 25, 'tax_bp': 1850, 'surcharge': 0, 'app': True, 'app_fee': 25}, {'base': 1795, 'tax': 332, 'total': 2157}), ({'base': 2304, 'resident': False, 'resident_pct': 20, 'tax_bp': 625, 'surcharge': 0, 'app': True, 'app_fee': 45}, {'base': 2304, 'tax': 144, 'total': 2496}), ({'base': 622, 'resident': True, 'resident_pct': 20, 'tax_bp': 625, 'surcharge': 0, 'app': True, 'app_fee': 25}, {'base': 498, 'tax': 31, 'total': 556}), ({'base': 1000, 'resident': True, 'resident_pct': 25, 'tax_bp': 1850, 'surcharge': 150, 'app': True, 'app_fee': 35}, {'base': 750, 'tax': 139, 'total': 1080})], [({'base': 4756, 'resident': True, 'resident_pct': 25, 'tax_bp': 625, 'surcharge': 50, 'app': False, 'app_fee': 35}, {'base': 3567, 'tax': 223, 'total': 3840}), ({'base': 1000, 'resident': True, 'resident_pct': 25, 'tax_bp': 1850, 'surcharge': 150, 'app': True, 'app_fee': 35}, {'base': 750, 'tax': 139, 'total': 1080}), ({'base': 4135, 'resident': False, 'resident_pct': 25, 'tax_bp': 625, 'surcharge': 50, 'app': True, 'app_fee': 45}, {'base': 4135, 'tax': 258, 'total': 4491}), ({'base': 4117, 'resident': False, 'resident_pct': 20, 'tax_bp': 1850, 'surcharge': 0, 'app': True, 'app_fee': 35}, {'base': 4117, 'tax': 762, 'total': 4920}), ({'base': 1189, 'resident': False, 'resident_pct': 50, 'tax_bp': 2250, 'surcharge': 150, 'app': False, 'app_fee': 45}, {'base': 1189, 'tax': 268, 'total': 1607}), ({'base': 815, 'resident': False, 'resident_pct': 50, 'tax_bp': 1850, 'surcharge': 150, 'app': False, 'app_fee': 35}, {'base': 815, 'tax': 151, 'total': 1116}), ({'base': 816, 'resident': False, 'resident_pct': 20, 'tax_bp': 1850, 'surcharge': 50, 'app': False, 'app_fee': 35}, {'base': 816, 'tax': 151, 'total': 1017}), ({'base': 4473, 'resident': True, 'resident_pct': 50, 'tax_bp': 1000, 'surcharge': 150, 'app': True, 'app_fee': 25}, {'base': 2237, 'tax': 224, 'total': 2639})], [({'base': 3532, 'resident': False, 'resident_pct': 50, 'tax_bp': 1000, 'surcharge': 0, 'app': True, 'app_fee': 35}, {'base': 3532, 'tax': 353, 'total': 3924}), ({'base': 4127, 'resident': False, 'resident_pct': 50, 'tax_bp': 1850, 'surcharge': 150, 'app': False, 'app_fee': 35}, {'base': 4127, 'tax': 763, 'total': 5040}), ({'base': 4285, 'resident': False, 'resident_pct': 50, 'tax_bp': 1850, 'surcharge': 150, 'app': False, 'app_fee': 25}, {'base': 4285, 'tax': 793, 'total': 5228}), ({'base': 2775, 'resident': False, 'resident_pct': 25, 'tax_bp': 1850, 'surcharge': 50, 'app': True, 'app_fee': 35}, {'base': 2775, 'tax': 513, 'total': 3379}), ({'base': 3543, 'resident': True, 'resident_pct': 50, 'tax_bp': 1000, 'surcharge': 150, 'app': False, 'app_fee': 25}, {'base': 1772, 'tax': 177, 'total': 2099}), ({'base': 4552, 'resident': True, 'resident_pct': 50, 'tax_bp': 625, 'surcharge': 0, 'app': True, 'app_fee': 35}, {'base': 2276, 'tax': 142, 'total': 2455}), ({'base': 2846, 'resident': True, 'resident_pct': 20, 'tax_bp': 2250, 'surcharge': 150, 'app': True, 'app_fee': 45}, {'base': 2277, 'tax': 512, 'total': 2994}), ({'base': 1000, 'resident': True, 'resident_pct': 25, 'tax_bp': 1850, 'surcharge': 150, 'app': True, 'app_fee': 35}, {'base': 750, 'tax': 139, 'total': 1080})], [({'base': 4467, 'resident': True, 'resident_pct': 20, 'tax_bp': 1000, 'surcharge': 50, 'app': False, 'app_fee': 25}, {'base': 3574, 'tax': 357, 'total': 3981}), ({'base': 3746, 'resident': False, 'resident_pct': 25, 'tax_bp': 1000, 'surcharge': 150, 'app': False, 'app_fee': 45}, {'base': 3746, 'tax': 375, 'total': 4271}), ({'base': 3485, 'resident': True, 'resident_pct': 20, 'tax_bp': 2250, 'surcharge': 0, 'app': True, 'app_fee': 25}, {'base': 2788, 'tax': 627, 'total': 3446}), ({'base': 1000, 'resident': True, 'resident_pct': 25, 'tax_bp': 1850, 'surcharge': 150, 'app': True, 'app_fee': 35}, {'base': 750, 'tax': 139, 'total': 1080}), ({'base': 4961, 'resident': False, 'resident_pct': 50, 'tax_bp': 2250, 'surcharge': 150, 'app': True, 'app_fee': 35}, {'base': 4961, 'tax': 1116, 'total': 6270}), ({'base': 3383, 'resident': False, 'resident_pct': 50, 'tax_bp': 2250, 'surcharge': 150, 'app': True, 'app_fee': 25}, {'base': 3383, 'tax': 761, 'total': 4325}), ({'base': 2453, 'resident': True, 'resident_pct': 25, 'tax_bp': 1000, 'surcharge': 0, 'app': False, 'app_fee': 35}, {'base': 1840, 'tax': 184, 'total': 2024}), ({'base': 1002, 'resident': False, 'resident_pct': 20, 'tax_bp': 625, 'surcharge': 50, 'app': False, 'app_fee': 45}, {'base': 1002, 'tax': 63, 'total': 1115})], [({'base': 1986, 'resident': False, 'resident_pct': 25, 'tax_bp': 2250, 'surcharge': 150, 'app': True, 'app_fee': 25}, {'base': 1986, 'tax': 447, 'total': 2614}), ({'base': 781, 'resident': False, 'resident_pct': 20, 'tax_bp': 1000, 'surcharge': 50, 'app': True, 'app_fee': 25}, {'base': 781, 'tax': 78, 'total': 937}), ({'base': 1000, 'resident': True, 'resident_pct': 25, 'tax_bp': 1850, 'surcharge': 150, 'app': True, 'app_fee': 35}, {'base': 750, 'tax': 139, 'total': 1080}), ({'base': 2384, 'resident': True, 'resident_pct': 25, 'tax_bp': 1000, 'surcharge': 0, 'app': False, 'app_fee': 45}, {'base': 1788, 'tax': 179, 'total': 1967}), ({'base': 1756, 'resident': False, 'resident_pct': 20, 'tax_bp': 2250, 'surcharge': 0, 'app': True, 'app_fee': 25}, {'base': 1756, 'tax': 395, 'total': 2182}), ({'base': 2491, 'resident': True, 'resident_pct': 25, 'tax_bp': 1850, 'surcharge': 50, 'app': False, 'app_fee': 45}, {'base': 1869, 'tax': 346, 'total': 2265}), ({'base': 3567, 'resident': False, 'resident_pct': 20, 'tax_bp': 2250, 'surcharge': 0, 'app': True, 'app_fee': 35}, {'base': 3567, 'tax': 803, 'total': 4413}), ({'base': 3650, 'resident': True, 'resident_pct': 50, 'tax_bp': 1000, 'surcharge': 150, 'app': False, 'app_fee': 25}, {'base': 1825, 'tax': 183, 'total': 2158})]]
for i, (args, expected) in enumerate(fixtures[N-1]):
    check('fee oracle' + ' %d' % 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
fee oracle 0{'base': 1218, 'tax': 122, 'total': 1490}{'base': 1219, 'tax': 122, 'total': 1491}Failed
fee oracle 1{'base': 24, 'tax': 4, 'total': 178}{'base': 98, 'tax': 18, 'total': 266}Failed
fee oracle 2{'base': 4927, 'tax': 911, 'total': 5838}{'base': 4927, 'tax': 911, 'total': 5838}Passed
fee oracle 3{'base': 2805, 'tax': 281, 'total': 3125}{'base': 2805, 'tax': 281, 'total': 3125}Passed
fee oracle 4{'base': 1795, 'tax': 332, 'total': 2157}{'base': 1795, 'tax': 332, 'total': 2157}Passed
fee oracle 5{'base': 2304, 'tax': 144, 'total': 2496}{'base': 2304, 'tax': 144, 'total': 2496}Passed
fee oracle 6{'base': 124, 'tax': 8, 'total': 159}{'base': 498, 'tax': 31, 'total': 556}Failed
fee oracle 7{'base': 250, 'tax': 46, 'total': 487}{'base': 750, 'tax': 139, 'total': 1080}Failed

SHA-256 / 4a1d928f2a049697190c56a69119b7c828a567736122f06ff05734ecdd48c2e2

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(x):
    base = x['base']
    if x['resident']:
        base -= x['resident_pct']
    tax = (base * x['tax_bp'] + 5000) // 10000
    total = base + tax + x['surcharge']
    if x['app']:
        total += x['app_fee'] + (x['app_fee'] * x['tax_bp'] + 5000) // 10000
    return {'base': base, 'tax': tax, 'total': total}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[({'base': 2437, 'resident': True, 'resident_pct': 50, 'tax_bp': 1000, 'surcharge': 150, 'app': False, 'app_fee': 35}, {'base': 1219, 'tax': 122, 'total': 1491}), ({'base': 122, 'resident': True, 'resident_pct': 20, 'tax_bp': 1850, 'surcharge': 150, 'app': False, 'app_fee': 25}, {'base': 98, 'tax': 18, 'total': 266}), ({'base': 4927, 'resident': False, 'resident_pct': 25, 'tax_bp': 1850, 'surcharge': 0, 'app': False, 'app_fee': 35}, {'base': 4927, 'tax': 911, 'total': 5838}), ({'base': 2805, 'resident': False, 'resident_pct': 20, 'tax_bp': 1000, 'surcharge': 0, 'app': True, 'app_fee': 35}, {'base': 2805, 'tax': 281, 'total': 3125}), ({'base': 1795, 'resident': False, 'resident_pct': 25, 'tax_bp': 1850, 'surcharge': 0, 'app': True, 'app_fee': 25}, {'base': 1795, 'tax': 332, 'total': 2157}), ({'base': 2304, 'resident': False, 'resident_pct': 20, 'tax_bp': 625, 'surcharge': 0, 'app': True, 'app_fee': 45}, {'base': 2304, 'tax': 144, 'total': 2496}), ({'base': 622, 'resident': True, 'resident_pct': 20, 'tax_bp': 625, 'surcharge': 0, 'app': True, 'app_fee': 25}, {'base': 498, 'tax': 31, 'total': 556}), ({'base': 1000, 'resident': True, 'resident_pct': 25, 'tax_bp': 1850, 'surcharge': 150, 'app': True, 'app_fee': 35}, {'base': 750, 'tax': 139, 'total': 1080})], [({'base': 4756, 'resident': True, 'resident_pct': 25, 'tax_bp': 625, 'surcharge': 50, 'app': False, 'app_fee': 35}, {'base': 3567, 'tax': 223, 'total': 3840}), ({'base': 1000, 'resident': True, 'resident_pct': 25, 'tax_bp': 1850, 'surcharge': 150, 'app': True, 'app_fee': 35}, {'base': 750, 'tax': 139, 'total': 1080}), ({'base': 4135, 'resident': False, 'resident_pct': 25, 'tax_bp': 625, 'surcharge': 50, 'app': True, 'app_fee': 45}, {'base': 4135, 'tax': 258, 'total': 4491}), ({'base': 4117, 'resident': False, 'resident_pct': 20, 'tax_bp': 1850, 'surcharge': 0, 'app': True, 'app_fee': 35}, {'base': 4117, 'tax': 762, 'total': 4920}), ({'base': 1189, 'resident': False, 'resident_pct': 50, 'tax_bp': 2250, 'surcharge': 150, 'app': False, 'app_fee': 45}, {'base': 1189, 'tax': 268, 'total': 1607}), ({'base': 815, 'resident': False, 'resident_pct': 50, 'tax_bp': 1850, 'surcharge': 150, 'app': False, 'app_fee': 35}, {'base': 815, 'tax': 151, 'total': 1116}), ({'base': 816, 'resident': False, 'resident_pct': 20, 'tax_bp': 1850, 'surcharge': 50, 'app': False, 'app_fee': 35}, {'base': 816, 'tax': 151, 'total': 1017}), ({'base': 4473, 'resident': True, 'resident_pct': 50, 'tax_bp': 1000, 'surcharge': 150, 'app': True, 'app_fee': 25}, {'base': 2237, 'tax': 224, 'total': 2639})], [({'base': 3532, 'resident': False, 'resident_pct': 50, 'tax_bp': 1000, 'surcharge': 0, 'app': True, 'app_fee': 35}, {'base': 3532, 'tax': 353, 'total': 3924}), ({'base': 4127, 'resident': False, 'resident_pct': 50, 'tax_bp': 1850, 'surcharge': 150, 'app': False, 'app_fee': 35}, {'base': 4127, 'tax': 763, 'total': 5040}), ({'base': 4285, 'resident': False, 'resident_pct': 50, 'tax_bp': 1850, 'surcharge': 150, 'app': False, 'app_fee': 25}, {'base': 4285, 'tax': 793, 'total': 5228}), ({'base': 2775, 'resident': False, 'resident_pct': 25, 'tax_bp': 1850, 'surcharge': 50, 'app': True, 'app_fee': 35}, {'base': 2775, 'tax': 513, 'total': 3379}), ({'base': 3543, 'resident': True, 'resident_pct': 50, 'tax_bp': 1000, 'surcharge': 150, 'app': False, 'app_fee': 25}, {'base': 1772, 'tax': 177, 'total': 2099}), ({'base': 4552, 'resident': True, 'resident_pct': 50, 'tax_bp': 625, 'surcharge': 0, 'app': True, 'app_fee': 35}, {'base': 2276, 'tax': 142, 'total': 2455}), ({'base': 2846, 'resident': True, 'resident_pct': 20, 'tax_bp': 2250, 'surcharge': 150, 'app': True, 'app_fee': 45}, {'base': 2277, 'tax': 512, 'total': 2994}), ({'base': 1000, 'resident': True, 'resident_pct': 25, 'tax_bp': 1850, 'surcharge': 150, 'app': True, 'app_fee': 35}, {'base': 750, 'tax': 139, 'total': 1080})], [({'base': 4467, 'resident': True, 'resident_pct': 20, 'tax_bp': 1000, 'surcharge': 50, 'app': False, 'app_fee': 25}, {'base': 3574, 'tax': 357, 'total': 3981}), ({'base': 3746, 'resident': False, 'resident_pct': 25, 'tax_bp': 1000, 'surcharge': 150, 'app': False, 'app_fee': 45}, {'base': 3746, 'tax': 375, 'total': 4271}), ({'base': 3485, 'resident': True, 'resident_pct': 20, 'tax_bp': 2250, 'surcharge': 0, 'app': True, 'app_fee': 25}, {'base': 2788, 'tax': 627, 'total': 3446}), ({'base': 1000, 'resident': True, 'resident_pct': 25, 'tax_bp': 1850, 'surcharge': 150, 'app': True, 'app_fee': 35}, {'base': 750, 'tax': 139, 'total': 1080}), ({'base': 4961, 'resident': False, 'resident_pct': 50, 'tax_bp': 2250, 'surcharge': 150, 'app': True, 'app_fee': 35}, {'base': 4961, 'tax': 1116, 'total': 6270}), ({'base': 3383, 'resident': False, 'resident_pct': 50, 'tax_bp': 2250, 'surcharge': 150, 'app': True, 'app_fee': 25}, {'base': 3383, 'tax': 761, 'total': 4325}), ({'base': 2453, 'resident': True, 'resident_pct': 25, 'tax_bp': 1000, 'surcharge': 0, 'app': False, 'app_fee': 35}, {'base': 1840, 'tax': 184, 'total': 2024}), ({'base': 1002, 'resident': False, 'resident_pct': 20, 'tax_bp': 625, 'surcharge': 50, 'app': False, 'app_fee': 45}, {'base': 1002, 'tax': 63, 'total': 1115})], [({'base': 1986, 'resident': False, 'resident_pct': 25, 'tax_bp': 2250, 'surcharge': 150, 'app': True, 'app_fee': 25}, {'base': 1986, 'tax': 447, 'total': 2614}), ({'base': 781, 'resident': False, 'resident_pct': 20, 'tax_bp': 1000, 'surcharge': 50, 'app': True, 'app_fee': 25}, {'base': 781, 'tax': 78, 'total': 937}), ({'base': 1000, 'resident': True, 'resident_pct': 25, 'tax_bp': 1850, 'surcharge': 150, 'app': True, 'app_fee': 35}, {'base': 750, 'tax': 139, 'total': 1080}), ({'base': 2384, 'resident': True, 'resident_pct': 25, 'tax_bp': 1000, 'surcharge': 0, 'app': False, 'app_fee': 45}, {'base': 1788, 'tax': 179, 'total': 1967}), ({'base': 1756, 'resident': False, 'resident_pct': 20, 'tax_bp': 2250, 'surcharge': 0, 'app': True, 'app_fee': 25}, {'base': 1756, 'tax': 395, 'total': 2182}), ({'base': 2491, 'resident': True, 'resident_pct': 25, 'tax_bp': 1850, 'surcharge': 50, 'app': False, 'app_fee': 45}, {'base': 1869, 'tax': 346, 'total': 2265}), ({'base': 3567, 'resident': False, 'resident_pct': 20, 'tax_bp': 2250, 'surcharge': 0, 'app': True, 'app_fee': 35}, {'base': 3567, 'tax': 803, 'total': 4413}), ({'base': 3650, 'resident': True, 'resident_pct': 50, 'tax_bp': 1000, 'surcharge': 150, 'app': False, 'app_fee': 25}, {'base': 1825, 'tax': 183, 'total': 2158})]]
for i, (args, expected) in enumerate(fixtures[N-1]):
    check('fee oracle' + ' %d' % 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
fee oracle 0{'base': 2387, 'tax': 239, 'total': 2776}{'base': 1219, 'tax': 122, 'total': 1491}Failed
fee oracle 1{'base': 102, 'tax': 19, 'total': 271}{'base': 98, 'tax': 18, 'total': 266}Failed
fee oracle 2{'base': 4927, 'tax': 911, 'total': 5838}{'base': 4927, 'tax': 911, 'total': 5838}Passed
fee oracle 3{'base': 2805, 'tax': 281, 'total': 3125}{'base': 2805, 'tax': 281, 'total': 3125}Passed
fee oracle 4{'base': 1795, 'tax': 332, 'total': 2157}{'base': 1795, 'tax': 332, 'total': 2157}Passed
fee oracle 5{'base': 2304, 'tax': 144, 'total': 2496}{'base': 2304, 'tax': 144, 'total': 2496}Passed
fee oracle 6{'base': 602, 'tax': 38, 'total': 667}{'base': 498, 'tax': 31, 'total': 556}Failed
fee oracle 7{'base': 975, 'tax': 180, 'total': 1346}{'base': 750, 'tax': 139, 'total': 1080}Failed

SHA-256 / 456f28ca6f03989de8a954d43c1335842cb2b80fdd208278413478a3e195145c

3 / The verified repair

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

N = 1
observations = []
def solve(x):
    base = x['base']
    if x['resident']:
        base -= base * x['resident_pct'] // 100
    tax = (base * x['tax_bp'] + 5000) // 10000
    total = base + tax + x['surcharge']
    if x['app']:
        total += x['app_fee'] + (x['app_fee'] * x['tax_bp'] + 5000) // 10000
    return {'base': base, 'tax': tax, 'total': total}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[({'base': 2437, 'resident': True, 'resident_pct': 50, 'tax_bp': 1000, 'surcharge': 150, 'app': False, 'app_fee': 35}, {'base': 1219, 'tax': 122, 'total': 1491}), ({'base': 122, 'resident': True, 'resident_pct': 20, 'tax_bp': 1850, 'surcharge': 150, 'app': False, 'app_fee': 25}, {'base': 98, 'tax': 18, 'total': 266}), ({'base': 4927, 'resident': False, 'resident_pct': 25, 'tax_bp': 1850, 'surcharge': 0, 'app': False, 'app_fee': 35}, {'base': 4927, 'tax': 911, 'total': 5838}), ({'base': 2805, 'resident': False, 'resident_pct': 20, 'tax_bp': 1000, 'surcharge': 0, 'app': True, 'app_fee': 35}, {'base': 2805, 'tax': 281, 'total': 3125}), ({'base': 1795, 'resident': False, 'resident_pct': 25, 'tax_bp': 1850, 'surcharge': 0, 'app': True, 'app_fee': 25}, {'base': 1795, 'tax': 332, 'total': 2157}), ({'base': 2304, 'resident': False, 'resident_pct': 20, 'tax_bp': 625, 'surcharge': 0, 'app': True, 'app_fee': 45}, {'base': 2304, 'tax': 144, 'total': 2496}), ({'base': 622, 'resident': True, 'resident_pct': 20, 'tax_bp': 625, 'surcharge': 0, 'app': True, 'app_fee': 25}, {'base': 498, 'tax': 31, 'total': 556}), ({'base': 1000, 'resident': True, 'resident_pct': 25, 'tax_bp': 1850, 'surcharge': 150, 'app': True, 'app_fee': 35}, {'base': 750, 'tax': 139, 'total': 1080})], [({'base': 4756, 'resident': True, 'resident_pct': 25, 'tax_bp': 625, 'surcharge': 50, 'app': False, 'app_fee': 35}, {'base': 3567, 'tax': 223, 'total': 3840}), ({'base': 1000, 'resident': True, 'resident_pct': 25, 'tax_bp': 1850, 'surcharge': 150, 'app': True, 'app_fee': 35}, {'base': 750, 'tax': 139, 'total': 1080}), ({'base': 4135, 'resident': False, 'resident_pct': 25, 'tax_bp': 625, 'surcharge': 50, 'app': True, 'app_fee': 45}, {'base': 4135, 'tax': 258, 'total': 4491}), ({'base': 4117, 'resident': False, 'resident_pct': 20, 'tax_bp': 1850, 'surcharge': 0, 'app': True, 'app_fee': 35}, {'base': 4117, 'tax': 762, 'total': 4920}), ({'base': 1189, 'resident': False, 'resident_pct': 50, 'tax_bp': 2250, 'surcharge': 150, 'app': False, 'app_fee': 45}, {'base': 1189, 'tax': 268, 'total': 1607}), ({'base': 815, 'resident': False, 'resident_pct': 50, 'tax_bp': 1850, 'surcharge': 150, 'app': False, 'app_fee': 35}, {'base': 815, 'tax': 151, 'total': 1116}), ({'base': 816, 'resident': False, 'resident_pct': 20, 'tax_bp': 1850, 'surcharge': 50, 'app': False, 'app_fee': 35}, {'base': 816, 'tax': 151, 'total': 1017}), ({'base': 4473, 'resident': True, 'resident_pct': 50, 'tax_bp': 1000, 'surcharge': 150, 'app': True, 'app_fee': 25}, {'base': 2237, 'tax': 224, 'total': 2639})], [({'base': 3532, 'resident': False, 'resident_pct': 50, 'tax_bp': 1000, 'surcharge': 0, 'app': True, 'app_fee': 35}, {'base': 3532, 'tax': 353, 'total': 3924}), ({'base': 4127, 'resident': False, 'resident_pct': 50, 'tax_bp': 1850, 'surcharge': 150, 'app': False, 'app_fee': 35}, {'base': 4127, 'tax': 763, 'total': 5040}), ({'base': 4285, 'resident': False, 'resident_pct': 50, 'tax_bp': 1850, 'surcharge': 150, 'app': False, 'app_fee': 25}, {'base': 4285, 'tax': 793, 'total': 5228}), ({'base': 2775, 'resident': False, 'resident_pct': 25, 'tax_bp': 1850, 'surcharge': 50, 'app': True, 'app_fee': 35}, {'base': 2775, 'tax': 513, 'total': 3379}), ({'base': 3543, 'resident': True, 'resident_pct': 50, 'tax_bp': 1000, 'surcharge': 150, 'app': False, 'app_fee': 25}, {'base': 1772, 'tax': 177, 'total': 2099}), ({'base': 4552, 'resident': True, 'resident_pct': 50, 'tax_bp': 625, 'surcharge': 0, 'app': True, 'app_fee': 35}, {'base': 2276, 'tax': 142, 'total': 2455}), ({'base': 2846, 'resident': True, 'resident_pct': 20, 'tax_bp': 2250, 'surcharge': 150, 'app': True, 'app_fee': 45}, {'base': 2277, 'tax': 512, 'total': 2994}), ({'base': 1000, 'resident': True, 'resident_pct': 25, 'tax_bp': 1850, 'surcharge': 150, 'app': True, 'app_fee': 35}, {'base': 750, 'tax': 139, 'total': 1080})], [({'base': 4467, 'resident': True, 'resident_pct': 20, 'tax_bp': 1000, 'surcharge': 50, 'app': False, 'app_fee': 25}, {'base': 3574, 'tax': 357, 'total': 3981}), ({'base': 3746, 'resident': False, 'resident_pct': 25, 'tax_bp': 1000, 'surcharge': 150, 'app': False, 'app_fee': 45}, {'base': 3746, 'tax': 375, 'total': 4271}), ({'base': 3485, 'resident': True, 'resident_pct': 20, 'tax_bp': 2250, 'surcharge': 0, 'app': True, 'app_fee': 25}, {'base': 2788, 'tax': 627, 'total': 3446}), ({'base': 1000, 'resident': True, 'resident_pct': 25, 'tax_bp': 1850, 'surcharge': 150, 'app': True, 'app_fee': 35}, {'base': 750, 'tax': 139, 'total': 1080}), ({'base': 4961, 'resident': False, 'resident_pct': 50, 'tax_bp': 2250, 'surcharge': 150, 'app': True, 'app_fee': 35}, {'base': 4961, 'tax': 1116, 'total': 6270}), ({'base': 3383, 'resident': False, 'resident_pct': 50, 'tax_bp': 2250, 'surcharge': 150, 'app': True, 'app_fee': 25}, {'base': 3383, 'tax': 761, 'total': 4325}), ({'base': 2453, 'resident': True, 'resident_pct': 25, 'tax_bp': 1000, 'surcharge': 0, 'app': False, 'app_fee': 35}, {'base': 1840, 'tax': 184, 'total': 2024}), ({'base': 1002, 'resident': False, 'resident_pct': 20, 'tax_bp': 625, 'surcharge': 50, 'app': False, 'app_fee': 45}, {'base': 1002, 'tax': 63, 'total': 1115})], [({'base': 1986, 'resident': False, 'resident_pct': 25, 'tax_bp': 2250, 'surcharge': 150, 'app': True, 'app_fee': 25}, {'base': 1986, 'tax': 447, 'total': 2614}), ({'base': 781, 'resident': False, 'resident_pct': 20, 'tax_bp': 1000, 'surcharge': 50, 'app': True, 'app_fee': 25}, {'base': 781, 'tax': 78, 'total': 937}), ({'base': 1000, 'resident': True, 'resident_pct': 25, 'tax_bp': 1850, 'surcharge': 150, 'app': True, 'app_fee': 35}, {'base': 750, 'tax': 139, 'total': 1080}), ({'base': 2384, 'resident': True, 'resident_pct': 25, 'tax_bp': 1000, 'surcharge': 0, 'app': False, 'app_fee': 45}, {'base': 1788, 'tax': 179, 'total': 1967}), ({'base': 1756, 'resident': False, 'resident_pct': 20, 'tax_bp': 2250, 'surcharge': 0, 'app': True, 'app_fee': 25}, {'base': 1756, 'tax': 395, 'total': 2182}), ({'base': 2491, 'resident': True, 'resident_pct': 25, 'tax_bp': 1850, 'surcharge': 50, 'app': False, 'app_fee': 45}, {'base': 1869, 'tax': 346, 'total': 2265}), ({'base': 3567, 'resident': False, 'resident_pct': 20, 'tax_bp': 2250, 'surcharge': 0, 'app': True, 'app_fee': 35}, {'base': 3567, 'tax': 803, 'total': 4413}), ({'base': 3650, 'resident': True, 'resident_pct': 50, 'tax_bp': 1000, 'surcharge': 150, 'app': False, 'app_fee': 25}, {'base': 1825, 'tax': 183, 'total': 2158})]]
for i, (args, expected) in enumerate(fixtures[N-1]):
    check('fee oracle' + ' %d' % 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
fee oracle 0{'base': 1219, 'tax': 122, 'total': 1491}{'base': 1219, 'tax': 122, 'total': 1491}Passed
fee oracle 1{'base': 98, 'tax': 18, 'total': 266}{'base': 98, 'tax': 18, 'total': 266}Passed
fee oracle 2{'base': 4927, 'tax': 911, 'total': 5838}{'base': 4927, 'tax': 911, 'total': 5838}Passed
fee oracle 3{'base': 2805, 'tax': 281, 'total': 3125}{'base': 2805, 'tax': 281, 'total': 3125}Passed
fee oracle 4{'base': 1795, 'tax': 332, 'total': 2157}{'base': 1795, 'tax': 332, 'total': 2157}Passed
fee oracle 5{'base': 2304, 'tax': 144, 'total': 2496}{'base': 2304, 'tax': 144, 'total': 2496}Passed
fee oracle 6{'base': 498, 'tax': 31, 'total': 556}{'base': 498, 'tax': 31, 'total': 556}Passed
fee oracle 7{'base': 750, 'tax': 139, 'total': 1080}{'base': 750, 'tax': 139, 'total': 1080}Passed

SHA-256 / 0bc9e36d6aa7f51f01073e1e827a718c406244d853806bc9498afec4f5e7faae

Verification & scope

A deterministic, bounded toy model with a stipulated contract; it makes no claim of conformance to any agency manual or standard. 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:48:05.980992+00:00.

Case digest / 6781fc75238d6cd48f627981abdc1f60b73ab21506e4c9e45bb69e5eae79e2d1