FAILURE MAP
← Case archive

FA-85636 / Ride-hailing fare and surge pricing / Open access

Lower-case zone names miss the flat table · case 01

A pickup reported as "air" is metered and skips the airport fee.

Verified by executionVariant 1 · 7 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

Zone names are not normalized before lookup.

VERIFIED REPAIR

Upper-case both zone names before lookups.

Unsuccessful approach: Normalizing only the pickup zone still misses mixed-case dropoffs.

Case 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].

Why this case matters

Ride-hailing prices are computed per trip at scale; ordering, unit and boundary slips become systematic over- or under-charging.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(table, pickup_zone, drop_zone, metered, tolls, surge, airport_fees):
    p, d = pickup_zone, drop_zone
    flat = table.get(p + '|' + d, table.get(d + '|' + p))
    if flat is not None:
        fare, kind = flat, 'flat'
    else:
        fare, kind = (metered * surge * 2 + 10) // 20, 'metered'
    fare += airport_fees.get(p, {}).get('pickup', 0) + airport_fees.get(d, {}).get('dropoff', 0)
    return [fare + tolls, kind]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: zone name normalization',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'MID', 'air', 2818, 600, 15,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [5127, 'metered']),
  ('partial repair probe: zone name normalization',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'AIR', 'air', 5170, 600, 10,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [6570, 'metered']),
  ('second regression',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'AIR', 'air', 803, 600, 10,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [2203, 'metered']),
  ('normal control 1',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'AIR', 'MID', 2204, 250, 10,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [2954, 'metered']),
  ('normal control 2',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'Dt', 'UNI', 5858, 600, 10,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [6458, 'metered']),
  ('normal control 3',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'AIR', 'UNI', 4561, 250, 15,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [4650, 'flat']),
  ('normal control 4',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'AIR', 'UNI', 2316, 0, 10,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [4400, 'flat'])],
 [('regression: zone name normalization',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'UNI', 'air', 1509, 0, 15,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [4200, 'flat']),
  ('partial repair probe: zone name normalization',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'Dt', 'air', 1624, 600, 10,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [5400, 'flat']),
  ('second regression',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'air', 'MID', 3754, 250, 15,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [6381, 'metered']),
  ('normal control 1',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'SHUT', 'SHUT', 1127, 600, 20,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [2854, 'metered']),
  ('normal control 2',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'MID', 2529, 250, 10,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [2779, 'metered']),
  ('normal control 3',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'UNI', 'SHUT', 1706, 0, 15,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [2559, 'metered']),
  ('normal control 4',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'MID', 'AIR', 3897, 600, 10,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [4797, 'metered'])],
 [('regression: zone name normalization',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'Dt', 'AIR', 5997, 0, 10,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [4800, 'flat']),
  ('partial repair probe: zone name normalization',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'AIR', 'air', 2722, 0, 10,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [3522, 'metered']),
  ('second regression',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'Dt', 'AIR', 5836, 0, 10,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [4800, 'flat']),
  ('normal control 1',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'Dt', 'DT', 3292, 250, 10,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [3542, 'metered']),
  ('normal control 2',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'UNI', 'DT', 5622, 250, 10,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [5872, 'metered']),
  ('normal control 3',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'SHUT', 'SHUT', 2719, 0, 15,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [4079, 'metered']),
  ('normal control 4',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'UNI', 'MID', 3755, 250, 15,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [5883, 'metered'])],
 [('regression: zone name normalization',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'air', 'Dt', 3694, 250, 10,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [5250, 'flat']),
  ('partial repair probe: zone name normalization',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'air', 'air', 2965, 250, 20,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [6980, 'metered']),
  ('second regression',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'air', 'UNI', 2911, 0, 20,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [4400, 'flat']),
  ('normal control 1',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'UNI', 'MID', 2503, 250, 15,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [4005, 'metered']),
  ('normal control 2',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'UNI', 'MID', 2587, 250, 15,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [4131, 'metered']),
  ('normal control 3',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'UNI', 'UNI', 2720, 0, 15,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [4080, 'metered']),
  ('normal control 4',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'Dt', 3004, 250, 10,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [3254, 'metered'])],
 [('regression: zone name normalization',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'Dt', 'air', 3508, 250, 10,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [5050, 'flat']),
  ('partial repair probe: zone name normalization',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'air', 5235, 600, 10,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [5400, 'flat']),
  ('second regression',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'AIR', 'Dt', 3354, 0, 10,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [5000, 'flat']),
  ('normal control 1',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'AIR', 'AIR', 1957, 0, 20,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [4714, 'metered']),
  ('normal control 2',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'Dt', 'UNI', 2918, 0, 10,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [2918, 'metered']),
  ('normal control 3',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'MID', 2209, 600, 15,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [3914, 'metered']),
  ('normal control 4',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'Dt', 'MID', 4348, 0, 10,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [4348, 'metered'])]]
