{"abstract":"Pay-by-plate invoice and tag discount returns a wrong result when the plate surcharge is floored.","category":"Toll and parking fee computation","checks":8,"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}.","contract_signature":"x","evaluation_group":"w2-toll_and_parking_fee_computation-plate-invoice","failed_approach":"Rounding to nearest (with banker ties) still drops fractions below one half.","family":"w2-toll_and_parking_fee_computation-plate-invoice-surcharge-rounding","id":"FA-68596","implementations":{"attempt":{"sha256":"5f411103fc6ccd325dccc6aa7ff8cb787529eb836918a44a9cdfa26e019a7709","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    tag = plate = 0\n    periods = set()\n    for day, base, method in x['trips']:\n        if method == 'exempt':\n            continue\n        if method == 'tag':\n            tag += base - base * x['tag_discount_pct'] // 100\n        else:\n            plate += base + round(base * x['plate_surcharge_pct'] / 100)\n            periods.add(day // x['cycle_days'])\n    fees = len(periods) * x['invoice_fee']\n    return {'tag': tag, 'plate': plate + fees, 'invoices': len(periods)}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[({'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': [[84, 250, 'tag'], [82, 250, 'plate']], 'plate_surcharge_pct': 50, 'tag_discount_pct': 10, 'invoice_fee': 200, 'cycle_days': 30}, {'tag': 225, 'plate': 575, 'invoices': 1}), ({'trips': [[76, 250, 'tag'], [71, 525, 'tag'], [40, 250, 'tag'], [16, 525, 'plate'], [18, 250, 'plate'], [35, 333, 'tag']], 'plate_surcharge_pct': 25, 'tag_discount_pct': 5, 'invoice_fee': 400, 'cycle_days': 31}, {'tag': 1292, 'plate': 1370, 'invoices': 1}), ({'trips': [[74, 175, 'plate']], 'plate_surcharge_pct': 50, 'tag_discount_pct': 15, 'invoice_fee': 200, 'cycle_days': 31}, {'tag': 0, 'plate': 463, 'invoices': 1}), ({'trips': [[10, 250, 'plate'], [0, 250, 'plate'], [89, 410, 'tag'], [19, 410, 'tag'], [44, 250, 'tag']], 'plate_surcharge_pct': 50, 'tag_discount_pct': 15, 'invoice_fee': 400, 'cycle_days': 30}, {'tag': 911, 'plate': 1150, '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': [[36, 410, 'plate'], [12, 175, 'exempt'], [24, 333, 'plate'], [48, 250, 'tag'], [7, 525, 'exempt']], 'plate_surcharge_pct': 25, 'tag_discount_pct': 10, 'invoice_fee': 400, 'cycle_days': 30}, {'tag': 225, 'plate': 1730, 'invoices': 2}), ({'trips': [[44, 410, 'exempt']], 'plate_surcharge_pct': 35, 'tag_discount_pct': 10, 'invoice_fee': 200, 'cycle_days': 31}, {'tag': 0, 'plate': 0, 'invoices': 0})], [({'trips': [[51, 175, 'tag'], [42, 410, 'tag'], [70, 175, 'exempt'], [17, 175, 'tag']], 'plate_surcharge_pct': 25, 'tag_discount_pct': 10, 'invoice_fee': 200, 'cycle_days': 30}, {'tag': 685, 'plate': 0, 'invoices': 0}), ({'trips': [[55, 525, 'tag']], 'plate_surcharge_pct': 35, 'tag_discount_pct': 10, 'invoice_fee': 150, 'cycle_days': 31}, {'tag': 473, 'plate': 0, 'invoices': 0}), ({'trips': [[64, 410, 'tag'], [0, 250, 'exempt'], [74, 250, 'exempt'], [12, 175, 'plate'], [4, 250, 'exempt'], [77, 410, 'tag'], [29, 250, 'plate'], [86, 410, 'tag']], 'plate_surcharge_pct': 25, 'tag_discount_pct': 5, 'invoice_fee': 400, 'cycle_days': 30}, {'tag': 1170, 'plate': 932, 'invoices': 1}), ({'trips': [[44, 333, 'tag']], 'plate_surcharge_pct': 50, 'tag_discount_pct': 10, 'invoice_fee': 400, 'cycle_days': 30}, {'tag': 300, 'plate': 0, 'invoices': 0}), ({'trips': [[80, 333, 'tag'], [37, 250, 'exempt'], [93, 525, 'tag'], [24, 175, 'plate'], [73, 525, 'tag'], [91, 250, 'plate'], [14, 333, 'tag']], 'plate_surcharge_pct': 50, 'tag_discount_pct': 10, 'invoice_fee': 200, 'cycle_days': 30}, {'tag': 1546, 'plate': 1038, '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': [[48, 175, 'plate'], [37, 525, 'tag'], [81, 333, 'plate'], [42, 175, 'tag'], [11, 250, 'exempt']], 'plate_surcharge_pct': 35, 'tag_discount_pct': 10, 'invoice_fee': 150, 'cycle_days': 30}, {'tag': 631, 'plate': 987, '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': [[20, 250, 'tag'], [55, 250, 'plate'], [77, 333, 'plate'], [83, 333, 'plate'], [95, 410, 'tag'], [27, 250, 'plate']], 'plate_surcharge_pct': 25, 'tag_discount_pct': 5, 'invoice_fee': 150, 'cycle_days': 30}, {'tag': 628, 'plate': 1910, 'invoices': 3}), ({'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': [[1, 410, 'tag'], [95, 250, 'exempt'], [59, 250, 'tag'], [51, 410, 'exempt'], [40, 333, 'plate'], [26, 410, 'plate'], [84, 333, 'plate'], [8, 250, 'tag']], 'plate_surcharge_pct': 25, 'tag_discount_pct': 15, 'invoice_fee': 400, 'cycle_days': 31}, {'tag': 775, 'plate': 2547, 'invoices': 3}), ({'trips': [[17, 525, 'tag'], [95, 175, 'plate'], [42, 410, 'tag']], 'plate_surcharge_pct': 25, 'tag_discount_pct': 10, 'invoice_fee': 150, 'cycle_days': 30}, {'tag': 842, 'plate': 369, 'invoices': 1}), ({'trips': [[22, 250, 'tag']], 'plate_surcharge_pct': 25, 'tag_discount_pct': 10, 'invoice_fee': 400, 'cycle_days': 30}, {'tag': 225, 'plate': 0, 'invoices': 0}), ({'trips': [[22, 250, 'exempt'], [95, 525, 'exempt'], [7, 410, 'exempt']], 'plate_surcharge_pct': 50, 'tag_discount_pct': 10, 'invoice_fee': 400, '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': [[89, 175, 'tag']], 'plate_surcharge_pct': 50, 'tag_discount_pct': 5, 'invoice_fee': 400, 'cycle_days': 30}, {'tag': 167, 'plate': 0, 'invoices': 0})], [({'trips': [[73, 250, 'plate'], [32, 410, 'tag'], [6, 333, 'plate'], [16, 250, 'plate'], [46, 250, 'tag'], [86, 175, 'tag']], 'plate_surcharge_pct': 35, 'tag_discount_pct': 10, 'invoice_fee': 200, 'cycle_days': 31}, {'tag': 752, 'plate': 1526, 'invoices': 2}), ({'trips': [[52, 410, 'exempt'], [6, 333, 'plate'], [26, 175, 'plate'], [18, 333, 'plate']], 'plate_surcharge_pct': 50, 'tag_discount_pct': 5, 'invoice_fee': 400, 'cycle_days': 31}, {'tag': 0, 'plate': 1663, 'invoices': 1}), ({'trips': [[8, 525, 'plate'], [27, 333, 'plate'], [72, 410, 'plate'], [15, 525, 'plate']], 'plate_surcharge_pct': 25, 'tag_discount_pct': 10, 'invoice_fee': 200, 'cycle_days': 30}, {'tag': 0, 'plate': 2644, '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': [[94, 525, 'exempt'], [50, 525, 'tag']], 'plate_surcharge_pct': 35, 'tag_discount_pct': 15, 'invoice_fee': 200, 'cycle_days': 30}, {'tag': 447, 'plate': 0, 'invoices': 0}), ({'trips': [[41, 333, 'tag'], [76, 250, 'plate'], [33, 410, 'exempt']], 'plate_surcharge_pct': 50, 'tag_discount_pct': 5, 'invoice_fee': 150, 'cycle_days': 30}, {'tag': 317, 'plate': 525, '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': [[43, 175, 'exempt'], [36, 175, 'exempt']], 'plate_surcharge_pct': 25, 'tag_discount_pct': 5, 'invoice_fee': 150, 'cycle_days': 31}, {'tag': 0, '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': [[72, 525, 'tag'], [18, 525, 'tag']], 'plate_surcharge_pct': 35, 'tag_discount_pct': 5, 'invoice_fee': 150, 'cycle_days': 31}, {'tag': 998, 'plate': 0, 'invoices': 0}), ({'trips': [[24, 175, 'plate'], [4, 525, 'plate'], [22, 333, 'tag'], [63, 525, 'tag'], [10, 525, 'tag'], [0, 525, 'plate'], [6, 410, 'tag'], [39, 525, 'tag']], 'plate_surcharge_pct': 50, 'tag_discount_pct': 10, 'invoice_fee': 150, 'cycle_days': 30}, {'tag': 2088, 'plate': 1989, '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': [[82, 250, 'exempt'], [20, 175, 'tag']], 'plate_surcharge_pct': 25, 'tag_discount_pct': 15, 'invoice_fee': 150, 'cycle_days': 31}, {'tag': 149, 'plate': 0, 'invoices': 0}), ({'trips': [[88, 410, 'tag'], [89, 250, 'plate'], [5, 525, 'tag'], [38, 175, 'exempt'], [64, 525, 'plate'], [28, 175, 'tag'], [62, 333, 'exempt'], [9, 250, 'plate']], 'plate_surcharge_pct': 25, 'tag_discount_pct': 15, 'invoice_fee': 200, 'cycle_days': 30}, {'tag': 945, 'plate': 1683, 'invoices': 2}), ({'trips': [[82, 333, 'plate'], [35, 410, 'plate'], [24, 175, 'plate'], [34, 410, 'tag'], [60, 333, 'exempt'], [10, 250, 'tag'], [40, 175, 'plate'], [47, 250, 'plate']], 'plate_surcharge_pct': 50, 'tag_discount_pct': 10, 'invoice_fee': 150, 'cycle_days': 31}, {'tag': 594, 'plate': 2466, 'invoices': 3}), ({'trips': [[76, 175, 'exempt'], [69, 410, 'exempt'], [75, 175, 'tag']], 'plate_surcharge_pct': 50, 'tag_discount_pct': 5, 'invoice_fee': 150, 'cycle_days': 30}, {'tag': 167, 'plate': 0, 'invoices': 0})]]\nfor i, (args, expected) in enumerate(fixtures[N-1]):\n    check('fee oracle' + ' %d' % i, solve(args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"broken":{"sha256":"6ca5fb415b8a588dcf0b609ac334b17adec13d92158ba347ebddbc29fdb92a0f","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    tag = plate = 0\n    periods = set()\n    for day, base, method in x['trips']:\n        if method == 'exempt':\n            continue\n        if method == 'tag':\n            tag += base - base * x['tag_discount_pct'] // 100\n        else:\n            plate += base + base * x['plate_surcharge_pct'] // 100\n            periods.add(day // x['cycle_days'])\n    fees = len(periods) * x['invoice_fee']\n    return {'tag': tag, 'plate': plate + fees, 'invoices': len(periods)}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[({'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': [[84, 250, 'tag'], [82, 250, 'plate']], 'plate_surcharge_pct': 50, 'tag_discount_pct': 10, 'invoice_fee': 200, 'cycle_days': 30}, {'tag': 225, 'plate': 575, 'invoices': 1}), ({'trips': [[76, 250, 'tag'], [71, 525, 'tag'], [40, 250, 'tag'], [16, 525, 'plate'], [18, 250, 'plate'], [35, 333, 'tag']], 'plate_surcharge_pct': 25, 'tag_discount_pct': 5, 'invoice_fee': 400, 'cycle_days': 31}, {'tag': 1292, 'plate': 1370, 'invoices': 1}), ({'trips': [[74, 175, 'plate']], 'plate_surcharge_pct': 50, 'tag_discount_pct': 15, 'invoice_fee': 200, 'cycle_days': 31}, {'tag': 0, 'plate': 463, 'invoices': 1}), ({'trips': [[10, 250, 'plate'], [0, 250, 'plate'], [89, 410, 'tag'], [19, 410, 'tag'], [44, 250, 'tag']], 'plate_surcharge_pct': 50, 'tag_discount_pct': 15, 'invoice_fee': 400, 'cycle_days': 30}, {'tag': 911, 'plate': 1150, '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': [[36, 410, 'plate'], [12, 175, 'exempt'], [24, 333, 'plate'], [48, 250, 'tag'], [7, 525, 'exempt']], 'plate_surcharge_pct': 25, 'tag_discount_pct': 10, 'invoice_fee': 400, 'cycle_days': 30}, {'tag': 225, 'plate': 1730, 'invoices': 2}), ({'trips': [[44, 410, 'exempt']], 'plate_surcharge_pct': 35, 'tag_discount_pct': 10, 'invoice_fee': 200, 'cycle_days': 31}, {'tag': 0, 'plate': 0, 'invoices': 0})], [({'trips': [[51, 175, 'tag'], [42, 410, 'tag'], [70, 175, 'exempt'], [17, 175, 'tag']], 'plate_surcharge_pct': 25, 'tag_discount_pct': 10, 'invoice_fee': 200, 'cycle_days': 30}, {'tag': 685, 'plate': 0, 'invoices': 0}), ({'trips': [[55, 525, 'tag']], 'plate_surcharge_pct': 35, 'tag_discount_pct': 10, 'invoice_fee': 150, 'cycle_days': 31}, {'tag': 473, 'plate': 0, 'invoices': 0}), ({'trips': [[64, 410, 'tag'], [0, 250, 'exempt'], [74, 250, 'exempt'], [12, 175, 'plate'], [4, 250, 'exempt'], [77, 410, 'tag'], [29, 250, 'plate'], [86, 410, 'tag']], 'plate_surcharge_pct': 25, 'tag_discount_pct': 5, 'invoice_fee': 400, 'cycle_days': 30}, {'tag': 1170, 'plate': 932, 'invoices': 1}), ({'trips': [[44, 333, 'tag']], 'plate_surcharge_pct': 50, 'tag_discount_pct': 10, 'invoice_fee': 400, 'cycle_days': 30}, {'tag': 300, 'plate': 0, 'invoices': 0}), ({'trips': [[80, 333, 'tag'], [37, 250, 'exempt'], [93, 525, 'tag'], [24, 175, 'plate'], [73, 525, 'tag'], [91, 250, 'plate'], [14, 333, 'tag']], 'plate_surcharge_pct': 50, 'tag_discount_pct': 10, 'invoice_fee': 200, 'cycle_days': 30}, {'tag': 1546, 'plate': 1038, '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': [[48, 175, 'plate'], [37, 525, 'tag'], [81, 333, 'plate'], [42, 175, 'tag'], [11, 250, 'exempt']], 'plate_surcharge_pct': 35, 'tag_discount_pct': 10, 'invoice_fee': 150, 'cycle_days': 30}, {'tag': 631, 'plate': 987, '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': [[20, 250, 'tag'], [55, 250, 'plate'], [77, 333, 'plate'], [83, 333, 'plate'], [95, 410, 'tag'], [27, 250, 'plate']], 'plate_surcharge_pct': 25, 'tag_discount_pct': 5, 'invoice_fee': 150, 'cycle_days': 30}, {'tag': 628, 'plate': 1910, 'invoices': 3}), ({'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': [[1, 410, 'tag'], [95, 250, 'exempt'], [59, 250, 'tag'], [51, 410, 'exempt'], [40, 333, 'plate'], [26, 410, 'plate'], [84, 333, 'plate'], [8, 250, 'tag']], 'plate_surcharge_pct': 25, 'tag_discount_pct': 15, 'invoice_fee': 400, 'cycle_days': 31}, {'tag': 775, 'plate': 2547, 'invoices': 3}), ({'trips': [[17, 525, 'tag'], [95, 175, 'plate'], [42, 410, 'tag']], 'plate_surcharge_pct': 25, 'tag_discount_pct': 10, 'invoice_fee': 150, 'cycle_days': 30}, {'tag': 842, 'plate': 369, 'invoices': 1}), ({'trips': [[22, 250, 'tag']], 'plate_surcharge_pct': 25, 'tag_discount_pct': 10, 'invoice_fee': 400, 'cycle_days': 30}, {'tag': 225, 'plate': 0, 'invoices': 0}), ({'trips': [[22, 250, 'exempt'], [95, 525, 'exempt'], [7, 410, 'exempt']], 'plate_surcharge_pct': 50, 'tag_discount_pct': 10, 'invoice_fee': 400, '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': [[89, 175, 'tag']], 'plate_surcharge_pct': 50, 'tag_discount_pct': 5, 'invoice_fee': 400, 'cycle_days': 30}, {'tag': 167, 'plate': 0, 'invoices': 0})], [({'trips': [[73, 250, 'plate'], [32, 410, 'tag'], [6, 333, 'plate'], [16, 250, 'plate'], [46, 250, 'tag'], [86, 175, 'tag']], 'plate_surcharge_pct': 35, 'tag_discount_pct': 10, 'invoice_fee': 200, 'cycle_days': 31}, {'tag': 752, 'plate': 1526, 'invoices': 2}), ({'trips': [[52, 410, 'exempt'], [6, 333, 'plate'], [26, 175, 'plate'], [18, 333, 'plate']], 'plate_surcharge_pct': 50, 'tag_discount_pct': 5, 'invoice_fee': 400, 'cycle_days': 31}, {'tag': 0, 'plate': 1663, 'invoices': 1}), ({'trips': [[8, 525, 'plate'], [27, 333, 'plate'], [72, 410, 'plate'], [15, 525, 'plate']], 'plate_surcharge_pct': 25, 'tag_discount_pct': 10, 'invoice_fee': 200, 'cycle_days': 30}, {'tag': 0, 'plate': 2644, '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': [[94, 525, 'exempt'], [50, 525, 'tag']], 'plate_surcharge_pct': 35, 'tag_discount_pct': 15, 'invoice_fee': 200, 'cycle_days': 30}, {'tag': 447, 'plate': 0, 'invoices': 0}), ({'trips': [[41, 333, 'tag'], [76, 250, 'plate'], [33, 410, 'exempt']], 'plate_surcharge_pct': 50, 'tag_discount_pct': 5, 'invoice_fee': 150, 'cycle_days': 30}, {'tag': 317, 'plate': 525, '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': [[43, 175, 'exempt'], [36, 175, 'exempt']], 'plate_surcharge_pct': 25, 'tag_discount_pct': 5, 'invoice_fee': 150, 'cycle_days': 31}, {'tag': 0, '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': [[72, 525, 'tag'], [18, 525, 'tag']], 'plate_surcharge_pct': 35, 'tag_discount_pct': 5, 'invoice_fee': 150, 'cycle_days': 31}, {'tag': 998, 'plate': 0, 'invoices': 0}), ({'trips': [[24, 175, 'plate'], [4, 525, 'plate'], [22, 333, 'tag'], [63, 525, 'tag'], [10, 525, 'tag'], [0, 525, 'plate'], [6, 410, 'tag'], [39, 525, 'tag']], 'plate_surcharge_pct': 50, 'tag_discount_pct': 10, 'invoice_fee': 150, 'cycle_days': 30}, {'tag': 2088, 'plate': 1989, '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': [[82, 250, 'exempt'], [20, 175, 'tag']], 'plate_surcharge_pct': 25, 'tag_discount_pct': 15, 'invoice_fee': 150, 'cycle_days': 31}, {'tag': 149, 'plate': 0, 'invoices': 0}), ({'trips': [[88, 410, 'tag'], [89, 250, 'plate'], [5, 525, 'tag'], [38, 175, 'exempt'], [64, 525, 'plate'], [28, 175, 'tag'], [62, 333, 'exempt'], [9, 250, 'plate']], 'plate_surcharge_pct': 25, 'tag_discount_pct': 15, 'invoice_fee': 200, 'cycle_days': 30}, {'tag': 945, 'plate': 1683, 'invoices': 2}), ({'trips': [[82, 333, 'plate'], [35, 410, 'plate'], [24, 175, 'plate'], [34, 410, 'tag'], [60, 333, 'exempt'], [10, 250, 'tag'], [40, 175, 'plate'], [47, 250, 'plate']], 'plate_surcharge_pct': 50, 'tag_discount_pct': 10, 'invoice_fee': 150, 'cycle_days': 31}, {'tag': 594, 'plate': 2466, 'invoices': 3}), ({'trips': [[76, 175, 'exempt'], [69, 410, 'exempt'], [75, 175, 'tag']], 'plate_surcharge_pct': 50, 'tag_discount_pct': 5, 'invoice_fee': 150, 'cycle_days': 30}, {'tag': 167, 'plate': 0, 'invoices': 0})]]\nfor i, (args, expected) in enumerate(fixtures[N-1]):\n    check('fee oracle' + ' %d' % i, solve(args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"}},"limitations":"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.","method":"Deterministic executable model with adversarial boundary fixtures.","provenance":{"created_by":"Failure Map","dependencies":"Python standard library","family":"w2-toll_and_parking_fee_computation-plate-invoice-surcharge-rounding","generated_at":"2026-09-29T14:48:03.648150+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Fee engines bill customers in integer cents; a wrong boundary, rounding stage or cap scope silently over- or under-charges.","root_cause":"Fractional surcharge cents are dropped although the tariff rounds them up.","sha256":"0fa4fa317d29783f1b028cd2ef9d5be640999685d43224adc635339639f93d65","title":"Pay-by-plate invoice and tag discount: the plate surcharge is floored · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verified":true,"visibility":"public","verification":{"attempt":{"elapsed_ms":40.586,"exit_code":1,"observations":[{"actual":{"invoices":0,"plate":0,"tag":369},"check":"fee oracle 0","expected":{"invoices":0,"plate":0,"tag":369},"passed":true},{"actual":{"invoices":1,"plate":575,"tag":225},"check":"fee oracle 1","expected":{"invoices":1,"plate":575,"tag":225},"passed":true},{"actual":{"invoices":1,"plate":1368,"tag":1292},"check":"fee oracle 2","expected":{"invoices":1,"plate":1370,"tag":1292},"passed":false},{"actual":{"invoices":1,"plate":463,"tag":0},"check":"fee oracle 3","expected":{"invoices":1,"plate":463,"tag":0},"passed":true},{"actual":{"invoices":1,"plate":1150,"tag":911},"check":"fee oracle 4","expected":{"invoices":1,"plate":1150,"tag":911},"passed":true},{"actual":{"invoices":2,"plate":1076,"tag":284},"check":"fee oracle 5","expected":{"invoices":2,"plate":1076,"tag":284},"passed":true},{"actual":{"invoices":2,"plate":1728,"tag":225},"check":"fee oracle 6","expected":{"invoices":2,"plate":1730,"tag":225},"passed":false},{"actual":{"invoices":0,"plate":0,"tag":0},"check":"fee oracle 7","expected":{"invoices":0,"plate":0,"tag":0},"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"fee oracle 0\", \"actual\": {\"tag\": 369, \"plate\": 0, \"invoices\": 0}, \"expected\": {\"tag\": 369, \"plate\": 0, \"invoices\": 0}, \"passed\": true}, {\"check\": \"fee oracle 1\", \"actual\": {\"tag\": 225, \"plate\": 575, \"invoices\": 1}, \"expected\": {\"tag\": 225, \"plate\": 575, \"invoices\": 1}, \"passed\": true}, {\"check\": \"fee oracle 2\", \"actual\": {\"tag\": 1292, \"plate\": 1368, \"invoices\": 1}, \"expected\": {\"tag\": 1292, \"plate\": 1370, \"invoices\": 1}, \"passed\": false}, {\"check\": \"fee oracle 3\", \"actual\": {\"tag\": 0, \"plate\": 463, \"invoices\": 1}, \"expected\": {\"tag\": 0, \"plate\": 463, \"invoices\": 1}, \"passed\": true}, {\"check\": \"fee oracle 4\", \"actual\": {\"tag\": 911, \"plate\": 1150, \"invoices\": 1}, \"expected\": {\"tag\": 911, \"plate\": 1150, \"invoices\": 1}, \"passed\": true}, {\"check\": \"fee oracle 5\", \"actual\": {\"tag\": 284, \"plate\": 1076, \"invoices\": 2}, \"expected\": {\"tag\": 284, \"plate\": 1076, \"invoices\": 2}, \"passed\": true}, {\"check\": \"fee oracle 6\", \"actual\": {\"tag\": 225, \"plate\": 1728, \"invoices\": 2}, \"expected\": {\"tag\": 225, \"plate\": 1730, \"invoices\": 2}, \"passed\": false}, {\"check\": \"fee oracle 7\", \"actual\": {\"tag\": 0, \"plate\": 0, \"invoices\": 0}, \"expected\": {\"tag\": 0, \"plate\": 0, \"invoices\": 0}, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":40.913,"exit_code":1,"observations":[{"actual":{"invoices":0,"plate":0,"tag":369},"check":"fee oracle 0","expected":{"invoices":0,"plate":0,"tag":369},"passed":true},{"actual":{"invoices":1,"plate":575,"tag":225},"check":"fee oracle 1","expected":{"invoices":1,"plate":575,"tag":225},"passed":true},{"actual":{"invoices":1,"plate":1368,"tag":1292},"check":"fee oracle 2","expected":{"invoices":1,"plate":1370,"tag":1292},"passed":false},{"actual":{"invoices":1,"plate":462,"tag":0},"check":"fee oracle 3","expected":{"invoices":1,"plate":463,"tag":0},"passed":false},{"actual":{"invoices":1,"plate":1150,"tag":911},"check":"fee oracle 4","expected":{"invoices":1,"plate":1150,"tag":911},"passed":true},{"actual":{"invoices":2,"plate":1074,"tag":284},"check":"fee oracle 5","expected":{"invoices":2,"plate":1076,"tag":284},"passed":false},{"actual":{"invoices":2,"plate":1728,"tag":225},"check":"fee oracle 6","expected":{"invoices":2,"plate":1730,"tag":225},"passed":false},{"actual":{"invoices":0,"plate":0,"tag":0},"check":"fee oracle 7","expected":{"invoices":0,"plate":0,"tag":0},"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"fee oracle 0\", \"actual\": {\"tag\": 369, \"plate\": 0, \"invoices\": 0}, \"expected\": {\"tag\": 369, \"plate\": 0, \"invoices\": 0}, \"passed\": true}, {\"check\": \"fee oracle 1\", \"actual\": {\"tag\": 225, \"plate\": 575, \"invoices\": 1}, \"expected\": {\"tag\": 225, \"plate\": 575, \"invoices\": 1}, \"passed\": true}, {\"check\": \"fee oracle 2\", \"actual\": {\"tag\": 1292, \"plate\": 1368, \"invoices\": 1}, \"expected\": {\"tag\": 1292, \"plate\": 1370, \"invoices\": 1}, \"passed\": false}, {\"check\": \"fee oracle 3\", \"actual\": {\"tag\": 0, \"plate\": 462, \"invoices\": 1}, \"expected\": {\"tag\": 0, \"plate\": 463, \"invoices\": 1}, \"passed\": false}, {\"check\": \"fee oracle 4\", \"actual\": {\"tag\": 911, \"plate\": 1150, \"invoices\": 1}, \"expected\": {\"tag\": 911, \"plate\": 1150, \"invoices\": 1}, \"passed\": true}, {\"check\": \"fee oracle 5\", \"actual\": {\"tag\": 284, \"plate\": 1074, \"invoices\": 2}, \"expected\": {\"tag\": 284, \"plate\": 1076, \"invoices\": 2}, \"passed\": false}, {\"check\": \"fee oracle 6\", \"actual\": {\"tag\": 225, \"plate\": 1728, \"invoices\": 2}, \"expected\": {\"tag\": 225, \"plate\": 1730, \"invoices\": 2}, \"passed\": false}, {\"check\": \"fee oracle 7\", \"actual\": {\"tag\": 0, \"plate\": 0, \"invoices\": 0}, \"expected\": {\"tag\": 0, \"plate\": 0, \"invoices\": 0}, \"passed\": true}], \"passed\": false}\n"}},"member_only":{"stages":["fixed"],"fields":["implementations.fixed","verification.fixed","harness","repair"],"note":"The verified repair, its recorded checks, the repair description, and the scoring harness are available to members."}}