FA-85831 / Ride-hailing fare and surge pricing / Open access
Tip cap ignores the 50.00 floor · case 01
Riders on a 12.00 trip cannot tip more than 24.00.
ROOT CAUSE
The cap is twice the fare without the minimum cap amount.
VERIFIED REPAIR
Use the larger of twice the fare and 5000 cents.
Unsuccessful approach: Taking the smaller value caps big-fare tips at 50.00.
Case contract
Tips can be added from trip end through 72 hours later inclusive (259200 s). Total tips per trip are capped at the larger of twice the fare or 50.00; a new tip is truncated to the remaining room, and rejected with "cap" when no room is left. Return [accepted cents, reason].
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(trip_end, tip_t, amount, fare, prior_tips):
elapsed = tip_t - trip_end
if elapsed < 0 or elapsed > 259200:
return [0, 'window']
cap = fare * 2
room = cap - prior_tips
if room <= 0:
return [0, 'cap']
return [min(amount, room), 'ok']
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: tip cap floor', [0, 259200, 6000, 2400, 1000], [4000, 'ok']),
('partial repair probe: tip cap floor', [0, 259200, 6000, 1200, 0], [5000, 'ok']),
('second regression', [0, 259200, 6000, 2400, 0], [5000, 'ok']),
('normal control 1', [0, 259201, 500, 2400, 1000], [0, 'window']),
('normal control 2', [0, 259200, 2000, 4000, 1000], [2000, 'ok']),
('normal control 3', [0, 3600, 500, 4000, 1000], [500, 'ok']),
('normal control 4', [0, 259199, 500, 2400, 1000], [500, 'ok'])],
[('regression: tip cap floor', [0, 0, 500, 2400, 4800], [200, 'ok']),
('partial repair probe: tip cap floor', [0, 0, 6000, 2400, 0], [5000, 'ok']),
('second regression', [0, 0, 6000, 1200, 1000], [4000, 'ok']),
('normal control 1', [0, -1, 500, 2400, 8000], [0, 'window']),
('normal control 2', [0, 0, 2000, 4000, 8000], [0, 'cap']),
('normal control 3', [0, 259200, 2000, 2400, 1000], [2000, 'ok']),
('normal control 4', [0, 259199, 2000, 4000, 0], [2000, 'ok'])],
[('regression: tip cap floor', [0, 0, 6000, 2400, 4800], [200, 'ok']),
('partial repair probe: tip cap floor', [0, 259199, 2000, 1200, 4800], [200, 'ok']),
('second regression', [0, 259199, 2000, 4000, 4800], [2000, 'ok']),
('normal control 1', [0, 259201, 2000, 2400, 0], [0, 'window']),
('normal control 2', [0, -1, 6000, 1200, 4800], [0, 'window']),
('normal control 3', [0, -1, 500, 4000, 0], [0, 'window']),
('normal control 4', [0, 259201, 2000, 4000, 4800], [0, 'window'])],
[('regression: tip cap floor', [0, 259199, 2000, 1200, 1000], [2000, 'ok']),
('partial repair probe: tip cap floor', [0, 259199, 500, 2400, 4800], [200, 'ok']),
('second regression', [0, 259199, 500, 4000, 4800], [500, 'ok']),
('normal control 1', [0, -1, 2000, 1200, 0], [0, 'window']),
('normal control 2', [0, 3600, 2000, 1200, 0], [2000, 'ok']),
('normal control 3', [0, 0, 500, 4000, 1000], [500, 'ok']),
('normal control 4', [0, 3600, 500, 1200, 1000], [500, 'ok'])],
[('regression: tip cap floor', [0, 0, 6000, 2400, 0], [5000, 'ok']),
('partial repair probe: tip cap floor', [0, 259200, 2000, 4000, 4800], [2000, 'ok']),
('second regression', [0, 259200, 6000, 2400, 1000], [4000, 'ok']),
('normal control 1', [0, 3600, 500, 1200, 8000], [0, 'cap']),
('normal control 2', [0, -1, 500, 2400, 8000], [0, 'window']),
('normal control 3', [0, 259199, 6000, 4000, 8000], [0, 'cap']),
('normal control 4', [0, 259199, 500, 4000, 1000], [500, 'ok'])]]
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: tip cap floor | [3800, 'ok'] | [4000, 'ok'] | Failed |
| partial repair probe: tip cap floor | [2400, 'ok'] | [5000, 'ok'] | Failed |
| second regression | [4800, 'ok'] | [5000, 'ok'] | Failed |
| normal control 1 | [0, 'window'] | [0, 'window'] | Passed |
| normal control 2 | [2000, 'ok'] | [2000, 'ok'] | Passed |
| normal control 3 | [500, 'ok'] | [500, 'ok'] | Passed |
| normal control 4 | [500, 'ok'] | [500, 'ok'] | Passed |
SHA-256 / 84c736f3429d5486943e76c8223d843bea6baebf0f21afd88787067f1bda79fd
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(trip_end, tip_t, amount, fare, prior_tips):
elapsed = tip_t - trip_end
if elapsed < 0 or elapsed > 259200:
return [0, 'window']
cap = min(fare * 2, 5000)
room = cap - prior_tips
if room <= 0:
return [0, 'cap']
return [min(amount, room), 'ok']
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: tip cap floor', [0, 259200, 6000, 2400, 1000], [4000, 'ok']),
('partial repair probe: tip cap floor', [0, 259200, 6000, 1200, 0], [5000, 'ok']),
('second regression', [0, 259200, 6000, 2400, 0], [5000, 'ok']),
('normal control 1', [0, 259201, 500, 2400, 1000], [0, 'window']),
('normal control 2', [0, 259200, 2000, 4000, 1000], [2000, 'ok']),
('normal control 3', [0, 3600, 500, 4000, 1000], [500, 'ok']),
('normal control 4', [0, 259199, 500, 2400, 1000], [500, 'ok'])],
[('regression: tip cap floor', [0, 0, 500, 2400, 4800], [200, 'ok']),
('partial repair probe: tip cap floor', [0, 0, 6000, 2400, 0], [5000, 'ok']),
('second regression', [0, 0, 6000, 1200, 1000], [4000, 'ok']),
('normal control 1', [0, -1, 500, 2400, 8000], [0, 'window']),
('normal control 2', [0, 0, 2000, 4000, 8000], [0, 'cap']),
('normal control 3', [0, 259200, 2000, 2400, 1000], [2000, 'ok']),
('normal control 4', [0, 259199, 2000, 4000, 0], [2000, 'ok'])],
[('regression: tip cap floor', [0, 0, 6000, 2400, 4800], [200, 'ok']),
('partial repair probe: tip cap floor', [0, 259199, 2000, 1200, 4800], [200, 'ok']),
('second regression', [0, 259199, 2000, 4000, 4800], [2000, 'ok']),
('normal control 1', [0, 259201, 2000, 2400, 0], [0, 'window']),
('normal control 2', [0, -1, 6000, 1200, 4800], [0, 'window']),
('normal control 3', [0, -1, 500, 4000, 0], [0, 'window']),
('normal control 4', [0, 259201, 2000, 4000, 4800], [0, 'window'])],
[('regression: tip cap floor', [0, 259199, 2000, 1200, 1000], [2000, 'ok']),
('partial repair probe: tip cap floor', [0, 259199, 500, 2400, 4800], [200, 'ok']),
('second regression', [0, 259199, 500, 4000, 4800], [500, 'ok']),
('normal control 1', [0, -1, 2000, 1200, 0], [0, 'window']),
('normal control 2', [0, 3600, 2000, 1200, 0], [2000, 'ok']),
('normal control 3', [0, 0, 500, 4000, 1000], [500, 'ok']),
('normal control 4', [0, 3600, 500, 1200, 1000], [500, 'ok'])],
[('regression: tip cap floor', [0, 0, 6000, 2400, 0], [5000, 'ok']),
('partial repair probe: tip cap floor', [0, 259200, 2000, 4000, 4800], [2000, 'ok']),
('second regression', [0, 259200, 6000, 2400, 1000], [4000, 'ok']),
('normal control 1', [0, 3600, 500, 1200, 8000], [0, 'cap']),
('normal control 2', [0, -1, 500, 2400, 8000], [0, 'window']),
('normal control 3', [0, 259199, 6000, 4000, 8000], [0, 'cap']),
('normal control 4', [0, 259199, 500, 4000, 1000], [500, 'ok'])]]
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: tip cap floor | [3800, 'ok'] | [4000, 'ok'] | Failed |
| partial repair probe: tip cap floor | [2400, 'ok'] | [5000, 'ok'] | Failed |
| second regression | [4800, 'ok'] | [5000, 'ok'] | Failed |
| normal control 1 | [0, 'window'] | [0, 'window'] | Passed |
| normal control 2 | [2000, 'ok'] | [2000, 'ok'] | Passed |
| normal control 3 | [500, 'ok'] | [500, 'ok'] | Passed |
| normal control 4 | [500, 'ok'] | [500, 'ok'] | Passed |
SHA-256 / 81e157a557eebf2305f85f4552b29b12db496a792fb7bcb9bd418dd4a82784b0
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(trip_end, tip_t, amount, fare, prior_tips):
elapsed = tip_t - trip_end
if elapsed < 0 or elapsed > 259200:
return [0, 'window']
cap = max(fare * 2, 5000)
room = cap - prior_tips
if room <= 0:
return [0, 'cap']
return [min(amount, room), 'ok']
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: tip cap floor', [0, 259200, 6000, 2400, 1000], [4000, 'ok']),
('partial repair probe: tip cap floor', [0, 259200, 6000, 1200, 0], [5000, 'ok']),
('second regression', [0, 259200, 6000, 2400, 0], [5000, 'ok']),
('normal control 1', [0, 259201, 500, 2400, 1000], [0, 'window']),
('normal control 2', [0, 259200, 2000, 4000, 1000], [2000, 'ok']),
('normal control 3', [0, 3600, 500, 4000, 1000], [500, 'ok']),
('normal control 4', [0, 259199, 500, 2400, 1000], [500, 'ok'])],
[('regression: tip cap floor', [0, 0, 500, 2400, 4800], [200, 'ok']),
('partial repair probe: tip cap floor', [0, 0, 6000, 2400, 0], [5000, 'ok']),
('second regression', [0, 0, 6000, 1200, 1000], [4000, 'ok']),
('normal control 1', [0, -1, 500, 2400, 8000], [0, 'window']),
('normal control 2', [0, 0, 2000, 4000, 8000], [0, 'cap']),
('normal control 3', [0, 259200, 2000, 2400, 1000], [2000, 'ok']),
('normal control 4', [0, 259199, 2000, 4000, 0], [2000, 'ok'])],
[('regression: tip cap floor', [0, 0, 6000, 2400, 4800], [200, 'ok']),
('partial repair probe: tip cap floor', [0, 259199, 2000, 1200, 4800], [200, 'ok']),
('second regression', [0, 259199, 2000, 4000, 4800], [2000, 'ok']),
('normal control 1', [0, 259201, 2000, 2400, 0], [0, 'window']),
('normal control 2', [0, -1, 6000, 1200, 4800], [0, 'window']),
('normal control 3', [0, -1, 500, 4000, 0], [0, 'window']),
('normal control 4', [0, 259201, 2000, 4000, 4800], [0, 'window'])],
[('regression: tip cap floor', [0, 259199, 2000, 1200, 1000], [2000, 'ok']),
('partial repair probe: tip cap floor', [0, 259199, 500, 2400, 4800], [200, 'ok']),
('second regression', [0, 259199, 500, 4000, 4800], [500, 'ok']),
('normal control 1', [0, -1, 2000, 1200, 0], [0, 'window']),
('normal control 2', [0, 3600, 2000, 1200, 0], [2000, 'ok']),
('normal control 3', [0, 0, 500, 4000, 1000], [500, 'ok']),
('normal control 4', [0, 3600, 500, 1200, 1000], [500, 'ok'])],
[('regression: tip cap floor', [0, 0, 6000, 2400, 0], [5000, 'ok']),
('partial repair probe: tip cap floor', [0, 259200, 2000, 4000, 4800], [2000, 'ok']),
('second regression', [0, 259200, 6000, 2400, 1000], [4000, 'ok']),
('normal control 1', [0, 3600, 500, 1200, 8000], [0, 'cap']),
('normal control 2', [0, -1, 500, 2400, 8000], [0, 'window']),
('normal control 3', [0, 259199, 6000, 4000, 8000], [0, 'cap']),
('normal control 4', [0, 259199, 500, 4000, 1000], [500, 'ok'])]]
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: tip cap floor | [4000, 'ok'] | [4000, 'ok'] | Passed |
| partial repair probe: tip cap floor | [5000, 'ok'] | [5000, 'ok'] | Passed |
| second regression | [5000, 'ok'] | [5000, 'ok'] | Passed |
| normal control 1 | [0, 'window'] | [0, 'window'] | Passed |
| normal control 2 | [2000, 'ok'] | [2000, 'ok'] | Passed |
| normal control 3 | [500, 'ok'] | [500, 'ok'] | Passed |
| normal control 4 | [500, 'ok'] | [500, 'ok'] | Passed |
SHA-256 / 2aecf2fe66ecddbd7eef877050afad6ff7b477dfe19819c62c13c0af9a806897
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:44.095468+00:00.
Case digest / cafaa90996af54b244fb8ad06fa8daac35b8652df813d4026742edde82d1d9b0