for label, args, expected in fixtures[N-1]:
    check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
regression: zone name normalization[4827, 'metered'][5127, 'metered']Failed
partial repair probe: zone name normalization[6270, 'metered'][6570, 'metered']Failed
second regression[1903, 'metered'][2203, 'metered']Failed
normal control 1[2954, 'metered'][2954, 'metered']Passed
normal control 2[6458, 'metered'][6458, 'metered']Passed
normal control 3[4650, 'flat'][4650, 'flat']Passed
normal control 4[4400, 'flat'][4400, 'flat']Passed

SHA-256 / 8b94cdd2e1f0774ad98e52fe23f36464b81cbf2ed94cde2578fdb3aba3a32bd2

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(table, pickup_zone, drop_zone, metered, tolls, surge, airport_fees):
    p, d = pickup_zone.upper(), drop_zone
    flat = table.get(p + '|' + d, table.get(d + '|' + p))
    if flat is not None:
        fare, kind = flat, 'flat'
    else:
        fare, kind = (metered * surge * 2 + 10) // 20, 'metered'
    fare += airport_fees.get(p, {}).get('pickup', 0) + airport_fees.get(d, {}).get('dropoff', 0)
    return [fare + tolls, kind]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: zone name normalization',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'MID', 'air', 2818, 600, 15,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [5127, 'metered']),
  ('partial repair probe: zone name normalization',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'AIR', 'air', 5170, 600, 10,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [6570, 'metered']),
  ('second regression',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'AIR', 'air', 803, 600, 10,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [2203, 'metered']),
  ('normal control 1',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'AIR', 'MID', 2204, 250, 10,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [2954, 'metered']),
  ('normal control 2',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'Dt', 'UNI', 5858, 600, 10,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [6458, 'metered']),
  ('normal control 3',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'AIR', 'UNI', 4561, 250, 15,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [4650, 'flat']),
  ('normal control 4',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'AIR', 'UNI', 2316, 0, 10,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [4400, 'flat'])],
 [('regression: zone name normalization',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'UNI', 'air', 1509, 0, 15,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [4200, 'flat']),
  ('partial repair probe: zone name normalization',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'Dt', 'air', 1624, 600, 10,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [5400, 'flat']),
  ('second regression',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'air', 'MID', 3754, 250, 15,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [6381, 'metered']),
  ('normal control 1',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'SHUT', 'SHUT', 1127, 600, 20,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [2854, 'metered']),
  ('normal control 2',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'MID', 2529, 250, 10,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [2779, 'metered']),
  ('normal control 3',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'UNI', 'SHUT', 1706, 0, 15,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [2559, 'metered']),
  ('normal control 4',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'MID', 'AIR', 3897, 600, 10,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [4797, 'metered'])],
 [('regression: zone name normalization',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'Dt', 'AIR', 5997, 0, 10,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [4800, 'flat']),
  ('partial repair probe: zone name normalization',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'AIR', 'air', 2722, 0, 10,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [3522, 'metered']),
  ('second regression',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'Dt', 'AIR', 5836, 0, 10,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [4800, 'flat']),
  ('normal control 1',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'Dt', 'DT', 3292, 250, 10,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [3542, 'metered']),
  ('normal control 2',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'UNI', 'DT', 5622, 250, 10,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [5872, 'metered']),
  ('normal control 3',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'SHUT', 'SHUT', 2719, 0, 15,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [4079, 'metered']),
  ('normal control 4',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'UNI', 'MID', 3755, 250, 15,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [5883, 'metered'])],
 [('regression: zone name normalization',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'air', 'Dt', 3694, 250, 10,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [5250, 'flat']),
  ('partial repair probe: zone name normalization',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'air', 'air', 2965, 250, 20,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [6980, 'metered']),
  ('second regression',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'air', 'UNI', 2911, 0, 20,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [4400, 'flat']),
  ('normal control 1',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'UNI', 'MID', 2503, 250, 15,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [4005, 'metered']),
  ('normal control 2',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'UNI', 'MID', 2587, 250, 15,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [4131, 'metered']),
  ('normal control 3',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'UNI', 'UNI', 2720, 0, 15,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [4080, 'metered']),
  ('normal control 4',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'Dt', 3004, 250, 10,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [3254, 'metered'])],
 [('regression: zone name normalization',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'Dt', 'air', 3508, 250, 10,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [5050, 'flat']),
  ('partial repair probe: zone name normalization',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'air', 5235, 600, 10,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [5400, 'flat']),
  ('second regression',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'AIR', 'Dt', 3354, 0, 10,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [5000, 'flat']),
  ('normal control 1',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'AIR', 'AIR', 1957, 0, 20,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [4714, 'metered']),
  ('normal control 2',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'Dt', 'UNI', 2918, 0, 10,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [2918, 'metered']),
  ('normal control 3',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'MID', 2209, 600, 15,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [3914, 'metered']),
  ('normal control 4',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'Dt', 'MID', 4348, 0, 10,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [4348, 'metered'])]]
