FA-68796 / Toll and parking fee computation / Open access
Unpaid toll violation escalation: penalties keep accruing after payment · case 01
Unpaid toll violation escalation returns a wrong result when penalties keep accruing after payment.
ROOT CAUSE
Age is measured to today even for paid notices, escalating violations that were settled in time.
VERIFIED REPAIR
Restore the evaluation day rule so that the step reads `x['paid_day'] if x['paid_day'] is not None else x['today']`.
Unsuccessful approach: A truthiness test treats a payment on day 0 as unpaid and keeps escalating it.
Case contract
Input {toll, issued_day, paid_day (or null), today, first_fee, second_fee, stage1_days, stage2_days, cap, waiver_first}. Age is measured to the payment day if paid, else today. Age above stage1 adds first_fee; first-time offenders (waiver_first) who actually paid within stage2 have it waived. Age above stage2 adds second_fee. Penalties (not the toll) are capped at cap. Return amount due.
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):
ev = x['today']
age = ev - x['issued_day']
pen = 0
if age > x['stage1_days']:
pen += x['first_fee']
if x['waiver_first'] and x['paid_day'] is not None and age <= x['stage2_days']:
pen -= x['first_fee']
if age > x['stage2_days']:
pen += x['second_fee']
return x['toll'] + min(pen, x['cap'])
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[({'toll': 400, 'issued_day': 86, 'paid_day': 105, 'today': 117, 'first_fee': 500, 'second_fee': 5000, 'stage1_days': 30, 'stage2_days': 60, 'cap': 7500, 'waiver_first': False}, 400), ({'toll': 250, 'issued_day': 42, 'paid_day': None, 'today': 73, 'first_fee': 1000, 'second_fee': 5000, 'stage1_days': 30, 'stage2_days': 60, 'cap': 5000, 'waiver_first': True}, 1250), ({'toll': 250, 'issued_day': 41, 'paid_day': 71, 'today': 102, 'first_fee': 1000, 'second_fee': 2500, 'stage1_days': 30, 'stage2_days': 60, 'cap': 7500, 'waiver_first': True}, 250), ({'toll': 400, 'issued_day': 97, 'paid_day': None, 'today': 128, 'first_fee': 1000, 'second_fee': 5000, 'stage1_days': 30, 'stage2_days': 60, 'cap': 7500, 'waiver_first': False}, 1400), ({'toll': 875, 'issued_day': 0, 'paid_day': None, 'today': 100, 'first_fee': 1000, 'second_fee': 5000, 'stage1_days': 30, 'stage2_days': 60, 'cap': 3000, 'waiver_first': False}, 3875), ({'toll': 400, 'issued_day': 97, 'paid_day': None, 'today': 127, 'first_fee': 1000, 'second_fee': 2500, 'stage1_days': 30, 'stage2_days': 60, 'cap': 7500, 'waiver_first': False}, 400), ({'toll': 400, 'issued_day': 0, 'paid_day': None, 'today': 45, 'first_fee': 1000, 'second_fee': 2500, 'stage1_days': 30, 'stage2_days': 60, 'cap': 5000, 'waiver_first': True}, 1400), ({'toll': 400, 'issued_day': 0, 'paid_day': 0, 'today': 45, 'first_fee': 1000, 'second_fee': 2500, 'stage1_days': 30, 'stage2_days': 60, 'cap': 5000, 'waiver_first': False}, 400)], [({'toll': 875, 'issued_day': 0, 'paid_day': None, 'today': 100, 'first_fee': 1000, 'second_fee': 5000, 'stage1_days': 30, 'stage2_days': 60, 'cap': 3000, 'waiver_first': False}, 3875), ({'toll': 400, 'issued_day': 0, 'paid_day': None, 'today': 45, 'first_fee': 1000, 'second_fee': 2500, 'stage1_days': 30, 'stage2_days': 60, 'cap': 5000, 'waiver_first': True}, 1400), ({'toll': 875, 'issued_day': 16, 'paid_day': 20, 'today': 77, 'first_fee': 500, 'second_fee': 5000, 'stage1_days': 30, 'stage2_days': 60, 'cap': 5000, 'waiver_first': False}, 875), ({'toll': 400, 'issued_day': 0, 'paid_day': 0, 'today': 45, 'first_fee': 1000, 'second_fee': 2500, 'stage1_days': 30, 'stage2_days': 60, 'cap': 5000, 'waiver_first': False}, 400), ({'toll': 875, 'issued_day': 76, 'paid_day': None, 'today': 106, 'first_fee': 500, 'second_fee': 5000, 'stage1_days': 30, 'stage2_days': 60, 'cap': 5000, 'waiver_first': False}, 875), ({'toll': 250, 'issued_day': 45, 'paid_day': None, 'today': 105, 'first_fee': 500, 'second_fee': 5000, 'stage1_days': 30, 'stage2_days': 60, 'cap': 7500, 'waiver_first': True}, 750), ({'toll': 400, 'issued_day': 10, 'paid_day': 70, 'today': 90, 'first_fee': 1000, 'second_fee': 2500, 'stage1_days': 30, 'stage2_days': 60, 'cap': 5000, 'waiver_first': True}, 400), ({'toll': 875, 'issued_day': 30, 'paid_day': 60, 'today': 91, 'first_fee': 500, 'second_fee': 5000, 'stage1_days': 30, 'stage2_days': 60, 'cap': 7500, 'waiver_first': False}, 875)], [({'toll': 875, 'issued_day': 50, 'paid_day': None, 'today': 94, 'first_fee': 500, 'second_fee': 5000, 'stage1_days': 30, 'stage2_days': 60, 'cap': 7500, 'waiver_first': False}, 1375), ({'toll': 400, 'issued_day': 0, 'paid_day': None, 'today': 45, 'first_fee': 1000, 'second_fee': 2500, 'stage1_days': 30, 'stage2_days': 60, 'cap': 5000, 'waiver_first': True}, 1400), ({'toll': 400, 'issued_day': 0, 'paid_day': 0, 'today': 45, 'first_fee': 1000, 'second_fee': 2500, 'stage1_days': 30, 'stage2_days': 60, 'cap': 5000, 'waiver_first': False}, 400), ({'toll': 250, 'issued_day': 86, 'paid_day': 117, 'today': 147, 'first_fee': 1000, 'second_fee': 2500, 'stage1_days': 30, 'stage2_days': 60, 'cap': 5000, 'waiver_first': True}, 250), ({'toll': 400, 'issued_day': 44, 'paid_day': 74, 'today': 75, 'first_fee': 500, 'second_fee': 2500, 'stage1_days': 30, 'stage2_days': 60, 'cap': 3000, 'waiver_first': False}, 400), ({'toll': 875, 'issued_day': 0, 'paid_day': None, 'today': 100, 'first_fee': 1000, 'second_fee': 5000, 'stage1_days': 30, 'stage2_days': 60, 'cap': 3000, 'waiver_first': False}, 3875), ({'toll': 875, 'issued_day': 98, 'paid_day': 129, 'today': 129, 'first_fee': 500, 'second_fee': 2500, 'stage1_days': 30, 'stage2_days': 60, 'cap': 7500, 'waiver_first': True}, 875), ({'toll': 400, 'issued_day': 10, 'paid_day': 70, 'today': 90, 'first_fee': 1000, 'second_fee': 2500, 'stage1_days': 30, 'stage2_days': 60, 'cap': 5000, 'waiver_first': True}, 400)], [({'toll': 250, 'issued_day': 28, 'paid_day': None, 'today': 59, 'first_fee': 500, 'second_fee': 2500, 'stage1_days': 30, 'stage2_days': 60, 'cap': 3000, 'waiver_first': False}, 750), ({'toll': 400, 'issued_day': 7, 'paid_day': None, 'today': 37, 'first_fee': 500, 'second_fee': 5000, 'stage1_days': 30, 'stage2_days': 60, 'cap': 7500, 'waiver_first': False}, 400), ({'toll': 400, 'issued_day': 0, 'paid_day': None, 'today': 45, 'first_fee': 1000, 'second_fee': 2500, 'stage1_days': 30, 'stage2_days': 60, 'cap': 5000, 'waiver_first': True}, 1400), ({'toll': 400, 'issued_day': 0, 'paid_day': 0, 'today': 45, 'first_fee': 1000, 'second_fee': 2500, 'stage1_days': 30, 'stage2_days': 60, 'cap': 5000, 'waiver_first': False}, 400), ({'toll': 875, 'issued_day': 2, 'paid_day': 33, 'today': 63, 'first_fee': 1000, 'second_fee': 2500, 'stage1_days': 30, 'stage2_days': 60, 'cap': 3000, 'waiver_first': True}, 875), ({'toll': 400, 'issued_day': 10, 'paid_day': 40, 'today': 90, 'first_fee': 1000, 'second_fee': 2500, 'stage1_days': 30, 'stage2_days': 60, 'cap': 5000, 'waiver_first': False}, 400), ({'toll': 875, 'issued_day': 65, 'paid_day': 96, 'today': 96, 'first_fee': 1000, 'second_fee': 2500, 'stage1_days': 30, 'stage2_days': 60, 'cap': 5000, 'waiver_first': False}, 1875), ({'toll': 400, 'issued_day': 10, 'paid_day': 70, 'today': 90, 'first_fee': 1000, 'second_fee': 2500, 'stage1_days': 30, 'stage2_days': 60, 'cap': 5000, 'waiver_first': True}, 400)], [({'toll': 250, 'issued_day': 18, 'paid_day': 48, 'today': 77, 'first_fee': 500, 'second_fee': 5000, 'stage1_days': 30, 'stage2_days': 60, 'cap': 3000, 'waiver_first': False}, 250), ({'toll': 875, 'issued_day': 0, 'paid_day': None, 'today': 100, 'first_fee': 1000, 'second_fee': 5000, 'stage1_days': 30, 'stage2_days': 60, 'cap': 3000, 'waiver_first': False}, 3875), ({'toll': 400, 'issued_day': 10, 'paid_day': 70, 'today': 90, 'first_fee': 1000, 'second_fee': 2500, 'stage1_days': 30, 'stage2_days': 60, 'cap': 5000, 'waiver_first': True}, 400), ({'toll': 875, 'issued_day': 86, 'paid_day': 116, 'today': 147, 'first_fee': 500, 'second_fee': 2500, 'stage1_days': 30, 'stage2_days': 60, 'cap': 7500, 'waiver_first': False}, 875), ({'toll': 400, 'issued_day': 0, 'paid_day': 0, 'today': 45, 'first_fee': 1000, 'second_fee': 2500, 'stage1_days': 30, 'stage2_days': 60, 'cap': 5000, 'waiver_first': False}, 400), ({'toll': 250, 'issued_day': 8, 'paid_day': None, 'today': 91, 'first_fee': 500, 'second_fee': 2500, 'stage1_days': 30, 'stage2_days': 60, 'cap': 5000, 'waiver_first': False}, 3250), ({'toll': 875, 'issued_day': 78, 'paid_day': None, 'today': 109, 'first_fee': 500, 'second_fee': 5000, 'stage1_days': 30, 'stage2_days': 60, 'cap': 5000, 'waiver_first': True}, 1375), ({'toll': 400, 'issued_day': 0, 'paid_day': None, 'today': 45, 'first_fee': 1000, 'second_fee': 2500, 'stage1_days': 30, 'stage2_days': 60, 'cap': 5000, 'waiver_first': True}, 1400)]]
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 | 900 | 400 | Failed |
| fee oracle 1 | 1250 | 1250 | Passed |
| fee oracle 2 | 3750 | 250 | Failed |
| fee oracle 3 | 1400 | 1400 | Passed |
| fee oracle 4 | 3875 | 3875 | Passed |
| fee oracle 5 | 400 | 400 | Passed |
| fee oracle 6 | 1400 | 1400 | Passed |
| fee oracle 7 | 1400 | 400 | Failed |
SHA-256 / 4da63533b7e79a667ee837c284a85f35fb4b6a101a23683f71886e2d6bd829c8
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
ev = x['paid_day'] if x['paid_day'] else x['today']
age = ev - x['issued_day']
pen = 0
if age > x['stage1_days']:
pen += x['first_fee']
if x['waiver_first'] and x['paid_day'] is not None and age <= x['stage2_days']:
pen -= x['first_fee']
if age > x['stage2_days']:
pen += x['second_fee']
return x['toll'] + min(pen, x['cap'])
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[({'toll': 400, 'issued_day': 86, 'paid_day': 105, 'today': 117, 'first_fee': 500, 'second_fee': 5000, 'stage1_days': 30, 'stage2_days': 60, 'cap': 7500, 'waiver_first': False}, 400), ({'toll': 250, 'issued_day': 42, 'paid_day': None, 'today': 73, 'first_fee': 1000, 'second_fee': 5000, 'stage1_days': 30, 'stage2_days': 60, 'cap': 5000, 'waiver_first': True}, 1250), ({'toll': 250, 'issued_day': 41, 'paid_day': 71, 'today': 102, 'first_fee': 1000, 'second_fee': 2500, 'stage1_days': 30, 'stage2_days': 60, 'cap': 7500, 'waiver_first': True}, 250), ({'toll': 400, 'issued_day': 97, 'paid_day': None, 'today': 128, 'first_fee': 1000, 'second_fee': 5000, 'stage1_days': 30, 'stage2_days': 60, 'cap': 7500, 'waiver_first': False}, 1400), ({'toll': 875, 'issued_day': 0, 'paid_day': None, 'today': 100, 'first_fee': 1000, 'second_fee': 5000, 'stage1_days': 30, 'stage2_days': 60, 'cap': 3000, 'waiver_first': False}, 3875), ({'toll': 400, 'issued_day': 97, 'paid_day': None, 'today': 127, 'first_fee': 1000, 'second_fee': 2500, 'stage1_days': 30, 'stage2_days': 60, 'cap': 7500, 'waiver_first': False}, 400), ({'toll': 400, 'issued_day': 0, 'paid_day': None, 'today': 45, 'first_fee': 1000, 'second_fee': 2500, 'stage1_days': 30, 'stage2_days': 60, 'cap': 5000, 'waiver_first': True}, 1400), ({'toll': 400, 'issued_day': 0, 'paid_day': 0, 'today': 45, 'first_fee': 1000, 'second_fee': 2500, 'stage1_days': 30, 'stage2_days': 60, 'cap': 5000, 'waiver_first': False}, 400)], [({'toll': 875, 'issued_day': 0, 'paid_day': None, 'today': 100, 'first_fee': 1000, 'second_fee': 5000, 'stage1_days': 30, 'stage2_days': 60, 'cap': 3000, 'waiver_first': False}, 3875), ({'toll': 400, 'issued_day': 0, 'paid_day': None, 'today': 45, 'first_fee': 1000, 'second_fee': 2500, 'stage1_days': 30, 'stage2_days': 60, 'cap': 5000, 'waiver_first': True}, 1400), ({'toll': 875, 'issued_day': 16, 'paid_day': 20, 'today': 77, 'first_fee': 500, 'second_fee': 5000, 'stage1_days': 30, 'stage2_days': 60, 'cap': 5000, 'waiver_first': False}, 875), ({'toll': 400, 'issued_day': 0, 'paid_day': 0, 'today': 45, 'first_fee': 1000, 'second_fee': 2500, 'stage1_days': 30, 'stage2_days': 60, 'cap': 5000, 'waiver_first': False}, 400), ({'toll': 875, 'issued_day': 76, 'paid_day': None, 'today': 106, 'first_fee': 500, 'second_fee': 5000, 'stage1_days': 30, 'stage2_days': 60, 'cap': 5000, 'waiver_first': False}, 875), ({'toll': 250, 'issued_day': 45, 'paid_day': None, 'today': 105, 'first_fee': 500, 'second_fee': 5000, 'stage1_days': 30, 'stage2_days': 60, 'cap': 7500, 'waiver_first': True}, 750), ({'toll': 400, 'issued_day': 10, 'paid_day': 70, 'today': 90, 'first_fee': 1000, 'second_fee': 2500, 'stage1_days': 30, 'stage2_days': 60, 'cap': 5000, 'waiver_first': True}, 400), ({'toll': 875, 'issued_day': 30, 'paid_day': 60, 'today': 91, 'first_fee': 500, 'second_fee': 5000, 'stage1_days': 30, 'stage2_days': 60, 'cap': 7500, 'waiver_first': False}, 875)], [({'toll': 875, 'issued_day': 50, 'paid_day': None, 'today': 94, 'first_fee': 500, 'second_fee': 5000, 'stage1_days': 30, 'stage2_days': 60, 'cap': 7500, 'waiver_first': False}, 1375), ({'toll': 400, 'issued_day': 0, 'paid_day': None, 'today': 45, 'first_fee': 1000, 'second_fee': 2500, 'stage1_days': 30, 'stage2_days': 60, 'cap': 5000, 'waiver_first': True}, 1400), ({'toll': 400, 'issued_day': 0, 'paid_day': 0, 'today': 45, 'first_fee': 1000, 'second_fee': 2500, 'stage1_days': 30, 'stage2_days': 60, 'cap': 5000, 'waiver_first': False}, 400), ({'toll': 250, 'issued_day': 86, 'paid_day': 117, 'today': 147, 'first_fee': 1000, 'second_fee': 2500, 'stage1_days': 30, 'stage2_days': 60, 'cap': 5000, 'waiver_first': True}, 250), ({'toll': 400, 'issued_day': 44, 'paid_day': 74, 'today': 75, 'first_fee': 500, 'second_fee': 2500, 'stage1_days': 30, 'stage2_days': 60, 'cap': 3000, 'waiver_first': False}, 400), ({'toll': 875, 'issued_day': 0, 'paid_day': None, 'today': 100, 'first_fee': 1000, 'second_fee': 5000, 'stage1_days': 30, 'stage2_days': 60, 'cap': 3000, 'waiver_first': False}, 3875), ({'toll': 875, 'issued_day': 98, 'paid_day': 129, 'today': 129, 'first_fee': 500, 'second_fee': 2500, 'stage1_days': 30, 'stage2_days': 60, 'cap': 7500, 'waiver_first': True}, 875), ({'toll': 400, 'issued_day': 10, 'paid_day': 70, 'today': 90, 'first_fee': 1000, 'second_fee': 2500, 'stage1_days': 30, 'stage2_days': 60, 'cap': 5000, 'waiver_first': True}, 400)], [({'toll': 250, 'issued_day': 28, 'paid_day': None, 'today': 59, 'first_fee': 500, 'second_fee': 2500, 'stage1_days': 30, 'stage2_days': 60, 'cap': 3000, 'waiver_first': False}, 750), ({'toll': 400, 'issued_day': 7, 'paid_day': None, 'today': 37, 'first_fee': 500, 'second_fee': 5000, 'stage1_days': 30, 'stage2_days': 60, 'cap': 7500, 'waiver_first': False}, 400), ({'toll': 400, 'issued_day': 0, 'paid_day': None, 'today': 45, 'first_fee': 1000, 'second_fee': 2500, 'stage1_days': 30, 'stage2_days': 60, 'cap': 5000, 'waiver_first': True}, 1400), ({'toll': 400, 'issued_day': 0, 'paid_day': 0, 'today': 45, 'first_fee': 1000, 'second_fee': 2500, 'stage1_days': 30, 'stage2_days': 60, 'cap': 5000, 'waiver_first': False}, 400), ({'toll': 875, 'issued_day': 2, 'paid_day': 33, 'today': 63, 'first_fee': 1000, 'second_fee': 2500, 'stage1_days': 30, 'stage2_days': 60, 'cap': 3000, 'waiver_first': True}, 875), ({'toll': 400, 'issued_day': 10, 'paid_day': 40, 'today': 90, 'first_fee': 1000, 'second_fee': 2500, 'stage1_days': 30, 'stage2_days': 60, 'cap': 5000, 'waiver_first': False}, 400), ({'toll': 875, 'issued_day': 65, 'paid_day': 96, 'today': 96, 'first_fee': 1000, 'second_fee': 2500, 'stage1_days': 30, 'stage2_days': 60, 'cap': 5000, 'waiver_first': False}, 1875), ({'toll': 400, 'issued_day': 10, 'paid_day': 70, 'today': 90, 'first_fee': 1000, 'second_fee': 2500, 'stage1_days': 30, 'stage2_days': 60, 'cap': 5000, 'waiver_first': True}, 400)], [({'toll': 250, 'issued_day': 18, 'paid_day': 48, 'today': 77, 'first_fee': 500, 'second_fee': 5000, 'stage1_days': 30, 'stage2_days': 60, 'cap': 3000, 'waiver_first': False}, 250), ({'toll': 875, 'issued_day': 0, 'paid_day': None, 'today': 100, 'first_fee': 1000, 'second_fee': 5000, 'stage1_days': 30, 'stage2_days': 60, 'cap': 3000, 'waiver_first': False}, 3875), ({'toll': 400, 'issued_day': 10, 'paid_day': 70, 'today': 90, 'first_fee': 1000, 'second_fee': 2500, 'stage1_days': 30, 'stage2_days': 60, 'cap': 5000, 'waiver_first': True}, 400), ({'toll': 875, 'issued_day': 86, 'paid_day': 116, 'today': 147, 'first_fee': 500, 'second_fee': 2500, 'stage1_days': 30, 'stage2_days': 60, 'cap': 7500, 'waiver_first': False}, 875), ({'toll': 400, 'issued_day': 0, 'paid_day': 0, 'today': 45, 'first_fee': 1000, 'second_fee': 2500, 'stage1_days': 30, 'stage2_days': 60, 'cap': 5000, 'waiver_first': False}, 400), ({'toll': 250, 'issued_day': 8, 'paid_day': None, 'today': 91, 'first_fee': 500, 'second_fee': 2500, 'stage1_days': 30, 'stage2_days': 60, 'cap': 5000, 'waiver_first': False}, 3250), ({'toll': 875, 'issued_day': 78, 'paid_day': None, 'today': 109, 'first_fee': 500, 'second_fee': 5000, 'stage1_days': 30, 'stage2_days': 60, 'cap': 5000, 'waiver_first': True}, 1375), ({'toll': 400, 'issued_day': 0, 'paid_day': None, 'today': 45, 'first_fee': 1000, 'second_fee': 2500, 'stage1_days': 30, 'stage2_days': 60, 'cap': 5000, 'waiver_first': True}, 1400)]]
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 | 400 | 400 | Passed |
| fee oracle 1 | 1250 | 1250 | Passed |
| fee oracle 2 | 250 | 250 | Passed |
| fee oracle 3 | 1400 | 1400 | Passed |
| fee oracle 4 | 3875 | 3875 | Passed |
| fee oracle 5 | 400 | 400 | Passed |
| fee oracle 6 | 1400 | 1400 | Passed |
| fee oracle 7 | 1400 | 400 | Failed |
SHA-256 / f5f82ca0164240157e62c82a6a9f6413ca3e38909e59e174a2fac9db62afd2be
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
ev = x['paid_day'] if x['paid_day'] is not None else x['today']
age = ev - x['issued_day']
pen = 0
if age > x['stage1_days']:
pen += x['first_fee']
if x['waiver_first'] and x['paid_day'] is not None and age <= x['stage2_days']:
pen -= x['first_fee']
if age > x['stage2_days']:
pen += x['second_fee']
return x['toll'] + min(pen, x['cap'])
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[({'toll': 400, 'issued_day': 86, 'paid_day': 105, 'today': 117, 'first_fee': 500, 'second_fee': 5000, 'stage1_days': 30, 'stage2_days': 60, 'cap': 7500, 'waiver_first': False}, 400), ({'toll': 250, 'issued_day': 42, 'paid_day': None, 'today': 73, 'first_fee': 1000, 'second_fee': 5000, 'stage1_days': 30, 'stage2_days': 60, 'cap': 5000, 'waiver_first': True}, 1250), ({'toll': 250, 'issued_day': 41, 'paid_day': 71, 'today': 102, 'first_fee': 1000, 'second_fee': 2500, 'stage1_days': 30, 'stage2_days': 60, 'cap': 7500, 'waiver_first': True}, 250), ({'toll': 400, 'issued_day': 97, 'paid_day': None, 'today': 128, 'first_fee': 1000, 'second_fee': 5000, 'stage1_days': 30, 'stage2_days': 60, 'cap': 7500, 'waiver_first': False}, 1400), ({'toll': 875, 'issued_day': 0, 'paid_day': None, 'today': 100, 'first_fee': 1000, 'second_fee': 5000, 'stage1_days': 30, 'stage2_days': 60, 'cap': 3000, 'waiver_first': False}, 3875), ({'toll': 400, 'issued_day': 97, 'paid_day': None, 'today': 127, 'first_fee': 1000, 'second_fee': 2500, 'stage1_days': 30, 'stage2_days': 60, 'cap': 7500, 'waiver_first': False}, 400), ({'toll': 400, 'issued_day': 0, 'paid_day': None, 'today': 45, 'first_fee': 1000, 'second_fee': 2500, 'stage1_days': 30, 'stage2_days': 60, 'cap': 5000, 'waiver_first': True}, 1400), ({'toll': 400, 'issued_day': 0, 'paid_day': 0, 'today': 45, 'first_fee': 1000, 'second_fee': 2500, 'stage1_days': 30, 'stage2_days': 60, 'cap': 5000, 'waiver_first': False}, 400)], [({'toll': 875, 'issued_day': 0, 'paid_day': None, 'today': 100, 'first_fee': 1000, 'second_fee': 5000, 'stage1_days': 30, 'stage2_days': 60, 'cap': 3000, 'waiver_first': False}, 3875), ({'toll': 400, 'issued_day': 0, 'paid_day': None, 'today': 45, 'first_fee': 1000, 'second_fee': 2500, 'stage1_days': 30, 'stage2_days': 60, 'cap': 5000, 'waiver_first': True}, 1400), ({'toll': 875, 'issued_day': 16, 'paid_day': 20, 'today': 77, 'first_fee': 500, 'second_fee': 5000, 'stage1_days': 30, 'stage2_days': 60, 'cap': 5000, 'waiver_first': False}, 875), ({'toll': 400, 'issued_day': 0, 'paid_day': 0, 'today': 45, 'first_fee': 1000, 'second_fee': 2500, 'stage1_days': 30, 'stage2_days': 60, 'cap': 5000, 'waiver_first': False}, 400), ({'toll': 875, 'issued_day': 76, 'paid_day': None, 'today': 106, 'first_fee': 500, 'second_fee': 5000, 'stage1_days': 30, 'stage2_days': 60, 'cap': 5000, 'waiver_first': False}, 875), ({'toll': 250, 'issued_day': 45, 'paid_day': None, 'today': 105, 'first_fee': 500, 'second_fee': 5000, 'stage1_days': 30, 'stage2_days': 60, 'cap': 7500, 'waiver_first': True}, 750), ({'toll': 400, 'issued_day': 10, 'paid_day': 70, 'today': 90, 'first_fee': 1000, 'second_fee': 2500, 'stage1_days': 30, 'stage2_days': 60, 'cap': 5000, 'waiver_first': True}, 400), ({'toll': 875, 'issued_day': 30, 'paid_day': 60, 'today': 91, 'first_fee': 500, 'second_fee': 5000, 'stage1_days': 30, 'stage2_days': 60, 'cap': 7500, 'waiver_first': False}, 875)], [({'toll': 875, 'issued_day': 50, 'paid_day': None, 'today': 94, 'first_fee': 500, 'second_fee': 5000, 'stage1_days': 30, 'stage2_days': 60, 'cap': 7500, 'waiver_first': False}, 1375), ({'toll': 400, 'issued_day': 0, 'paid_day': None, 'today': 45, 'first_fee': 1000, 'second_fee': 2500, 'stage1_days': 30, 'stage2_days': 60, 'cap': 5000, 'waiver_first': True}, 1400), ({'toll': 400, 'issued_day': 0, 'paid_day': 0, 'today': 45, 'first_fee': 1000, 'second_fee': 2500, 'stage1_days': 30, 'stage2_days': 60, 'cap': 5000, 'waiver_first': False}, 400), ({'toll': 250, 'issued_day': 86, 'paid_day': 117, 'today': 147, 'first_fee': 1000, 'second_fee': 2500, 'stage1_days': 30, 'stage2_days': 60, 'cap': 5000, 'waiver_first': True}, 250), ({'toll': 400, 'issued_day': 44, 'paid_day': 74, 'today': 75, 'first_fee': 500, 'second_fee': 2500, 'stage1_days': 30, 'stage2_days': 60, 'cap': 3000, 'waiver_first': False}, 400), ({'toll': 875, 'issued_day': 0, 'paid_day': None, 'today': 100, 'first_fee': 1000, 'second_fee': 5000, 'stage1_days': 30, 'stage2_days': 60, 'cap': 3000, 'waiver_first': False}, 3875), ({'toll': 875, 'issued_day': 98, 'paid_day': 129, 'today': 129, 'first_fee': 500, 'second_fee': 2500, 'stage1_days': 30, 'stage2_days': 60, 'cap': 7500, 'waiver_first': True}, 875), ({'toll': 400, 'issued_day': 10, 'paid_day': 70, 'today': 90, 'first_fee': 1000, 'second_fee': 2500, 'stage1_days': 30, 'stage2_days': 60, 'cap': 5000, 'waiver_first': True}, 400)], [({'toll': 250, 'issued_day': 28, 'paid_day': None, 'today': 59, 'first_fee': 500, 'second_fee': 2500, 'stage1_days': 30, 'stage2_days': 60, 'cap': 3000, 'waiver_first': False}, 750), ({'toll': 400, 'issued_day': 7, 'paid_day': None, 'today': 37, 'first_fee': 500, 'second_fee': 5000, 'stage1_days': 30, 'stage2_days': 60, 'cap': 7500, 'waiver_first': False}, 400), ({'toll': 400, 'issued_day': 0, 'paid_day': None, 'today': 45, 'first_fee': 1000, 'second_fee': 2500, 'stage1_days': 30, 'stage2_days': 60, 'cap': 5000, 'waiver_first': True}, 1400), ({'toll': 400, 'issued_day': 0, 'paid_day': 0, 'today': 45, 'first_fee': 1000, 'second_fee': 2500, 'stage1_days': 30, 'stage2_days': 60, 'cap': 5000, 'waiver_first': False}, 400), ({'toll': 875, 'issued_day': 2, 'paid_day': 33, 'today': 63, 'first_fee': 1000, 'second_fee': 2500, 'stage1_days': 30, 'stage2_days': 60, 'cap': 3000, 'waiver_first': True}, 875), ({'toll': 400, 'issued_day': 10, 'paid_day': 40, 'today': 90, 'first_fee': 1000, 'second_fee': 2500, 'stage1_days': 30, 'stage2_days': 60, 'cap': 5000, 'waiver_first': False}, 400), ({'toll': 875, 'issued_day': 65, 'paid_day': 96, 'today': 96, 'first_fee': 1000, 'second_fee': 2500, 'stage1_days': 30, 'stage2_days': 60, 'cap': 5000, 'waiver_first': False}, 1875), ({'toll': 400, 'issued_day': 10, 'paid_day': 70, 'today': 90, 'first_fee': 1000, 'second_fee': 2500, 'stage1_days': 30, 'stage2_days': 60, 'cap': 5000, 'waiver_first': True}, 400)], [({'toll': 250, 'issued_day': 18, 'paid_day': 48, 'today': 77, 'first_fee': 500, 'second_fee': 5000, 'stage1_days': 30, 'stage2_days': 60, 'cap': 3000, 'waiver_first': False}, 250), ({'toll': 875, 'issued_day': 0, 'paid_day': None, 'today': 100, 'first_fee': 1000, 'second_fee': 5000, 'stage1_days': 30, 'stage2_days': 60, 'cap': 3000, 'waiver_first': False}, 3875), ({'toll': 400, 'issued_day': 10, 'paid_day': 70, 'today': 90, 'first_fee': 1000, 'second_fee': 2500, 'stage1_days': 30, 'stage2_days': 60, 'cap': 5000, 'waiver_first': True}, 400), ({'toll': 875, 'issued_day': 86, 'paid_day': 116, 'today': 147, 'first_fee': 500, 'second_fee': 2500, 'stage1_days': 30, 'stage2_days': 60, 'cap': 7500, 'waiver_first': False}, 875), ({'toll': 400, 'issued_day': 0, 'paid_day': 0, 'today': 45, 'first_fee': 1000, 'second_fee': 2500, 'stage1_days': 30, 'stage2_days': 60, 'cap': 5000, 'waiver_first': False}, 400), ({'toll': 250, 'issued_day': 8, 'paid_day': None, 'today': 91, 'first_fee': 500, 'second_fee': 2500, 'stage1_days': 30, 'stage2_days': 60, 'cap': 5000, 'waiver_first': False}, 3250), ({'toll': 875, 'issued_day': 78, 'paid_day': None, 'today': 109, 'first_fee': 500, 'second_fee': 5000, 'stage1_days': 30, 'stage2_days': 60, 'cap': 5000, 'waiver_first': True}, 1375), ({'toll': 400, 'issued_day': 0, 'paid_day': None, 'today': 45, 'first_fee': 1000, 'second_fee': 2500, 'stage1_days': 30, 'stage2_days': 60, 'cap': 5000, 'waiver_first': True}, 1400)]]
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 | 400 | 400 | Passed |
| fee oracle 1 | 1250 | 1250 | Passed |
| fee oracle 2 | 250 | 250 | Passed |
| fee oracle 3 | 1400 | 1400 | Passed |
| fee oracle 4 | 3875 | 3875 | Passed |
| fee oracle 5 | 400 | 400 | Passed |
| fee oracle 6 | 1400 | 1400 | Passed |
| fee oracle 7 | 400 | 400 | Passed |
SHA-256 / 84a44ad4008cbd1e13f6721dcdfd2f056e21eec1d017baac7102a10f880d68f5
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.554782+00:00.
Case digest / 44c49d6a4eed7b86e20d4ad9cfaa01751d58630a8a2c6926dd045ff73a4af18e