{"abstract":"Downtown-to-airport trips are metered while airport-to-downtown is flat.","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":"Chaining with or discards a stored flat of 0 and falls back to the meter.","family":"w2-ride-hailing-fare-surge-flat-zone-fares-reverse-direction-lookup","id":"FA-85626","implementations":{"attempt":{"sha256":"062b4127acbd97a175a3324c4e56e35100abc683931fe784ea6e9828815162d3","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) or 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: reverse direction lookup',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'air', 3608, 0, 15,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [4800, 'flat']),\n  ('partial repair probe: reverse direction lookup',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'Dt', 'SHUT', 4805, 600, 20,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [600, 'flat']),\n  ('second regression',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'SHUT', 5208, 250, 15,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [250, 'flat']),\n  ('normal control 1',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'Dt', 'Dt', 1699, 0, 20,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [3398, 'metered']),\n  ('normal control 2',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'MID', 'SHUT', 3856, 0, 20,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [7712, 'metered']),\n  ('normal control 3',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'DT', 1127, 0, 20,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [2254, 'metered']),\n  ('normal control 4',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'UNI', 2552, 600, 20,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [5704, 'metered'])],\n [('regression: reverse direction lookup',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'SHUT', 'Dt', 1073, 0, 20,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [0, 'flat']),\n  ('partial repair probe: reverse direction lookup',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'SHUT', 931, 600, 10,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [600, 'flat']),\n  ('second regression',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'AIR', 3359, 600, 20,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [5400, 'flat']),\n  ('normal control 1',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'MID', 'AIR', 2443, 600, 10,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [3343, 'metered']),\n  ('normal control 2',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'SHUT', 'UNI', 923, 0, 20,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [1846, 'metered']),\n  ('normal control 3',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'MID', 'Dt', 3022, 250, 10,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [3272, 'metered']),\n  ('normal control 4',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'SHUT', 'UNI', 805, 0, 15,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [1208, 'metered'])],\n [('regression: reverse direction lookup',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'Dt', 'air', 3515, 600, 10,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [5400, 'flat']),\n  ('partial repair probe: reverse direction lookup',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'Dt', 'SHUT', 2597, 250, 20,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [250, 'flat']),\n  ('second regression',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'SHUT', 'DT', 4747, 0, 15,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [0, 'flat']),\n  ('normal control 1',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'MID', 'air', 2328, 600, 20,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [5556, 'metered']),\n  ('normal control 2',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'MID', 5158, 0, 10,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [5158, 'metered']),\n  ('normal control 3',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'air', 'AIR', 1806, 600, 15,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [4109, 'metered']),\n  ('normal control 4',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'Dt', 'MID', 1753, 0, 10,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [1753, 'metered'])],\n [('regression: reverse direction lookup',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'SHUT', 'Dt', 1321, 250, 15,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [250, 'flat']),\n  ('partial repair probe: reverse direction lookup',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'SHUT', 5412, 250, 10,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [250, 'flat']),\n  ('second regression',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'air', 880, 600, 20,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [5400, 'flat']),\n  ('normal control 1',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'SHUT', 'MID', 3538, 250, 20,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [7326, 'metered']),\n  ('normal control 2',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'SHUT', 'MID', 3425, 0, 20,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [6850, 'metered']),\n  ('normal control 3',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'SHUT', 'SHUT', 4765, 600, 15,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [7748, 'metered']),\n  ('normal control 4',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'AIR', 'MID', 1553, 0, 15,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [2830, 'metered'])],\n [('regression: reverse direction lookup',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'Dt', 'AIR', 3392, 0, 10,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [4800, 'flat']),\n  ('partial repair probe: reverse direction lookup',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'SHUT', 2417, 250, 10,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [250, 'flat']),\n  ('second regression',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'air', 3231, 600, 10,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [5400, 'flat']),\n  ('normal control 1',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'MID', 'Dt', 1302, 600, 10,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [1902, 'metered']),\n  ('normal control 2',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'Dt', 'DT', 5689, 0, 20,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [11378, 'metered']),\n  ('normal control 3',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'air', 'SHUT', 4147, 250, 10,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [4897, 'metered']),\n  ('normal control 4',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'MID', 'SHUT', 1371, 600, 10,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [1971, '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":"90df3f5ff91f0718f2c3a6fd755425237a1083f3f63293f609c1cb5e3d0f24a4","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)\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: reverse direction lookup',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'air', 3608, 0, 15,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [4800, 'flat']),\n  ('partial repair probe: reverse direction lookup',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'Dt', 'SHUT', 4805, 600, 20,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [600, 'flat']),\n  ('second regression',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'SHUT', 5208, 250, 15,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [250, 'flat']),\n  ('normal control 1',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'Dt', 'Dt', 1699, 0, 20,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [3398, 'metered']),\n  ('normal control 2',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'MID', 'SHUT', 3856, 0, 20,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [7712, 'metered']),\n  ('normal control 3',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'DT', 1127, 0, 20,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [2254, 'metered']),\n  ('normal control 4',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'UNI', 2552, 600, 20,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [5704, 'metered'])],\n [('regression: reverse direction lookup',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'SHUT', 'Dt', 1073, 0, 20,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [0, 'flat']),\n  ('partial repair probe: reverse direction lookup',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'SHUT', 931, 600, 10,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [600, 'flat']),\n  ('second regression',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'AIR', 3359, 600, 20,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [5400, 'flat']),\n  ('normal control 1',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'MID', 'AIR', 2443, 600, 10,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [3343, 'metered']),\n  ('normal control 2',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'SHUT', 'UNI', 923, 0, 20,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [1846, 'metered']),\n  ('normal control 3',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'MID', 'Dt', 3022, 250, 10,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [3272, 'metered']),\n  ('normal control 4',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'SHUT', 'UNI', 805, 0, 15,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [1208, 'metered'])],\n [('regression: reverse direction lookup',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'Dt', 'air', 3515, 600, 10,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [5400, 'flat']),\n  ('partial repair probe: reverse direction lookup',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'Dt', 'SHUT', 2597, 250, 20,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [250, 'flat']),\n  ('second regression',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'SHUT', 'DT', 4747, 0, 15,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [0, 'flat']),\n  ('normal control 1',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'MID', 'air', 2328, 600, 20,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [5556, 'metered']),\n  ('normal control 2',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'MID', 5158, 0, 10,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [5158, 'metered']),\n  ('normal control 3',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'air', 'AIR', 1806, 600, 15,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [4109, 'metered']),\n  ('normal control 4',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'Dt', 'MID', 1753, 0, 10,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [1753, 'metered'])],\n [('regression: reverse direction lookup',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'SHUT', 'Dt', 1321, 250, 15,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [250, 'flat']),\n  ('partial repair probe: reverse direction lookup',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'SHUT', 5412, 250, 10,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [250, 'flat']),\n  ('second regression',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'air', 880, 600, 20,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [5400, 'flat']),\n  ('normal control 1',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'SHUT', 'MID', 3538, 250, 20,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [7326, 'metered']),\n  ('normal control 2',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'SHUT', 'MID', 3425, 0, 20,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [6850, 'metered']),\n  ('normal control 3',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'SHUT', 'SHUT', 4765, 600, 15,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [7748, 'metered']),\n  ('normal control 4',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'AIR', 'MID', 1553, 0, 15,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [2830, 'metered'])],\n [('regression: reverse direction lookup',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'Dt', 'AIR', 3392, 0, 10,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [4800, 'flat']),\n  ('partial repair probe: reverse direction lookup',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'SHUT', 2417, 250, 10,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [250, 'flat']),\n  ('second regression',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'air', 3231, 600, 10,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [5400, 'flat']),\n  ('normal control 1',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'MID', 'Dt', 1302, 600, 10,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [1902, 'metered']),\n  ('normal control 2',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'Dt', 'DT', 5689, 0, 20,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [11378, 'metered']),\n  ('normal control 3',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'air', 'SHUT', 4147, 250, 10,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [4897, 'metered']),\n  ('normal control 4',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'MID', 'SHUT', 1371, 600, 10,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [1971, '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":"f342e12ad7af8bb75e20dbad632859c4aea59e79651759ccdb61e160a85d30c0","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: reverse direction lookup',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'air', 3608, 0, 15,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [4800, 'flat']),\n  ('partial repair probe: reverse direction lookup',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'Dt', 'SHUT', 4805, 600, 20,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [600, 'flat']),\n  ('second regression',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'SHUT', 5208, 250, 15,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [250, 'flat']),\n  ('normal control 1',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'Dt', 'Dt', 1699, 0, 20,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [3398, 'metered']),\n  ('normal control 2',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'MID', 'SHUT', 3856, 0, 20,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [7712, 'metered']),\n  ('normal control 3',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'DT', 1127, 0, 20,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [2254, 'metered']),\n  ('normal control 4',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'UNI', 2552, 600, 20,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [5704, 'metered'])],\n [('regression: reverse direction lookup',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'SHUT', 'Dt', 1073, 0, 20,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [0, 'flat']),\n  ('partial repair probe: reverse direction lookup',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'SHUT', 931, 600, 10,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [600, 'flat']),\n  ('second regression',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'AIR', 3359, 600, 20,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [5400, 'flat']),\n  ('normal control 1',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'MID', 'AIR', 2443, 600, 10,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [3343, 'metered']),\n  ('normal control 2',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'SHUT', 'UNI', 923, 0, 20,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [1846, 'metered']),\n  ('normal control 3',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'MID', 'Dt', 3022, 250, 10,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [3272, 'metered']),\n  ('normal control 4',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'SHUT', 'UNI', 805, 0, 15,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [1208, 'metered'])],\n [('regression: reverse direction lookup',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'Dt', 'air', 3515, 600, 10,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [5400, 'flat']),\n  ('partial repair probe: reverse direction lookup',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'Dt', 'SHUT', 2597, 250, 20,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [250, 'flat']),\n  ('second regression',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'SHUT', 'DT', 4747, 0, 15,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [0, 'flat']),\n  ('normal control 1',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'MID', 'air', 2328, 600, 20,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [5556, 'metered']),\n  ('normal control 2',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'MID', 5158, 0, 10,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [5158, 'metered']),\n  ('normal control 3',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'air', 'AIR', 1806, 600, 15,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [4109, 'metered']),\n  ('normal control 4',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'Dt', 'MID', 1753, 0, 10,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [1753, 'metered'])],\n [('regression: reverse direction lookup',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'SHUT', 'Dt', 1321, 250, 15,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [250, 'flat']),\n  ('partial repair probe: reverse direction lookup',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'SHUT', 5412, 250, 10,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [250, 'flat']),\n  ('second regression',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'air', 880, 600, 20,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [5400, 'flat']),\n  ('normal control 1',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'SHUT', 'MID', 3538, 250, 20,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [7326, 'metered']),\n  ('normal control 2',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'SHUT', 'MID', 3425, 0, 20,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [6850, 'metered']),\n  ('normal control 3',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'SHUT', 'SHUT', 4765, 600, 15,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [7748, 'metered']),\n  ('normal control 4',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'AIR', 'MID', 1553, 0, 15,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [2830, 'metered'])],\n [('regression: reverse direction lookup',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'Dt', 'AIR', 3392, 0, 10,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [4800, 'flat']),\n  ('partial repair probe: reverse direction lookup',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'SHUT', 2417, 250, 10,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [250, 'flat']),\n  ('second regression',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'air', 3231, 600, 10,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [5400, 'flat']),\n  ('normal control 1',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'MID', 'Dt', 1302, 600, 10,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [1902, 'metered']),\n  ('normal control 2',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'Dt', 'DT', 5689, 0, 20,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [11378, 'metered']),\n  ('normal control 3',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'air', 'SHUT', 4147, 250, 10,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [4897, 'metered']),\n  ('normal control 4',\n   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'MID', 'SHUT', 1371, 600, 10,\n    {'AIR': {'dropoff': 300, 'pickup': 500}}],\n   [1971, '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-reverse-direction-lookup","generated_at":"2026-09-29T14:50:42.189799+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":"Try both key orders, keeping falsy values such as 0.","root_cause":"The flat table is looked up in one direction only.","sha256":"0a38f0d8cfa4ef38dcc7df7474154308028caad207e5094994c292a9fb510eb5","title":"Flat fare only applies in the stored direction · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":42.768,"exit_code":1,"observations":[{"actual":[4800,"flat"],"check":"regression: reverse direction lookup","expected":[4800,"flat"],"passed":true},{"actual":[10210,"metered"],"check":"partial repair probe: reverse direction lookup","expected":[600,"flat"],"passed":false},{"actual":[8062,"metered"],"check":"second regression","expected":[250,"flat"],"passed":false},{"actual":[3398,"metered"],"check":"normal control 1","expected":[3398,"metered"],"passed":true},{"actual":[7712,"metered"],"check":"normal control 2","expected":[7712,"metered"],"passed":true},{"actual":[2254,"metered"],"check":"normal control 3","expected":[2254,"metered"],"passed":true},{"actual":[5704,"metered"],"check":"normal control 4","expected":[5704,"metered"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: reverse direction lookup\", \"actual\": [4800, \"flat\"], \"expected\": [4800, \"flat\"], \"passed\": true}, {\"check\": \"partial repair probe: reverse direction lookup\", \"actual\": [10210, \"metered\"], \"expected\": [600, \"flat\"], \"passed\": false}, {\"check\": \"second regression\", \"actual\": [8062, \"metered\"], \"expected\": [250, \"flat\"], \"passed\": false}, {\"check\": \"normal control 1\", \"actual\": [3398, \"metered\"], \"expected\": [3398, \"metered\"], \"passed\": true}, {\"check\": \"normal control 2\", \"actual\": [7712, \"metered\"], \"expected\": [7712, \"metered\"], \"passed\": true}, {\"check\": \"normal control 3\", \"actual\": [2254, \"metered\"], \"expected\": [2254, \"metered\"], \"passed\": true}, {\"check\": \"normal control 4\", \"actual\": [5704, \"metered\"], \"expected\": [5704, \"metered\"], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":41.477,"exit_code":1,"observations":[{"actual":[5712,"metered"],"check":"regression: reverse direction lookup","expected":[4800,"flat"],"passed":false},{"actual":[600,"flat"],"check":"partial repair probe: reverse direction lookup","expected":[600,"flat"],"passed":true},{"actual":[250,"flat"],"check":"second regression","expected":[250,"flat"],"passed":true},{"actual":[3398,"metered"],"check":"normal control 1","expected":[3398,"metered"],"passed":true},{"actual":[7712,"metered"],"check":"normal control 2","expected":[7712,"metered"],"passed":true},{"actual":[2254,"metered"],"check":"normal control 3","expected":[2254,"metered"],"passed":true},{"actual":[5704,"metered"],"check":"normal control 4","expected":[5704,"metered"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: reverse direction lookup\", \"actual\": [5712, \"metered\"], \"expected\": [4800, \"flat\"], \"passed\": false}, {\"check\": \"partial repair probe: reverse direction lookup\", \"actual\": [600, \"flat\"], \"expected\": [600, \"flat\"], \"passed\": true}, {\"check\": \"second regression\", \"actual\": [250, \"flat\"], \"expected\": [250, \"flat\"], \"passed\": true}, {\"check\": \"normal control 1\", \"actual\": [3398, \"metered\"], \"expected\": [3398, \"metered\"], \"passed\": true}, {\"check\": \"normal control 2\", \"actual\": [7712, \"metered\"], \"expected\": [7712, \"metered\"], \"passed\": true}, {\"check\": \"normal control 3\", \"actual\": [2254, \"metered\"], \"expected\": [2254, \"metered\"], \"passed\": true}, {\"check\": \"normal control 4\", \"actual\": [5704, \"metered\"], \"expected\": [5704, \"metered\"], \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":41.412,"exit_code":0,"observations":[{"actual":[4800,"flat"],"check":"regression: reverse direction lookup","expected":[4800,"flat"],"passed":true},{"actual":[600,"flat"],"check":"partial repair probe: reverse direction lookup","expected":[600,"flat"],"passed":true},{"actual":[250,"flat"],"check":"second regression","expected":[250,"flat"],"passed":true},{"actual":[3398,"metered"],"check":"normal control 1","expected":[3398,"metered"],"passed":true},{"actual":[7712,"metered"],"check":"normal control 2","expected":[7712,"metered"],"passed":true},{"actual":[2254,"metered"],"check":"normal control 3","expected":[2254,"metered"],"passed":true},{"actual":[5704,"metered"],"check":"normal control 4","expected":[5704,"metered"],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: reverse direction lookup\", \"actual\": [4800, \"flat\"], \"expected\": [4800, \"flat\"], \"passed\": true}, {\"check\": \"partial repair probe: reverse direction lookup\", \"actual\": [600, \"flat\"], \"expected\": [600, \"flat\"], \"passed\": true}, {\"check\": \"second regression\", \"actual\": [250, \"flat\"], \"expected\": [250, \"flat\"], \"passed\": true}, {\"check\": \"normal control 1\", \"actual\": [3398, \"metered\"], \"expected\": [3398, \"metered\"], \"passed\": true}, {\"check\": \"normal control 2\", \"actual\": [7712, \"metered\"], \"expected\": [7712, \"metered\"], \"passed\": true}, {\"check\": \"normal control 3\", \"actual\": [2254, \"metered\"], \"expected\": [2254, \"metered\"], \"passed\": true}, {\"check\": \"normal control 4\", \"actual\": [5704, \"metered\"], \"expected\": [5704, \"metered\"], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}