for label, args, expected in fixtures[N-1]:
    check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
regression: zone name normalization[4827, 'metered'][5127, 'metered']Failed
partial repair probe: zone name normalization[6270, 'metered'][6570, 'metered']Failed
second regression[1903, 'metered'][2203, 'metered']Failed
normal control 1[2954, 'metered'][2954, 'metered']Passed
normal control 2[6458, 'metered'][6458, 'metered']Passed
normal control 3[4650, 'flat'][4650, 'flat']Passed
normal control 4[4400, 'flat'][4400, 'flat']Passed

SHA-256 / 14ec966e6029b974aeb2aaecb876e57f2e5ee7a9a9f20d549a2214cf38123374

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(table, pickup_zone, drop_zone, metered, tolls, surge, airport_fees):
    p, d = pickup_zone.upper(), drop_zone.upper()
    flat = table.get(p + '|' + d, table.get(d + '|' + p))
    if flat is not None:
        fare, kind = flat, 'flat'
    else:
        fare, kind = (metered * surge * 2 + 10) // 20, 'metered'
    fare += airport_fees.get(p, {}).get('pickup', 0) + airport_fees.get(d, {}).get('dropoff', 0)
    return [fare + tolls, kind]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: zone name normalization',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'MID', 'air', 2818, 600, 15,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [5127, 'metered']),
  ('partial repair probe: zone name normalization',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'AIR', 'air', 5170, 600, 10,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [6570, 'metered']),
  ('second regression',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'AIR', 'air', 803, 600, 10,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [2203, 'metered']),
  ('normal control 1',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'AIR', 'MID', 2204, 250, 10,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [2954, 'metered']),
  ('normal control 2',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'Dt', 'UNI', 5858, 600, 10,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [6458, 'metered']),
  ('normal control 3',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'AIR', 'UNI', 4561, 250, 15,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [4650, 'flat']),
  ('normal control 4',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'AIR', 'UNI', 2316, 0, 10,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [4400, 'flat'])],
 [('regression: zone name normalization',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'UNI', 'air', 1509, 0, 15,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [4200, 'flat']),
  ('partial repair probe: zone name normalization',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'Dt', 'air', 1624, 600, 10,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [5400, 'flat']),
  ('second regression',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'air', 'MID', 3754, 250, 15,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [6381, 'metered']),
  ('normal control 1',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'SHUT', 'SHUT', 1127, 600, 20,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [2854, 'metered']),
  ('normal control 2',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'MID', 2529, 250, 10,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [2779, 'metered']),
  ('normal control 3',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'UNI', 'SHUT', 1706, 0, 15,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [2559, 'metered']),
  ('normal control 4',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'MID', 'AIR', 3897, 600, 10,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [4797, 'metered'])],
 [('regression: zone name normalization',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'Dt', 'AIR', 5997, 0, 10,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [4800, 'flat']),
  ('partial repair probe: zone name normalization',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'AIR', 'air', 2722, 0, 10,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [3522, 'metered']),
  ('second regression',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'Dt', 'AIR', 5836, 0, 10,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [4800, 'flat']),
  ('normal control 1',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'Dt', 'DT', 3292, 250, 10,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [3542, 'metered']),
  ('normal control 2',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'UNI', 'DT', 5622, 250, 10,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [5872, 'metered']),
  ('normal control 3',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'SHUT', 'SHUT', 2719, 0, 15,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [4079, 'metered']),
  ('normal control 4',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'UNI', 'MID', 3755, 250, 15,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [5883, 'metered'])],
 [('regression: zone name normalization',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'air', 'Dt', 3694, 250, 10,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [5250, 'flat']),
  ('partial repair probe: zone name normalization',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'air', 'air', 2965, 250, 20,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [6980, 'metered']),
  ('second regression',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'air', 'UNI', 2911, 0, 20,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [4400, 'flat']),
  ('normal control 1',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'UNI', 'MID', 2503, 250, 15,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [4005, 'metered']),
  ('normal control 2',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'UNI', 'MID', 2587, 250, 15,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [4131, 'metered']),
  ('normal control 3',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'UNI', 'UNI', 2720, 0, 15,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [4080, 'metered']),
  ('normal control 4',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'Dt', 3004, 250, 10,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [3254, 'metered'])],
 [('regression: zone name normalization',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'Dt', 'air', 3508, 250, 10,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [5050, 'flat']),
  ('partial repair probe: zone name normalization',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'air', 5235, 600, 10,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [5400, 'flat']),
  ('second regression',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'AIR', 'Dt', 3354, 0, 10,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [5000, 'flat']),
  ('normal control 1',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'AIR', 'AIR', 1957, 0, 20,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [4714, 'metered']),
  ('normal control 2',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'Dt', 'UNI', 2918, 0, 10,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [2918, 'metered']),
  ('normal control 3',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'MID', 2209, 600, 15,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [3914, 'metered']),
  ('normal control 4',
   [{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'Dt', 'MID', 4348, 0, 10,
    {'AIR': {'dropoff': 300, 'pickup': 500}}],
   [4348, 'metered'])]]
for label, args, expected in fixtures[N-1]:
    check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
regression: zone name normalization[5127, 'metered'][5127, 'metered']Passed
partial repair probe: zone name normalization[6570, 'metered'][6570, 'metered']Passed
second regression[2203, 'metered'][2203, 'metered']Passed
normal control 1[2954, 'metered'][2954, 'metered']Passed
normal control 2[6458, 'metered'][6458, 'metered']Passed
normal control 3[4650, 'flat'][4650, 'flat']Passed
normal control 4[4400, 'flat'][4400, 'flat']Passed

SHA-256 / 803e0432d5add98ee4daa3a443ad5ed511509da2fd98d3dcd214ac03ec1a4ed0

Verification & scope

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.

Observations recorded using Python 3.12.14 at 2026-09-29T14:50:42.226079+00:00.

Case digest / 918a77c850242f6b8dc6836f68881a9f87033d4cdd2b2d18bfa557854f782cff