FA-68831 / Toll and parking fee computation / Open access
Parking tax and fee composition: the app fee is left untaxed · case 01
Parking tax and fee composition returns a wrong result when the app fee is left untaxed.
ROOT CAUSE
The convenience fee is not taxed although the contract taxes it.
VERIFIED REPAIR
Restore the app fee tax rule so that the step reads `x['app_fee'] + (x['app_fee'] * x['tax_bp'] + 5000) // 10000`.
Unsuccessful approach: Flooring fee plus tax together truncates the tax on the fee.
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']
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': 3638, 'resident': False, 'resident_pct': 50, 'tax_bp': 1000, 'surcharge': 0, 'app': False, 'app_fee': 45}, {'base': 3638, 'tax': 364, 'total': 4002}), ({'base': 407, 'resident': False, 'resident_pct': 25, 'tax_bp': 1000, 'surcharge': 50, 'app': False, 'app_fee': 25}, {'base': 407, 'tax': 41, 'total': 498}), ({'base': 3231, 'resident': False, 'resident_pct': 50, 'tax_bp': 1850, 'surcharge': 50, 'app': True, 'app_fee': 25}, {'base': 3231, 'tax': 598, 'total': 3909}), ({'base': 3732, 'resident': False, 'resident_pct': 20, 'tax_bp': 1000, 'surcharge': 0, 'app': True, 'app_fee': 25}, {'base': 3732, 'tax': 373, 'total': 4133}), ({'base': 363, 'resident': True, 'resident_pct': 20, 'tax_bp': 1850, 'surcharge': 150, 'app': False, 'app_fee': 35}, {'base': 291, 'tax': 54, 'total': 495}), ({'base': 3002, 'resident': True, 'resident_pct': 20, 'tax_bp': 625, 'surcharge': 50, 'app': True, 'app_fee': 25}, {'base': 2402, 'tax': 150, 'total': 2629}), ({'base': 1000, 'resident': True, 'resident_pct': 25, 'tax_bp': 1850, 'surcharge': 150, 'app': True, 'app_fee': 35}, {'base': 750, 'tax': 139, 'total': 1080}), ({'base': 3434, 'resident': True, 'resident_pct': 25, 'tax_bp': 1850, 'surcharge': 150, 'app': False, 'app_fee': 25}, {'base': 2576, 'tax': 477, 'total': 3203})], [({'base': 1981, 'resident': True, 'resident_pct': 20, 'tax_bp': 1850, 'surcharge': 150, 'app': True, 'app_fee': 45}, {'base': 1585, 'tax': 293, 'total': 2081}), ({'base': 3279, 'resident': False, 'resident_pct': 20, 'tax_bp': 2250, 'surcharge': 150, 'app': False, 'app_fee': 45}, {'base': 3279, 'tax': 738, 'total': 4167}), ({'base': 2460, 'resident': False, 'resident_pct': 25, 'tax_bp': 625, 'surcharge': 150, 'app': True, 'app_fee': 25}, {'base': 2460, 'tax': 154, 'total': 2791}), ({'base': 1000, 'resident': True, 'resident_pct': 25, 'tax_bp': 1850, 'surcharge': 150, 'app': True, 'app_fee': 35}, {'base': 750, 'tax': 139, 'total': 1080}), ({'base': 3803, 'resident': False, 'resident_pct': 25, 'tax_bp': 1850, 'surcharge': 50, 'app': False, 'app_fee': 35}, {'base': 3803, 'tax': 704, 'total': 4557}), ({'base': 4360, 'resident': False, 'resident_pct': 50, 'tax_bp': 625, 'surcharge': 50, 'app': True, 'app_fee': 45}, {'base': 4360, 'tax': 273, 'total': 4731}), ({'base': 4204, 'resident': False, 'resident_pct': 20, 'tax_bp': 1850, 'surcharge': 50, 'app': False, 'app_fee': 25}, {'base': 4204, 'tax': 778, 'total': 5032}), ({'base': 2514, 'resident': False, 'resident_pct': 20, 'tax_bp': 1850, 'surcharge': 150, 'app': False, 'app_fee': 25}, {'base': 2514, 'tax': 465, 'total': 3129})], [({'base': 4611, 'resident': False, 'resident_pct': 20, 'tax_bp': 2250, 'surcharge': 50, 'app': False, 'app_fee': 45}, {'base': 4611, 'tax': 1037, 'total': 5698}), ({'base': 1000, 'resident': True, 'resident_pct': 25, 'tax_bp': 1850, 'surcharge': 150, 'app': True, 'app_fee': 35}, {'base': 750, 'tax': 139, 'total': 1080}), ({'base': 3136, 'resident': False, 'resident_pct': 20, 'tax_bp': 1000, 'surcharge': 50, 'app': True, 'app_fee': 25}, {'base': 3136, 'tax': 314, 'total': 3528}), ({'base': 3785, 'resident': False, 'resident_pct': 50, 'tax_bp': 1000, 'surcharge': 50, 'app': False, 'app_fee': 45}, {'base': 3785, 'tax': 379, 'total': 4214}), ({'base': 3524, 'resident': False, 'resident_pct': 25, 'tax_bp': 1000, 'surcharge': 150, 'app': False, 'app_fee': 35}, {'base': 3524, 'tax': 352, 'total': 4026}), ({'base': 2889, 'resident': True, 'resident_pct': 20, 'tax_bp': 2250, 'surcharge': 0, 'app': False, 'app_fee': 35}, {'base': 2312, 'tax': 520, 'total': 2832}), ({'base': 4399, 'resident': True, 'resident_pct': 50, 'tax_bp': 1850, 'surcharge': 150, 'app': True, 'app_fee': 25}, {'base': 2200, 'tax': 407, 'total': 2787}), ({'base': 520, 'resident': False, 'resident_pct': 20, 'tax_bp': 2250, 'surcharge': 150, 'app': False, 'app_fee': 25}, {'base': 520, 'tax': 117, 'total': 787})], [({'base': 1169, 'resident': False, 'resident_pct': 20, 'tax_bp': 1000, 'surcharge': 150, 'app': True, 'app_fee': 45}, {'base': 1169, 'tax': 117, 'total': 1486}), ({'base': 262, 'resident': False, 'resident_pct': 25, 'tax_bp': 2250, 'surcharge': 50, 'app': False, 'app_fee': 35}, {'base': 262, 'tax': 59, 'total': 371}), ({'base': 112, 'resident': True, 'resident_pct': 20, 'tax_bp': 1850, 'surcharge': 0, 'app': False, 'app_fee': 25}, {'base': 90, 'tax': 17, 'total': 107}), ({'base': 3364, 'resident': True, 'resident_pct': 20, 'tax_bp': 1850, 'surcharge': 0, 'app': False, 'app_fee': 45}, {'base': 2692, 'tax': 498, 'total': 3190}), ({'base': 2377, 'resident': True, 'resident_pct': 20, 'tax_bp': 1850, 'surcharge': 50, 'app': False, 'app_fee': 25}, {'base': 1902, 'tax': 352, 'total': 2304}), ({'base': 1000, 'resident': True, 'resident_pct': 25, 'tax_bp': 1850, 'surcharge': 150, 'app': True, 'app_fee': 35}, {'base': 750, 'tax': 139, 'total': 1080}), ({'base': 2393, 'resident': False, 'resident_pct': 25, 'tax_bp': 1850, 'surcharge': 150, 'app': True, 'app_fee': 25}, {'base': 2393, 'tax': 443, 'total': 3016}), ({'base': 933, 'resident': True, 'resident_pct': 20, 'tax_bp': 1000, 'surcharge': 0, 'app': True, 'app_fee': 45}, {'base': 747, 'tax': 75, 'total': 872})], [({'base': 1000, 'resident': True, 'resident_pct': 25, 'tax_bp': 1850, 'surcharge': 150, 'app': True, 'app_fee': 35}, {'base': 750, 'tax': 139, 'total': 1080}), ({'base': 968, 'resident': False, 'resident_pct': 20, 'tax_bp': 2250, 'surcharge': 0, 'app': False, 'app_fee': 35}, {'base': 968, 'tax': 218, 'total': 1186}), ({'base': 2247, 'resident': False, 'resident_pct': 50, 'tax_bp': 1850, 'surcharge': 150, 'app': False, 'app_fee': 35}, {'base': 2247, 'tax': 416, 'total': 2813}), ({'base': 549, 'resident': False, 'resident_pct': 50, 'tax_bp': 2250, 'surcharge': 50, 'app': True, 'app_fee': 35}, {'base': 549, 'tax': 124, 'total': 766}), ({'base': 4563, 'resident': True, 'resident_pct': 50, 'tax_bp': 2250, 'surcharge': 50, 'app': True, 'app_fee': 45}, {'base': 2282, 'tax': 513, 'total': 2900}), ({'base': 885, 'resident': True, 'resident_pct': 25, 'tax_bp': 625, 'surcharge': 50, 'app': False, 'app_fee': 35}, {'base': 664, 'tax': 42, 'total': 756}), ({'base': 4948, 'resident': False, 'resident_pct': 50, 'tax_bp': 2250, 'surcharge': 50, 'app': True, 'app_fee': 35}, {'base': 4948, 'tax': 1113, 'total': 6154}), ({'base': 1984, 'resident': True, 'resident_pct': 25, 'tax_bp': 1000, 'surcharge': 150, 'app': False, 'app_fee': 45}, {'base': 1488, 'tax': 149, 'total': 1787})]]
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| fee oracle 0 | {'base': 3638, 'tax': 364, 'total': 4002} | {'base': 3638, 'tax': 364, 'total': 4002} | Passed |
| fee oracle 1 | {'base': 407, 'tax': 41, 'total': 498} | {'base': 407, 'tax': 41, 'total': 498} | Passed |
| fee oracle 2 | {'base': 3231, 'tax': 598, 'total': 3904} | {'base': 3231, 'tax': 598, 'total': 3909} | Failed |
| fee oracle 3 | {'base': 3732, 'tax': 373, 'total': 4130} | {'base': 3732, 'tax': 373, 'total': 4133} | Failed |
| fee oracle 4 | {'base': 291, 'tax': 54, 'total': 495} | {'base': 291, 'tax': 54, 'total': 495} | Passed |
| fee oracle 5 | {'base': 2402, 'tax': 150, 'total': 2627} | {'base': 2402, 'tax': 150, 'total': 2629} | Failed |
| fee oracle 6 | {'base': 750, 'tax': 139, 'total': 1074} | {'base': 750, 'tax': 139, 'total': 1080} | Failed |
| fee oracle 7 | {'base': 2576, 'tax': 477, 'total': 3203} | {'base': 2576, 'tax': 477, 'total': 3203} | Passed |
SHA-256 / 5498229925aea4a2628afea4b2aa734db8e9c02a220b97a79da6136e94150815
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 -= base * x['resident_pct'] // 100
tax = (base * x['tax_bp'] + 5000) // 10000
total = base + tax + x['surcharge']
if x['app']:
total += x['app_fee'] * (10000 + x['tax_bp']) // 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': 3638, 'resident': False, 'resident_pct': 50, 'tax_bp': 1000, 'surcharge': 0, 'app': False, 'app_fee': 45}, {'base': 3638, 'tax': 364, 'total': 4002}), ({'base': 407, 'resident': False, 'resident_pct': 25, 'tax_bp': 1000, 'surcharge': 50, 'app': False, 'app_fee': 25}, {'base': 407, 'tax': 41, 'total': 498}), ({'base': 3231, 'resident': False, 'resident_pct': 50, 'tax_bp': 1850, 'surcharge': 50, 'app': True, 'app_fee': 25}, {'base': 3231, 'tax': 598, 'total': 3909}), ({'base': 3732, 'resident': False, 'resident_pct': 20, 'tax_bp': 1000, 'surcharge': 0, 'app': True, 'app_fee': 25}, {'base': 3732, 'tax': 373, 'total': 4133}), ({'base': 363, 'resident': True, 'resident_pct': 20, 'tax_bp': 1850, 'surcharge': 150, 'app': False, 'app_fee': 35}, {'base': 291, 'tax': 54, 'total': 495}), ({'base': 3002, 'resident': True, 'resident_pct': 20, 'tax_bp': 625, 'surcharge': 50, 'app': True, 'app_fee': 25}, {'base': 2402, 'tax': 150, 'total': 2629}), ({'base': 1000, 'resident': True, 'resident_pct': 25, 'tax_bp': 1850, 'surcharge': 150, 'app': True, 'app_fee': 35}, {'base': 750, 'tax': 139, 'total': 1080}), ({'base': 3434, 'resident': True, 'resident_pct': 25, 'tax_bp': 1850, 'surcharge': 150, 'app': False, 'app_fee': 25}, {'base': 2576, 'tax': 477, 'total': 3203})], [({'base': 1981, 'resident': True, 'resident_pct': 20, 'tax_bp': 1850, 'surcharge': 150, 'app': True, 'app_fee': 45}, {'base': 1585, 'tax': 293, 'total': 2081}), ({'base': 3279, 'resident': False, 'resident_pct': 20, 'tax_bp': 2250, 'surcharge': 150, 'app': False, 'app_fee': 45}, {'base': 3279, 'tax': 738, 'total': 4167}), ({'base': 2460, 'resident': False, 'resident_pct': 25, 'tax_bp': 625, 'surcharge': 150, 'app': True, 'app_fee': 25}, {'base': 2460, 'tax': 154, 'total': 2791}), ({'base': 1000, 'resident': True, 'resident_pct': 25, 'tax_bp': 1850, 'surcharge': 150, 'app': True, 'app_fee': 35}, {'base': 750, 'tax': 139, 'total': 1080}), ({'base': 3803, 'resident': False, 'resident_pct': 25, 'tax_bp': 1850, 'surcharge': 50, 'app': False, 'app_fee': 35}, {'base': 3803, 'tax': 704, 'total': 4557}), ({'base': 4360, 'resident': False, 'resident_pct': 50, 'tax_bp': 625, 'surcharge': 50, 'app': True, 'app_fee': 45}, {'base': 4360, 'tax': 273, 'total': 4731}), ({'base': 4204, 'resident': False, 'resident_pct': 20, 'tax_bp': 1850, 'surcharge': 50, 'app': False, 'app_fee': 25}, {'base': 4204, 'tax': 778, 'total': 5032}), ({'base': 2514, 'resident': False, 'resident_pct': 20, 'tax_bp': 1850, 'surcharge': 150, 'app': False, 'app_fee': 25}, {'base': 2514, 'tax': 465, 'total': 3129})], [({'base': 4611, 'resident': False, 'resident_pct': 20, 'tax_bp': 2250, 'surcharge': 50, 'app': False, 'app_fee': 45}, {'base': 4611, 'tax': 1037, 'total': 5698}), ({'base': 1000, 'resident': True, 'resident_pct': 25, 'tax_bp': 1850, 'surcharge': 150, 'app': True, 'app_fee': 35}, {'base': 750, 'tax': 139, 'total': 1080}), ({'base': 3136, 'resident': False, 'resident_pct': 20, 'tax_bp': 1000, 'surcharge': 50, 'app': True, 'app_fee': 25}, {'base': 3136, 'tax': 314, 'total': 3528}), ({'base': 3785, 'resident': False, 'resident_pct': 50, 'tax_bp': 1000, 'surcharge': 50, 'app': False, 'app_fee': 45}, {'base': 3785, 'tax': 379, 'total': 4214}), ({'base': 3524, 'resident': False, 'resident_pct': 25, 'tax_bp': 1000, 'surcharge': 150, 'app': False, 'app_fee': 35}, {'base': 3524, 'tax': 352, 'total': 4026}), ({'base': 2889, 'resident': True, 'resident_pct': 20, 'tax_bp': 2250, 'surcharge': 0, 'app': False, 'app_fee': 35}, {'base': 2312, 'tax': 520, 'total': 2832}), ({'base': 4399, 'resident': True, 'resident_pct': 50, 'tax_bp': 1850, 'surcharge': 150, 'app': True, 'app_fee': 25}, {'base': 2200, 'tax': 407, 'total': 2787}), ({'base': 520, 'resident': False, 'resident_pct': 20, 'tax_bp': 2250, 'surcharge': 150, 'app': False, 'app_fee': 25}, {'base': 520, 'tax': 117, 'total': 787})], [({'base': 1169, 'resident': False, 'resident_pct': 20, 'tax_bp': 1000, 'surcharge': 150, 'app': True, 'app_fee': 45}, {'base': 1169, 'tax': 117, 'total': 1486}), ({'base': 262, 'resident': False, 'resident_pct': 25, 'tax_bp': 2250, 'surcharge': 50, 'app': False, 'app_fee': 35}, {'base': 262, 'tax': 59, 'total': 371}), ({'base': 112, 'resident': True, 'resident_pct': 20, 'tax_bp': 1850, 'surcharge': 0, 'app': False, 'app_fee': 25}, {'base': 90, 'tax': 17, 'total': 107}), ({'base': 3364, 'resident': True, 'resident_pct': 20, 'tax_bp': 1850, 'surcharge': 0, 'app': False, 'app_fee': 45}, {'base': 2692, 'tax': 498, 'total': 3190}), ({'base': 2377, 'resident': True, 'resident_pct': 20, 'tax_bp': 1850, 'surcharge': 50, 'app': False, 'app_fee': 25}, {'base': 1902, 'tax': 352, 'total': 2304}), ({'base': 1000, 'resident': True, 'resident_pct': 25, 'tax_bp': 1850, 'surcharge': 150, 'app': True, 'app_fee': 35}, {'base': 750, 'tax': 139, 'total': 1080}), ({'base': 2393, 'resident': False, 'resident_pct': 25, 'tax_bp': 1850, 'surcharge': 150, 'app': True, 'app_fee': 25}, {'base': 2393, 'tax': 443, 'total': 3016}), ({'base': 933, 'resident': True, 'resident_pct': 20, 'tax_bp': 1000, 'surcharge': 0, 'app': True, 'app_fee': 45}, {'base': 747, 'tax': 75, 'total': 872})], [({'base': 1000, 'resident': True, 'resident_pct': 25, 'tax_bp': 1850, 'surcharge': 150, 'app': True, 'app_fee': 35}, {'base': 750, 'tax': 139, 'total': 1080}), ({'base': 968, 'resident': False, 'resident_pct': 20, 'tax_bp': 2250, 'surcharge': 0, 'app': False, 'app_fee': 35}, {'base': 968, 'tax': 218, 'total': 1186}), ({'base': 2247, 'resident': False, 'resident_pct': 50, 'tax_bp': 1850, 'surcharge': 150, 'app': False, 'app_fee': 35}, {'base': 2247, 'tax': 416, 'total': 2813}), ({'base': 549, 'resident': False, 'resident_pct': 50, 'tax_bp': 2250, 'surcharge': 50, 'app': True, 'app_fee': 35}, {'base': 549, 'tax': 124, 'total': 766}), ({'base': 4563, 'resident': True, 'resident_pct': 50, 'tax_bp': 2250, 'surcharge': 50, 'app': True, 'app_fee': 45}, {'base': 2282, 'tax': 513, 'total': 2900}), ({'base': 885, 'resident': True, 'resident_pct': 25, 'tax_bp': 625, 'surcharge': 50, 'app': False, 'app_fee': 35}, {'base': 664, 'tax': 42, 'total': 756}), ({'base': 4948, 'resident': False, 'resident_pct': 50, 'tax_bp': 2250, 'surcharge': 50, 'app': True, 'app_fee': 35}, {'base': 4948, 'tax': 1113, 'total': 6154}), ({'base': 1984, 'resident': True, 'resident_pct': 25, 'tax_bp': 1000, 'surcharge': 150, 'app': False, 'app_fee': 45}, {'base': 1488, 'tax': 149, 'total': 1787})]]
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| fee oracle 0 | {'base': 3638, 'tax': 364, 'total': 4002} | {'base': 3638, 'tax': 364, 'total': 4002} | Passed |
| fee oracle 1 | {'base': 407, 'tax': 41, 'total': 498} | {'base': 407, 'tax': 41, 'total': 498} | Passed |
| fee oracle 2 | {'base': 3231, 'tax': 598, 'total': 3908} | {'base': 3231, 'tax': 598, 'total': 3909} | Failed |
| fee oracle 3 | {'base': 3732, 'tax': 373, 'total': 4132} | {'base': 3732, 'tax': 373, 'total': 4133} | Failed |
| fee oracle 4 | {'base': 291, 'tax': 54, 'total': 495} | {'base': 291, 'tax': 54, 'total': 495} | Passed |
| fee oracle 5 | {'base': 2402, 'tax': 150, 'total': 2628} | {'base': 2402, 'tax': 150, 'total': 2629} | Failed |
| fee oracle 6 | {'base': 750, 'tax': 139, 'total': 1080} | {'base': 750, 'tax': 139, 'total': 1080} | Passed |
| fee oracle 7 | {'base': 2576, 'tax': 477, 'total': 3203} | {'base': 2576, 'tax': 477, 'total': 3203} | Passed |
SHA-256 / 93af69b72bd1efcfe0f76ba0ea3f50f1e21ae3c8bdc79fb04be808937c0eb2b8
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': 3638, 'resident': False, 'resident_pct': 50, 'tax_bp': 1000, 'surcharge': 0, 'app': False, 'app_fee': 45}, {'base': 3638, 'tax': 364, 'total': 4002}), ({'base': 407, 'resident': False, 'resident_pct': 25, 'tax_bp': 1000, 'surcharge': 50, 'app': False, 'app_fee': 25}, {'base': 407, 'tax': 41, 'total': 498}), ({'base': 3231, 'resident': False, 'resident_pct': 50, 'tax_bp': 1850, 'surcharge': 50, 'app': True, 'app_fee': 25}, {'base': 3231, 'tax': 598, 'total': 3909}), ({'base': 3732, 'resident': False, 'resident_pct': 20, 'tax_bp': 1000, 'surcharge': 0, 'app': True, 'app_fee': 25}, {'base': 3732, 'tax': 373, 'total': 4133}), ({'base': 363, 'resident': True, 'resident_pct': 20, 'tax_bp': 1850, 'surcharge': 150, 'app': False, 'app_fee': 35}, {'base': 291, 'tax': 54, 'total': 495}), ({'base': 3002, 'resident': True, 'resident_pct': 20, 'tax_bp': 625, 'surcharge': 50, 'app': True, 'app_fee': 25}, {'base': 2402, 'tax': 150, 'total': 2629}), ({'base': 1000, 'resident': True, 'resident_pct': 25, 'tax_bp': 1850, 'surcharge': 150, 'app': True, 'app_fee': 35}, {'base': 750, 'tax': 139, 'total': 1080}), ({'base': 3434, 'resident': True, 'resident_pct': 25, 'tax_bp': 1850, 'surcharge': 150, 'app': False, 'app_fee': 25}, {'base': 2576, 'tax': 477, 'total': 3203})], [({'base': 1981, 'resident': True, 'resident_pct': 20, 'tax_bp': 1850, 'surcharge': 150, 'app': True, 'app_fee': 45}, {'base': 1585, 'tax': 293, 'total': 2081}), ({'base': 3279, 'resident': False, 'resident_pct': 20, 'tax_bp': 2250, 'surcharge': 150, 'app': False, 'app_fee': 45}, {'base': 3279, 'tax': 738, 'total': 4167}), ({'base': 2460, 'resident': False, 'resident_pct': 25, 'tax_bp': 625, 'surcharge': 150, 'app': True, 'app_fee': 25}, {'base': 2460, 'tax': 154, 'total': 2791}), ({'base': 1000, 'resident': True, 'resident_pct': 25, 'tax_bp': 1850, 'surcharge': 150, 'app': True, 'app_fee': 35}, {'base': 750, 'tax': 139, 'total': 1080}), ({'base': 3803, 'resident': False, 'resident_pct': 25, 'tax_bp': 1850, 'surcharge': 50, 'app': False, 'app_fee': 35}, {'base': 3803, 'tax': 704, 'total': 4557}), ({'base': 4360, 'resident': False, 'resident_pct': 50, 'tax_bp': 625, 'surcharge': 50, 'app': True, 'app_fee': 45}, {'base': 4360, 'tax': 273, 'total': 4731}), ({'base': 4204, 'resident': False, 'resident_pct': 20, 'tax_bp': 1850, 'surcharge': 50, 'app': False, 'app_fee': 25}, {'base': 4204, 'tax': 778, 'total': 5032}), ({'base': 2514, 'resident': False, 'resident_pct': 20, 'tax_bp': 1850, 'surcharge': 150, 'app': False, 'app_fee': 25}, {'base': 2514, 'tax': 465, 'total': 3129})], [({'base': 4611, 'resident': False, 'resident_pct': 20, 'tax_bp': 2250, 'surcharge': 50, 'app': False, 'app_fee': 45}, {'base': 4611, 'tax': 1037, 'total': 5698}), ({'base': 1000, 'resident': True, 'resident_pct': 25, 'tax_bp': 1850, 'surcharge': 150, 'app': True, 'app_fee': 35}, {'base': 750, 'tax': 139, 'total': 1080}), ({'base': 3136, 'resident': False, 'resident_pct': 20, 'tax_bp': 1000, 'surcharge': 50, 'app': True, 'app_fee': 25}, {'base': 3136, 'tax': 314, 'total': 3528}), ({'base': 3785, 'resident': False, 'resident_pct': 50, 'tax_bp': 1000, 'surcharge': 50, 'app': False, 'app_fee': 45}, {'base': 3785, 'tax': 379, 'total': 4214}), ({'base': 3524, 'resident': False, 'resident_pct': 25, 'tax_bp': 1000, 'surcharge': 150, 'app': False, 'app_fee': 35}, {'base': 3524, 'tax': 352, 'total': 4026}), ({'base': 2889, 'resident': True, 'resident_pct': 20, 'tax_bp': 2250, 'surcharge': 0, 'app': False, 'app_fee': 35}, {'base': 2312, 'tax': 520, 'total': 2832}), ({'base': 4399, 'resident': True, 'resident_pct': 50, 'tax_bp': 1850, 'surcharge': 150, 'app': True, 'app_fee': 25}, {'base': 2200, 'tax': 407, 'total': 2787}), ({'base': 520, 'resident': False, 'resident_pct': 20, 'tax_bp': 2250, 'surcharge': 150, 'app': False, 'app_fee': 25}, {'base': 520, 'tax': 117, 'total': 787})], [({'base': 1169, 'resident': False, 'resident_pct': 20, 'tax_bp': 1000, 'surcharge': 150, 'app': True, 'app_fee': 45}, {'base': 1169, 'tax': 117, 'total': 1486}), ({'base': 262, 'resident': False, 'resident_pct': 25, 'tax_bp': 2250, 'surcharge': 50, 'app': False, 'app_fee': 35}, {'base': 262, 'tax': 59, 'total': 371}), ({'base': 112, 'resident': True, 'resident_pct': 20, 'tax_bp': 1850, 'surcharge': 0, 'app': False, 'app_fee': 25}, {'base': 90, 'tax': 17, 'total': 107}), ({'base': 3364, 'resident': True, 'resident_pct': 20, 'tax_bp': 1850, 'surcharge': 0, 'app': False, 'app_fee': 45}, {'base': 2692, 'tax': 498, 'total': 3190}), ({'base': 2377, 'resident': True, 'resident_pct': 20, 'tax_bp': 1850, 'surcharge': 50, 'app': False, 'app_fee': 25}, {'base': 1902, 'tax': 352, 'total': 2304}), ({'base': 1000, 'resident': True, 'resident_pct': 25, 'tax_bp': 1850, 'surcharge': 150, 'app': True, 'app_fee': 35}, {'base': 750, 'tax': 139, 'total': 1080}), ({'base': 2393, 'resident': False, 'resident_pct': 25, 'tax_bp': 1850, 'surcharge': 150, 'app': True, 'app_fee': 25}, {'base': 2393, 'tax': 443, 'total': 3016}), ({'base': 933, 'resident': True, 'resident_pct': 20, 'tax_bp': 1000, 'surcharge': 0, 'app': True, 'app_fee': 45}, {'base': 747, 'tax': 75, 'total': 872})], [({'base': 1000, 'resident': True, 'resident_pct': 25, 'tax_bp': 1850, 'surcharge': 150, 'app': True, 'app_fee': 35}, {'base': 750, 'tax': 139, 'total': 1080}), ({'base': 968, 'resident': False, 'resident_pct': 20, 'tax_bp': 2250, 'surcharge': 0, 'app': False, 'app_fee': 35}, {'base': 968, 'tax': 218, 'total': 1186}), ({'base': 2247, 'resident': False, 'resident_pct': 50, 'tax_bp': 1850, 'surcharge': 150, 'app': False, 'app_fee': 35}, {'base': 2247, 'tax': 416, 'total': 2813}), ({'base': 549, 'resident': False, 'resident_pct': 50, 'tax_bp': 2250, 'surcharge': 50, 'app': True, 'app_fee': 35}, {'base': 549, 'tax': 124, 'total': 766}), ({'base': 4563, 'resident': True, 'resident_pct': 50, 'tax_bp': 2250, 'surcharge': 50, 'app': True, 'app_fee': 45}, {'base': 2282, 'tax': 513, 'total': 2900}), ({'base': 885, 'resident': True, 'resident_pct': 25, 'tax_bp': 625, 'surcharge': 50, 'app': False, 'app_fee': 35}, {'base': 664, 'tax': 42, 'total': 756}), ({'base': 4948, 'resident': False, 'resident_pct': 50, 'tax_bp': 2250, 'surcharge': 50, 'app': True, 'app_fee': 35}, {'base': 4948, 'tax': 1113, 'total': 6154}), ({'base': 1984, 'resident': True, 'resident_pct': 25, 'tax_bp': 1000, 'surcharge': 150, 'app': False, 'app_fee': 45}, {'base': 1488, 'tax': 149, 'total': 1787})]]
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| fee oracle 0 | {'base': 3638, 'tax': 364, 'total': 4002} | {'base': 3638, 'tax': 364, 'total': 4002} | Passed |
| fee oracle 1 | {'base': 407, 'tax': 41, 'total': 498} | {'base': 407, 'tax': 41, 'total': 498} | Passed |
| fee oracle 2 | {'base': 3231, 'tax': 598, 'total': 3909} | {'base': 3231, 'tax': 598, 'total': 3909} | Passed |
| fee oracle 3 | {'base': 3732, 'tax': 373, 'total': 4133} | {'base': 3732, 'tax': 373, 'total': 4133} | Passed |
| fee oracle 4 | {'base': 291, 'tax': 54, 'total': 495} | {'base': 291, 'tax': 54, 'total': 495} | Passed |
| fee oracle 5 | {'base': 2402, 'tax': 150, 'total': 2629} | {'base': 2402, 'tax': 150, 'total': 2629} | Passed |
| fee oracle 6 | {'base': 750, 'tax': 139, 'total': 1080} | {'base': 750, 'tax': 139, 'total': 1080} | Passed |
| fee oracle 7 | {'base': 2576, 'tax': 477, 'total': 3203} | {'base': 2576, 'tax': 477, 'total': 3203} | Passed |
SHA-256 / e9e120800a24f16470d69f35d738ee73d2af23f5e285567a8bead43af8e91ad9
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.851580+00:00.
Case digest / 1ed27ad26bb316a93ad574394f3065aef403c2ee3099d2c85376333943d64942