{"abstract":"Percentage promos are larger than advertised because they include the fee.","category":"Ride-hailing fare and surge pricing","checks":7,"contract":"Cents throughout. Surge (tenths) multiplies only base+distance+time, rounded half up. A percentage promo discounts the surged amount (floor), capped at promo cap cents. The booking fee is added after the discount. Tax (basis points, rounded half up) applies to surged - discount + booking fee; tolls and airport fees are passed through untaxed and unsurged.","evaluation_group":"w2-ride-hailing-fare-surge-fare-composition","failed_approach":"Discounting the pre-surge fare shrinks the promo during surge.","family":"w2-ride-hailing-fare-surge-fare-composition-promo-base","id":"FA-85386","implementations":{"attempt":{"sha256":"926f78b99284ebb94977fbf7aeca0997f37dcd53a1cff24bee0a01057c81ade6","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(parts, surge, promo, tax_bp):\n    def half_up(num, den):\n        return (num * 2 + den) // (den * 2)\n    core = parts['base'] + parts['distance'] + parts['time']\n    surged = half_up(core * surge, 10)\n    disc = 0\n    if promo:\n        disc = min(core * promo['pct'] // 100, promo['cap'])\n    sub = surged - disc + parts['booking_fee']\n    tax = half_up(sub * tax_bp, 10000)\n    total = sub + tax + parts['tolls'] + parts['airport_fee']\n    return {'surged': surged, 'discount': disc, 'tax': tax, 'total': total}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression: promo base',\n   [{'airport_fee': 500, 'base': 150, 'booking_fee': 175, 'distance': 997, 'time': 241, 'tolls': 0}, 15,\n    {'cap': 500, 'pct': 20}, 0],\n   {'discount': 416, 'surged': 2082, 'tax': 0, 'total': 2341}),\n  ('partial repair probe: promo base',\n   [{'airport_fee': 0, 'base': 250, 'booking_fee': 245, 'distance': 1174, 'time': 192, 'tolls': 690}, 15,\n    {'cap': 1000, 'pct': 50}, 0],\n   {'discount': 1000, 'surged': 2424, 'tax': 0, 'total': 2359}),\n  ('second regression',\n   [{'airport_fee': 0, 'base': 150, 'booking_fee': 0, 'distance': 968, 'time': 734, 'tolls': 0}, 15,\n    {'cap': 500, 'pct': 20}, 625],\n   {'discount': 500, 'surged': 2778, 'tax': 142, 'total': 2420}),\n  ('normal control 1',\n   [{'airport_fee': 0, 'base': 250, 'booking_fee': 245, 'distance': 1973, 'time': 171, 'tolls': 690}, 17,\n    {'cap': 5, 'pct': 15}, 825],\n   {'discount': 5, 'surged': 4070, 'tax': 356, 'total': 5356}),\n  ('normal control 2',\n   [{'airport_fee': 0, 'base': 150, 'booking_fee': 175, 'distance': 2993, 'time': 725, 'tolls': 375}, 25,\n    None, 0],\n   {'discount': 0, 'surged': 9670, 'tax': 0, 'total': 10220}),\n  ('normal control 3',\n   [{'airport_fee': 0, 'base': 150, 'booking_fee': 175, 'distance': 1154, 'time': 617, 'tolls': 0}, 17, None,\n    1000],\n   {'discount': 0, 'surged': 3266, 'tax': 344, 'total': 3785}),\n  ('normal control 4',\n   [{'airport_fee': 500, 'base': 250, 'booking_fee': 0, 'distance': 1221, 'time': 768, 'tolls': 690}, 15,\n    None, 1000],\n   {'discount': 0, 'surged': 3359, 'tax': 336, 'total': 4885})],\n [('regression: promo base',\n   [{'airport_fee': 0, 'base': 150, 'booking_fee': 175, 'distance': 516, 'time': 674, 'tolls': 0}, 10,\n    {'cap': 500, 'pct': 20}, 0],\n   {'discount': 268, 'surged': 1340, 'tax': 0, 'total': 1247}),\n  ('partial repair probe: promo base',\n   [{'airport_fee': 0, 'base': 250, 'booking_fee': 175, 'distance': 682, 'time': 249, 'tolls': 0}, 25,\n    {'cap': 1000, 'pct': 50}, 1000],\n   {'discount': 1000, 'surged': 2953, 'tax': 213, 'total': 2341}),\n  ('second regression',\n   [{'airport_fee': 0, 'base': 150, 'booking_fee': 0, 'distance': 671, 'time': 774, 'tolls': 690}, 15,\n    {'cap': 1000, 'pct': 50}, 825],\n   {'discount': 1000, 'surged': 2393, 'tax': 115, 'total': 2198}),\n  ('normal control 1',\n   [{'airport_fee': 0, 'base': 150, 'booking_fee': 0, 'distance': 730, 'time': 288, 'tolls': 375}, 17, None,\n    0],\n   {'discount': 0, 'surged': 1986, 'tax': 0, 'total': 2361}),\n  ('normal control 2',\n   [{'airport_fee': 0, 'base': 150, 'booking_fee': 175, 'distance': 2138, 'time': 530, 'tolls': 375}, 15,\n    None, 625],\n   {'discount': 0, 'surged': 4227, 'tax': 275, 'total': 5052}),\n  ('normal control 3',\n   [{'airport_fee': 500, 'base': 250, 'booking_fee': 245, 'distance': 1816, 'time': 118, 'tolls': 0}, 15,\n    {'cap': 5, 'pct': 15}, 825],\n   {'discount': 5, 'surged': 3276, 'tax': 290, 'total': 4306}),\n  ('normal control 4',\n   [{'airport_fee': 0, 'base': 150, 'booking_fee': 245, 'distance': 2778, 'time': 103, 'tolls': 0}, 17,\n    {'cap': 1000, 'pct': 50}, 625],\n   {'discount': 1000, 'surged': 5153, 'tax': 275, 'total': 4673})],\n [('regression: promo base',\n   [{'airport_fee': 0, 'base': 150, 'booking_fee': 175, 'distance': 253, 'time': 403, 'tolls': 0}, 15,\n    {'cap': 500, 'pct': 20}, 1000],\n   {'discount': 241, 'surged': 1209, 'tax': 114, 'total': 1257}),\n  ('partial repair probe: promo base',\n   [{'airport_fee': 0, 'base': 150, 'booking_fee': 175, 'distance': 1108, 'time': 532, 'tolls': 375}, 25,\n    {'cap': 1000, 'pct': 50}, 0],\n   {'discount': 1000, 'surged': 4475, 'tax': 0, 'total': 4025}),\n  ('second regression',\n   [{'airport_fee': 0, 'base': 250, 'booking_fee': 175, 'distance': 750, 'time': 709, 'tolls': 0}, 17,\n    {'cap': 1000, 'pct': 50}, 0],\n   {'discount': 1000, 'surged': 2905, 'tax': 0, 'total': 2080}),\n  ('normal control 1',\n   [{'airport_fee': 0, 'base': 150, 'booking_fee': 245, 'distance': 2269, 'time': 623, 'tolls': 690}, 17,\n    {'cap': 5, 'pct': 15}, 625],\n   {'discount': 5, 'surged': 5171, 'tax': 338, 'total': 6439}),\n  ('normal control 2',\n   [{'airport_fee': 0, 'base': 150, 'booking_fee': 0, 'distance': 847, 'time': 274, 'tolls': 0}, 15,\n    {'cap': 5, 'pct': 15}, 625],\n   {'discount': 5, 'surged': 1907, 'tax': 119, 'total': 2021}),\n  ('normal control 3',\n   [{'airport_fee': 500, 'base': 150, 'booking_fee': 0, 'distance': 1522, 'time': 555, 'tolls': 690}, 25,\n    {'cap': 5, 'pct': 15}, 1000],\n   {'discount': 5, 'surged': 5568, 'tax': 556, 'total': 7309}),\n  ('normal control 4',\n   [{'airport_fee': 0, 'base': 150, 'booking_fee': 0, 'distance': 1887, 'time': 217, 'tolls': 690}, 10, None,\n    0],\n   {'discount': 0, 'surged': 2254, 'tax': 0, 'total': 2944})],\n [('regression: promo base',\n   [{'airport_fee': 0, 'base': 150, 'booking_fee': 245, 'distance': 410, 'time': 874, 'tolls': 0}, 17,\n    {'cap': 500, 'pct': 20}, 625],\n   {'discount': 487, 'surged': 2438, 'tax': 137, 'total': 2333}),\n  ('partial repair probe: promo base',\n   [{'airport_fee': 0, 'base': 250, 'booking_fee': 0, 'distance': 1510, 'time': 277, 'tolls': 690}, 15,\n    {'cap': 500, 'pct': 20}, 1000],\n   {'discount': 500, 'surged': 3056, 'tax': 256, 'total': 3502}),\n  ('second regression',\n   [{'airport_fee': 500, 'base': 150, 'booking_fee': 175, 'distance': 1334, 'time': 485, 'tolls': 690}, 25,\n    {'cap': 1000, 'pct': 50}, 1000],\n   {'discount': 1000, 'surged': 4923, 'tax': 410, 'total': 5698}),\n  ('normal control 1',\n   [{'airport_fee': 0, 'base': 250, 'booking_fee': 175, 'distance': 2365, 'time': 516, 'tolls': 0}, 10,\n    {'cap': 5, 'pct': 15}, 625],\n   {'discount': 5, 'surged': 3131, 'tax': 206, 'total': 3507}),\n  ('normal control 2',\n   [{'airport_fee': 0, 'base': 250, 'booking_fee': 175, 'distance': 2432, 'time': 337, 'tolls': 375}, 10,\n    {'cap': 1000, 'pct': 50}, 825],\n   {'discount': 1000, 'surged': 3019, 'tax': 181, 'total': 2750}),\n  ('normal control 3',\n   [{'airport_fee': 0, 'base': 150, 'booking_fee': 175, 'distance': 2663, 'time': 244, 'tolls': 375}, 17,\n    {'cap': 500, 'pct': 20}, 625],\n   {'discount': 500, 'surged': 5197, 'tax': 305, 'total': 5552}),\n  ('normal control 4',\n   [{'airport_fee': 0, 'base': 250, 'booking_fee': 0, 'distance': 1527, 'time': 355, 'tolls': 0}, 10,\n    {'cap': 5, 'pct': 15}, 0],\n   {'discount': 5, 'surged': 2132, 'tax': 0, 'total': 2127})],\n [('regression: promo base',\n   [{'airport_fee': 500, 'base': 150, 'booking_fee': 175, 'distance': 678, 'time': 178, 'tolls': 0}, 12,\n    {'cap': 1000, 'pct': 50}, 0],\n   {'discount': 603, 'surged': 1207, 'tax': 0, 'total': 1279}),\n  ('partial repair probe: promo base',\n   [{'airport_fee': 500, 'base': 250, 'booking_fee': 245, 'distance': 487, 'time': 307, 'tolls': 0}, 12,\n    {'cap': 1000, 'pct': 50}, 0],\n   {'discount': 626, 'surged': 1253, 'tax': 0, 'total': 1372}),\n  ('second regression',\n   [{'airport_fee': 0, 'base': 150, 'booking_fee': 245, 'distance': 598, 'time': 531, 'tolls': 690}, 12,\n    {'cap': 1000, 'pct': 50}, 1000],\n   {'discount': 767, 'surged': 1535, 'tax': 101, 'total': 1804}),\n  ('normal control 1',\n   [{'airport_fee': 0, 'base': 150, 'booking_fee': 0, 'distance': 2692, 'time': 466, 'tolls': 690}, 25, None,\n    825],\n   {'discount': 0, 'surged': 8270, 'tax': 682, 'total': 9642}),\n  ('normal control 2',\n   [{'airport_fee': 0, 'base': 250, 'booking_fee': 245, 'distance': 2757, 'time': 257, 'tolls': 0}, 12,\n    {'cap': 500, 'pct': 20}, 0],\n   {'discount': 500, 'surged': 3917, 'tax': 0, 'total': 3662}),\n  ('normal control 3',\n   [{'airport_fee': 500, 'base': 250, 'booking_fee': 245, 'distance': 2803, 'time': 828, 'tolls': 0}, 15,\n    {'cap': 1000, 'pct': 50}, 0],\n   {'discount': 1000, 'surged': 5822, 'tax': 0, 'total': 5567}),\n  ('normal control 4',\n   [{'airport_fee': 0, 'base': 150, 'booking_fee': 175, 'distance': 2004, 'time': 876, 'tolls': 690}, 25,\n    {'cap': 1000, 'pct': 50}, 625],\n   {'discount': 1000, 'surged': 7575, 'tax': 422, 'total': 7862})]]\nfor label, args, expected in fixtures[N-1]:\n    check(label, 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":"1c354c2c511d64507ff3420d3e204be251891137a0a3c6ce056ef037b3867838","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(parts, surge, promo, tax_bp):\n    def half_up(num, den):\n        return (num * 2 + den) // (den * 2)\n    core = parts['base'] + parts['distance'] + parts['time']\n    surged = half_up(core * surge, 10)\n    disc = 0\n    if promo:\n        disc = min((surged + parts['booking_fee']) * promo['pct'] // 100, promo['cap'])\n    sub = surged - disc + parts['booking_fee']\n    tax = half_up(sub * tax_bp, 10000)\n    total = sub + tax + parts['tolls'] + parts['airport_fee']\n    return {'surged': surged, 'discount': disc, 'tax': tax, 'total': total}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression: promo base',\n   [{'airport_fee': 500, 'base': 150, 'booking_fee': 175, 'distance': 997, 'time': 241, 'tolls': 0}, 15,\n    {'cap': 500, 'pct': 20}, 0],\n   {'discount': 416, 'surged': 2082, 'tax': 0, 'total': 2341}),\n  ('partial repair probe: promo base',\n   [{'airport_fee': 0, 'base': 250, 'booking_fee': 245, 'distance': 1174, 'time': 192, 'tolls': 690}, 15,\n    {'cap': 1000, 'pct': 50}, 0],\n   {'discount': 1000, 'surged': 2424, 'tax': 0, 'total': 2359}),\n  ('second regression',\n   [{'airport_fee': 0, 'base': 150, 'booking_fee': 0, 'distance': 968, 'time': 734, 'tolls': 0}, 15,\n    {'cap': 500, 'pct': 20}, 625],\n   {'discount': 500, 'surged': 2778, 'tax': 142, 'total': 2420}),\n  ('normal control 1',\n   [{'airport_fee': 0, 'base': 250, 'booking_fee': 245, 'distance': 1973, 'time': 171, 'tolls': 690}, 17,\n    {'cap': 5, 'pct': 15}, 825],\n   {'discount': 5, 'surged': 4070, 'tax': 356, 'total': 5356}),\n  ('normal control 2',\n   [{'airport_fee': 0, 'base': 150, 'booking_fee': 175, 'distance': 2993, 'time': 725, 'tolls': 375}, 25,\n    None, 0],\n   {'discount': 0, 'surged': 9670, 'tax': 0, 'total': 10220}),\n  ('normal control 3',\n   [{'airport_fee': 0, 'base': 150, 'booking_fee': 175, 'distance': 1154, 'time': 617, 'tolls': 0}, 17, None,\n    1000],\n   {'discount': 0, 'surged': 3266, 'tax': 344, 'total': 3785}),\n  ('normal control 4',\n   [{'airport_fee': 500, 'base': 250, 'booking_fee': 0, 'distance': 1221, 'time': 768, 'tolls': 690}, 15,\n    None, 1000],\n   {'discount': 0, 'surged': 3359, 'tax': 336, 'total': 4885})],\n [('regression: promo base',\n   [{'airport_fee': 0, 'base': 150, 'booking_fee': 175, 'distance': 516, 'time': 674, 'tolls': 0}, 10,\n    {'cap': 500, 'pct': 20}, 0],\n   {'discount': 268, 'surged': 1340, 'tax': 0, 'total': 1247}),\n  ('partial repair probe: promo base',\n   [{'airport_fee': 0, 'base': 250, 'booking_fee': 175, 'distance': 682, 'time': 249, 'tolls': 0}, 25,\n    {'cap': 1000, 'pct': 50}, 1000],\n   {'discount': 1000, 'surged': 2953, 'tax': 213, 'total': 2341}),\n  ('second regression',\n   [{'airport_fee': 0, 'base': 150, 'booking_fee': 0, 'distance': 671, 'time': 774, 'tolls': 690}, 15,\n    {'cap': 1000, 'pct': 50}, 825],\n   {'discount': 1000, 'surged': 2393, 'tax': 115, 'total': 2198}),\n  ('normal control 1',\n   [{'airport_fee': 0, 'base': 150, 'booking_fee': 0, 'distance': 730, 'time': 288, 'tolls': 375}, 17, None,\n    0],\n   {'discount': 0, 'surged': 1986, 'tax': 0, 'total': 2361}),\n  ('normal control 2',\n   [{'airport_fee': 0, 'base': 150, 'booking_fee': 175, 'distance': 2138, 'time': 530, 'tolls': 375}, 15,\n    None, 625],\n   {'discount': 0, 'surged': 4227, 'tax': 275, 'total': 5052}),\n  ('normal control 3',\n   [{'airport_fee': 500, 'base': 250, 'booking_fee': 245, 'distance': 1816, 'time': 118, 'tolls': 0}, 15,\n    {'cap': 5, 'pct': 15}, 825],\n   {'discount': 5, 'surged': 3276, 'tax': 290, 'total': 4306}),\n  ('normal control 4',\n   [{'airport_fee': 0, 'base': 150, 'booking_fee': 245, 'distance': 2778, 'time': 103, 'tolls': 0}, 17,\n    {'cap': 1000, 'pct': 50}, 625],\n   {'discount': 1000, 'surged': 5153, 'tax': 275, 'total': 4673})],\n [('regression: promo base',\n   [{'airport_fee': 0, 'base': 150, 'booking_fee': 175, 'distance': 253, 'time': 403, 'tolls': 0}, 15,\n    {'cap': 500, 'pct': 20}, 1000],\n   {'discount': 241, 'surged': 1209, 'tax': 114, 'total': 1257}),\n  ('partial repair probe: promo base',\n   [{'airport_fee': 0, 'base': 150, 'booking_fee': 175, 'distance': 1108, 'time': 532, 'tolls': 375}, 25,\n    {'cap': 1000, 'pct': 50}, 0],\n   {'discount': 1000, 'surged': 4475, 'tax': 0, 'total': 4025}),\n  ('second regression',\n   [{'airport_fee': 0, 'base': 250, 'booking_fee': 175, 'distance': 750, 'time': 709, 'tolls': 0}, 17,\n    {'cap': 1000, 'pct': 50}, 0],\n   {'discount': 1000, 'surged': 2905, 'tax': 0, 'total': 2080}),\n  ('normal control 1',\n   [{'airport_fee': 0, 'base': 150, 'booking_fee': 245, 'distance': 2269, 'time': 623, 'tolls': 690}, 17,\n    {'cap': 5, 'pct': 15}, 625],\n   {'discount': 5, 'surged': 5171, 'tax': 338, 'total': 6439}),\n  ('normal control 2',\n   [{'airport_fee': 0, 'base': 150, 'booking_fee': 0, 'distance': 847, 'time': 274, 'tolls': 0}, 15,\n    {'cap': 5, 'pct': 15}, 625],\n   {'discount': 5, 'surged': 1907, 'tax': 119, 'total': 2021}),\n  ('normal control 3',\n   [{'airport_fee': 500, 'base': 150, 'booking_fee': 0, 'distance': 1522, 'time': 555, 'tolls': 690}, 25,\n    {'cap': 5, 'pct': 15}, 1000],\n   {'discount': 5, 'surged': 5568, 'tax': 556, 'total': 7309}),\n  ('normal control 4',\n   [{'airport_fee': 0, 'base': 150, 'booking_fee': 0, 'distance': 1887, 'time': 217, 'tolls': 690}, 10, None,\n    0],\n   {'discount': 0, 'surged': 2254, 'tax': 0, 'total': 2944})],\n [('regression: promo base',\n   [{'airport_fee': 0, 'base': 150, 'booking_fee': 245, 'distance': 410, 'time': 874, 'tolls': 0}, 17,\n    {'cap': 500, 'pct': 20}, 625],\n   {'discount': 487, 'surged': 2438, 'tax': 137, 'total': 2333}),\n  ('partial repair probe: promo base',\n   [{'airport_fee': 0, 'base': 250, 'booking_fee': 0, 'distance': 1510, 'time': 277, 'tolls': 690}, 15,\n    {'cap': 500, 'pct': 20}, 1000],\n   {'discount': 500, 'surged': 3056, 'tax': 256, 'total': 3502}),\n  ('second regression',\n   [{'airport_fee': 500, 'base': 150, 'booking_fee': 175, 'distance': 1334, 'time': 485, 'tolls': 690}, 25,\n    {'cap': 1000, 'pct': 50}, 1000],\n   {'discount': 1000, 'surged': 4923, 'tax': 410, 'total': 5698}),\n  ('normal control 1',\n   [{'airport_fee': 0, 'base': 250, 'booking_fee': 175, 'distance': 2365, 'time': 516, 'tolls': 0}, 10,\n    {'cap': 5, 'pct': 15}, 625],\n   {'discount': 5, 'surged': 3131, 'tax': 206, 'total': 3507}),\n  ('normal control 2',\n   [{'airport_fee': 0, 'base': 250, 'booking_fee': 175, 'distance': 2432, 'time': 337, 'tolls': 375}, 10,\n    {'cap': 1000, 'pct': 50}, 825],\n   {'discount': 1000, 'surged': 3019, 'tax': 181, 'total': 2750}),\n  ('normal control 3',\n   [{'airport_fee': 0, 'base': 150, 'booking_fee': 175, 'distance': 2663, 'time': 244, 'tolls': 375}, 17,\n    {'cap': 500, 'pct': 20}, 625],\n   {'discount': 500, 'surged': 5197, 'tax': 305, 'total': 5552}),\n  ('normal control 4',\n   [{'airport_fee': 0, 'base': 250, 'booking_fee': 0, 'distance': 1527, 'time': 355, 'tolls': 0}, 10,\n    {'cap': 5, 'pct': 15}, 0],\n   {'discount': 5, 'surged': 2132, 'tax': 0, 'total': 2127})],\n [('regression: promo base',\n   [{'airport_fee': 500, 'base': 150, 'booking_fee': 175, 'distance': 678, 'time': 178, 'tolls': 0}, 12,\n    {'cap': 1000, 'pct': 50}, 0],\n   {'discount': 603, 'surged': 1207, 'tax': 0, 'total': 1279}),\n  ('partial repair probe: promo base',\n   [{'airport_fee': 500, 'base': 250, 'booking_fee': 245, 'distance': 487, 'time': 307, 'tolls': 0}, 12,\n    {'cap': 1000, 'pct': 50}, 0],\n   {'discount': 626, 'surged': 1253, 'tax': 0, 'total': 1372}),\n  ('second regression',\n   [{'airport_fee': 0, 'base': 150, 'booking_fee': 245, 'distance': 598, 'time': 531, 'tolls': 690}, 12,\n    {'cap': 1000, 'pct': 50}, 1000],\n   {'discount': 767, 'surged': 1535, 'tax': 101, 'total': 1804}),\n  ('normal control 1',\n   [{'airport_fee': 0, 'base': 150, 'booking_fee': 0, 'distance': 2692, 'time': 466, 'tolls': 690}, 25, None,\n    825],\n   {'discount': 0, 'surged': 8270, 'tax': 682, 'total': 9642}),\n  ('normal control 2',\n   [{'airport_fee': 0, 'base': 250, 'booking_fee': 245, 'distance': 2757, 'time': 257, 'tolls': 0}, 12,\n    {'cap': 500, 'pct': 20}, 0],\n   {'discount': 500, 'surged': 3917, 'tax': 0, 'total': 3662}),\n  ('normal control 3',\n   [{'airport_fee': 500, 'base': 250, 'booking_fee': 245, 'distance': 2803, 'time': 828, 'tolls': 0}, 15,\n    {'cap': 1000, 'pct': 50}, 0],\n   {'discount': 1000, 'surged': 5822, 'tax': 0, 'total': 5567}),\n  ('normal control 4',\n   [{'airport_fee': 0, 'base': 150, 'booking_fee': 175, 'distance': 2004, 'time': 876, 'tolls': 690}, 25,\n    {'cap': 1000, 'pct': 50}, 625],\n   {'discount': 1000, 'surged': 7575, 'tax': 422, 'total': 7862})]]\nfor label, args, expected in fixtures[N-1]:\n    check(label, 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"},"fixed":{"sha256":"eb9696acdf634d233221bd13a4677568e33682bcecff7497e4b56f6e84296726","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(parts, surge, promo, tax_bp):\n    def half_up(num, den):\n        return (num * 2 + den) // (den * 2)\n    core = parts['base'] + parts['distance'] + parts['time']\n    surged = half_up(core * surge, 10)\n    disc = 0\n    if promo:\n        disc = min(surged * promo['pct'] // 100, promo['cap'])\n    sub = surged - disc + parts['booking_fee']\n    tax = half_up(sub * tax_bp, 10000)\n    total = sub + tax + parts['tolls'] + parts['airport_fee']\n    return {'surged': surged, 'discount': disc, 'tax': tax, 'total': total}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression: promo base',\n   [{'airport_fee': 500, 'base': 150, 'booking_fee': 175, 'distance': 997, 'time': 241, 'tolls': 0}, 15,\n    {'cap': 500, 'pct': 20}, 0],\n   {'discount': 416, 'surged': 2082, 'tax': 0, 'total': 2341}),\n  ('partial repair probe: promo base',\n   [{'airport_fee': 0, 'base': 250, 'booking_fee': 245, 'distance': 1174, 'time': 192, 'tolls': 690}, 15,\n    {'cap': 1000, 'pct': 50}, 0],\n   {'discount': 1000, 'surged': 2424, 'tax': 0, 'total': 2359}),\n  ('second regression',\n   [{'airport_fee': 0, 'base': 150, 'booking_fee': 0, 'distance': 968, 'time': 734, 'tolls': 0}, 15,\n    {'cap': 500, 'pct': 20}, 625],\n   {'discount': 500, 'surged': 2778, 'tax': 142, 'total': 2420}),\n  ('normal control 1',\n   [{'airport_fee': 0, 'base': 250, 'booking_fee': 245, 'distance': 1973, 'time': 171, 'tolls': 690}, 17,\n    {'cap': 5, 'pct': 15}, 825],\n   {'discount': 5, 'surged': 4070, 'tax': 356, 'total': 5356}),\n  ('normal control 2',\n   [{'airport_fee': 0, 'base': 150, 'booking_fee': 175, 'distance': 2993, 'time': 725, 'tolls': 375}, 25,\n    None, 0],\n   {'discount': 0, 'surged': 9670, 'tax': 0, 'total': 10220}),\n  ('normal control 3',\n   [{'airport_fee': 0, 'base': 150, 'booking_fee': 175, 'distance': 1154, 'time': 617, 'tolls': 0}, 17, None,\n    1000],\n   {'discount': 0, 'surged': 3266, 'tax': 344, 'total': 3785}),\n  ('normal control 4',\n   [{'airport_fee': 500, 'base': 250, 'booking_fee': 0, 'distance': 1221, 'time': 768, 'tolls': 690}, 15,\n    None, 1000],\n   {'discount': 0, 'surged': 3359, 'tax': 336, 'total': 4885})],\n [('regression: promo base',\n   [{'airport_fee': 0, 'base': 150, 'booking_fee': 175, 'distance': 516, 'time': 674, 'tolls': 0}, 10,\n    {'cap': 500, 'pct': 20}, 0],\n   {'discount': 268, 'surged': 1340, 'tax': 0, 'total': 1247}),\n  ('partial repair probe: promo base',\n   [{'airport_fee': 0, 'base': 250, 'booking_fee': 175, 'distance': 682, 'time': 249, 'tolls': 0}, 25,\n    {'cap': 1000, 'pct': 50}, 1000],\n   {'discount': 1000, 'surged': 2953, 'tax': 213, 'total': 2341}),\n  ('second regression',\n   [{'airport_fee': 0, 'base': 150, 'booking_fee': 0, 'distance': 671, 'time': 774, 'tolls': 690}, 15,\n    {'cap': 1000, 'pct': 50}, 825],\n   {'discount': 1000, 'surged': 2393, 'tax': 115, 'total': 2198}),\n  ('normal control 1',\n   [{'airport_fee': 0, 'base': 150, 'booking_fee': 0, 'distance': 730, 'time': 288, 'tolls': 375}, 17, None,\n    0],\n   {'discount': 0, 'surged': 1986, 'tax': 0, 'total': 2361}),\n  ('normal control 2',\n   [{'airport_fee': 0, 'base': 150, 'booking_fee': 175, 'distance': 2138, 'time': 530, 'tolls': 375}, 15,\n    None, 625],\n   {'discount': 0, 'surged': 4227, 'tax': 275, 'total': 5052}),\n  ('normal control 3',\n   [{'airport_fee': 500, 'base': 250, 'booking_fee': 245, 'distance': 1816, 'time': 118, 'tolls': 0}, 15,\n    {'cap': 5, 'pct': 15}, 825],\n   {'discount': 5, 'surged': 3276, 'tax': 290, 'total': 4306}),\n  ('normal control 4',\n   [{'airport_fee': 0, 'base': 150, 'booking_fee': 245, 'distance': 2778, 'time': 103, 'tolls': 0}, 17,\n    {'cap': 1000, 'pct': 50}, 625],\n   {'discount': 1000, 'surged': 5153, 'tax': 275, 'total': 4673})],\n [('regression: promo base',\n   [{'airport_fee': 0, 'base': 150, 'booking_fee': 175, 'distance': 253, 'time': 403, 'tolls': 0}, 15,\n    {'cap': 500, 'pct': 20}, 1000],\n   {'discount': 241, 'surged': 1209, 'tax': 114, 'total': 1257}),\n  ('partial repair probe: promo base',\n   [{'airport_fee': 0, 'base': 150, 'booking_fee': 175, 'distance': 1108, 'time': 532, 'tolls': 375}, 25,\n    {'cap': 1000, 'pct': 50}, 0],\n   {'discount': 1000, 'surged': 4475, 'tax': 0, 'total': 4025}),\n  ('second regression',\n   [{'airport_fee': 0, 'base': 250, 'booking_fee': 175, 'distance': 750, 'time': 709, 'tolls': 0}, 17,\n    {'cap': 1000, 'pct': 50}, 0],\n   {'discount': 1000, 'surged': 2905, 'tax': 0, 'total': 2080}),\n  ('normal control 1',\n   [{'airport_fee': 0, 'base': 150, 'booking_fee': 245, 'distance': 2269, 'time': 623, 'tolls': 690}, 17,\n    {'cap': 5, 'pct': 15}, 625],\n   {'discount': 5, 'surged': 5171, 'tax': 338, 'total': 6439}),\n  ('normal control 2',\n   [{'airport_fee': 0, 'base': 150, 'booking_fee': 0, 'distance': 847, 'time': 274, 'tolls': 0}, 15,\n    {'cap': 5, 'pct': 15}, 625],\n   {'discount': 5, 'surged': 1907, 'tax': 119, 'total': 2021}),\n  ('normal control 3',\n   [{'airport_fee': 500, 'base': 150, 'booking_fee': 0, 'distance': 1522, 'time': 555, 'tolls': 690}, 25,\n    {'cap': 5, 'pct': 15}, 1000],\n   {'discount': 5, 'surged': 5568, 'tax': 556, 'total': 7309}),\n  ('normal control 4',\n   [{'airport_fee': 0, 'base': 150, 'booking_fee': 0, 'distance': 1887, 'time': 217, 'tolls': 690}, 10, None,\n    0],\n   {'discount': 0, 'surged': 2254, 'tax': 0, 'total': 2944})],\n [('regression: promo base',\n   [{'airport_fee': 0, 'base': 150, 'booking_fee': 245, 'distance': 410, 'time': 874, 'tolls': 0}, 17,\n    {'cap': 500, 'pct': 20}, 625],\n   {'discount': 487, 'surged': 2438, 'tax': 137, 'total': 2333}),\n  ('partial repair probe: promo base',\n   [{'airport_fee': 0, 'base': 250, 'booking_fee': 0, 'distance': 1510, 'time': 277, 'tolls': 690}, 15,\n    {'cap': 500, 'pct': 20}, 1000],\n   {'discount': 500, 'surged': 3056, 'tax': 256, 'total': 3502}),\n  ('second regression',\n   [{'airport_fee': 500, 'base': 150, 'booking_fee': 175, 'distance': 1334, 'time': 485, 'tolls': 690}, 25,\n    {'cap': 1000, 'pct': 50}, 1000],\n   {'discount': 1000, 'surged': 4923, 'tax': 410, 'total': 5698}),\n  ('normal control 1',\n   [{'airport_fee': 0, 'base': 250, 'booking_fee': 175, 'distance': 2365, 'time': 516, 'tolls': 0}, 10,\n    {'cap': 5, 'pct': 15}, 625],\n   {'discount': 5, 'surged': 3131, 'tax': 206, 'total': 3507}),\n  ('normal control 2',\n   [{'airport_fee': 0, 'base': 250, 'booking_fee': 175, 'distance': 2432, 'time': 337, 'tolls': 375}, 10,\n    {'cap': 1000, 'pct': 50}, 825],\n   {'discount': 1000, 'surged': 3019, 'tax': 181, 'total': 2750}),\n  ('normal control 3',\n   [{'airport_fee': 0, 'base': 150, 'booking_fee': 175, 'distance': 2663, 'time': 244, 'tolls': 375}, 17,\n    {'cap': 500, 'pct': 20}, 625],\n   {'discount': 500, 'surged': 5197, 'tax': 305, 'total': 5552}),\n  ('normal control 4',\n   [{'airport_fee': 0, 'base': 250, 'booking_fee': 0, 'distance': 1527, 'time': 355, 'tolls': 0}, 10,\n    {'cap': 5, 'pct': 15}, 0],\n   {'discount': 5, 'surged': 2132, 'tax': 0, 'total': 2127})],\n [('regression: promo base',\n   [{'airport_fee': 500, 'base': 150, 'booking_fee': 175, 'distance': 678, 'time': 178, 'tolls': 0}, 12,\n    {'cap': 1000, 'pct': 50}, 0],\n   {'discount': 603, 'surged': 1207, 'tax': 0, 'total': 1279}),\n  ('partial repair probe: promo base',\n   [{'airport_fee': 500, 'base': 250, 'booking_fee': 245, 'distance': 487, 'time': 307, 'tolls': 0}, 12,\n    {'cap': 1000, 'pct': 50}, 0],\n   {'discount': 626, 'surged': 1253, 'tax': 0, 'total': 1372}),\n  ('second regression',\n   [{'airport_fee': 0, 'base': 150, 'booking_fee': 245, 'distance': 598, 'time': 531, 'tolls': 690}, 12,\n    {'cap': 1000, 'pct': 50}, 1000],\n   {'discount': 767, 'surged': 1535, 'tax': 101, 'total': 1804}),\n  ('normal control 1',\n   [{'airport_fee': 0, 'base': 150, 'booking_fee': 0, 'distance': 2692, 'time': 466, 'tolls': 690}, 25, None,\n    825],\n   {'discount': 0, 'surged': 8270, 'tax': 682, 'total': 9642}),\n  ('normal control 2',\n   [{'airport_fee': 0, 'base': 250, 'booking_fee': 245, 'distance': 2757, 'time': 257, 'tolls': 0}, 12,\n    {'cap': 500, 'pct': 20}, 0],\n   {'discount': 500, 'surged': 3917, 'tax': 0, 'total': 3662}),\n  ('normal control 3',\n   [{'airport_fee': 500, 'base': 250, 'booking_fee': 245, 'distance': 2803, 'time': 828, 'tolls': 0}, 15,\n    {'cap': 1000, 'pct': 50}, 0],\n   {'discount': 1000, 'surged': 5822, 'tax': 0, 'total': 5567}),\n  ('normal control 4',\n   [{'airport_fee': 0, 'base': 150, 'booking_fee': 175, 'distance': 2004, 'time': 876, 'tolls': 690}, 25,\n    {'cap': 1000, 'pct': 50}, 625],\n   {'discount': 1000, 'surged': 7575, 'tax': 422, 'total': 7862})]]\nfor label, args, expected in fixtures[N-1]:\n    check(label, 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 toy pricing contract stipulated for this example; it does not reproduce the pricing of any real ride-hailing operator or regulator. 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-ride-hailing-fare-surge-fare-composition-promo-base","generated_at":"2026-09-29T14:50:39.891935+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Ride-hailing prices are computed per trip at scale; ordering, unit and boundary slips become systematic over- or under-charging.","repair":"Discount only the surged fare.","root_cause":"The discount base includes the booking fee.","sha256":"575da66b291bff773f3cbfbf0b81d42001ef5b73b137173d1c6269c761cdb80c","title":"Promo percentage applied to the booking fee · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":41.235,"exit_code":1,"observations":[{"actual":{"discount":277,"surged":2082,"tax":0,"total":2480},"check":"regression: promo base","expected":{"discount":416,"surged":2082,"tax":0,"total":2341},"passed":false},{"actual":{"discount":808,"surged":2424,"tax":0,"total":2551},"check":"partial repair probe: promo base","expected":{"discount":1000,"surged":2424,"tax":0,"total":2359},"passed":false},{"actual":{"discount":370,"surged":2778,"tax":151,"total":2559},"check":"second regression","expected":{"discount":500,"surged":2778,"tax":142,"total":2420},"passed":false},{"actual":{"discount":5,"surged":4070,"tax":356,"total":5356},"check":"normal control 1","expected":{"discount":5,"surged":4070,"tax":356,"total":5356},"passed":true},{"actual":{"discount":0,"surged":9670,"tax":0,"total":10220},"check":"normal control 2","expected":{"discount":0,"surged":9670,"tax":0,"total":10220},"passed":true},{"actual":{"discount":0,"surged":3266,"tax":344,"total":3785},"check":"normal control 3","expected":{"discount":0,"surged":3266,"tax":344,"total":3785},"passed":true},{"actual":{"discount":0,"surged":3359,"tax":336,"total":4885},"check":"normal control 4","expected":{"discount":0,"surged":3359,"tax":336,"total":4885},"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: promo base\", \"actual\": {\"surged\": 2082, \"discount\": 277, \"tax\": 0, \"total\": 2480}, \"expected\": {\"discount\": 416, \"surged\": 2082, \"tax\": 0, \"total\": 2341}, \"passed\": false}, {\"check\": \"partial repair probe: promo base\", \"actual\": {\"surged\": 2424, \"discount\": 808, \"tax\": 0, \"total\": 2551}, \"expected\": {\"discount\": 1000, \"surged\": 2424, \"tax\": 0, \"total\": 2359}, \"passed\": false}, {\"check\": \"second regression\", \"actual\": {\"surged\": 2778, \"discount\": 370, \"tax\": 151, \"total\": 2559}, \"expected\": {\"discount\": 500, \"surged\": 2778, \"tax\": 142, \"total\": 2420}, \"passed\": false}, {\"check\": \"normal control 1\", \"actual\": {\"surged\": 4070, \"discount\": 5, \"tax\": 356, \"total\": 5356}, \"expected\": {\"discount\": 5, \"surged\": 4070, \"tax\": 356, \"total\": 5356}, \"passed\": true}, {\"check\": \"normal control 2\", \"actual\": {\"surged\": 9670, \"discount\": 0, \"tax\": 0, \"total\": 10220}, \"expected\": {\"discount\": 0, \"surged\": 9670, \"tax\": 0, \"total\": 10220}, \"passed\": true}, {\"check\": \"normal control 3\", \"actual\": {\"surged\": 3266, \"discount\": 0, \"tax\": 344, \"total\": 3785}, \"expected\": {\"discount\": 0, \"surged\": 3266, \"tax\": 344, \"total\": 3785}, \"passed\": true}, {\"check\": \"normal control 4\", \"actual\": {\"surged\": 3359, \"discount\": 0, \"tax\": 336, \"total\": 4885}, \"expected\": {\"discount\": 0, \"surged\": 3359, \"tax\": 336, \"total\": 4885}, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":43.5,"exit_code":1,"observations":[{"actual":{"discount":451,"surged":2082,"tax":0,"total":2306},"check":"regression: promo base","expected":{"discount":416,"surged":2082,"tax":0,"total":2341},"passed":false},{"actual":{"discount":1000,"surged":2424,"tax":0,"total":2359},"check":"partial repair probe: promo base","expected":{"discount":1000,"surged":2424,"tax":0,"total":2359},"passed":true},{"actual":{"discount":500,"surged":2778,"tax":142,"total":2420},"check":"second regression","expected":{"discount":500,"surged":2778,"tax":142,"total":2420},"passed":true},{"actual":{"discount":5,"surged":4070,"tax":356,"total":5356},"check":"normal control 1","expected":{"discount":5,"surged":4070,"tax":356,"total":5356},"passed":true},{"actual":{"discount":0,"surged":9670,"tax":0,"total":10220},"check":"normal control 2","expected":{"discount":0,"surged":9670,"tax":0,"total":10220},"passed":true},{"actual":{"discount":0,"surged":3266,"tax":344,"total":3785},"check":"normal control 3","expected":{"discount":0,"surged":3266,"tax":344,"total":3785},"passed":true},{"actual":{"discount":0,"surged":3359,"tax":336,"total":4885},"check":"normal control 4","expected":{"discount":0,"surged":3359,"tax":336,"total":4885},"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: promo base\", \"actual\": {\"surged\": 2082, \"discount\": 451, \"tax\": 0, \"total\": 2306}, \"expected\": {\"discount\": 416, \"surged\": 2082, \"tax\": 0, \"total\": 2341}, \"passed\": false}, {\"check\": \"partial repair probe: promo base\", \"actual\": {\"surged\": 2424, \"discount\": 1000, \"tax\": 0, \"total\": 2359}, \"expected\": {\"discount\": 1000, \"surged\": 2424, \"tax\": 0, \"total\": 2359}, \"passed\": true}, {\"check\": \"second regression\", \"actual\": {\"surged\": 2778, \"discount\": 500, \"tax\": 142, \"total\": 2420}, \"expected\": {\"discount\": 500, \"surged\": 2778, \"tax\": 142, \"total\": 2420}, \"passed\": true}, {\"check\": \"normal control 1\", \"actual\": {\"surged\": 4070, \"discount\": 5, \"tax\": 356, \"total\": 5356}, \"expected\": {\"discount\": 5, \"surged\": 4070, \"tax\": 356, \"total\": 5356}, \"passed\": true}, {\"check\": \"normal control 2\", \"actual\": {\"surged\": 9670, \"discount\": 0, \"tax\": 0, \"total\": 10220}, \"expected\": {\"discount\": 0, \"surged\": 9670, \"tax\": 0, \"total\": 10220}, \"passed\": true}, {\"check\": \"normal control 3\", \"actual\": {\"surged\": 3266, \"discount\": 0, \"tax\": 344, \"total\": 3785}, \"expected\": {\"discount\": 0, \"surged\": 3266, \"tax\": 344, \"total\": 3785}, \"passed\": true}, {\"check\": \"normal control 4\", \"actual\": {\"surged\": 3359, \"discount\": 0, \"tax\": 336, \"total\": 4885}, \"expected\": {\"discount\": 0, \"surged\": 3359, \"tax\": 336, \"total\": 4885}, \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":42.654,"exit_code":0,"observations":[{"actual":{"discount":416,"surged":2082,"tax":0,"total":2341},"check":"regression: promo base","expected":{"discount":416,"surged":2082,"tax":0,"total":2341},"passed":true},{"actual":{"discount":1000,"surged":2424,"tax":0,"total":2359},"check":"partial repair probe: promo base","expected":{"discount":1000,"surged":2424,"tax":0,"total":2359},"passed":true},{"actual":{"discount":500,"surged":2778,"tax":142,"total":2420},"check":"second regression","expected":{"discount":500,"surged":2778,"tax":142,"total":2420},"passed":true},{"actual":{"discount":5,"surged":4070,"tax":356,"total":5356},"check":"normal control 1","expected":{"discount":5,"surged":4070,"tax":356,"total":5356},"passed":true},{"actual":{"discount":0,"surged":9670,"tax":0,"total":10220},"check":"normal control 2","expected":{"discount":0,"surged":9670,"tax":0,"total":10220},"passed":true},{"actual":{"discount":0,"surged":3266,"tax":344,"total":3785},"check":"normal control 3","expected":{"discount":0,"surged":3266,"tax":344,"total":3785},"passed":true},{"actual":{"discount":0,"surged":3359,"tax":336,"total":4885},"check":"normal control 4","expected":{"discount":0,"surged":3359,"tax":336,"total":4885},"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: promo base\", \"actual\": {\"surged\": 2082, \"discount\": 416, \"tax\": 0, \"total\": 2341}, \"expected\": {\"discount\": 416, \"surged\": 2082, \"tax\": 0, \"total\": 2341}, \"passed\": true}, {\"check\": \"partial repair probe: promo base\", \"actual\": {\"surged\": 2424, \"discount\": 1000, \"tax\": 0, \"total\": 2359}, \"expected\": {\"discount\": 1000, \"surged\": 2424, \"tax\": 0, \"total\": 2359}, \"passed\": true}, {\"check\": \"second regression\", \"actual\": {\"surged\": 2778, \"discount\": 500, \"tax\": 142, \"total\": 2420}, \"expected\": {\"discount\": 500, \"surged\": 2778, \"tax\": 142, \"total\": 2420}, \"passed\": true}, {\"check\": \"normal control 1\", \"actual\": {\"surged\": 4070, \"discount\": 5, \"tax\": 356, \"total\": 5356}, \"expected\": {\"discount\": 5, \"surged\": 4070, \"tax\": 356, \"total\": 5356}, \"passed\": true}, {\"check\": \"normal control 2\", \"actual\": {\"surged\": 9670, \"discount\": 0, \"tax\": 0, \"total\": 10220}, \"expected\": {\"discount\": 0, \"surged\": 9670, \"tax\": 0, \"total\": 10220}, \"passed\": true}, {\"check\": \"normal control 3\", \"actual\": {\"surged\": 3266, \"discount\": 0, \"tax\": 344, \"total\": 3785}, \"expected\": {\"discount\": 0, \"surged\": 3266, \"tax\": 344, \"total\": 3785}, \"passed\": true}, {\"check\": \"normal control 4\", \"actual\": {\"surged\": 3359, \"discount\": 0, \"tax\": 336, \"total\": 4885}, \"expected\": {\"discount\": 0, \"surged\": 3359, \"tax\": 336, \"total\": 4885}, \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}