FA-68611 / Toll and parking fee computation / Open access
Pay-by-plate invoice and tag discount: exempt trips fall through to plate billing · case 01
Pay-by-plate invoice and tag discount returns a wrong result when exempt trips fall through to plate billing.
ROOT CAUSE
Exempt trips are billed as plate trips with surcharge and invoice.
THE FAILURE
Exempt trips are billed as plate trips with surcharge and invoice.
Unsuccessful approach: Zeroing the base still opens a plate invoice and its fee for an exempt vehicle.
Case contract
Input {trips: [[day (0-based), base cents, tag|plate|exempt]], plate_surcharge_pct, tag_discount_pct, invoice_fee, cycle_days}. Exempt trips are ignored. Tag trips pay base minus a discount floored to cents. Plate trips pay base plus a surcharge rounded up to cents and are grouped into invoices by billing period day // cycle_days; each invoice adds one invoice_fee to the plate total. Return {tag, plate, invoices}.
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):
tag = plate = 0
periods = set()
for day, base, method in x['trips']:
if method == 'exempt':
pass
if method == 'tag':
tag += base - base * x['tag_discount_pct'] // 100
else:
plate += base + -(-base * x['plate_surcharge_pct'] // 100)
periods.add(day // x['cycle_days'])
fees = len(periods) * x['invoice_fee']
return {'tag': tag, 'plate': plate + fees, 'invoices': len(periods)}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[({'trips': [[19, 525, 'tag']], 'plate_surcharge_pct': 25, 'tag_discount_pct': 15, 'invoice_fee': 200, 'cycle_days': 30}, {'tag': 447, 'plate': 0, 'invoices': 0}), ({'trips': [[3, 410, 'exempt'], [4, 410, 'tag']], 'plate_surcharge_pct': 50, 'tag_discount_pct': 10, 'invoice_fee': 200, 'cycle_days': 30}, {'tag': 369, 'plate': 0, 'invoices': 0}), ({'trips': [[14, 175, 'tag'], [8, 333, 'plate'], [31, 333, 'tag'], [34, 333, 'tag'], [85, 525, 'tag']], 'plate_surcharge_pct': 35, 'tag_discount_pct': 5, 'invoice_fee': 150, 'cycle_days': 30}, {'tag': 1300, 'plate': 600, 'invoices': 1}), ({'trips': [[46, 250, 'plate'], [36, 175, 'tag'], [84, 250, 'plate']], 'plate_surcharge_pct': 35, 'tag_discount_pct': 15, 'invoice_fee': 150, 'cycle_days': 31}, {'tag': 149, 'plate': 976, 'invoices': 2}), ({'trips': [[28, 410, 'exempt'], [41, 333, 'tag']], 'plate_surcharge_pct': 35, 'tag_discount_pct': 15, 'invoice_fee': 200, 'cycle_days': 30}, {'tag': 284, 'plate': 0, 'invoices': 0}), ({'trips': [[29, 250, 'plate'], [30, 250, 'plate'], [5, 333, 'tag']], 'plate_surcharge_pct': 35, 'tag_discount_pct': 15, 'invoice_fee': 200, 'cycle_days': 30}, {'tag': 284, 'plate': 1076, 'invoices': 2}), ({'trips': [[86, 525, 'exempt'], [43, 525, 'plate'], [12, 410, 'plate'], [69, 525, 'plate'], [35, 410, 'plate']], 'plate_surcharge_pct': 25, 'tag_discount_pct': 10, 'invoice_fee': 200, 'cycle_days': 31}, {'tag': 0, 'plate': 2940, 'invoices': 3}), ({'trips': [[46, 250, 'exempt'], [13, 410, 'tag'], [29, 333, 'plate'], [27, 525, 'exempt']], 'plate_surcharge_pct': 35, 'tag_discount_pct': 10, 'invoice_fee': 200, 'cycle_days': 30}, {'tag': 369, 'plate': 650, 'invoices': 1})], [({'trips': [[34, 410, 'plate'], [42, 410, 'tag'], [69, 525, 'plate'], [4, 525, 'tag'], [11, 250, 'exempt'], [87, 525, 'tag']], 'plate_surcharge_pct': 35, 'tag_discount_pct': 10, 'invoice_fee': 400, 'cycle_days': 30}, {'tag': 1315, 'plate': 2063, 'invoices': 2}), ({'trips': [[77, 250, 'plate'], [50, 175, 'plate'], [14, 175, 'tag'], [81, 250, 'plate'], [89, 333, 'tag'], [61, 250, 'tag'], [19, 333, 'tag'], [9, 333, 'tag']], 'plate_surcharge_pct': 25, 'tag_discount_pct': 5, 'invoice_fee': 150, 'cycle_days': 31}, {'tag': 1356, 'plate': 1145, 'invoices': 2}), ({'trips': [[33, 333, 'plate']], 'plate_surcharge_pct': 35, 'tag_discount_pct': 10, 'invoice_fee': 200, 'cycle_days': 31}, {'tag': 0, 'plate': 650, 'invoices': 1}), ({'trips': [[76, 250, 'tag'], [39, 175, 'plate'], [95, 175, 'plate'], [20, 333, 'plate'], [78, 410, 'exempt'], [59, 250, 'plate'], [88, 410, 'tag'], [5, 175, 'plate']], 'plate_surcharge_pct': 35, 'tag_discount_pct': 5, 'invoice_fee': 150, 'cycle_days': 31}, {'tag': 628, 'plate': 1949, 'invoices': 3}), ({'trips': [[55, 410, 'exempt']], 'plate_surcharge_pct': 25, 'tag_discount_pct': 5, 'invoice_fee': 200, 'cycle_days': 31}, {'tag': 0, 'plate': 0, 'invoices': 0}), ({'trips': [[3, 410, 'exempt'], [4, 410, 'tag']], 'plate_surcharge_pct': 50, 'tag_discount_pct': 10, 'invoice_fee': 200, 'cycle_days': 30}, {'tag': 369, 'plate': 0, 'invoices': 0}), ({'trips': [[19, 525, 'plate'], [51, 410, 'plate']], 'plate_surcharge_pct': 25, 'tag_discount_pct': 15, 'invoice_fee': 400, 'cycle_days': 31}, {'tag': 0, 'plate': 1970, 'invoices': 2}), ({'trips': [[29, 250, 'plate'], [30, 250, 'plate'], [5, 333, 'tag']], 'plate_surcharge_pct': 35, 'tag_discount_pct': 15, 'invoice_fee': 200, 'cycle_days': 30}, {'tag': 284, 'plate': 1076, 'invoices': 2})], [({'trips': [[40, 410, 'tag'], [72, 250, 'exempt'], [22, 410, 'tag'], [1, 525, 'exempt'], [12, 410, 'plate'], [67, 525, 'plate'], [31, 410, 'tag']], 'plate_surcharge_pct': 25, 'tag_discount_pct': 5, 'invoice_fee': 150, 'cycle_days': 31}, {'tag': 1170, 'plate': 1470, 'invoices': 2}), ({'trips': [[3, 410, 'exempt'], [4, 410, 'tag']], 'plate_surcharge_pct': 50, 'tag_discount_pct': 10, 'invoice_fee': 200, 'cycle_days': 30}, {'tag': 369, 'plate': 0, 'invoices': 0}), ({'trips': [[29, 250, 'plate'], [30, 250, 'plate'], [5, 333, 'tag']], 'plate_surcharge_pct': 35, 'tag_discount_pct': 15, 'invoice_fee': 200, 'cycle_days': 30}, {'tag': 284, 'plate': 1076, 'invoices': 2}), ({'trips': [[52, 175, 'plate'], [89, 525, 'tag'], [15, 333, 'plate'], [70, 333, 'plate'], [65, 333, 'tag'], [45, 250, 'tag'], [80, 175, 'tag'], [82, 410, 'tag']], 'plate_surcharge_pct': 50, 'tag_discount_pct': 10, 'invoice_fee': 150, 'cycle_days': 31}, {'tag': 1525, 'plate': 1713, 'invoices': 3}), ({'trips': [[12, 250, 'exempt'], [79, 175, 'plate'], [39, 175, 'plate'], [33, 175, 'plate'], [59, 525, 'tag']], 'plate_surcharge_pct': 50, 'tag_discount_pct': 15, 'invoice_fee': 400, 'cycle_days': 31}, {'tag': 447, 'plate': 1589, 'invoices': 2}), ({'trips': [[69, 525, 'tag'], [7, 525, 'plate'], [83, 410, 'plate'], [84, 333, 'tag'], [1, 175, 'plate'], [52, 175, 'plate'], [0, 525, 'plate'], [33, 410, 'plate']], 'plate_surcharge_pct': 50, 'tag_discount_pct': 10, 'invoice_fee': 150, 'cycle_days': 30}, {'tag': 773, 'plate': 3782, 'invoices': 3}), ({'trips': [[1, 525, 'plate'], [80, 333, 'tag'], [16, 250, 'tag'], [26, 525, 'plate'], [81, 410, 'tag'], [16, 525, 'plate'], [22, 250, 'plate']], 'plate_surcharge_pct': 25, 'tag_discount_pct': 5, 'invoice_fee': 200, 'cycle_days': 30}, {'tag': 945, 'plate': 2484, 'invoices': 1}), ({'trips': [[59, 410, 'plate']], 'plate_surcharge_pct': 50, 'tag_discount_pct': 15, 'invoice_fee': 200, 'cycle_days': 30}, {'tag': 0, 'plate': 815, 'invoices': 1})], [({'trips': [[29, 250, 'plate'], [30, 250, 'plate'], [5, 333, 'tag']], 'plate_surcharge_pct': 35, 'tag_discount_pct': 15, 'invoice_fee': 200, 'cycle_days': 30}, {'tag': 284, 'plate': 1076, 'invoices': 2}), ({'trips': [[64, 410, 'tag'], [37, 250, 'plate'], [70, 410, 'exempt'], [69, 333, 'plate'], [15, 250, 'tag']], 'plate_surcharge_pct': 35, 'tag_discount_pct': 5, 'invoice_fee': 200, 'cycle_days': 30}, {'tag': 628, 'plate': 1188, 'invoices': 2}), ({'trips': [[39, 175, 'exempt'], [88, 250, 'exempt'], [26, 333, 'plate'], [38, 250, 'plate'], [87, 333, 'plate'], [91, 333, 'tag'], [95, 333, 'plate'], [21, 333, 'exempt']], 'plate_surcharge_pct': 50, 'tag_discount_pct': 15, 'invoice_fee': 200, 'cycle_days': 30}, {'tag': 284, 'plate': 2675, 'invoices': 4}), ({'trips': [[89, 410, 'tag'], [63, 250, 'plate'], [89, 333, 'plate']], 'plate_surcharge_pct': 50, 'tag_discount_pct': 10, 'invoice_fee': 150, 'cycle_days': 31}, {'tag': 369, 'plate': 1025, 'invoices': 1}), ({'trips': [[3, 410, 'exempt'], [4, 410, 'tag']], 'plate_surcharge_pct': 50, 'tag_discount_pct': 10, 'invoice_fee': 200, 'cycle_days': 30}, {'tag': 369, 'plate': 0, 'invoices': 0}), ({'trips': [[45, 175, 'plate']], 'plate_surcharge_pct': 25, 'tag_discount_pct': 5, 'invoice_fee': 400, 'cycle_days': 31}, {'tag': 0, 'plate': 619, 'invoices': 1}), ({'trips': [[21, 333, 'tag'], [53, 175, 'tag']], 'plate_surcharge_pct': 25, 'tag_discount_pct': 10, 'invoice_fee': 400, 'cycle_days': 31}, {'tag': 458, 'plate': 0, 'invoices': 0}), ({'trips': [[16, 410, 'tag'], [38, 333, 'plate'], [40, 175, 'plate'], [91, 250, 'exempt'], [67, 250, 'tag']], 'plate_surcharge_pct': 50, 'tag_discount_pct': 5, 'invoice_fee': 200, 'cycle_days': 30}, {'tag': 628, 'plate': 963, 'invoices': 1})], [({'trips': [[34, 175, 'plate'], [12, 175, 'plate'], [40, 250, 'plate'], [83, 525, 'tag'], [79, 250, 'plate']], 'plate_surcharge_pct': 50, 'tag_discount_pct': 10, 'invoice_fee': 150, 'cycle_days': 30}, {'tag': 473, 'plate': 1726, 'invoices': 3}), ({'trips': [[23, 175, 'plate'], [66, 525, 'plate'], [52, 410, 'plate'], [73, 175, 'plate'], [39, 410, 'exempt'], [44, 250, 'tag'], [20, 333, 'tag'], [66, 410, 'exempt']], 'plate_surcharge_pct': 50, 'tag_discount_pct': 5, 'invoice_fee': 400, 'cycle_days': 30}, {'tag': 555, 'plate': 3129, 'invoices': 3}), ({'trips': [[83, 175, 'exempt'], [80, 333, 'plate']], 'plate_surcharge_pct': 50, 'tag_discount_pct': 10, 'invoice_fee': 400, 'cycle_days': 31}, {'tag': 0, 'plate': 900, 'invoices': 1}), ({'trips': [[3, 410, 'exempt'], [4, 410, 'tag']], 'plate_surcharge_pct': 50, 'tag_discount_pct': 10, 'invoice_fee': 200, 'cycle_days': 30}, {'tag': 369, 'plate': 0, 'invoices': 0}), ({'trips': [[29, 250, 'plate'], [30, 250, 'plate'], [5, 333, 'tag']], 'plate_surcharge_pct': 35, 'tag_discount_pct': 15, 'invoice_fee': 200, 'cycle_days': 30}, {'tag': 284, 'plate': 1076, 'invoices': 2}), ({'trips': [[67, 525, 'tag'], [87, 525, 'exempt'], [47, 525, 'tag'], [12, 250, 'tag'], [26, 250, 'exempt']], 'plate_surcharge_pct': 35, 'tag_discount_pct': 5, 'invoice_fee': 400, 'cycle_days': 30}, {'tag': 1236, 'plate': 0, 'invoices': 0}), ({'trips': [[88, 175, 'tag']], 'plate_surcharge_pct': 25, 'tag_discount_pct': 5, 'invoice_fee': 400, 'cycle_days': 30}, {'tag': 167, 'plate': 0, 'invoices': 0}), ({'trips': [[92, 525, 'tag'], [74, 333, 'tag'], [73, 333, 'plate']], 'plate_surcharge_pct': 50, 'tag_discount_pct': 10, 'invoice_fee': 200, 'cycle_days': 31}, {'tag': 773, 'plate': 700, 'invoices': 1})]]
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 | {'invoices': 0, 'plate': 0, 'tag': 447} | {'invoices': 0, 'plate': 0, 'tag': 447} | Passed |
| fee oracle 1 | {'invoices': 1, 'plate': 815, 'tag': 369} | {'invoices': 0, 'plate': 0, 'tag': 369} | Failed |
| fee oracle 2 | {'invoices': 1, 'plate': 600, 'tag': 1300} | {'invoices': 1, 'plate': 600, 'tag': 1300} | Passed |
| fee oracle 3 | {'invoices': 2, 'plate': 976, 'tag': 149} | {'invoices': 2, 'plate': 976, 'tag': 149} | Passed |
| fee oracle 4 | {'invoices': 1, 'plate': 754, 'tag': 284} | {'invoices': 0, 'plate': 0, 'tag': 284} | Failed |
| fee oracle 5 | {'invoices': 2, 'plate': 1076, 'tag': 284} | {'invoices': 2, 'plate': 1076, 'tag': 284} | Passed |
| fee oracle 6 | {'invoices': 3, 'plate': 3597, 'tag': 0} | {'invoices': 3, 'plate': 2940, 'tag': 0} | Failed |
| fee oracle 7 | {'invoices': 2, 'plate': 1897, 'tag': 369} | {'invoices': 1, 'plate': 650, 'tag': 369} | Failed |
SHA-256 / 2fba38db69fb5fbf93f7289d9551f69abcb54122e290b6786f87a528933d43af
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
tag = plate = 0
periods = set()
for day, base, method in x['trips']:
if method == 'exempt':
base = 0
if method == 'tag':
tag += base - base * x['tag_discount_pct'] // 100
else:
plate += base + -(-base * x['plate_surcharge_pct'] // 100)
periods.add(day // x['cycle_days'])
fees = len(periods) * x['invoice_fee']
return {'tag': tag, 'plate': plate + fees, 'invoices': len(periods)}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[({'trips': [[19, 525, 'tag']], 'plate_surcharge_pct': 25, 'tag_discount_pct': 15, 'invoice_fee': 200, 'cycle_days': 30}, {'tag': 447, 'plate': 0, 'invoices': 0}), ({'trips': [[3, 410, 'exempt'], [4, 410, 'tag']], 'plate_surcharge_pct': 50, 'tag_discount_pct': 10, 'invoice_fee': 200, 'cycle_days': 30}, {'tag': 369, 'plate': 0, 'invoices': 0}), ({'trips': [[14, 175, 'tag'], [8, 333, 'plate'], [31, 333, 'tag'], [34, 333, 'tag'], [85, 525, 'tag']], 'plate_surcharge_pct': 35, 'tag_discount_pct': 5, 'invoice_fee': 150, 'cycle_days': 30}, {'tag': 1300, 'plate': 600, 'invoices': 1}), ({'trips': [[46, 250, 'plate'], [36, 175, 'tag'], [84, 250, 'plate']], 'plate_surcharge_pct': 35, 'tag_discount_pct': 15, 'invoice_fee': 150, 'cycle_days': 31}, {'tag': 149, 'plate': 976, 'invoices': 2}), ({'trips': [[28, 410, 'exempt'], [41, 333, 'tag']], 'plate_surcharge_pct': 35, 'tag_discount_pct': 15, 'invoice_fee': 200, 'cycle_days': 30}, {'tag': 284, 'plate': 0, 'invoices': 0}), ({'trips': [[29, 250, 'plate'], [30, 250, 'plate'], [5, 333, 'tag']], 'plate_surcharge_pct': 35, 'tag_discount_pct': 15, 'invoice_fee': 200, 'cycle_days': 30}, {'tag': 284, 'plate': 1076, 'invoices': 2}), ({'trips': [[86, 525, 'exempt'], [43, 525, 'plate'], [12, 410, 'plate'], [69, 525, 'plate'], [35, 410, 'plate']], 'plate_surcharge_pct': 25, 'tag_discount_pct': 10, 'invoice_fee': 200, 'cycle_days': 31}, {'tag': 0, 'plate': 2940, 'invoices': 3}), ({'trips': [[46, 250, 'exempt'], [13, 410, 'tag'], [29, 333, 'plate'], [27, 525, 'exempt']], 'plate_surcharge_pct': 35, 'tag_discount_pct': 10, 'invoice_fee': 200, 'cycle_days': 30}, {'tag': 369, 'plate': 650, 'invoices': 1})], [({'trips': [[34, 410, 'plate'], [42, 410, 'tag'], [69, 525, 'plate'], [4, 525, 'tag'], [11, 250, 'exempt'], [87, 525, 'tag']], 'plate_surcharge_pct': 35, 'tag_discount_pct': 10, 'invoice_fee': 400, 'cycle_days': 30}, {'tag': 1315, 'plate': 2063, 'invoices': 2}), ({'trips': [[77, 250, 'plate'], [50, 175, 'plate'], [14, 175, 'tag'], [81, 250, 'plate'], [89, 333, 'tag'], [61, 250, 'tag'], [19, 333, 'tag'], [9, 333, 'tag']], 'plate_surcharge_pct': 25, 'tag_discount_pct': 5, 'invoice_fee': 150, 'cycle_days': 31}, {'tag': 1356, 'plate': 1145, 'invoices': 2}), ({'trips': [[33, 333, 'plate']], 'plate_surcharge_pct': 35, 'tag_discount_pct': 10, 'invoice_fee': 200, 'cycle_days': 31}, {'tag': 0, 'plate': 650, 'invoices': 1}), ({'trips': [[76, 250, 'tag'], [39, 175, 'plate'], [95, 175, 'plate'], [20, 333, 'plate'], [78, 410, 'exempt'], [59, 250, 'plate'], [88, 410, 'tag'], [5, 175, 'plate']], 'plate_surcharge_pct': 35, 'tag_discount_pct': 5, 'invoice_fee': 150, 'cycle_days': 31}, {'tag': 628, 'plate': 1949, 'invoices': 3}), ({'trips': [[55, 410, 'exempt']], 'plate_surcharge_pct': 25, 'tag_discount_pct': 5, 'invoice_fee': 200, 'cycle_days': 31}, {'tag': 0, 'plate': 0, 'invoices': 0}), ({'trips': [[3, 410, 'exempt'], [4, 410, 'tag']], 'plate_surcharge_pct': 50, 'tag_discount_pct': 10, 'invoice_fee': 200, 'cycle_days': 30}, {'tag': 369, 'plate': 0, 'invoices': 0}), ({'trips': [[19, 525, 'plate'], [51, 410, 'plate']], 'plate_surcharge_pct': 25, 'tag_discount_pct': 15, 'invoice_fee': 400, 'cycle_days': 31}, {'tag': 0, 'plate': 1970, 'invoices': 2}), ({'trips': [[29, 250, 'plate'], [30, 250, 'plate'], [5, 333, 'tag']], 'plate_surcharge_pct': 35, 'tag_discount_pct': 15, 'invoice_fee': 200, 'cycle_days': 30}, {'tag': 284, 'plate': 1076, 'invoices': 2})], [({'trips': [[40, 410, 'tag'], [72, 250, 'exempt'], [22, 410, 'tag'], [1, 525, 'exempt'], [12, 410, 'plate'], [67, 525, 'plate'], [31, 410, 'tag']], 'plate_surcharge_pct': 25, 'tag_discount_pct': 5, 'invoice_fee': 150, 'cycle_days': 31}, {'tag': 1170, 'plate': 1470, 'invoices': 2}), ({'trips': [[3, 410, 'exempt'], [4, 410, 'tag']], 'plate_surcharge_pct': 50, 'tag_discount_pct': 10, 'invoice_fee': 200, 'cycle_days': 30}, {'tag': 369, 'plate': 0, 'invoices': 0}), ({'trips': [[29, 250, 'plate'], [30, 250, 'plate'], [5, 333, 'tag']], 'plate_surcharge_pct': 35, 'tag_discount_pct': 15, 'invoice_fee': 200, 'cycle_days': 30}, {'tag': 284, 'plate': 1076, 'invoices': 2}), ({'trips': [[52, 175, 'plate'], [89, 525, 'tag'], [15, 333, 'plate'], [70, 333, 'plate'], [65, 333, 'tag'], [45, 250, 'tag'], [80, 175, 'tag'], [82, 410, 'tag']], 'plate_surcharge_pct': 50, 'tag_discount_pct': 10, 'invoice_fee': 150, 'cycle_days': 31}, {'tag': 1525, 'plate': 1713, 'invoices': 3}), ({'trips': [[12, 250, 'exempt'], [79, 175, 'plate'], [39, 175, 'plate'], [33, 175, 'plate'], [59, 525, 'tag']], 'plate_surcharge_pct': 50, 'tag_discount_pct': 15, 'invoice_fee': 400, 'cycle_days': 31}, {'tag': 447, 'plate': 1589, 'invoices': 2}), ({'trips': [[69, 525, 'tag'], [7, 525, 'plate'], [83, 410, 'plate'], [84, 333, 'tag'], [1, 175, 'plate'], [52, 175, 'plate'], [0, 525, 'plate'], [33, 410, 'plate']], 'plate_surcharge_pct': 50, 'tag_discount_pct': 10, 'invoice_fee': 150, 'cycle_days': 30}, {'tag': 773, 'plate': 3782, 'invoices': 3}), ({'trips': [[1, 525, 'plate'], [80, 333, 'tag'], [16, 250, 'tag'], [26, 525, 'plate'], [81, 410, 'tag'], [16, 525, 'plate'], [22, 250, 'plate']], 'plate_surcharge_pct': 25, 'tag_discount_pct': 5, 'invoice_fee': 200, 'cycle_days': 30}, {'tag': 945, 'plate': 2484, 'invoices': 1}), ({'trips': [[59, 410, 'plate']], 'plate_surcharge_pct': 50, 'tag_discount_pct': 15, 'invoice_fee': 200, 'cycle_days': 30}, {'tag': 0, 'plate': 815, 'invoices': 1})], [({'trips': [[29, 250, 'plate'], [30, 250, 'plate'], [5, 333, 'tag']], 'plate_surcharge_pct': 35, 'tag_discount_pct': 15, 'invoice_fee': 200, 'cycle_days': 30}, {'tag': 284, 'plate': 1076, 'invoices': 2}), ({'trips': [[64, 410, 'tag'], [37, 250, 'plate'], [70, 410, 'exempt'], [69, 333, 'plate'], [15, 250, 'tag']], 'plate_surcharge_pct': 35, 'tag_discount_pct': 5, 'invoice_fee': 200, 'cycle_days': 30}, {'tag': 628, 'plate': 1188, 'invoices': 2}), ({'trips': [[39, 175, 'exempt'], [88, 250, 'exempt'], [26, 333, 'plate'], [38, 250, 'plate'], [87, 333, 'plate'], [91, 333, 'tag'], [95, 333, 'plate'], [21, 333, 'exempt']], 'plate_surcharge_pct': 50, 'tag_discount_pct': 15, 'invoice_fee': 200, 'cycle_days': 30}, {'tag': 284, 'plate': 2675, 'invoices': 4}), ({'trips': [[89, 410, 'tag'], [63, 250, 'plate'], [89, 333, 'plate']], 'plate_surcharge_pct': 50, 'tag_discount_pct': 10, 'invoice_fee': 150, 'cycle_days': 31}, {'tag': 369, 'plate': 1025, 'invoices': 1}), ({'trips': [[3, 410, 'exempt'], [4, 410, 'tag']], 'plate_surcharge_pct': 50, 'tag_discount_pct': 10, 'invoice_fee': 200, 'cycle_days': 30}, {'tag': 369, 'plate': 0, 'invoices': 0}), ({'trips': [[45, 175, 'plate']], 'plate_surcharge_pct': 25, 'tag_discount_pct': 5, 'invoice_fee': 400, 'cycle_days': 31}, {'tag': 0, 'plate': 619, 'invoices': 1}), ({'trips': [[21, 333, 'tag'], [53, 175, 'tag']], 'plate_surcharge_pct': 25, 'tag_discount_pct': 10, 'invoice_fee': 400, 'cycle_days': 31}, {'tag': 458, 'plate': 0, 'invoices': 0}), ({'trips': [[16, 410, 'tag'], [38, 333, 'plate'], [40, 175, 'plate'], [91, 250, 'exempt'], [67, 250, 'tag']], 'plate_surcharge_pct': 50, 'tag_discount_pct': 5, 'invoice_fee': 200, 'cycle_days': 30}, {'tag': 628, 'plate': 963, 'invoices': 1})], [({'trips': [[34, 175, 'plate'], [12, 175, 'plate'], [40, 250, 'plate'], [83, 525, 'tag'], [79, 250, 'plate']], 'plate_surcharge_pct': 50, 'tag_discount_pct': 10, 'invoice_fee': 150, 'cycle_days': 30}, {'tag': 473, 'plate': 1726, 'invoices': 3}), ({'trips': [[23, 175, 'plate'], [66, 525, 'plate'], [52, 410, 'plate'], [73, 175, 'plate'], [39, 410, 'exempt'], [44, 250, 'tag'], [20, 333, 'tag'], [66, 410, 'exempt']], 'plate_surcharge_pct': 50, 'tag_discount_pct': 5, 'invoice_fee': 400, 'cycle_days': 30}, {'tag': 555, 'plate': 3129, 'invoices': 3}), ({'trips': [[83, 175, 'exempt'], [80, 333, 'plate']], 'plate_surcharge_pct': 50, 'tag_discount_pct': 10, 'invoice_fee': 400, 'cycle_days': 31}, {'tag': 0, 'plate': 900, 'invoices': 1}), ({'trips': [[3, 410, 'exempt'], [4, 410, 'tag']], 'plate_surcharge_pct': 50, 'tag_discount_pct': 10, 'invoice_fee': 200, 'cycle_days': 30}, {'tag': 369, 'plate': 0, 'invoices': 0}), ({'trips': [[29, 250, 'plate'], [30, 250, 'plate'], [5, 333, 'tag']], 'plate_surcharge_pct': 35, 'tag_discount_pct': 15, 'invoice_fee': 200, 'cycle_days': 30}, {'tag': 284, 'plate': 1076, 'invoices': 2}), ({'trips': [[67, 525, 'tag'], [87, 525, 'exempt'], [47, 525, 'tag'], [12, 250, 'tag'], [26, 250, 'exempt']], 'plate_surcharge_pct': 35, 'tag_discount_pct': 5, 'invoice_fee': 400, 'cycle_days': 30}, {'tag': 1236, 'plate': 0, 'invoices': 0}), ({'trips': [[88, 175, 'tag']], 'plate_surcharge_pct': 25, 'tag_discount_pct': 5, 'invoice_fee': 400, 'cycle_days': 30}, {'tag': 167, 'plate': 0, 'invoices': 0}), ({'trips': [[92, 525, 'tag'], [74, 333, 'tag'], [73, 333, 'plate']], 'plate_surcharge_pct': 50, 'tag_discount_pct': 10, 'invoice_fee': 200, 'cycle_days': 31}, {'tag': 773, 'plate': 700, 'invoices': 1})]]
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 | {'invoices': 0, 'plate': 0, 'tag': 447} | {'invoices': 0, 'plate': 0, 'tag': 447} | Passed |
| fee oracle 1 | {'invoices': 1, 'plate': 200, 'tag': 369} | {'invoices': 0, 'plate': 0, 'tag': 369} | Failed |
| fee oracle 2 | {'invoices': 1, 'plate': 600, 'tag': 1300} | {'invoices': 1, 'plate': 600, 'tag': 1300} | Passed |
| fee oracle 3 | {'invoices': 2, 'plate': 976, 'tag': 149} | {'invoices': 2, 'plate': 976, 'tag': 149} | Passed |
| fee oracle 4 | {'invoices': 1, 'plate': 200, 'tag': 284} | {'invoices': 0, 'plate': 0, 'tag': 284} | Failed |
| fee oracle 5 | {'invoices': 2, 'plate': 1076, 'tag': 284} | {'invoices': 2, 'plate': 1076, 'tag': 284} | Passed |
| fee oracle 6 | {'invoices': 3, 'plate': 2940, 'tag': 0} | {'invoices': 3, 'plate': 2940, 'tag': 0} | Passed |
| fee oracle 7 | {'invoices': 2, 'plate': 850, 'tag': 369} | {'invoices': 1, 'plate': 650, 'tag': 369} | Failed |
SHA-256 / be0aee9dcc1a0358af1cb6e805edd0f0b53c04ad0240cfac66e40e45b4fd45ec
HELD IN THE MEMBER ARCHIVE
The verified repair and its recorded checks are member-only.
This mechanism has 8 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.
Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.
Member access is invitation-based. Sign in with your invited account to inspect the repair.
Sign in to the archive ↗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:03.827450+00:00.
Case digest / 088283756421ad590e70aad58b6ddd176869852c4d2bf363f9a75759b9f20d21