FAILURE MAP
← Case archive

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

Tip at exactly 72 hours rejected · case 01

A tip added at the last second of the window is refused.

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

ROOT CAUSE

The window end is exclusive.

VERIFIED REPAIR

Accept tips up to and including 259200 seconds.

Unsuccessful approach: Writing the window as 72 * 60 closes it after 72 minutes.

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 = 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 window end', [0, 259200, 500, 4000, 8000], [0, 'cap']),
  ('partial repair probe: tip window end', [0, 259199, 6000, 2400, 4800], [200, 'ok']),
  ('second regression', [0, 259200, 500, 4000, 0], [500, 'ok']),
  ('normal control 1', [0, 0, 2000, 2400, 0], [2000, 'ok']),
  ('normal control 2', [0, -1, 2000, 4000, 0], [0, 'window']),
  ('normal control 3', [0, 259201, 6000, 2400, 4800], [0, 'window']),
  ('normal control 4', [0, 3600, 500, 2400, 8000], [0, 'cap'])],
 [('regression: tip window end', [0, 259200, 6000, 2400, 8000], [0, 'cap']),
  ('partial repair probe: tip window end', [0, 259199, 500, 4000, 0], [500, 'ok']),
  ('second regression', [0, 259199, 6000, 2400, 0], [5000, 'ok']),
  ('normal control 1', [0, 259201, 6000, 4000, 8000], [0, 'window']),
  ('normal control 2', [0, -1, 6000, 4000, 0], [0, 'window']),
  ('normal control 3', [0, 3600, 500, 1200, 1000], [500, 'ok']),
  ('normal control 4', [0, 3600, 2000, 4000, 8000], [0, 'cap'])],
 [('regression: tip window end', [0, 259200, 6000, 1200, 1000], [4000, 'ok']),
  ('partial repair probe: tip window end', [0, 259199, 500, 2400, 8000], [0, 'cap']),
  ('second regression', [0, 259199, 2000, 2400, 4800], [200, 'ok']),
  ('normal control 1', [0, 259201, 2000, 2400, 8000], [0, 'window']),
  ('normal control 2', [0, -1, 2000, 4000, 0], [0, 'window']),
  ('normal control 3', [0, -1, 500, 4000, 8000], [0, 'window']),
  ('normal control 4', [0, 259201, 6000, 2400, 4800], [0, 'window'])],
 [('regression: tip window end', [0, 259200, 500, 4000, 4800], [500, 'ok']),
  ('partial repair probe: tip window end', [0, 259199, 500, 4000, 0], [500, 'ok']),
  ('second regression', [0, 259199, 6000, 1200, 8000], [0, 'cap']),
  ('normal control 1', [0, 259201, 6000, 1200, 8000], [0, 'window']),
  ('normal control 2', [0, 259201, 6000, 2400, 4800], [0, 'window']),
  ('normal control 3', [0, 3600, 2000, 2400, 0], [2000, 'ok']),
  ('normal control 4', [0, -1, 500, 4000, 1000], [0, 'window'])],
 [('regression: tip window end', [0, 259200, 6000, 4000, 8000], [0, 'cap']),
  ('partial repair probe: tip window end', [0, 259200, 6000, 1200, 0], [5000, 'ok']),
  ('second regression', [0, 259200, 2000, 1200, 0], [2000, 'ok']),
  ('normal control 1', [0, 0, 2000, 2400, 4800], [200, 'ok']),
  ('normal control 2', [0, -1, 500, 2400, 0], [0, 'window']),
  ('normal control 3', [0, -1, 6000, 2400, 0], [0, 'window']),
  ('normal control 4', [0, -1, 500, 4000, 0], [0, 'window'])]]
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: tip window end[0, 'window'][0, 'cap']Failed
partial repair probe: tip window end[200, 'ok'][200, 'ok']Passed
second regression[0, 'window'][500, 'ok']Failed
normal control 1[2000, 'ok'][2000, 'ok']Passed
normal control 2[0, 'window'][0, 'window']Passed
normal control 3[0, 'window'][0, 'window']Passed
normal control 4[0, 'cap'][0, 'cap']Passed

