{"abstract":"Pay-by-plate invoice and tag discount returns a wrong result when the discounted price is floored instead of the discount.","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 the discount up has the same effect from the other side.","family":"w2-toll_and_parking_fee_computation-plate-invoice-tag-discount","id":"FA-68601","implementations":{"attempt":{"sha256":"ed3cdf81f8fecd89d74da2106b08252d1d49e26f322b197c522c5d63890e2900","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': [[91, 175, 'tag'], [42, 250, 'tag'], [44, 333, 'exempt']], 'plate_surcharge_pct': 25, 'tag_discount_pct': 10, 'invoice_fee': 150, 'cycle_days': 30}, {'tag': 383, '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': [[76, 333, 'plate'], [50, 525, 'exempt']], 'plate_surcharge_pct': 50, 'tag_discount_pct': 5, 'invoice_fee': 150, 'cycle_days': 31}, {'tag': 0, 'plate': 650, 'invoices': 1}), ({'trips': [[26, 333, 'tag'], [88, 175, 'tag'], [11, 525, 'exempt'], [80, 175, 'tag'], [18, 175, 'plate'], [51, 333, 'plate']], 'plate_surcharge_pct': 25, 'tag_discount_pct': 15, 'invoice_fee': 400, 'cycle_days': 30}, {'tag': 582, 'plate': 1436, '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, 250, 'plate']], 'plate_surcharge_pct': 35, 'tag_discount_pct': 5, 'invoice_fee': 150, 'cycle_days': 30}, {'tag': 0, 'plate': 488, 'invoices': 1}), ({'trips': [[63, 525, 'plate']], 'plate_surcharge_pct': 35, 'tag_discount_pct': 10, 'invoice_fee': 400, 'cycle_days': 31}, {'tag': 0, 'plate': 1109, 'invoices': 1}), ({'trips': [[61, 333, 'tag']], 'plate_surcharge_pct': 25, 'tag_discount_pct': 15, 'invoice_fee': 150, 'cycle_days': 30}, {'tag': 284, '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': [[27, 250, 'tag'], [39, 410, 'plate'], [68, 525, 'tag'], [60, 525, 'plate'], [21, 175, 'tag'], [32, 250, 'exempt'], [67, 410, 'exempt'], [95, 410, 'exempt']], 'plate_surcharge_pct': 25, 'tag_discount_pct': 5, 'invoice_fee': 200, 'cycle_days': 31}, {'tag': 904, 'plate': 1370, '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': [[91, 333, 'exempt'], [12, 525, 'tag'], [73, 175, 'plate']], 'plate_surcharge_pct': 25, 'tag_discount_pct': 5, 'invoice_fee': 400, 'cycle_days': 31}, {'tag': 499, 'plate': 619, 'invoices': 1}), ({'trips': [[54, 525, 'plate']], 'plate_surcharge_pct': 35, 'tag_discount_pct': 10, 'invoice_fee': 400, 'cycle_days': 31}, {'tag': 0, 'plate': 1109, 'invoices': 1}), ({'trips': [[48, 410, 'plate'], [33, 175, 'exempt'], [49, 175, 'plate']], 'plate_surcharge_pct': 25, 'tag_discount_pct': 10, 'invoice_fee': 150, 'cycle_days': 31}, {'tag': 0, 'plate': 882, 'invoices': 1}), ({'trips': [[1, 333, 'plate'], [37, 250, 'plate'], [50, 175, 'plate']], 'plate_surcharge_pct': 35, 'tag_discount_pct': 10, 'invoice_fee': 200, 'cycle_days': 31}, {'tag': 0, 'plate': 1425, 'invoices': 2}), ({'trips': [[21, 525, 'tag'], [11, 525, 'tag'], [62, 410, 'exempt']], 'plate_surcharge_pct': 25, 'tag_discount_pct': 10, 'invoice_fee': 400, 'cycle_days': 30}, {'tag': 946, 'plate': 0, 'invoices': 0})], [({'trips': [[10, 410, 'plate'], [15, 250, 'exempt'], [21, 525, 'plate'], [36, 250, 'plate'], [56, 175, 'plate'], [35, 250, 'tag'], [94, 525, 'plate']], 'plate_surcharge_pct': 25, 'tag_discount_pct': 10, 'invoice_fee': 150, 'cycle_days': 31}, {'tag': 225, 'plate': 2809, 'invoices': 3}), ({'trips': [[25, 175, 'exempt'], [7, 175, 'exempt'], [95, 410, 'plate'], [12, 250, 'exempt'], [95, 175, 'plate']], 'plate_surcharge_pct': 25, 'tag_discount_pct': 10, 'invoice_fee': 200, 'cycle_days': 30}, {'tag': 0, 'plate': 932, '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': [[54, 410, 'tag'], [50, 250, 'plate'], [25, 333, 'tag'], [46, 333, 'plate'], [39, 333, 'plate'], [41, 175, 'plate'], [49, 175, 'plate']], 'plate_surcharge_pct': 25, 'tag_discount_pct': 15, 'invoice_fee': 400, 'cycle_days': 31}, {'tag': 633, 'plate': 1985, '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': [[81, 250, 'tag'], [14, 250, 'plate'], [37, 333, 'tag']], 'plate_surcharge_pct': 25, 'tag_discount_pct': 10, 'invoice_fee': 400, 'cycle_days': 30}, {'tag': 525, 'plate': 713, 'invoices': 1}), ({'trips': [[31, 525, 'plate']], 'plate_surcharge_pct': 35, 'tag_discount_pct': 10, 'invoice_fee': 200, 'cycle_days': 30}, {'tag': 0, 'plate': 909, 'invoices': 1}), ({'trips': [[46, 333, 'exempt'], [24, 250, 'tag'], [31, 175, 'plate'], [4, 250, 'exempt'], [28, 333, 'exempt'], [14, 250, 'tag'], [79, 410, 'plate'], [1, 525, 'plate']], 'plate_surcharge_pct': 35, 'tag_discount_pct': 15, 'invoice_fee': 150, 'cycle_days': 31}, {'tag': 426, 'plate': 1950, 'invoices': 3})], [({'trips': [[20, 410, 'plate'], [72, 525, 'plate'], [58, 525, 'plate'], [6, 250, 'exempt']], 'plate_surcharge_pct': 50, 'tag_discount_pct': 5, 'invoice_fee': 200, 'cycle_days': 30}, {'tag': 0, 'plate': 2791, 'invoices': 3}), ({'trips': [[74, 250, 'plate'], [2, 250, 'plate'], [8, 525, 'plate'], [44, 175, 'tag'], [92, 250, 'plate'], [31, 175, 'plate'], [50, 333, 'plate'], [74, 250, 'tag']], 'plate_surcharge_pct': 25, 'tag_discount_pct': 15, 'invoice_fee': 400, 'cycle_days': 30}, {'tag': 362, 'plate': 3832, 'invoices': 4}), ({'trips': [[78, 250, 'tag'], [20, 250, 'plate'], [57, 175, 'exempt']], 'plate_surcharge_pct': 50, 'tag_discount_pct': 10, 'invoice_fee': 400, 'cycle_days': 30}, {'tag': 225, 'plate': 775, 'invoices': 1}), ({'trips': [[15, 250, 'tag'], [8, 410, 'tag']], 'plate_surcharge_pct': 25, 'tag_discount_pct': 5, 'invoice_fee': 150, 'cycle_days': 30}, {'tag': 628, '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': [[8, 333, 'plate']], 'plate_surcharge_pct': 25, 'tag_discount_pct': 15, 'invoice_fee': 200, 'cycle_days': 31}, {'tag': 0, 'plate': 617, 'invoices': 1}), ({'trips': [[46, 410, 'exempt'], [86, 525, 'plate'], [35, 250, 'tag'], [77, 333, 'tag'], [63, 250, 'plate'], [34, 250, 'exempt'], [50, 525, 'plate']], 'plate_surcharge_pct': 50, 'tag_discount_pct': 5, 'invoice_fee': 200, 'cycle_days': 31}, {'tag': 555, 'plate': 2351, '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': [[22, 175, 'plate'], [60, 250, 'plate'], [21, 333, 'tag'], [66, 333, 'plate'], [60, 525, 'plate'], [14, 250, 'tag']], 'plate_surcharge_pct': 25, 'tag_discount_pct': 5, 'invoice_fee': 400, 'cycle_days': 30}, {'tag': 555, 'plate': 2406, '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': [[68, 410, 'tag'], [4, 410, 'plate'], [20, 250, 'plate'], [32, 525, 'exempt'], [72, 250, 'plate'], [75, 250, 'plate'], [93, 525, 'plate'], [84, 250, 'exempt']], 'plate_surcharge_pct': 50, 'tag_discount_pct': 10, 'invoice_fee': 200, 'cycle_days': 30}, {'tag': 369, 'plate': 3128, 'invoices': 3}), ({'trips': [[18, 250, 'plate'], [23, 175, 'tag']], 'plate_surcharge_pct': 25, 'tag_discount_pct': 5, 'invoice_fee': 400, 'cycle_days': 30}, {'tag': 167, 'plate': 713, 'invoices': 1}), ({'trips': [[27, 333, 'plate'], [18, 250, 'plate']], 'plate_surcharge_pct': 50, 'tag_discount_pct': 10, 'invoice_fee': 200, 'cycle_days': 30}, {'tag': 0, 'plate': 1075, 'invoices': 1}), ({'trips': [[51, 250, 'plate'], [31, 333, 'plate']], 'plate_surcharge_pct': 35, 'tag_discount_pct': 15, 'invoice_fee': 150, 'cycle_days': 30}, {'tag': 0, 'plate': 938, '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': [[3, 410, 'exempt'], [13, 250, 'tag']], 'plate_surcharge_pct': 35, 'tag_discount_pct': 15, 'invoice_fee': 150, 'cycle_days': 31}, {'tag': 213, '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":"24ea8c5abba3676be6400efe114eb680187b0eed9cd86c45a8824262335b60a1","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 * (100 - 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': [[91, 175, 'tag'], [42, 250, 'tag'], [44, 333, 'exempt']], 'plate_surcharge_pct': 25, 'tag_discount_pct': 10, 'invoice_fee': 150, 'cycle_days': 30}, {'tag': 383, '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': [[76, 333, 'plate'], [50, 525, 'exempt']], 'plate_surcharge_pct': 50, 'tag_discount_pct': 5, 'invoice_fee': 150, 'cycle_days': 31}, {'tag': 0, 'plate': 650, 'invoices': 1}), ({'trips': [[26, 333, 'tag'], [88, 175, 'tag'], [11, 525, 'exempt'], [80, 175, 'tag'], [18, 175, 'plate'], [51, 333, 'plate']], 'plate_surcharge_pct': 25, 'tag_discount_pct': 15, 'invoice_fee': 400, 'cycle_days': 30}, {'tag': 582, 'plate': 1436, '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, 250, 'plate']], 'plate_surcharge_pct': 35, 'tag_discount_pct': 5, 'invoice_fee': 150, 'cycle_days': 30}, {'tag': 0, 'plate': 488, 'invoices': 1}), ({'trips': [[63, 525, 'plate']], 'plate_surcharge_pct': 35, 'tag_discount_pct': 10, 'invoice_fee': 400, 'cycle_days': 31}, {'tag': 0, 'plate': 1109, 'invoices': 1}), ({'trips': [[61, 333, 'tag']], 'plate_surcharge_pct': 25, 'tag_discount_pct': 15, 'invoice_fee': 150, 'cycle_days': 30}, {'tag': 284, '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': [[27, 250, 'tag'], [39, 410, 'plate'], [68, 525, 'tag'], [60, 525, 'plate'], [21, 175, 'tag'], [32, 250, 'exempt'], [67, 410, 'exempt'], [95, 410, 'exempt']], 'plate_surcharge_pct': 25, 'tag_discount_pct': 5, 'invoice_fee': 200, 'cycle_days': 31}, {'tag': 904, 'plate': 1370, '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': [[91, 333, 'exempt'], [12, 525, 'tag'], [73, 175, 'plate']], 'plate_surcharge_pct': 25, 'tag_discount_pct': 5, 'invoice_fee': 400, 'cycle_days': 31}, {'tag': 499, 'plate': 619, 'invoices': 1}), ({'trips': [[54, 525, 'plate']], 'plate_surcharge_pct': 35, 'tag_discount_pct': 10, 'invoice_fee': 400, 'cycle_days': 31}, {'tag': 0, 'plate': 1109, 'invoices': 1}), ({'trips': [[48, 410, 'plate'], [33, 175, 'exempt'], [49, 175, 'plate']], 'plate_surcharge_pct': 25, 'tag_discount_pct': 10, 'invoice_fee': 150, 'cycle_days': 31}, {'tag': 0, 'plate': 882, 'invoices': 1}), ({'trips': [[1, 333, 'plate'], [37, 250, 'plate'], [50, 175, 'plate']], 'plate_surcharge_pct': 35, 'tag_discount_pct': 10, 'invoice_fee': 200, 'cycle_days': 31}, {'tag': 0, 'plate': 1425, 'invoices': 2}), ({'trips': [[21, 525, 'tag'], [11, 525, 'tag'], [62, 410, 'exempt']], 'plate_surcharge_pct': 25, 'tag_discount_pct': 10, 'invoice_fee': 400, 'cycle_days': 30}, {'tag': 946, 'plate': 0, 'invoices': 0})], [({'trips': [[10, 410, 'plate'], [15, 250, 'exempt'], [21, 525, 'plate'], [36, 250, 'plate'], [56, 175, 'plate'], [35, 250, 'tag'], [94, 525, 'plate']], 'plate_surcharge_pct': 25, 'tag_discount_pct': 10, 'invoice_fee': 150, 'cycle_days': 31}, {'tag': 225, 'plate': 2809, 'invoices': 3}), ({'trips': [[25, 175, 'exempt'], [7, 175, 'exempt'], [95, 410, 'plate'], [12, 250, 'exempt'], [95, 175, 'plate']], 'plate_surcharge_pct': 25, 'tag_discount_pct': 10, 'invoice_fee': 200, 'cycle_days': 30}, {'tag': 0, 'plate': 932, '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': [[54, 410, 'tag'], [50, 250, 'plate'], [25, 333, 'tag'], [46, 333, 'plate'], [39, 333, 'plate'], [41, 175, 'plate'], [49, 175, 'plate']], 'plate_surcharge_pct': 25, 'tag_discount_pct': 15, 'invoice_fee': 400, 'cycle_days': 31}, {'tag': 633, 'plate': 1985, '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': [[81, 250, 'tag'], [14, 250, 'plate'], [37, 333, 'tag']], 'plate_surcharge_pct': 25, 'tag_discount_pct': 10, 'invoice_fee': 400, 'cycle_days': 30}, {'tag': 525, 'plate': 713, 'invoices': 1}), ({'trips': [[31, 525, 'plate']], 'plate_surcharge_pct': 35, 'tag_discount_pct': 10, 'invoice_fee': 200, 'cycle_days': 30}, {'tag': 0, 'plate': 909, 'invoices': 1}), ({'trips': [[46, 333, 'exempt'], [24, 250, 'tag'], [31, 175, 'plate'], [4, 250, 'exempt'], [28, 333, 'exempt'], [14, 250, 'tag'], [79, 410, 'plate'], [1, 525, 'plate']], 'plate_surcharge_pct': 35, 'tag_discount_pct': 15, 'invoice_fee': 150, 'cycle_days': 31}, {'tag': 426, 'plate': 1950, 'invoices': 3})], [({'trips': [[20, 410, 'plate'], [72, 525, 'plate'], [58, 525, 'plate'], [6, 250, 'exempt']], 'plate_surcharge_pct': 50, 'tag_discount_pct': 5, 'invoice_fee': 200, 'cycle_days': 30}, {'tag': 0, 'plate': 2791, 'invoices': 3}), ({'trips': [[74, 250, 'plate'], [2, 250, 'plate'], [8, 525, 'plate'], [44, 175, 'tag'], [92, 250, 'plate'], [31, 175, 'plate'], [50, 333, 'plate'], [74, 250, 'tag']], 'plate_surcharge_pct': 25, 'tag_discount_pct': 15, 'invoice_fee': 400, 'cycle_days': 30}, {'tag': 362, 'plate': 3832, 'invoices': 4}), ({'trips': [[78, 250, 'tag'], [20, 250, 'plate'], [57, 175, 'exempt']], 'plate_surcharge_pct': 50, 'tag_discount_pct': 10, 'invoice_fee': 400, 'cycle_days': 30}, {'tag': 225, 'plate': 775, 'invoices': 1}), ({'trips': [[15, 250, 'tag'], [8, 410, 'tag']], 'plate_surcharge_pct': 25, 'tag_discount_pct': 5, 'invoice_fee': 150, 'cycle_days': 30}, {'tag': 628, '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': [[8, 333, 'plate']], 'plate_surcharge_pct': 25, 'tag_discount_pct': 15, 'invoice_fee': 200, 'cycle_days': 31}, {'tag': 0, 'plate': 617, 'invoices': 1}), ({'trips': [[46, 410, 'exempt'], [86, 525, 'plate'], [35, 250, 'tag'], [77, 333, 'tag'], [63, 250, 'plate'], [34, 250, 'exempt'], [50, 525, 'plate']], 'plate_surcharge_pct': 50, 'tag_discount_pct': 5, 'invoice_fee': 200, 'cycle_days': 31}, {'tag': 555, 'plate': 2351, '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': [[22, 175, 'plate'], [60, 250, 'plate'], [21, 333, 'tag'], [66, 333, 'plate'], [60, 525, 'plate'], [14, 250, 'tag']], 'plate_surcharge_pct': 25, 'tag_discount_pct': 5, 'invoice_fee': 400, 'cycle_days': 30}, {'tag': 555, 'plate': 2406, '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': [[68, 410, 'tag'], [4, 410, 'plate'], [20, 250, 'plate'], [32, 525, 'exempt'], [72, 250, 'plate'], [75, 250, 'plate'], [93, 525, 'plate'], [84, 250, 'exempt']], 'plate_surcharge_pct': 50, 'tag_discount_pct': 10, 'invoice_fee': 200, 'cycle_days': 30}, {'tag': 369, 'plate': 3128, 'invoices': 3}), ({'trips': [[18, 250, 'plate'], [23, 175, 'tag']], 'plate_surcharge_pct': 25, 'tag_discount_pct': 5, 'invoice_fee': 400, 'cycle_days': 30}, {'tag': 167, 'plate': 713, 'invoices': 1}), ({'trips': [[27, 333, 'plate'], [18, 250, 'plate']], 'plate_surcharge_pct': 50, 'tag_discount_pct': 10, 'invoice_fee': 200, 'cycle_days': 30}, {'tag': 0, 'plate': 1075, 'invoices': 1}), ({'trips': [[51, 250, 'plate'], [31, 333, 'plate']], 'plate_surcharge_pct': 35, 'tag_discount_pct': 15, 'invoice_fee': 150, 'cycle_days': 30}, {'tag': 0, 'plate': 938, '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': [[3, 410, 'exempt'], [13, 250, 'tag']], 'plate_surcharge_pct': 35, 'tag_discount_pct': 15, 'invoice_fee': 150, 'cycle_days': 31}, {'tag': 213, '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-tag-discount","generated_at":"2026-09-29T14:48:03.734171+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":"Flooring the discounted price gives the customer the fractional cent the contract keeps.","sha256":"bb4ee8d292d0383709814803a1b93e35753b8a280be4ae4c40e9d0afc30301fe","title":"Pay-by-plate invoice and tag discount: the discounted price is floored instead of the discount · 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.745,"exit_code":1,"observations":[{"actual":{"invoices":0,"plate":0,"tag":382},"check":"fee oracle 0","expected":{"invoices":0,"plate":0,"tag":383},"passed":false},{"actual":{"invoices":0,"plate":0,"tag":369},"check":"fee oracle 1","expected":{"invoices":0,"plate":0,"tag":369},"passed":true},{"actual":{"invoices":1,"plate":650,"tag":0},"check":"fee oracle 2","expected":{"invoices":1,"plate":650,"tag":0},"passed":true},{"actual":{"invoices":2,"plate":1436,"tag":579},"check":"fee oracle 3","expected":{"invoices":2,"plate":1436,"tag":582},"passed":false},{"actual":{"invoices":2,"plate":1076,"tag":283},"check":"fee oracle 4","expected":{"invoices":2,"plate":1076,"tag":284},"passed":false},{"actual":{"invoices":1,"plate":488,"tag":0},"check":"fee oracle 5","expected":{"invoices":1,"plate":488,"tag":0},"passed":true},{"actual":{"invoices":1,"plate":1109,"tag":0},"check":"fee oracle 6","expected":{"invoices":1,"plate":1109,"tag":0},"passed":true},{"actual":{"invoices":0,"plate":0,"tag":283},"check":"fee oracle 7","expected":{"invoices":0,"plate":0,"tag":284},"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"fee oracle 0\", \"actual\": {\"tag\": 382, \"plate\": 0, \"invoices\": 0}, \"expected\": {\"tag\": 383, \"plate\": 0, \"invoices\": 0}, \"passed\": false}, {\"check\": \"fee oracle 1\", \"actual\": {\"tag\": 369, \"plate\": 0, \"invoices\": 0}, \"expected\": {\"tag\": 369, \"plate\": 0, \"invoices\": 0}, \"passed\": true}, {\"check\": \"fee oracle 2\", \"actual\": {\"tag\": 0, \"plate\": 650, \"invoices\": 1}, \"expected\": {\"tag\": 0, \"plate\": 650, \"invoices\": 1}, \"passed\": true}, {\"check\": \"fee oracle 3\", \"actual\": {\"tag\": 579, \"plate\": 1436, \"invoices\": 2}, \"expected\": {\"tag\": 582, \"plate\": 1436, \"invoices\": 2}, \"passed\": false}, {\"check\": \"fee oracle 4\", \"actual\": {\"tag\": 283, \"plate\": 1076, \"invoices\": 2}, \"expected\": {\"tag\": 284, \"plate\": 1076, \"invoices\": 2}, \"passed\": false}, {\"check\": \"fee oracle 5\", \"actual\": {\"tag\": 0, \"plate\": 488, \"invoices\": 1}, \"expected\": {\"tag\": 0, \"plate\": 488, \"invoices\": 1}, \"passed\": true}, {\"check\": \"fee oracle 6\", \"actual\": {\"tag\": 0, \"plate\": 1109, \"invoices\": 1}, \"expected\": {\"tag\": 0, \"plate\": 1109, \"invoices\": 1}, \"passed\": true}, {\"check\": \"fee oracle 7\", \"actual\": {\"tag\": 283, \"plate\": 0, \"invoices\": 0}, \"expected\": {\"tag\": 284, \"plate\": 0, \"invoices\": 0}, \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":39.257,"exit_code":1,"observations":[{"actual":{"invoices":0,"plate":0,"tag":382},"check":"fee oracle 0","expected":{"invoices":0,"plate":0,"tag":383},"passed":false},{"actual":{"invoices":0,"plate":0,"tag":369},"check":"fee oracle 1","expected":{"invoices":0,"plate":0,"tag":369},"passed":true},{"actual":{"invoices":1,"plate":650,"tag":0},"check":"fee oracle 2","expected":{"invoices":1,"plate":650,"tag":0},"passed":true},{"actual":{"invoices":2,"plate":1436,"tag":579},"check":"fee oracle 3","expected":{"invoices":2,"plate":1436,"tag":582},"passed":false},{"actual":{"invoices":2,"plate":1076,"tag":283},"check":"fee oracle 4","expected":{"invoices":2,"plate":1076,"tag":284},"passed":false},{"actual":{"invoices":1,"plate":488,"tag":0},"check":"fee oracle 5","expected":{"invoices":1,"plate":488,"tag":0},"passed":true},{"actual":{"invoices":1,"plate":1109,"tag":0},"check":"fee oracle 6","expected":{"invoices":1,"plate":1109,"tag":0},"passed":true},{"actual":{"invoices":0,"plate":0,"tag":283},"check":"fee oracle 7","expected":{"invoices":0,"plate":0,"tag":284},"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"fee oracle 0\", \"actual\": {\"tag\": 382, \"plate\": 0, \"invoices\": 0}, \"expected\": {\"tag\": 383, \"plate\": 0, \"invoices\": 0}, \"passed\": false}, {\"check\": \"fee oracle 1\", \"actual\": {\"tag\": 369, \"plate\": 0, \"invoices\": 0}, \"expected\": {\"tag\": 369, \"plate\": 0, \"invoices\": 0}, \"passed\": true}, {\"check\": \"fee oracle 2\", \"actual\": {\"tag\": 0, \"plate\": 650, \"invoices\": 1}, \"expected\": {\"tag\": 0, \"plate\": 650, \"invoices\": 1}, \"passed\": true}, {\"check\": \"fee oracle 3\", \"actual\": {\"tag\": 579, \"plate\": 1436, \"invoices\": 2}, \"expected\": {\"tag\": 582, \"plate\": 1436, \"invoices\": 2}, \"passed\": false}, {\"check\": \"fee oracle 4\", \"actual\": {\"tag\": 283, \"plate\": 1076, \"invoices\": 2}, \"expected\": {\"tag\": 284, \"plate\": 1076, \"invoices\": 2}, \"passed\": false}, {\"check\": \"fee oracle 5\", \"actual\": {\"tag\": 0, \"plate\": 488, \"invoices\": 1}, \"expected\": {\"tag\": 0, \"plate\": 488, \"invoices\": 1}, \"passed\": true}, {\"check\": \"fee oracle 6\", \"actual\": {\"tag\": 0, \"plate\": 1109, \"invoices\": 1}, \"expected\": {\"tag\": 0, \"plate\": 1109, \"invoices\": 1}, \"passed\": true}, {\"check\": \"fee oracle 7\", \"actual\": {\"tag\": 283, \"plate\": 0, \"invoices\": 0}, \"expected\": {\"tag\": 284, \"plate\": 0, \"invoices\": 0}, \"passed\": false}], \"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."}}