FA-85626 / Ride-hailing fare and surge pricing / Open access
Flat fare only applies in the stored direction · case 01
Downtown-to-airport trips are metered while airport-to-downtown is flat.
ROOT CAUSE
The flat table is looked up in one direction only.
VERIFIED REPAIR
Try both key orders, keeping falsy values such as 0.
Unsuccessful approach: Chaining with or discards a stored flat of 0 and falls back to the meter.
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.upper(), drop_zone.upper()
flat = table.get(p + '|' + d)
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: reverse direction lookup',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'air', 3608, 0, 15,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[4800, 'flat']),
('partial repair probe: reverse direction lookup',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'Dt', 'SHUT', 4805, 600, 20,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[600, 'flat']),
('second regression',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'SHUT', 5208, 250, 15,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[250, 'flat']),
('normal control 1',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'Dt', 'Dt', 1699, 0, 20,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[3398, 'metered']),
('normal control 2',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'MID', 'SHUT', 3856, 0, 20,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[7712, 'metered']),
('normal control 3',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'DT', 1127, 0, 20,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[2254, 'metered']),
('normal control 4',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'UNI', 2552, 600, 20,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[5704, 'metered'])],
[('regression: reverse direction lookup',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'SHUT', 'Dt', 1073, 0, 20,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[0, 'flat']),
('partial repair probe: reverse direction lookup',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'SHUT', 931, 600, 10,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[600, 'flat']),
('second regression',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'AIR', 3359, 600, 20,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[5400, 'flat']),
('normal control 1',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'MID', 'AIR', 2443, 600, 10,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[3343, 'metered']),
('normal control 2',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'SHUT', 'UNI', 923, 0, 20,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[1846, 'metered']),
('normal control 3',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'MID', 'Dt', 3022, 250, 10,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[3272, 'metered']),
('normal control 4',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'SHUT', 'UNI', 805, 0, 15,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[1208, 'metered'])],
[('regression: reverse direction lookup',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'Dt', 'air', 3515, 600, 10,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[5400, 'flat']),
('partial repair probe: reverse direction lookup',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'Dt', 'SHUT', 2597, 250, 20,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[250, 'flat']),
('second regression',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'SHUT', 'DT', 4747, 0, 15,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[0, 'flat']),
('normal control 1',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'MID', 'air', 2328, 600, 20,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[5556, 'metered']),
('normal control 2',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'MID', 5158, 0, 10,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[5158, 'metered']),
('normal control 3',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'air', 'AIR', 1806, 600, 15,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[4109, 'metered']),
('normal control 4',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'Dt', 'MID', 1753, 0, 10,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[1753, 'metered'])],
[('regression: reverse direction lookup',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'SHUT', 'Dt', 1321, 250, 15,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[250, 'flat']),
('partial repair probe: reverse direction lookup',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'SHUT', 5412, 250, 10,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[250, 'flat']),
('second regression',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'air', 880, 600, 20,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[5400, 'flat']),
('normal control 1',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'SHUT', 'MID', 3538, 250, 20,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[7326, 'metered']),
('normal control 2',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'SHUT', 'MID', 3425, 0, 20,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[6850, 'metered']),
('normal control 3',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'SHUT', 'SHUT', 4765, 600, 15,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[7748, 'metered']),
('normal control 4',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'AIR', 'MID', 1553, 0, 15,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[2830, 'metered'])],
[('regression: reverse direction lookup',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'Dt', 'AIR', 3392, 0, 10,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[4800, 'flat']),
('partial repair probe: reverse direction lookup',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'SHUT', 2417, 250, 10,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[250, 'flat']),
('second regression',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'air', 3231, 600, 10,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[5400, 'flat']),
('normal control 1',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'MID', 'Dt', 1302, 600, 10,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[1902, 'metered']),
('normal control 2',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'Dt', 'DT', 5689, 0, 20,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[11378, 'metered']),
('normal control 3',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'air', 'SHUT', 4147, 250, 10,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[4897, 'metered']),
('normal control 4',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'MID', 'SHUT', 1371, 600, 10,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[1971, '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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression: reverse direction lookup | [5712, 'metered'] | [4800, 'flat'] | Failed |
| partial repair probe: reverse direction lookup | [600, 'flat'] | [600, 'flat'] | Passed |
| second regression | [250, 'flat'] | [250, 'flat'] | Passed |
| normal control 1 | [3398, 'metered'] | [3398, 'metered'] | Passed |
| normal control 2 | [7712, 'metered'] | [7712, 'metered'] | Passed |
| normal control 3 | [2254, 'metered'] | [2254, 'metered'] | Passed |
| normal control 4 | [5704, 'metered'] | [5704, 'metered'] | Passed |
SHA-256 / 90df3f5ff91f0718f2c3a6fd755425237a1083f3f63293f609c1cb5e3d0f24a4
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.upper()
flat = table.get(p + '|' + d) or 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: reverse direction lookup',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'air', 3608, 0, 15,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[4800, 'flat']),
('partial repair probe: reverse direction lookup',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'Dt', 'SHUT', 4805, 600, 20,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[600, 'flat']),
('second regression',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'SHUT', 5208, 250, 15,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[250, 'flat']),
('normal control 1',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'Dt', 'Dt', 1699, 0, 20,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[3398, 'metered']),
('normal control 2',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'MID', 'SHUT', 3856, 0, 20,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[7712, 'metered']),
('normal control 3',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'DT', 1127, 0, 20,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[2254, 'metered']),
('normal control 4',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'UNI', 2552, 600, 20,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[5704, 'metered'])],
[('regression: reverse direction lookup',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'SHUT', 'Dt', 1073, 0, 20,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[0, 'flat']),
('partial repair probe: reverse direction lookup',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'SHUT', 931, 600, 10,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[600, 'flat']),
('second regression',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'AIR', 3359, 600, 20,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[5400, 'flat']),
('normal control 1',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'MID', 'AIR', 2443, 600, 10,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[3343, 'metered']),
('normal control 2',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'SHUT', 'UNI', 923, 0, 20,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[1846, 'metered']),
('normal control 3',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'MID', 'Dt', 3022, 250, 10,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[3272, 'metered']),
('normal control 4',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'SHUT', 'UNI', 805, 0, 15,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[1208, 'metered'])],
[('regression: reverse direction lookup',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'Dt', 'air', 3515, 600, 10,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[5400, 'flat']),
('partial repair probe: reverse direction lookup',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'Dt', 'SHUT', 2597, 250, 20,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[250, 'flat']),
('second regression',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'SHUT', 'DT', 4747, 0, 15,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[0, 'flat']),
('normal control 1',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'MID', 'air', 2328, 600, 20,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[5556, 'metered']),
('normal control 2',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'MID', 5158, 0, 10,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[5158, 'metered']),
('normal control 3',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'air', 'AIR', 1806, 600, 15,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[4109, 'metered']),
('normal control 4',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'Dt', 'MID', 1753, 0, 10,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[1753, 'metered'])],
[('regression: reverse direction lookup',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'SHUT', 'Dt', 1321, 250, 15,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[250, 'flat']),
('partial repair probe: reverse direction lookup',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'SHUT', 5412, 250, 10,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[250, 'flat']),
('second regression',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'air', 880, 600, 20,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[5400, 'flat']),
('normal control 1',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'SHUT', 'MID', 3538, 250, 20,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[7326, 'metered']),
('normal control 2',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'SHUT', 'MID', 3425, 0, 20,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[6850, 'metered']),
('normal control 3',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'SHUT', 'SHUT', 4765, 600, 15,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[7748, 'metered']),
('normal control 4',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'AIR', 'MID', 1553, 0, 15,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[2830, 'metered'])],
[('regression: reverse direction lookup',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'Dt', 'AIR', 3392, 0, 10,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[4800, 'flat']),
('partial repair probe: reverse direction lookup',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'SHUT', 2417, 250, 10,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[250, 'flat']),
('second regression',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'air', 3231, 600, 10,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[5400, 'flat']),
('normal control 1',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'MID', 'Dt', 1302, 600, 10,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[1902, 'metered']),
('normal control 2',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'Dt', 'DT', 5689, 0, 20,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[11378, 'metered']),
('normal control 3',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'air', 'SHUT', 4147, 250, 10,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[4897, 'metered']),
('normal control 4',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'MID', 'SHUT', 1371, 600, 10,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[1971, '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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression: reverse direction lookup | [4800, 'flat'] | [4800, 'flat'] | Passed |
| partial repair probe: reverse direction lookup | [10210, 'metered'] | [600, 'flat'] | Failed |
| second regression | [8062, 'metered'] | [250, 'flat'] | Failed |
| normal control 1 | [3398, 'metered'] | [3398, 'metered'] | Passed |
| normal control 2 | [7712, 'metered'] | [7712, 'metered'] | Passed |
| normal control 3 | [2254, 'metered'] | [2254, 'metered'] | Passed |
| normal control 4 | [5704, 'metered'] | [5704, 'metered'] | Passed |
SHA-256 / 062b4127acbd97a175a3324c4e56e35100abc683931fe784ea6e9828815162d3
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: reverse direction lookup',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'air', 3608, 0, 15,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[4800, 'flat']),
('partial repair probe: reverse direction lookup',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'Dt', 'SHUT', 4805, 600, 20,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[600, 'flat']),
('second regression',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'SHUT', 5208, 250, 15,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[250, 'flat']),
('normal control 1',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'Dt', 'Dt', 1699, 0, 20,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[3398, 'metered']),
('normal control 2',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'MID', 'SHUT', 3856, 0, 20,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[7712, 'metered']),
('normal control 3',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'DT', 1127, 0, 20,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[2254, 'metered']),
('normal control 4',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'UNI', 2552, 600, 20,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[5704, 'metered'])],
[('regression: reverse direction lookup',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'SHUT', 'Dt', 1073, 0, 20,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[0, 'flat']),
('partial repair probe: reverse direction lookup',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'SHUT', 931, 600, 10,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[600, 'flat']),
('second regression',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'AIR', 3359, 600, 20,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[5400, 'flat']),
('normal control 1',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'MID', 'AIR', 2443, 600, 10,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[3343, 'metered']),
('normal control 2',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'SHUT', 'UNI', 923, 0, 20,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[1846, 'metered']),
('normal control 3',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'MID', 'Dt', 3022, 250, 10,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[3272, 'metered']),
('normal control 4',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'SHUT', 'UNI', 805, 0, 15,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[1208, 'metered'])],
[('regression: reverse direction lookup',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'Dt', 'air', 3515, 600, 10,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[5400, 'flat']),
('partial repair probe: reverse direction lookup',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'Dt', 'SHUT', 2597, 250, 20,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[250, 'flat']),
('second regression',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'SHUT', 'DT', 4747, 0, 15,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[0, 'flat']),
('normal control 1',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'MID', 'air', 2328, 600, 20,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[5556, 'metered']),
('normal control 2',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'MID', 5158, 0, 10,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[5158, 'metered']),
('normal control 3',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'air', 'AIR', 1806, 600, 15,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[4109, 'metered']),
('normal control 4',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'Dt', 'MID', 1753, 0, 10,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[1753, 'metered'])],
[('regression: reverse direction lookup',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'SHUT', 'Dt', 1321, 250, 15,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[250, 'flat']),
('partial repair probe: reverse direction lookup',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'SHUT', 5412, 250, 10,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[250, 'flat']),
('second regression',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'air', 880, 600, 20,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[5400, 'flat']),
('normal control 1',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'SHUT', 'MID', 3538, 250, 20,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[7326, 'metered']),
('normal control 2',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'SHUT', 'MID', 3425, 0, 20,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[6850, 'metered']),
('normal control 3',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'SHUT', 'SHUT', 4765, 600, 15,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[7748, 'metered']),
('normal control 4',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'AIR', 'MID', 1553, 0, 15,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[2830, 'metered'])],
[('regression: reverse direction lookup',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'Dt', 'AIR', 3392, 0, 10,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[4800, 'flat']),
('partial repair probe: reverse direction lookup',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'SHUT', 2417, 250, 10,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[250, 'flat']),
('second regression',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'DT', 'air', 3231, 600, 10,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[5400, 'flat']),
('normal control 1',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'MID', 'Dt', 1302, 600, 10,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[1902, 'metered']),
('normal control 2',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'Dt', 'DT', 5689, 0, 20,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[11378, 'metered']),
('normal control 3',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'air', 'SHUT', 4147, 250, 10,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[4897, 'metered']),
('normal control 4',
[{'AIR|DT': 4500, 'AIR|UNI': 3900, 'DT|SHUT': 0}, 'MID', 'SHUT', 1371, 600, 10,
{'AIR': {'dropoff': 300, 'pickup': 500}}],
[1971, '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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression: reverse direction lookup | [4800, 'flat'] | [4800, 'flat'] | Passed |
| partial repair probe: reverse direction lookup | [600, 'flat'] | [600, 'flat'] | Passed |
| second regression | [250, 'flat'] | [250, 'flat'] | Passed |
| normal control 1 | [3398, 'metered'] | [3398, 'metered'] | Passed |
| normal control 2 | [7712, 'metered'] | [7712, 'metered'] | Passed |
| normal control 3 | [2254, 'metered'] | [2254, 'metered'] | Passed |
| normal control 4 | [5704, 'metered'] | [5704, 'metered'] | Passed |
SHA-256 / f342e12ad7af8bb75e20dbad632859c4aea59e79651759ccdb61e160a85d30c0
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.189799+00:00.
Case digest / 0a38f0d8cfa4ef38dcc7df7474154308028caad207e5094994c292a9fb510eb5