SHA-256 / 2800e814511754e66f60c177df20b229429bbe5d703b5fb5da6aee9592e5be38

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 > 72 * 60:
        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 window end', [0, 259200, 500, 4000, 8000], [0, 'cap']),
  ('partial repair probe: tip window end', [0, 259199, 6000, 2400, 4800], [200, 'ok']),
  ('second regression', [0, 259200, 500, 4000, 0], [500, 'ok']),
  ('normal control 1', [0, 0, 2000, 2400, 0], [2000, 'ok']),
  ('normal control 2', [0, -1, 2000, 4000, 0], [0, 'window']),
  ('normal control 3', [0, 259201, 6000, 2400, 4800], [0, 'window']),
  ('normal control 4', [0, 3600, 500, 2400, 8000], [0, 'cap'])],
 [('regression: tip window end', [0, 259200, 6000, 2400, 8000], [0, 'cap']),
  ('partial repair probe: tip window end', [0, 259199, 500, 4000, 0], [500, 'ok']),
  ('second regression', [0, 259199, 6000, 2400, 0], [5000, 'ok']),
  ('normal control 1', [0, 259201, 6000, 4000, 8000], [0, 'window']),
  ('normal control 2', [0, -1, 6000, 4000, 0], [0, 'window']),
  ('normal control 3', [0, 3600, 500, 1200, 1000], [500, 'ok']),
  ('normal control 4', [0, 3600, 2000, 4000, 8000], [0, 'cap'])],
 [('regression: tip window end', [0, 259200, 6000, 1200, 1000], [4000, 'ok']),
  ('partial repair probe: tip window end', [0, 259199, 500, 2400, 8000], [0, 'cap']),
  ('second regression', [0, 259199, 2000, 2400, 4800], [200, 'ok']),
  ('normal control 1', [0, 259201, 2000, 2400, 8000], [0, 'window']),
  ('normal control 2', [0, -1, 2000, 4000, 0], [0, 'window']),
  ('normal control 3', [0, -1, 500, 4000, 8000], [0, 'window']),
  ('normal control 4', [0, 259201, 6000, 2400, 4800], [0, 'window'])],
 [('regression: tip window end', [0, 259200, 500, 4000, 4800], [500, 'ok']),
  ('partial repair probe: tip window end', [0, 259199, 500, 4000, 0], [500, 'ok']),
  ('second regression', [0, 259199, 6000, 1200, 8000], [0, 'cap']),
  ('normal control 1', [0, 259201, 6000, 1200, 8000], [0, 'window']),
  ('normal control 2', [0, 259201, 6000, 2400, 4800], [0, 'window']),
  ('normal control 3', [0, 3600, 2000, 2400, 0], [2000, 'ok']),
  ('normal control 4', [0, -1, 500, 4000, 1000], [0, 'window'])],
 [('regression: tip window end', [0, 259200, 6000, 4000, 8000], [0, 'cap']),
  ('partial repair probe: tip window end', [0, 259200, 6000, 1200, 0], [5000, 'ok']),
  ('second regression', [0, 259200, 2000, 1200, 0], [2000, 'ok']),
  ('normal control 1', [0, 0, 2000, 2400, 4800], [200, 'ok']),
  ('normal control 2', [0, -1, 500, 2400, 0], [0, 'window']),
  ('normal control 3', [0, -1, 6000, 2400, 0], [0, 'window']),
  ('normal control 4', [0, -1, 500, 4000, 0], [0, 'window'])]]
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: tip window end[0, 'window'][0, 'cap']Failed
partial repair probe: tip window end[0, 'window'][200, 'ok']Failed
second regression[0, 'window'][500, 'ok']Failed
normal control 1[2000, 'ok'][2000, 'ok']Passed
normal control 2[0, 'window'][0, 'window']Passed
normal control 3[0, 'window'][0, 'window']Passed
normal control 4[0, 'cap'][0, 'cap']Passed

