FA-85696 / Ride-hailing fare and surge pricing / Open access
Minimum fare applied after the width adjustment · case 01
Short trips show a range whose low end equals the high end.
ROOT CAUSE
The minimum clamp is applied after the width rule, so the range can collapse.
VERIFIED REPAIR
Clamp the low end to the minimum before enforcing the width.
Unsuccessful approach: Also clamping the high end still leaves a zero-width range.
Case contract
Show a fare range from a point estimate in cents: low = 90% of the estimate floored to whole dollars, but never below the minimum fare; high = 110% of the estimate rounded up to whole dollars; if the range is narrower than 2.00 the high end becomes low + 2.00. Return [low, high] cents.
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(est, minimum):
low = est * 9 // 10 // 100 * 100
high = -(-(est * 11) // 1000) * 100
if high - low < 200:
high = low + 200
low = max(low, minimum)
return [low, high]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: minimum clamp ordering', [699, 800], [800, 1000]),
('partial repair probe: minimum clamp ordering', [1000, 1000], [1000, 1200]),
('second regression', [700, 1000], [1000, 1200]), ('normal control 1', [2500, 500], [2200, 2800]),
('normal control 2', [1999, 500], [1700, 2200]), ('normal control 3', [1234, 1000], [1100, 1400]),
('normal control 4', [1111, 800], [900, 1300])],
[('regression: minimum clamp ordering', [700, 800], [800, 1000]),
('partial repair probe: minimum clamp ordering', [1000, 1000], [1000, 1200]),
('second regression', [700, 1000], [1000, 1200]), ('normal control 1', [2050, 800], [1800, 2300]),
('normal control 2', [2500, 800], [2200, 2800]), ('normal control 3', [1111, 800], [900, 1300]),
('normal control 4', [1999, 1000], [1700, 2200])],
[('regression: minimum clamp ordering', [1000, 1000], [1000, 1200]),
('partial repair probe: minimum clamp ordering', [700, 1000], [1000, 1200]),
('second regression', [700, 800], [800, 1000]), ('normal control 1', [1999, 500], [1700, 2200]),
('normal control 2', [2050, 800], [1800, 2300]), ('normal control 3', [2405, 800], [2100, 2700]),
('normal control 4', [2500, 1000], [2200, 2800])],
[('regression: minimum clamp ordering', [1000, 1000], [1000, 1200]),
('partial repair probe: minimum clamp ordering', [700, 800], [800, 1000]),
('second regression', [594, 800], [800, 1000]), ('normal control 1', [1111, 800], [900, 1300]),
('normal control 2', [1999, 800], [1700, 2200]), ('normal control 3', [2050, 500], [1800, 2300]),
('normal control 4', [3986, 800], [3500, 4400])],
[('regression: minimum clamp ordering', [700, 1000], [1000, 1200]),
('partial repair probe: minimum clamp ordering', [701, 800], [800, 1000]),
('second regression', [1000, 1000], [1000, 1200]), ('normal control 1', [2050, 500], [1800, 2300]),
('normal control 2', [2050, 800], [1800, 2300]), ('normal control 3', [1999, 1000], [1700, 2200]),
('normal control 4', [664, 500], [500, 800])]]
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: minimum clamp ordering | [800, 800] | [800, 1000] | Failed |
| partial repair probe: minimum clamp ordering | [1000, 1100] | [1000, 1200] | Failed |
| second regression | [1000, 800] | [1000, 1200] | Failed |
| normal control 1 | [2200, 2800] | [2200, 2800] | Passed |
| normal control 2 | [1700, 2200] | [1700, 2200] | Passed |
| normal control 3 | [1100, 1400] | [1100, 1400] | Passed |
| normal control 4 | [900, 1300] | [900, 1300] | Passed |
SHA-256 / ca3023f5add842ce051aabbcae9c096f782afa3687418dd1702573a8af6eea07
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(est, minimum):
low = est * 9 // 10 // 100 * 100
high = -(-(est * 11) // 1000) * 100
if high - low < 200:
high = low + 200
low = max(low, minimum)
high = max(high, minimum)
return [low, high]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: minimum clamp ordering', [699, 800], [800, 1000]),
('partial repair probe: minimum clamp ordering', [1000, 1000], [1000, 1200]),
('second regression', [700, 1000], [1000, 1200]), ('normal control 1', [2500, 500], [2200, 2800]),
('normal control 2', [1999, 500], [1700, 2200]), ('normal control 3', [1234, 1000], [1100, 1400]),
('normal control 4', [1111, 800], [900, 1300])],
[('regression: minimum clamp ordering', [700, 800], [800, 1000]),
('partial repair probe: minimum clamp ordering', [1000, 1000], [1000, 1200]),
('second regression', [700, 1000], [1000, 1200]), ('normal control 1', [2050, 800], [1800, 2300]),
('normal control 2', [2500, 800], [2200, 2800]), ('normal control 3', [1111, 800], [900, 1300]),
('normal control 4', [1999, 1000], [1700, 2200])],
[('regression: minimum clamp ordering', [1000, 1000], [1000, 1200]),
('partial repair probe: minimum clamp ordering', [700, 1000], [1000, 1200]),
('second regression', [700, 800], [800, 1000]), ('normal control 1', [1999, 500], [1700, 2200]),
('normal control 2', [2050, 800], [1800, 2300]), ('normal control 3', [2405, 800], [2100, 2700]),
('normal control 4', [2500, 1000], [2200, 2800])],
[('regression: minimum clamp ordering', [1000, 1000], [1000, 1200]),
('partial repair probe: minimum clamp ordering', [700, 800], [800, 1000]),
('second regression', [594, 800], [800, 1000]), ('normal control 1', [1111, 800], [900, 1300]),
('normal control 2', [1999, 800], [1700, 2200]), ('normal control 3', [2050, 500], [1800, 2300]),
('normal control 4', [3986, 800], [3500, 4400])],
[('regression: minimum clamp ordering', [700, 1000], [1000, 1200]),
('partial repair probe: minimum clamp ordering', [701, 800], [800, 1000]),
('second regression', [1000, 1000], [1000, 1200]), ('normal control 1', [2050, 500], [1800, 2300]),
('normal control 2', [2050, 800], [1800, 2300]), ('normal control 3', [1999, 1000], [1700, 2200]),
('normal control 4', [664, 500], [500, 800])]]
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: minimum clamp ordering | [800, 800] | [800, 1000] | Failed |
| partial repair probe: minimum clamp ordering | [1000, 1100] | [1000, 1200] | Failed |
| second regression | [1000, 1000] | [1000, 1200] | Failed |
| normal control 1 | [2200, 2800] | [2200, 2800] | Passed |
| normal control 2 | [1700, 2200] | [1700, 2200] | Passed |
| normal control 3 | [1100, 1400] | [1100, 1400] | Passed |
| normal control 4 | [900, 1300] | [900, 1300] | Passed |
SHA-256 / baf6ab101d8eccf9cc66f8cbc6ac6739ecdadd585c75fce6886b29f5d1b25197
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(est, minimum):
low = max(est * 9 // 10 // 100 * 100, minimum)
high = -(-(est * 11) // 1000) * 100
if high - low < 200:
high = low + 200
return [low, high]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('regression: minimum clamp ordering', [699, 800], [800, 1000]),
('partial repair probe: minimum clamp ordering', [1000, 1000], [1000, 1200]),
('second regression', [700, 1000], [1000, 1200]), ('normal control 1', [2500, 500], [2200, 2800]),
('normal control 2', [1999, 500], [1700, 2200]), ('normal control 3', [1234, 1000], [1100, 1400]),
('normal control 4', [1111, 800], [900, 1300])],
[('regression: minimum clamp ordering', [700, 800], [800, 1000]),
('partial repair probe: minimum clamp ordering', [1000, 1000], [1000, 1200]),
('second regression', [700, 1000], [1000, 1200]), ('normal control 1', [2050, 800], [1800, 2300]),
('normal control 2', [2500, 800], [2200, 2800]), ('normal control 3', [1111, 800], [900, 1300]),
('normal control 4', [1999, 1000], [1700, 2200])],
[('regression: minimum clamp ordering', [1000, 1000], [1000, 1200]),
('partial repair probe: minimum clamp ordering', [700, 1000], [1000, 1200]),
('second regression', [700, 800], [800, 1000]), ('normal control 1', [1999, 500], [1700, 2200]),
('normal control 2', [2050, 800], [1800, 2300]), ('normal control 3', [2405, 800], [2100, 2700]),
('normal control 4', [2500, 1000], [2200, 2800])],
[('regression: minimum clamp ordering', [1000, 1000], [1000, 1200]),
('partial repair probe: minimum clamp ordering', [700, 800], [800, 1000]),
('second regression', [594, 800], [800, 1000]), ('normal control 1', [1111, 800], [900, 1300]),
('normal control 2', [1999, 800], [1700, 2200]), ('normal control 3', [2050, 500], [1800, 2300]),
('normal control 4', [3986, 800], [3500, 4400])],
[('regression: minimum clamp ordering', [700, 1000], [1000, 1200]),
('partial repair probe: minimum clamp ordering', [701, 800], [800, 1000]),
('second regression', [1000, 1000], [1000, 1200]), ('normal control 1', [2050, 500], [1800, 2300]),
('normal control 2', [2050, 800], [1800, 2300]), ('normal control 3', [1999, 1000], [1700, 2200]),
('normal control 4', [664, 500], [500, 800])]]
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: minimum clamp ordering | [800, 1000] | [800, 1000] | Passed |
| partial repair probe: minimum clamp ordering | [1000, 1200] | [1000, 1200] | Passed |
| second regression | [1000, 1200] | [1000, 1200] | Passed |
| normal control 1 | [2200, 2800] | [2200, 2800] | Passed |
| normal control 2 | [1700, 2200] | [1700, 2200] | Passed |
| normal control 3 | [1100, 1400] | [1100, 1400] | Passed |
| normal control 4 | [900, 1300] | [900, 1300] | Passed |
SHA-256 / 18cd2c7fa7cd6f87acd15aab8497e6fdd20cd26099ade96b3d4121ce39d6ab62
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.838453+00:00.
Case digest / ec8122df50d7d2749348dc13346197b6ebc54dde5247c84f9c44621cccd009ca