{"abstract":"The advertised 45.00 airport flat becomes 90.00 during surge.","category":"Ride-hailing fare and surge pricing","checks":7,"contract":"Zone names are case-insensitive (normalized upper case). A flat fare table keyed \"A|B\" applies in both directions; a flat fare (0 is a valid promotional flat) is never surged. Otherwise the metered fare is surged (tenths, half up). Airport fees apply separately: the pickup fee of the pickup zone and the dropoff fee of the dropoff zone. Tolls are added last. Return [fare, flat|metered].","evaluation_group":"w2-ride-hailing-fare-surge-flat-zone-fares","failed_approach":"Capping the surge on flat fares still surges them.","family":"w2-ride-hailing-fare-surge-flat-zone-fares-surge-on-flat-fares","id":"FA-85631","implementations":{"attempt":{"sha256":"d0ca5fb97559f28442a3f7a506bddfb3cdd2001dfaa8336d657cd95457b3d463","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(table, pickup_zone, drop_zone, metered, tolls, surge, airport_fees):\n    p, d = pickup_zone.upper(), drop_zone.upper()\n    flat = table.get(p + '|' + d, table.get(d + '|' + p))\n    if flat is not None:\n        fare, kind = (flat * min(surge, 15) * 2 + 10) // 20, 'flat'\n    else:\n        fare, kind = (metered * surge * 2 + 10) // 20, 'metered'\n    fare += airport_fees.get(p, {}).get('pickup', 0) + airport_fees.get(d, {}).get('dropoff', 0)\n    return [fare + tolls, kind]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression: surge on flat fares',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'AIR', 'Dt', 4020, 250, 15,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [5250, 'flat']),\n  ('partial repair probe: surge on flat fares',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'air', 'UNI', 1583, 250, 15,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [4650, 'flat']),\n  ('second regression',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'UNI', 'air', 3817, 0, 20,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [4200, 'flat']),\n  ('normal control 1',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'UNI', 'MID', 1392, 600, 15,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [2688, 'metered']),\n  ('normal control 2',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'SHUT', 2416, 0, 15,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [0, 'flat']),\n  ('normal control 3',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'AIR', 'UNI', 1886, 600, 10,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [5000, 'flat']),\n  ('normal control 4',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'UNI', 'MID', 3959, 0, 10,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [3959, 'metered'])],\n [('regression: surge on flat fares',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'air', 'DT', 2394, 0, 20,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [5000, 'flat']),\n  ('partial repair probe: surge on flat fares',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'air', 'DT', 1758, 250, 20,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [5250, 'flat']),\n  ('second regression',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'AIR', 'Dt', 5666, 0, 20,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [5000, 'flat']),\n  ('normal control 1',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'Dt', 'DT', 4719, 600, 10,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [5319, 'metered']),\n  ('normal control 2',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'UNI', 'Dt', 4427, 0, 10,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [4427, 'metered']),\n  ('normal control 3',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'air', 2639, 250, 10,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [5050, 'flat']),\n  ('normal control 4',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'MID', 'UNI', 1611, 0, 10,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [1611, 'metered'])],\n [('regression: surge on flat fares',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'AIR', 4755, 0, 20,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [4800, 'flat']),\n  ('partial repair probe: surge on flat fares',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'air', 'Dt', 4524, 600, 15,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [5600, 'flat']),\n  ('second regression',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'air', 'DT', 1236, 600, 15,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [5600, 'flat']),\n  ('normal control 1',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'Dt', 'air', 2551, 250, 10,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [5050, 'flat']),\n  ('normal control 2',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'MID', 'SHUT', 3196, 250, 20,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [6642, 'metered']),\n  ('normal control 3',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'air', 2794, 600, 10,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [5400, 'flat']),\n  ('normal control 4',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'air', 'air', 4676, 250, 10,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [5726, 'metered'])],\n [('regression: surge on flat fares',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'air', 'DT', 5371, 250, 15,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [5250, 'flat']),\n  ('partial repair probe: surge on flat fares',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'air', 'Dt', 3909, 250, 15,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [5250, 'flat']),\n  ('second regression',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'AIR', 2322, 0, 20,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [4800, 'flat']),\n  ('normal control 1',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'SHUT', 'UNI', 5805, 0, 15,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [8708, 'metered']),\n  ('normal control 2',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'MID', 3717, 600, 15,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [6176, 'metered']),\n  ('normal control 3',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'UNI', 'UNI', 4021, 0, 20,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [8042, 'metered']),\n  ('normal control 4',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'SHUT', 'AIR', 1131, 250, 15,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [2247, 'metered'])],\n [('regression: surge on flat fares',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'air', 2796, 600, 15,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [5400, 'flat']),\n  ('partial repair probe: surge on flat fares',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'AIR', 'Dt', 2621, 0, 15,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [5000, 'flat']),\n  ('second regression',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'air', 'DT', 1792, 250, 20,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [5250, 'flat']),\n  ('normal control 1',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'Dt', 'MID', 2031, 600, 15,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [3647, 'metered']),\n  ('normal control 2',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'MID', 4946, 250, 20,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [10142, 'metered']),\n  ('normal control 3',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'AIR', 'air', 3171, 0, 15,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [5557, 'metered']),\n  ('normal control 4',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'air', 'AIR', 4585, 600, 10,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [5985, 'metered'])]]\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":"d8e727f2058a7963edadcbcc9a1fce851852b21d4d878fd667faa1b80d9276e1","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(table, pickup_zone, drop_zone, metered, tolls, surge, airport_fees):\n    p, d = pickup_zone.upper(), drop_zone.upper()\n    flat = table.get(p + '|' + d, table.get(d + '|' + p))\n    if flat is not None:\n        fare, kind = (flat * surge * 2 + 10) // 20, 'flat'\n    else:\n        fare, kind = (metered * surge * 2 + 10) // 20, 'metered'\n    fare += airport_fees.get(p, {}).get('pickup', 0) + airport_fees.get(d, {}).get('dropoff', 0)\n    return [fare + tolls, kind]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression: surge on flat fares',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'AIR', 'Dt', 4020, 250, 15,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [5250, 'flat']),\n  ('partial repair probe: surge on flat fares',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'air', 'UNI', 1583, 250, 15,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [4650, 'flat']),\n  ('second regression',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'UNI', 'air', 3817, 0, 20,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [4200, 'flat']),\n  ('normal control 1',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'UNI', 'MID', 1392, 600, 15,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [2688, 'metered']),\n  ('normal control 2',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'SHUT', 2416, 0, 15,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [0, 'flat']),\n  ('normal control 3',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'AIR', 'UNI', 1886, 600, 10,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [5000, 'flat']),\n  ('normal control 4',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'UNI', 'MID', 3959, 0, 10,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [3959, 'metered'])],\n [('regression: surge on flat fares',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'air', 'DT', 2394, 0, 20,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [5000, 'flat']),\n  ('partial repair probe: surge on flat fares',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'air', 'DT', 1758, 250, 20,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [5250, 'flat']),\n  ('second regression',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'AIR', 'Dt', 5666, 0, 20,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [5000, 'flat']),\n  ('normal control 1',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'Dt', 'DT', 4719, 600, 10,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [5319, 'metered']),\n  ('normal control 2',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'UNI', 'Dt', 4427, 0, 10,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [4427, 'metered']),\n  ('normal control 3',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'air', 2639, 250, 10,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [5050, 'flat']),\n  ('normal control 4',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'MID', 'UNI', 1611, 0, 10,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [1611, 'metered'])],\n [('regression: surge on flat fares',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'AIR', 4755, 0, 20,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [4800, 'flat']),\n  ('partial repair probe: surge on flat fares',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'air', 'Dt', 4524, 600, 15,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [5600, 'flat']),\n  ('second regression',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'air', 'DT', 1236, 600, 15,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [5600, 'flat']),\n  ('normal control 1',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'Dt', 'air', 2551, 250, 10,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [5050, 'flat']),\n  ('normal control 2',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'MID', 'SHUT', 3196, 250, 20,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [6642, 'metered']),\n  ('normal control 3',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'air', 2794, 600, 10,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [5400, 'flat']),\n  ('normal control 4',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'air', 'air', 4676, 250, 10,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [5726, 'metered'])],\n [('regression: surge on flat fares',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'air', 'DT', 5371, 250, 15,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [5250, 'flat']),\n  ('partial repair probe: surge on flat fares',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'air', 'Dt', 3909, 250, 15,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [5250, 'flat']),\n  ('second regression',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'AIR', 2322, 0, 20,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [4800, 'flat']),\n  ('normal control 1',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'SHUT', 'UNI', 5805, 0, 15,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [8708, 'metered']),\n  ('normal control 2',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'MID', 3717, 600, 15,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [6176, 'metered']),\n  ('normal control 3',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'UNI', 'UNI', 4021, 0, 20,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [8042, 'metered']),\n  ('normal control 4',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'SHUT', 'AIR', 1131, 250, 15,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [2247, 'metered'])],\n [('regression: surge on flat fares',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'air', 2796, 600, 15,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [5400, 'flat']),\n  ('partial repair probe: surge on flat fares',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'AIR', 'Dt', 2621, 0, 15,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [5000, 'flat']),\n  ('second regression',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'air', 'DT', 1792, 250, 20,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [5250, 'flat']),\n  ('normal control 1',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'Dt', 'MID', 2031, 600, 15,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [3647, 'metered']),\n  ('normal control 2',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'MID', 4946, 250, 20,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [10142, 'metered']),\n  ('normal control 3',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'AIR', 'air', 3171, 0, 15,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [5557, 'metered']),\n  ('normal control 4',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'air', 'AIR', 4585, 600, 10,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [5985, 'metered'])]]\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":"9d72f9be9dbd62a72e3b3c68a525393b0cb4cf403a754dd9b5a85f7f994e7531","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(table, pickup_zone, drop_zone, metered, tolls, surge, airport_fees):\n    p, d = pickup_zone.upper(), drop_zone.upper()\n    flat = table.get(p + '|' + d, table.get(d + '|' + p))\n    if flat is not None:\n        fare, kind = flat, 'flat'\n    else:\n        fare, kind = (metered * surge * 2 + 10) // 20, 'metered'\n    fare += airport_fees.get(p, {}).get('pickup', 0) + airport_fees.get(d, {}).get('dropoff', 0)\n    return [fare + tolls, kind]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression: surge on flat fares',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'AIR', 'Dt', 4020, 250, 15,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [5250, 'flat']),\n  ('partial repair probe: surge on flat fares',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'air', 'UNI', 1583, 250, 15,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [4650, 'flat']),\n  ('second regression',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'UNI', 'air', 3817, 0, 20,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [4200, 'flat']),\n  ('normal control 1',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'UNI', 'MID', 1392, 600, 15,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [2688, 'metered']),\n  ('normal control 2',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'SHUT', 2416, 0, 15,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [0, 'flat']),\n  ('normal control 3',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'AIR', 'UNI', 1886, 600, 10,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [5000, 'flat']),\n  ('normal control 4',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'UNI', 'MID', 3959, 0, 10,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [3959, 'metered'])],\n [('regression: surge on flat fares',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'air', 'DT', 2394, 0, 20,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [5000, 'flat']),\n  ('partial repair probe: surge on flat fares',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'air', 'DT', 1758, 250, 20,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [5250, 'flat']),\n  ('second regression',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'AIR', 'Dt', 5666, 0, 20,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [5000, 'flat']),\n  ('normal control 1',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'Dt', 'DT', 4719, 600, 10,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [5319, 'metered']),\n  ('normal control 2',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'UNI', 'Dt', 4427, 0, 10,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [4427, 'metered']),\n  ('normal control 3',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'air', 2639, 250, 10,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [5050, 'flat']),\n  ('normal control 4',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'MID', 'UNI', 1611, 0, 10,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [1611, 'metered'])],\n [('regression: surge on flat fares',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'AIR', 4755, 0, 20,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [4800, 'flat']),\n  ('partial repair probe: surge on flat fares',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'air', 'Dt', 4524, 600, 15,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [5600, 'flat']),\n  ('second regression',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'air', 'DT', 1236, 600, 15,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [5600, 'flat']),\n  ('normal control 1',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'Dt', 'air', 2551, 250, 10,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [5050, 'flat']),\n  ('normal control 2',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'MID', 'SHUT', 3196, 250, 20,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [6642, 'metered']),\n  ('normal control 3',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'air', 2794, 600, 10,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [5400, 'flat']),\n  ('normal control 4',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'air', 'air', 4676, 250, 10,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [5726, 'metered'])],\n [('regression: surge on flat fares',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'air', 'DT', 5371, 250, 15,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [5250, 'flat']),\n  ('partial repair probe: surge on flat fares',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'air', 'Dt', 3909, 250, 15,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [5250, 'flat']),\n  ('second regression',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'AIR', 2322, 0, 20,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [4800, 'flat']),\n  ('normal control 1',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'SHUT', 'UNI', 5805, 0, 15,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [8708, 'metered']),\n  ('normal control 2',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'MID', 3717, 600, 15,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [6176, 'metered']),\n  ('normal control 3',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'UNI', 'UNI', 4021, 0, 20,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [8042, 'metered']),\n  ('normal control 4',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'SHUT', 'AIR', 1131, 250, 15,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [2247, 'metered'])],\n [('regression: surge on flat fares',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'air', 2796, 600, 15,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [5400, 'flat']),\n  ('partial repair probe: surge on flat fares',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'AIR', 'Dt', 2621, 0, 15,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [5000, 'flat']),\n  ('second regression',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'air', 'DT', 1792, 250, 20,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [5250, 'flat']),\n  ('normal control 1',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'Dt', 'MID', 2031, 600, 15,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [3647, 'metered']),\n  ('normal control 2',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'MID', 4946, 250, 20,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [10142, 'metered']),\n  ('normal control 3',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'AIR', 'air', 3171, 0, 15,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [5557, 'metered']),\n  ('normal control 4',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'air', 'AIR', 4585, 600, 10,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [5985, 'metered'])]]\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-flat-zone-fares-surge-on-flat-fares","generated_at":"2026-09-29T14:50:42.224021+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":"Never surge flat fares.","root_cause":"Flat fares are multiplied by the surge factor.","sha256":"3f703fb68f00596dcb5a61e6f75580de4c0c66c496a9dcb160239e927402035a","title":"Surge applied to a flat airport fare · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":42.757,"exit_code":1,"observations":[{"actual":[7500,"flat"],"check":"regression: surge on flat fares","expected":[5250,"flat"],"passed":false},{"actual":[6600,"flat"],"check":"partial repair probe: surge on flat fares","expected":[4650,"flat"],"passed":false},{"actual":[6150,"flat"],"check":"second regression","expected":[4200,"flat"],"passed":false},{"actual":[2688,"metered"],"check":"normal control 1","expected":[2688,"metered"],"passed":true},{"actual":[0,"flat"],"check":"normal control 2","expected":[0,"flat"],"passed":true},{"actual":[5000,"flat"],"check":"normal control 3","expected":[5000,"flat"],"passed":true},{"actual":[3959,"metered"],"check":"normal control 4","expected":[3959,"metered"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: surge on flat fares\", \"actual\": [7500, \"flat\"], \"expected\": [5250, \"flat\"], \"passed\": false}, {\"check\": \"partial repair probe: surge on flat fares\", \"actual\": [6600, \"flat\"], \"expected\": [4650, \"flat\"], \"passed\": false}, {\"check\": \"second regression\", \"actual\": [6150, \"flat\"], \"expected\": [4200, \"flat\"], \"passed\": false}, {\"check\": \"normal control 1\", \"actual\": [2688, \"metered\"], \"expected\": [2688, \"metered\"], \"passed\": true}, {\"check\": \"normal control 2\", \"actual\": [0, \"flat\"], \"expected\": [0, \"flat\"], \"passed\": true}, {\"check\": \"normal control 3\", \"actual\": [5000, \"flat\"], \"expected\": [5000, \"flat\"], \"passed\": true}, {\"check\": \"normal control 4\", \"actual\": [3959, \"metered\"], \"expected\": [3959, \"metered\"], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":41.967,"exit_code":1,"observations":[{"actual":[7500,"flat"],"check":"regression: surge on flat fares","expected":[5250,"flat"],"passed":false},{"actual":[6600,"flat"],"check":"partial repair probe: surge on flat fares","expected":[4650,"flat"],"passed":false},{"actual":[8100,"flat"],"check":"second regression","expected":[4200,"flat"],"passed":false},{"actual":[2688,"metered"],"check":"normal control 1","expected":[2688,"metered"],"passed":true},{"actual":[0,"flat"],"check":"normal control 2","expected":[0,"flat"],"passed":true},{"actual":[5000,"flat"],"check":"normal control 3","expected":[5000,"flat"],"passed":true},{"actual":[3959,"metered"],"check":"normal control 4","expected":[3959,"metered"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: surge on flat fares\", \"actual\": [7500, \"flat\"], \"expected\": [5250, \"flat\"], \"passed\": false}, {\"check\": \"partial repair probe: surge on flat fares\", \"actual\": [6600, \"flat\"], \"expected\": [4650, \"flat\"], \"passed\": false}, {\"check\": \"second regression\", \"actual\": [8100, \"flat\"], \"expected\": [4200, \"flat\"], \"passed\": false}, {\"check\": \"normal control 1\", \"actual\": [2688, \"metered\"], \"expected\": [2688, \"metered\"], \"passed\": true}, {\"check\": \"normal control 2\", \"actual\": [0, \"flat\"], \"expected\": [0, \"flat\"], \"passed\": true}, {\"check\": \"normal control 3\", \"actual\": [5000, \"flat\"], \"expected\": [5000, \"flat\"], \"passed\": true}, {\"check\": \"normal control 4\", \"actual\": [3959, \"metered\"], \"expected\": [3959, \"metered\"], \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":42.054,"exit_code":0,"observations":[{"actual":[5250,"flat"],"check":"regression: surge on flat fares","expected":[5250,"flat"],"passed":true},{"actual":[4650,"flat"],"check":"partial repair probe: surge on flat fares","expected":[4650,"flat"],"passed":true},{"actual":[4200,"flat"],"check":"second regression","expected":[4200,"flat"],"passed":true},{"actual":[2688,"metered"],"check":"normal control 1","expected":[2688,"metered"],"passed":true},{"actual":[0,"flat"],"check":"normal control 2","expected":[0,"flat"],"passed":true},{"actual":[5000,"flat"],"check":"normal control 3","expected":[5000,"flat"],"passed":true},{"actual":[3959,"metered"],"check":"normal control 4","expected":[3959,"metered"],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: surge on flat fares\", \"actual\": [5250, \"flat\"], \"expected\": [5250, \"flat\"], \"passed\": true}, {\"check\": \"partial repair probe: surge on flat fares\", \"actual\": [4650, \"flat\"], \"expected\": [4650, \"flat\"], \"passed\": true}, {\"check\": \"second regression\", \"actual\": [4200, \"flat\"], \"expected\": [4200, \"flat\"], \"passed\": true}, {\"check\": \"normal control 1\", \"actual\": [2688, \"metered\"], \"expected\": [2688, \"metered\"], \"passed\": true}, {\"check\": \"normal control 2\", \"actual\": [0, \"flat\"], \"expected\": [0, \"flat\"], \"passed\": true}, {\"check\": \"normal control 3\", \"actual\": [5000, \"flat\"], \"expected\": [5000, \"flat\"], \"passed\": true}, {\"check\": \"normal control 4\", \"actual\": [3959, \"metered\"], \"expected\": [3959, \"metered\"], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}