SHA-256 / 8e9b420b0f3d53a784606e60a16cab8cb20585d3289612f18fbc5d6b2c960dbb

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 window end', [0, 259200, 500, 4000, 8000], [0, 'cap']),
  ('partial repair probe: tip window end', [0, 259199, 6000, 2400, 4800], [200, 'ok']),
  ('second regression', [0, 259200, 500, 4000, 0], [500, 'ok']),
  ('normal control 1', [0, 0, 2000, 2400, 0], [2000, 'ok']),
  ('normal control 2', [0, -1, 2000, 4000, 0], [0, 'window']),
  ('normal control 3', [0, 259201, 6000, 2400, 4800], [0, 'window']),
  ('normal control 4', [0, 3600, 500, 2400, 8000], [0, 'cap'])],
 [('regression: tip window end', [0, 259200, 6000, 2400, 8000], [0, 'cap']),
  ('partial repair probe: tip window end', [0, 259199, 500, 4000, 0], [500, 'ok']),
  ('second regression', [0, 259199, 6000, 2400, 0], [5000, 'ok']),
  ('normal control 1', [0, 259201, 6000, 4000, 8000], [0, 'window']),
  ('normal control 2', [0, -1, 6000, 4000, 0], [0, 'window']),
  ('normal control 3', [0, 3600, 500, 1200, 1000], [500, 'ok']),
  ('normal control 4', [0, 3600, 2000, 4000, 8000], [0, 'cap'])],
 [('regression: tip window end', [0, 259200, 6000, 1200, 1000], [4000, 'ok']),
  ('partial repair probe: tip window end', [0, 259199, 500, 2400, 8000], [0, 'cap']),
  ('second regression', [0, 259199, 2000, 2400, 4800], [200, 'ok']),
  ('normal control 1', [0, 259201, 2000, 2400, 8000], [0, 'window']),
  ('normal control 2', [0, -1, 2000, 4000, 0], [0, 'window']),
  ('normal control 3', [0, -1, 500, 4000, 8000], [0, 'window']),
  ('normal control 4', [0, 259201, 6000, 2400, 4800], [0, 'window'])],
 [('regression: tip window end', [0, 259200, 500, 4000, 4800], [500, 'ok']),
  ('partial repair probe: tip window end', [0, 259199, 500, 4000, 0], [500, 'ok']),
  ('second regression', [0, 259199, 6000, 1200, 8000], [0, 'cap']),
  ('normal control 1', [0, 259201, 6000, 1200, 8000], [0, 'window']),
  ('normal control 2', [0, 259201, 6000, 2400, 4800], [0, 'window']),
  ('normal control 3', [0, 3600, 2000, 2400, 0], [2000, 'ok']),
  ('normal control 4', [0, -1, 500, 4000, 1000], [0, 'window'])],
 [('regression: tip window end', [0, 259200, 6000, 4000, 8000], [0, 'cap']),
  ('partial repair probe: tip window end', [0, 259200, 6000, 1200, 0], [5000, 'ok']),
  ('second regression', [0, 259200, 2000, 1200, 0], [2000, 'ok']),
  ('normal control 1', [0, 0, 2000, 2400, 4800], [200, 'ok']),
  ('normal control 2', [0, -1, 500, 2400, 0], [0, 'window']),
  ('normal control 3', [0, -1, 6000, 2400, 0], [0, 'window']),
  ('normal control 4', [0, -1, 500, 4000, 0], [0, 'window'])]]
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: tip window end[0, 'cap'][0, 'cap']Passed
partial repair probe: tip window end[200, 'ok'][200, 'ok']Passed
second regression[500, 'ok'][500, 'ok']Passed
normal control 1[2000, 'ok'][2000, 'ok']Passed
normal control 2[0, 'window'][0, 'window']Passed
normal control 3[0, 'window'][0, 'window']Passed
normal control 4[0, 'cap'][0, 'cap']Passed

SHA-256 / 6e8cef22c2951fb8793d39a198858cb31db1141e7375371cfba86585fac4d53f

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:43.886476+00:00.

Case digest / ba83f3d8c64b7f332d5c213144c37ad35d1fc7478e4d875d922148fddd7a672c