FAILURE MAP
← Case archive

FA-68571 / Toll and parking fee computation / Open access

Express lane dynamic price: the posted price is not floored at the minimum · case 01

Express lane dynamic price returns a wrong result when the posted price is not floored at the minimum.

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

ROOT CAUSE

A previous price outside the configured range is carried into the posted price.

VERIFIED REPAIR

Restore the posted price bounds rule so that the step reads `max(x['min_price'], min(x['max_price'], prev + step))`.

Unsuccessful approach: Clamping only the maximum still lets the price fall below min_price.

Case contract

Input {density, prev_price, bands: [[density upto, price]] ascending, max_step, min_price, max_price, occupancy, hov_free_min, hov2_pct}. The target is the first band whose upto is >= density, else max_price. The posted price moves from prev_price toward the target by at most max_step either way, then is clamped to [min_price, max_price]. Vehicles with occupancy >= hov_free_min pay 0; occupancy 2 (when not free) pays hov2_pct percent floored to 5 cents. Return [posted, charged].

Why this case matters

Fee engines bill customers in integer cents; a wrong boundary, rounding stage or cap scope silently over- or under-charges.

1 / The failure

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

N = 1
observations = []
def solve(x):
    target = x['max_price']
    for upto, price in x['bands']:
        if x['density'] <= upto:
            target = price
            break
    prev = x['prev_price']
    step = max(-x['max_step'], min(x['max_step'], target - prev))
    price = prev + step
    if x['occupancy'] >= x['hov_free_min']:
        return [price, 0]
    if x['occupancy'] == 2:
        return [price, price * x['hov2_pct'] // 100 // 5 * 5]
    return [price, price]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[({'density': 37, 'prev_price': 650, 'bands': [[13, 475], [36, 650], [37, 800], [42, 1000]], 'max_step': 100, 'min_price': 50, 'max_price': 1200, 'occupancy': 3, 'hov_free_min': 3, 'hov2_pct': 70}, [750, 0]), ({'density': 19, 'prev_price': 625, 'bands': [[13, 125], [19, 725], [23, 750], [36, 925]], 'max_step': 50, 'min_price': 50, 'max_price': 1000, 'occupancy': 2, 'hov_free_min': 3, 'hov2_pct': 50}, [675, 335]), ({'density': 20, 'prev_price': 300, 'bands': [[12, 100], [20, 400], [30, 700], [40, 900]], 'max_step': 50, 'min_price': 50, 'max_price': 1000, 'occupancy': 2, 'hov_free_min': 3, 'hov2_pct': 70}, [350, 245]), ({'density': 45, 'prev_price': 1100, 'bands': [[12, 100], [20, 400], [30, 700], [40, 900]], 'max_step': 50, 'min_price': 50, 'max_price': 1000, 'occupancy': 1, 'hov_free_min': 3, 'hov2_pct': 70}, [1000, 1000]), ({'density': 25, 'prev_price': 0, 'bands': [[12, 100], [20, 400], [30, 700], [40, 900]], 'max_step': 25, 'min_price': 50, 'max_price': 1000, 'occupancy': 1, 'hov_free_min': 3, 'hov2_pct': 50}, [50, 50]), ({'density': 21, 'prev_price': 1250, 'bands': [[18, 225], [21, 250], [22, 350], [43, 525]], 'max_step': 100, 'min_price': 50, 'max_price': 800, 'occupancy': 1, 'hov_free_min': 3, 'hov2_pct': 50}, [800, 800]), ({'density': 44, 'prev_price': 1200, 'bands': [[19, 450], [40, 525], [41, 650], [44, 925]], 'max_step': 50, 'min_price': 50, 'max_price': 1200, 'occupancy': 4, 'hov_free_min': 3, 'hov2_pct': 50}, [1150, 0]), ({'density': 11, 'prev_price': 1250, 'bands': [[11, 275], [17, 500], [21, 700], [44, 825]], 'max_step': 50, 'min_price': 50, 'max_price': 800, 'occupancy': 1, 'hov_free_min': 3, 'hov2_pct': 50}, [800, 800])], [({'density': 45, 'prev_price': 1100, 'bands': [[12, 100], [20, 400], [30, 700], [40, 900]], 'max_step': 50, 'min_price': 50, 'max_price': 1000, 'occupancy': 1, 'hov_free_min': 3, 'hov2_pct': 70}, [1000, 1000]), ({'density': 20, 'prev_price': 300, 'bands': [[12, 100], [20, 400], [30, 700], [40, 900]], 'max_step': 50, 'min_price': 50, 'max_price': 1000, 'occupancy': 2, 'hov_free_min': 3, 'hov2_pct': 70}, [350, 245]), ({'density': 25, 'prev_price': 0, 'bands': [[12, 100], [20, 400], [30, 700], [40, 900]], 'max_step': 25, 'min_price': 50, 'max_price': 1000, 'occupancy': 1, 'hov_free_min': 3, 'hov2_pct': 50}, [50, 50]), ({'density': 19, 'prev_price': 1250, 'bands': [[19, 275], [23, 475], [24, 575], [38, 825]], 'max_step': 25, 'min_price': 50, 'max_price': 1000, 'occupancy': 3, 'hov_free_min': 3, 'hov2_pct': 70}, [1000, 0]), ({'density': 23, 'prev_price': 0, 'bands': [[13, 175], [19, 475], [23, 700], [29, 850]], 'max_step': 25, 'min_price': 50, 'max_price': 800, 'occupancy': 1, 'hov_free_min': 4, 'hov2_pct': 50}, [50, 50]), ({'density': 35, 'prev_price': 700, 'bands': [[23, 150], [33, 450], [38, 725], [41, 950]], 'max_step': 25, 'min_price': 50, 'max_price': 1200, 'occupancy': 2, 'hov_free_min': 3, 'hov2_pct': 50}, [725, 360]), ({'density': 17, 'prev_price': 625, 'bands': [[17, 300], [28, 500], [30, 700], [36, 925]], 'max_step': 25, 'min_price': 50, 'max_price': 800, 'occupancy': 3, 'hov_free_min': 4, 'hov2_pct': 70}, [600, 600]), ({'density': 3, 'prev_price': 250, 'bands': [[15, 425], [20, 600], [24, 775], [27, 975]], 'max_step': 50, 'min_price': 50, 'max_price': 800, 'occupancy': 1, 'hov_free_min': 4, 'hov2_pct': 50}, [300, 300])], [({'density': 42, 'prev_price': 0, 'bands': [[14, 225], [16, 675], [30, 775], [42, 925]], 'max_step': 25, 'min_price': 50, 'max_price': 1200, 'occupancy': 4, 'hov_free_min': 3, 'hov2_pct': 50}, [50, 0]), ({'density': 10, 'prev_price': 225, 'bands': [[10, 75], [16, 300], [36, 725], [44, 900]], 'max_step': 25, 'min_price': 50, 'max_price': 1000, 'occupancy': 1, 'hov_free_min': 3, 'hov2_pct': 50}, [200, 200]), ({'density': 16, 'prev_price': 1200, 'bands': [[13, 50], [16, 450], [17, 725], [39, 900]], 'max_step': 25, 'min_price': 50, 'max_price': 1200, 'occupancy': 1, 'hov_free_min': 2, 'hov2_pct': 70}, [1175, 1175]), ({'density': 34, 'prev_price': 1175, 'bands': [[16, 225], [27, 325], [39, 400], [40, 475]], 'max_step': 25, 'min_price': 50, 'max_price': 1000, 'occupancy': 1, 'hov_free_min': 3, 'hov2_pct': 50}, [1000, 1000]), ({'density': 45, 'prev_price': 1100, 'bands': [[12, 100], [20, 400], [30, 700], [40, 900]], 'max_step': 50, 'min_price': 50, 'max_price': 1000, 'occupancy': 1, 'hov_free_min': 3, 'hov2_pct': 70}, [1000, 1000]), ({'density': 22, 'prev_price': 500, 'bands': [[10, 350], [19, 425], [22, 450], [24, 650]], 'max_step': 100, 'min_price': 50, 'max_price': 800, 'occupancy': 1, 'hov_free_min': 4, 'hov2_pct': 50}, [450, 450]), ({'density': 20, 'prev_price': 300, 'bands': [[12, 100], [20, 400], [30, 700], [40, 900]], 'max_step': 50, 'min_price': 50, 'max_price': 1000, 'occupancy': 2, 'hov_free_min': 3, 'hov2_pct': 70}, [350, 245]), ({'density': 25, 'prev_price': 0, 'bands': [[12, 100], [20, 400], [30, 700], [40, 900]], 'max_step': 25, 'min_price': 50, 'max_price': 1000, 'occupancy': 1, 'hov_free_min': 3, 'hov2_pct': 50}, [50, 50])], [({'density': 18, 'prev_price': 850, 'bands': [[18, 100], [20, 175], [35, 250], [44, 800]], 'max_step': 25, 'min_price': 50, 'max_price': 1000, 'occupancy': 3, 'hov_free_min': 3, 'hov2_pct': 50}, [825, 0]), ({'density': 16, 'prev_price': 25, 'bands': [[16, 50], [23, 350], [26, 700], [36, 725]], 'max_step': 50, 'min_price': 50, 'max_price': 1000, 'occupancy': 4, 'hov_free_min': 4, 'hov2_pct': 70}, [50, 0]), ({'density': 45, 'prev_price': 1100, 'bands': [[12, 100], [20, 400], [30, 700], [40, 900]], 'max_step': 50, 'min_price': 50, 'max_price': 1000, 'occupancy': 1, 'hov_free_min': 3, 'hov2_pct': 70}, [1000, 1000]), ({'density': 49, 'prev_price': 0, 'bands': [[12, 350], [33, 475], [34, 500], [41, 800]], 'max_step': 25, 'min_price': 50, 'max_price': 800, 'occupancy': 1, 'hov_free_min': 3, 'hov2_pct': 70}, [50, 50]), ({'density': 19, 'prev_price': 250, 'bands': [[19, 275], [31, 450], [37, 675], [40, 700]], 'max_step': 25, 'min_price': 50, 'max_price': 1000, 'occupancy': 2, 'hov_free_min': 3, 'hov2_pct': 50}, [275, 135]), ({'density': 35, 'prev_price': 1300, 'bands': [[31, 175], [38, 200], [40, 400], [42, 800]], 'max_step': 50, 'min_price': 50, 'max_price': 1000, 'occupancy': 3, 'hov_free_min': 3, 'hov2_pct': 70}, [1000, 0]), ({'density': 25, 'prev_price': 0, 'bands': [[12, 100], [20, 400], [30, 700], [40, 900]], 'max_step': 25, 'min_price': 50, 'max_price': 1000, 'occupancy': 1, 'hov_free_min': 3, 'hov2_pct': 50}, [50, 50]), ({'density': 20, 'prev_price': 300, 'bands': [[12, 100], [20, 400], [30, 700], [40, 900]], 'max_step': 50, 'min_price': 50, 'max_price': 1000, 'occupancy': 2, 'hov_free_min': 3, 'hov2_pct': 70}, [350, 245])], [({'density': 14, 'prev_price': 925, 'bands': [[10, 150], [12, 525], [14, 750], [40, 850]], 'max_step': 25, 'min_price': 50, 'max_price': 800, 'occupancy': 1, 'hov_free_min': 2, 'hov2_pct': 70}, [800, 800]), ({'density': 34, 'prev_price': 0, 'bands': [[27, 450], [29, 525], [34, 550], [42, 950]], 'max_step': 25, 'min_price': 50, 'max_price': 1000, 'occupancy': 1, 'hov_free_min': 4, 'hov2_pct': 50}, [50, 50]), ({'density': 25, 'prev_price': 0, 'bands': [[12, 100], [20, 400], [30, 700], [40, 900]], 'max_step': 25, 'min_price': 50, 'max_price': 1000, 'occupancy': 1, 'hov_free_min': 3, 'hov2_pct': 50}, [50, 50]), ({'density': 34, 'prev_price': 250, 'bands': [[16, 325], [33, 400], [34, 475], [38, 1000]], 'max_step': 100, 'min_price': 50, 'max_price': 1200, 'occupancy': 3, 'hov_free_min': 2, 'hov2_pct': 50}, [350, 0]), ({'density': 45, 'prev_price': 1100, 'bands': [[12, 100], [20, 400], [30, 700], [40, 900]], 'max_step': 50, 'min_price': 50, 'max_price': 1000, 'occupancy': 1, 'hov_free_min': 3, 'hov2_pct': 70}, [1000, 1000]), ({'density': 37, 'prev_price': 850, 'bands': [[22, 525], [30, 800], [37, 825], [44, 975]], 'max_step': 25, 'min_price': 50, 'max_price': 1000, 'occupancy': 4, 'hov_free_min': 2, 'hov2_pct': 70}, [825, 0]), ({'density': 20, 'prev_price': 300, 'bands': [[12, 100], [20, 400], [30, 700], [40, 900]], 'max_step': 50, 'min_price': 50, 'max_price': 1000, 'occupancy': 2, 'hov_free_min': 3, 'hov2_pct': 70}, [350, 245]), ({'density': 41, 'prev_price': 350, 'bands': [[29, 225], [33, 525], [41, 575], [44, 625]], 'max_step': 50, 'min_price': 50, 'max_price': 1200, 'occupancy': 4, 'hov_free_min': 4, 'hov2_pct': 50}, [400, 0])]]
for i, (args, expected) in enumerate(fixtures[N-1]):
    check('fee oracle' + ' %d' % i, 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
fee oracle 0[750, 0][750, 0]Passed
fee oracle 1[675, 335][675, 335]Passed
fee oracle 2[350, 245][350, 245]Passed
fee oracle 3[1050, 1050][1000, 1000]Failed
fee oracle 4[25, 25][50, 50]Failed
fee oracle 5[1150, 1150][800, 800]Failed
fee oracle 6[1150, 0][1150, 0]Passed
fee oracle 7[1200, 1200][800, 800]Failed

SHA-256 / 887686b1c913a7180b9f36e8ba9f51a615e82dbea0d23899dcd63c223c4aa23f

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(x):
    target = x['max_price']
    for upto, price in x['bands']:
        if x['density'] <= upto:
            target = price
            break
    prev = x['prev_price']
    step = max(-x['max_step'], min(x['max_step'], target - prev))
    price = min(x['max_price'], prev + step)
    if x['occupancy'] >= x['hov_free_min']:
        return [price, 0]
    if x['occupancy'] == 2:
        return [price, price * x['hov2_pct'] // 100 // 5 * 5]
    return [price, price]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[({'density': 37, 'prev_price': 650, 'bands': [[13, 475], [36, 650], [37, 800], [42, 1000]], 'max_step': 100, 'min_price': 50, 'max_price': 1200, 'occupancy': 3, 'hov_free_min': 3, 'hov2_pct': 70}, [750, 0]), ({'density': 19, 'prev_price': 625, 'bands': [[13, 125], [19, 725], [23, 750], [36, 925]], 'max_step': 50, 'min_price': 50, 'max_price': 1000, 'occupancy': 2, 'hov_free_min': 3, 'hov2_pct': 50}, [675, 335]), ({'density': 20, 'prev_price': 300, 'bands': [[12, 100], [20, 400], [30, 700], [40, 900]], 'max_step': 50, 'min_price': 50, 'max_price': 1000, 'occupancy': 2, 'hov_free_min': 3, 'hov2_pct': 70}, [350, 245]), ({'density': 45, 'prev_price': 1100, 'bands': [[12, 100], [20, 400], [30, 700], [40, 900]], 'max_step': 50, 'min_price': 50, 'max_price': 1000, 'occupancy': 1, 'hov_free_min': 3, 'hov2_pct': 70}, [1000, 1000]), ({'density': 25, 'prev_price': 0, 'bands': [[12, 100], [20, 400], [30, 700], [40, 900]], 'max_step': 25, 'min_price': 50, 'max_price': 1000, 'occupancy': 1, 'hov_free_min': 3, 'hov2_pct': 50}, [50, 50]), ({'density': 21, 'prev_price': 1250, 'bands': [[18, 225], [21, 250], [22, 350], [43, 525]], 'max_step': 100, 'min_price': 50, 'max_price': 800, 'occupancy': 1, 'hov_free_min': 3, 'hov2_pct': 50}, [800, 800]), ({'density': 44, 'prev_price': 1200, 'bands': [[19, 450], [40, 525], [41, 650], [44, 925]], 'max_step': 50, 'min_price': 50, 'max_price': 1200, 'occupancy': 4, 'hov_free_min': 3, 'hov2_pct': 50}, [1150, 0]), ({'density': 11, 'prev_price': 1250, 'bands': [[11, 275], [17, 500], [21, 700], [44, 825]], 'max_step': 50, 'min_price': 50, 'max_price': 800, 'occupancy': 1, 'hov_free_min': 3, 'hov2_pct': 50}, [800, 800])], [({'density': 45, 'prev_price': 1100, 'bands': [[12, 100], [20, 400], [30, 700], [40, 900]], 'max_step': 50, 'min_price': 50, 'max_price': 1000, 'occupancy': 1, 'hov_free_min': 3, 'hov2_pct': 70}, [1000, 1000]), ({'density': 20, 'prev_price': 300, 'bands': [[12, 100], [20, 400], [30, 700], [40, 900]], 'max_step': 50, 'min_price': 50, 'max_price': 1000, 'occupancy': 2, 'hov_free_min': 3, 'hov2_pct': 70}, [350, 245]), ({'density': 25, 'prev_price': 0, 'bands': [[12, 100], [20, 400], [30, 700], [40, 900]], 'max_step': 25, 'min_price': 50, 'max_price': 1000, 'occupancy': 1, 'hov_free_min': 3, 'hov2_pct': 50}, [50, 50]), ({'density': 19, 'prev_price': 1250, 'bands': [[19, 275], [23, 475], [24, 575], [38, 825]], 'max_step': 25, 'min_price': 50, 'max_price': 1000, 'occupancy': 3, 'hov_free_min': 3, 'hov2_pct': 70}, [1000, 0]), ({'density': 23, 'prev_price': 0, 'bands': [[13, 175], [19, 475], [23, 700], [29, 850]], 'max_step': 25, 'min_price': 50, 'max_price': 800, 'occupancy': 1, 'hov_free_min': 4, 'hov2_pct': 50}, [50, 50]), ({'density': 35, 'prev_price': 700, 'bands': [[23, 150], [33, 450], [38, 725], [41, 950]], 'max_step': 25, 'min_price': 50, 'max_price': 1200, 'occupancy': 2, 'hov_free_min': 3, 'hov2_pct': 50}, [725, 360]), ({'density': 17, 'prev_price': 625, 'bands': [[17, 300], [28, 500], [30, 700], [36, 925]], 'max_step': 25, 'min_price': 50, 'max_price': 800, 'occupancy': 3, 'hov_free_min': 4, 'hov2_pct': 70}, [600, 600]), ({'density': 3, 'prev_price': 250, 'bands': [[15, 425], [20, 600], [24, 775], [27, 975]], 'max_step': 50, 'min_price': 50, 'max_price': 800, 'occupancy': 1, 'hov_free_min': 4, 'hov2_pct': 50}, [300, 300])], [({'density': 42, 'prev_price': 0, 'bands': [[14, 225], [16, 675], [30, 775], [42, 925]], 'max_step': 25, 'min_price': 50, 'max_price': 1200, 'occupancy': 4, 'hov_free_min': 3, 'hov2_pct': 50}, [50, 0]), ({'density': 10, 'prev_price': 225, 'bands': [[10, 75], [16, 300], [36, 725], [44, 900]], 'max_step': 25, 'min_price': 50, 'max_price': 1000, 'occupancy': 1, 'hov_free_min': 3, 'hov2_pct': 50}, [200, 200]), ({'density': 16, 'prev_price': 1200, 'bands': [[13, 50], [16, 450], [17, 725], [39, 900]], 'max_step': 25, 'min_price': 50, 'max_price': 1200, 'occupancy': 1, 'hov_free_min': 2, 'hov2_pct': 70}, [1175, 1175]), ({'density': 34, 'prev_price': 1175, 'bands': [[16, 225], [27, 325], [39, 400], [40, 475]], 'max_step': 25, 'min_price': 50, 'max_price': 1000, 'occupancy': 1, 'hov_free_min': 3, 'hov2_pct': 50}, [1000, 1000]), ({'density': 45, 'prev_price': 1100, 'bands': [[12, 100], [20, 400], [30, 700], [40, 900]], 'max_step': 50, 'min_price': 50, 'max_price': 1000, 'occupancy': 1, 'hov_free_min': 3, 'hov2_pct': 70}, [1000, 1000]), ({'density': 22, 'prev_price': 500, 'bands': [[10, 350], [19, 425], [22, 450], [24, 650]], 'max_step': 100, 'min_price': 50, 'max_price': 800, 'occupancy': 1, 'hov_free_min': 4, 'hov2_pct': 50}, [450, 450]), ({'density': 20, 'prev_price': 300, 'bands': [[12, 100], [20, 400], [30, 700], [40, 900]], 'max_step': 50, 'min_price': 50, 'max_price': 1000, 'occupancy': 2, 'hov_free_min': 3, 'hov2_pct': 70}, [350, 245]), ({'density': 25, 'prev_price': 0, 'bands': [[12, 100], [20, 400], [30, 700], [40, 900]], 'max_step': 25, 'min_price': 50, 'max_price': 1000, 'occupancy': 1, 'hov_free_min': 3, 'hov2_pct': 50}, [50, 50])], [({'density': 18, 'prev_price': 850, 'bands': [[18, 100], [20, 175], [35, 250], [44, 800]], 'max_step': 25, 'min_price': 50, 'max_price': 1000, 'occupancy': 3, 'hov_free_min': 3, 'hov2_pct': 50}, [825, 0]), ({'density': 16, 'prev_price': 25, 'bands': [[16, 50], [23, 350], [26, 700], [36, 725]], 'max_step': 50, 'min_price': 50, 'max_price': 1000, 'occupancy': 4, 'hov_free_min': 4, 'hov2_pct': 70}, [50, 0]), ({'density': 45, 'prev_price': 1100, 'bands': [[12, 100], [20, 400], [30, 700], [40, 900]], 'max_step': 50, 'min_price': 50, 'max_price': 1000, 'occupancy': 1, 'hov_free_min': 3, 'hov2_pct': 70}, [1000, 1000]), ({'density': 49, 'prev_price': 0, 'bands': [[12, 350], [33, 475], [34, 500], [41, 800]], 'max_step': 25, 'min_price': 50, 'max_price': 800, 'occupancy': 1, 'hov_free_min': 3, 'hov2_pct': 70}, [50, 50]), ({'density': 19, 'prev_price': 250, 'bands': [[19, 275], [31, 450], [37, 675], [40, 700]], 'max_step': 25, 'min_price': 50, 'max_price': 1000, 'occupancy': 2, 'hov_free_min': 3, 'hov2_pct': 50}, [275, 135]), ({'density': 35, 'prev_price': 1300, 'bands': [[31, 175], [38, 200], [40, 400], [42, 800]], 'max_step': 50, 'min_price': 50, 'max_price': 1000, 'occupancy': 3, 'hov_free_min': 3, 'hov2_pct': 70}, [1000, 0]), ({'density': 25, 'prev_price': 0, 'bands': [[12, 100], [20, 400], [30, 700], [40, 900]], 'max_step': 25, 'min_price': 50, 'max_price': 1000, 'occupancy': 1, 'hov_free_min': 3, 'hov2_pct': 50}, [50, 50]), ({'density': 20, 'prev_price': 300, 'bands': [[12, 100], [20, 400], [30, 700], [40, 900]], 'max_step': 50, 'min_price': 50, 'max_price': 1000, 'occupancy': 2, 'hov_free_min': 3, 'hov2_pct': 70}, [350, 245])], [({'density': 14, 'prev_price': 925, 'bands': [[10, 150], [12, 525], [14, 750], [40, 850]], 'max_step': 25, 'min_price': 50, 'max_price': 800, 'occupancy': 1, 'hov_free_min': 2, 'hov2_pct': 70}, [800, 800]), ({'density': 34, 'prev_price': 0, 'bands': [[27, 450], [29, 525], [34, 550], [42, 950]], 'max_step': 25, 'min_price': 50, 'max_price': 1000, 'occupancy': 1, 'hov_free_min': 4, 'hov2_pct': 50}, [50, 50]), ({'density': 25, 'prev_price': 0, 'bands': [[12, 100], [20, 400], [30, 700], [40, 900]], 'max_step': 25, 'min_price': 50, 'max_price': 1000, 'occupancy': 1, 'hov_free_min': 3, 'hov2_pct': 50}, [50, 50]), ({'density': 34, 'prev_price': 250, 'bands': [[16, 325], [33, 400], [34, 475], [38, 1000]], 'max_step': 100, 'min_price': 50, 'max_price': 1200, 'occupancy': 3, 'hov_free_min': 2, 'hov2_pct': 50}, [350, 0]), ({'density': 45, 'prev_price': 1100, 'bands': [[12, 100], [20, 400], [30, 700], [40, 900]], 'max_step': 50, 'min_price': 50, 'max_price': 1000, 'occupancy': 1, 'hov_free_min': 3, 'hov2_pct': 70}, [1000, 1000]), ({'density': 37, 'prev_price': 850, 'bands': [[22, 525], [30, 800], [37, 825], [44, 975]], 'max_step': 25, 'min_price': 50, 'max_price': 1000, 'occupancy': 4, 'hov_free_min': 2, 'hov2_pct': 70}, [825, 0]), ({'density': 20, 'prev_price': 300, 'bands': [[12, 100], [20, 400], [30, 700], [40, 900]], 'max_step': 50, 'min_price': 50, 'max_price': 1000, 'occupancy': 2, 'hov_free_min': 3, 'hov2_pct': 70}, [350, 245]), ({'density': 41, 'prev_price': 350, 'bands': [[29, 225], [33, 525], [41, 575], [44, 625]], 'max_step': 50, 'min_price': 50, 'max_price': 1200, 'occupancy': 4, 'hov_free_min': 4, 'hov2_pct': 50}, [400, 0])]]
for i, (args, expected) in enumerate(fixtures[N-1]):
    check('fee oracle' + ' %d' % i, 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
fee oracle 0[750, 0][750, 0]Passed
fee oracle 1[675, 335][675, 335]Passed
fee oracle 2[350, 245][350, 245]Passed
fee oracle 3[1000, 1000][1000, 1000]Passed
fee oracle 4[25, 25][50, 50]Failed
fee oracle 5[800, 800][800, 800]Passed
fee oracle 6[1150, 0][1150, 0]Passed
fee oracle 7[800, 800][800, 800]Passed

SHA-256 / 499c1180ab00b816dcb3d4715338d0ef71c862f9215972b3a5a4783f29b301d8

3 / The verified repair

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

N = 1
observations = []
def solve(x):
    target = x['max_price']
    for upto, price in x['bands']:
        if x['density'] <= upto:
            target = price
            break
    prev = x['prev_price']
    step = max(-x['max_step'], min(x['max_step'], target - prev))
    price = max(x['min_price'], min(x['max_price'], prev + step))
    if x['occupancy'] >= x['hov_free_min']:
        return [price, 0]
    if x['occupancy'] == 2:
        return [price, price * x['hov2_pct'] // 100 // 5 * 5]
    return [price, price]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[({'density': 37, 'prev_price': 650, 'bands': [[13, 475], [36, 650], [37, 800], [42, 1000]], 'max_step': 100, 'min_price': 50, 'max_price': 1200, 'occupancy': 3, 'hov_free_min': 3, 'hov2_pct': 70}, [750, 0]), ({'density': 19, 'prev_price': 625, 'bands': [[13, 125], [19, 725], [23, 750], [36, 925]], 'max_step': 50, 'min_price': 50, 'max_price': 1000, 'occupancy': 2, 'hov_free_min': 3, 'hov2_pct': 50}, [675, 335]), ({'density': 20, 'prev_price': 300, 'bands': [[12, 100], [20, 400], [30, 700], [40, 900]], 'max_step': 50, 'min_price': 50, 'max_price': 1000, 'occupancy': 2, 'hov_free_min': 3, 'hov2_pct': 70}, [350, 245]), ({'density': 45, 'prev_price': 1100, 'bands': [[12, 100], [20, 400], [30, 700], [40, 900]], 'max_step': 50, 'min_price': 50, 'max_price': 1000, 'occupancy': 1, 'hov_free_min': 3, 'hov2_pct': 70}, [1000, 1000]), ({'density': 25, 'prev_price': 0, 'bands': [[12, 100], [20, 400], [30, 700], [40, 900]], 'max_step': 25, 'min_price': 50, 'max_price': 1000, 'occupancy': 1, 'hov_free_min': 3, 'hov2_pct': 50}, [50, 50]), ({'density': 21, 'prev_price': 1250, 'bands': [[18, 225], [21, 250], [22, 350], [43, 525]], 'max_step': 100, 'min_price': 50, 'max_price': 800, 'occupancy': 1, 'hov_free_min': 3, 'hov2_pct': 50}, [800, 800]), ({'density': 44, 'prev_price': 1200, 'bands': [[19, 450], [40, 525], [41, 650], [44, 925]], 'max_step': 50, 'min_price': 50, 'max_price': 1200, 'occupancy': 4, 'hov_free_min': 3, 'hov2_pct': 50}, [1150, 0]), ({'density': 11, 'prev_price': 1250, 'bands': [[11, 275], [17, 500], [21, 700], [44, 825]], 'max_step': 50, 'min_price': 50, 'max_price': 800, 'occupancy': 1, 'hov_free_min': 3, 'hov2_pct': 50}, [800, 800])], [({'density': 45, 'prev_price': 1100, 'bands': [[12, 100], [20, 400], [30, 700], [40, 900]], 'max_step': 50, 'min_price': 50, 'max_price': 1000, 'occupancy': 1, 'hov_free_min': 3, 'hov2_pct': 70}, [1000, 1000]), ({'density': 20, 'prev_price': 300, 'bands': [[12, 100], [20, 400], [30, 700], [40, 900]], 'max_step': 50, 'min_price': 50, 'max_price': 1000, 'occupancy': 2, 'hov_free_min': 3, 'hov2_pct': 70}, [350, 245]), ({'density': 25, 'prev_price': 0, 'bands': [[12, 100], [20, 400], [30, 700], [40, 900]], 'max_step': 25, 'min_price': 50, 'max_price': 1000, 'occupancy': 1, 'hov_free_min': 3, 'hov2_pct': 50}, [50, 50]), ({'density': 19, 'prev_price': 1250, 'bands': [[19, 275], [23, 475], [24, 575], [38, 825]], 'max_step': 25, 'min_price': 50, 'max_price': 1000, 'occupancy': 3, 'hov_free_min': 3, 'hov2_pct': 70}, [1000, 0]), ({'density': 23, 'prev_price': 0, 'bands': [[13, 175], [19, 475], [23, 700], [29, 850]], 'max_step': 25, 'min_price': 50, 'max_price': 800, 'occupancy': 1, 'hov_free_min': 4, 'hov2_pct': 50}, [50, 50]), ({'density': 35, 'prev_price': 700, 'bands': [[23, 150], [33, 450], [38, 725], [41, 950]], 'max_step': 25, 'min_price': 50, 'max_price': 1200, 'occupancy': 2, 'hov_free_min': 3, 'hov2_pct': 50}, [725, 360]), ({'density': 17, 'prev_price': 625, 'bands': [[17, 300], [28, 500], [30, 700], [36, 925]], 'max_step': 25, 'min_price': 50, 'max_price': 800, 'occupancy': 3, 'hov_free_min': 4, 'hov2_pct': 70}, [600, 600]), ({'density': 3, 'prev_price': 250, 'bands': [[15, 425], [20, 600], [24, 775], [27, 975]], 'max_step': 50, 'min_price': 50, 'max_price': 800, 'occupancy': 1, 'hov_free_min': 4, 'hov2_pct': 50}, [300, 300])], [({'density': 42, 'prev_price': 0, 'bands': [[14, 225], [16, 675], [30, 775], [42, 925]], 'max_step': 25, 'min_price': 50, 'max_price': 1200, 'occupancy': 4, 'hov_free_min': 3, 'hov2_pct': 50}, [50, 0]), ({'density': 10, 'prev_price': 225, 'bands': [[10, 75], [16, 300], [36, 725], [44, 900]], 'max_step': 25, 'min_price': 50, 'max_price': 1000, 'occupancy': 1, 'hov_free_min': 3, 'hov2_pct': 50}, [200, 200]), ({'density': 16, 'prev_price': 1200, 'bands': [[13, 50], [16, 450], [17, 725], [39, 900]], 'max_step': 25, 'min_price': 50, 'max_price': 1200, 'occupancy': 1, 'hov_free_min': 2, 'hov2_pct': 70}, [1175, 1175]), ({'density': 34, 'prev_price': 1175, 'bands': [[16, 225], [27, 325], [39, 400], [40, 475]], 'max_step': 25, 'min_price': 50, 'max_price': 1000, 'occupancy': 1, 'hov_free_min': 3, 'hov2_pct': 50}, [1000, 1000]), ({'density': 45, 'prev_price': 1100, 'bands': [[12, 100], [20, 400], [30, 700], [40, 900]], 'max_step': 50, 'min_price': 50, 'max_price': 1000, 'occupancy': 1, 'hov_free_min': 3, 'hov2_pct': 70}, [1000, 1000]), ({'density': 22, 'prev_price': 500, 'bands': [[10, 350], [19, 425], [22, 450], [24, 650]], 'max_step': 100, 'min_price': 50, 'max_price': 800, 'occupancy': 1, 'hov_free_min': 4, 'hov2_pct': 50}, [450, 450]), ({'density': 20, 'prev_price': 300, 'bands': [[12, 100], [20, 400], [30, 700], [40, 900]], 'max_step': 50, 'min_price': 50, 'max_price': 1000, 'occupancy': 2, 'hov_free_min': 3, 'hov2_pct': 70}, [350, 245]), ({'density': 25, 'prev_price': 0, 'bands': [[12, 100], [20, 400], [30, 700], [40, 900]], 'max_step': 25, 'min_price': 50, 'max_price': 1000, 'occupancy': 1, 'hov_free_min': 3, 'hov2_pct': 50}, [50, 50])], [({'density': 18, 'prev_price': 850, 'bands': [[18, 100], [20, 175], [35, 250], [44, 800]], 'max_step': 25, 'min_price': 50, 'max_price': 1000, 'occupancy': 3, 'hov_free_min': 3, 'hov2_pct': 50}, [825, 0]), ({'density': 16, 'prev_price': 25, 'bands': [[16, 50], [23, 350], [26, 700], [36, 725]], 'max_step': 50, 'min_price': 50, 'max_price': 1000, 'occupancy': 4, 'hov_free_min': 4, 'hov2_pct': 70}, [50, 0]), ({'density': 45, 'prev_price': 1100, 'bands': [[12, 100], [20, 400], [30, 700], [40, 900]], 'max_step': 50, 'min_price': 50, 'max_price': 1000, 'occupancy': 1, 'hov_free_min': 3, 'hov2_pct': 70}, [1000, 1000]), ({'density': 49, 'prev_price': 0, 'bands': [[12, 350], [33, 475], [34, 500], [41, 800]], 'max_step': 25, 'min_price': 50, 'max_price': 800, 'occupancy': 1, 'hov_free_min': 3, 'hov2_pct': 70}, [50, 50]), ({'density': 19, 'prev_price': 250, 'bands': [[19, 275], [31, 450], [37, 675], [40, 700]], 'max_step': 25, 'min_price': 50, 'max_price': 1000, 'occupancy': 2, 'hov_free_min': 3, 'hov2_pct': 50}, [275, 135]), ({'density': 35, 'prev_price': 1300, 'bands': [[31, 175], [38, 200], [40, 400], [42, 800]], 'max_step': 50, 'min_price': 50, 'max_price': 1000, 'occupancy': 3, 'hov_free_min': 3, 'hov2_pct': 70}, [1000, 0]), ({'density': 25, 'prev_price': 0, 'bands': [[12, 100], [20, 400], [30, 700], [40, 900]], 'max_step': 25, 'min_price': 50, 'max_price': 1000, 'occupancy': 1, 'hov_free_min': 3, 'hov2_pct': 50}, [50, 50]), ({'density': 20, 'prev_price': 300, 'bands': [[12, 100], [20, 400], [30, 700], [40, 900]], 'max_step': 50, 'min_price': 50, 'max_price': 1000, 'occupancy': 2, 'hov_free_min': 3, 'hov2_pct': 70}, [350, 245])], [({'density': 14, 'prev_price': 925, 'bands': [[10, 150], [12, 525], [14, 750], [40, 850]], 'max_step': 25, 'min_price': 50, 'max_price': 800, 'occupancy': 1, 'hov_free_min': 2, 'hov2_pct': 70}, [800, 800]), ({'density': 34, 'prev_price': 0, 'bands': [[27, 450], [29, 525], [34, 550], [42, 950]], 'max_step': 25, 'min_price': 50, 'max_price': 1000, 'occupancy': 1, 'hov_free_min': 4, 'hov2_pct': 50}, [50, 50]), ({'density': 25, 'prev_price': 0, 'bands': [[12, 100], [20, 400], [30, 700], [40, 900]], 'max_step': 25, 'min_price': 50, 'max_price': 1000, 'occupancy': 1, 'hov_free_min': 3, 'hov2_pct': 50}, [50, 50]), ({'density': 34, 'prev_price': 250, 'bands': [[16, 325], [33, 400], [34, 475], [38, 1000]], 'max_step': 100, 'min_price': 50, 'max_price': 1200, 'occupancy': 3, 'hov_free_min': 2, 'hov2_pct': 50}, [350, 0]), ({'density': 45, 'prev_price': 1100, 'bands': [[12, 100], [20, 400], [30, 700], [40, 900]], 'max_step': 50, 'min_price': 50, 'max_price': 1000, 'occupancy': 1, 'hov_free_min': 3, 'hov2_pct': 70}, [1000, 1000]), ({'density': 37, 'prev_price': 850, 'bands': [[22, 525], [30, 800], [37, 825], [44, 975]], 'max_step': 25, 'min_price': 50, 'max_price': 1000, 'occupancy': 4, 'hov_free_min': 2, 'hov2_pct': 70}, [825, 0]), ({'density': 20, 'prev_price': 300, 'bands': [[12, 100], [20, 400], [30, 700], [40, 900]], 'max_step': 50, 'min_price': 50, 'max_price': 1000, 'occupancy': 2, 'hov_free_min': 3, 'hov2_pct': 70}, [350, 245]), ({'density': 41, 'prev_price': 350, 'bands': [[29, 225], [33, 525], [41, 575], [44, 625]], 'max_step': 50, 'min_price': 50, 'max_price': 1200, 'occupancy': 4, 'hov_free_min': 4, 'hov2_pct': 50}, [400, 0])]]
for i, (args, expected) in enumerate(fixtures[N-1]):
    check('fee oracle' + ' %d' % i, 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
fee oracle 0[750, 0][750, 0]Passed
fee oracle 1[675, 335][675, 335]Passed
fee oracle 2[350, 245][350, 245]Passed
fee oracle 3[1000, 1000][1000, 1000]Passed
fee oracle 4[50, 50][50, 50]Passed
fee oracle 5[800, 800][800, 800]Passed
fee oracle 6[1150, 0][1150, 0]Passed
fee oracle 7[800, 800][800, 800]Passed

SHA-256 / 980ced07e29bedb7ae976d8472ba2565f327eca14ff1296718c398f752f432a1

Verification & scope

A deterministic, bounded toy model with a stipulated contract; it makes no claim of conformance to any agency manual or standard. 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:48:03.467160+00:00.

Case digest / a1178c5703436a4f8af2ae8eeae3f3e240861e69436f0b79d68f1b9e45301e3b