FAILURE MAP
← Case archive

FA-95761 / Shipping rate zone lookup / Open access

Fuel table: current week price used · case 01

Fuel surcharge changes two weeks early, before the price is published for billing.

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

ROOT CAUSE

The lookup uses the ship week itself instead of the two-week lag.

VERIFIED REPAIR

Use the price published for week - 2.

Unsuccessful approach: A one-week lag is still too early.

Case contract

prices [[week, diesel_cents]] published weekly (weeks may be missing). A ship week uses the latest price published at or before week - 2. bands [[lo, hi, basis_points]] are half-open [lo, hi). At or above the last band hi, add 25 bp for each started 5 cents at or above hi (the hi price itself adds one step). Below the table -> 0; no price -> None.

Why this case matters

Carriers index fuel surcharges to published diesel prices with a lag.

1 / The failure

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

N = 1
observations = []
def solve(week, prices, bands):
    target = week
    avail = [pc for pc in prices if pc[0] <= target]
    if not avail:
        return None
    p = max(avail)[1]
    for lo, hi, bp in bands:
        if lo <= p < hi:
            return bp
    top_hi, top_bp = bands[-1][1], bands[-1][2]
    if p >= top_hi:
        return top_bp + ((p - top_hi) // 5 + 1) * 25
    return 0
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['two week lag', [13, [[10, 345], [11, 350], [12, 402], [14, 500], [15, 299], [17, 512]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1300], ['band lower edge', [12, [[10, 345], [11, 350], [12, 402], [14, 500], [15, 299], [17, 512]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1200], ['missing week fallback', [15, [[10, 345], [11, 350], [12, 402], [14, 500], [15, 299], [17, 512]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1400], ['below table', [17, [[10, 345], [11, 350], [12, 402], [14, 500], [15, 299], [17, 512]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 0], ['above table steps', [19, [[10, 345], [11, 350], [12, 402], [14, 500], [15, 299], [17, 512]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1575], ['above table at hi', [16, [[10, 345], [11, 350], [12, 402], [14, 500], [15, 299], [17, 512]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1525], ['generated mix 6', [19, [[10, 345], [11, 350], [14, 500], [15, 299], [17, 512], [18, 350]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1575], ['generated mix 14', [19, [[10, 345], [11, 350], [12, 402], [15, 299], [17, 512], [18, 504]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1575]], [['generated mix 5', [11, [[11, 350], [14, 500], [17, 512], [18, 505]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], None], ['generated mix 6', [19, [[10, 345], [11, 350], [14, 500], [15, 299], [17, 512], [18, 350]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1575], ['above table at hi', [16, [[10, 345], [11, 350], [12, 402], [14, 500], [15, 299], [17, 512]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1525], ['no price yet', [11, [[10, 345], [11, 350], [12, 402], [14, 500], [15, 299], [17, 512]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], None], ['shared edge', [3, [[1, 450]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1500], ['band lower edge', [12, [[10, 345], [11, 350], [12, 402], [14, 500], [15, 299], [17, 512]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1200], ['generated mix 10', [20, [[10, 345], [11, 350], [12, 402], [14, 500], [17, 512], [16, 300]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1575], ['generated mix 18', [20, [[10, 345], [14, 500], [15, 299], [17, 512], [16, 350]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1575]], [['generated mix 16', [12, [[10, 345], [11, 350], [14, 500], [15, 299], [17, 512], [18, 499]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1200], ['generated mix 17', [12, [[10, 345], [11, 350], [12, 402], [15, 299], [17, 512], [16, 504]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1200], ['above table steps', [19, [[10, 345], [11, 350], [12, 402], [14, 500], [15, 299], [17, 512]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1575], ['two week lag', [13, [[10, 345], [11, 350], [12, 402], [14, 500], [15, 299], [17, 512]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1300], ['missing week fallback', [15, [[10, 345], [11, 350], [12, 402], [14, 500], [15, 299], [17, 512]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1400], ['below table', [17, [[10, 345], [11, 350], [12, 402], [14, 500], [15, 299], [17, 512]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 0], ['generated mix 21', [17, [[10, 345], [11, 350], [12, 402], [15, 299], [17, 512], [13, 530]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 0], ['generated mix 29', [13, [[10, 345], [12, 402], [14, 500], [17, 512], [16, 499]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1200]], [['generated mix 24', [16, [[11, 350], [12, 402], [14, 500], [15, 299], [17, 512], [13, 299]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1525], ['generated mix 31', [12, [[10, 345], [11, 350], [12, 402], [14, 500], [18, 300]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1200], ['band lower edge', [12, [[10, 345], [11, 350], [12, 402], [14, 500], [15, 299], [17, 512]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1200], ['above table at hi', [16, [[10, 345], [11, 350], [12, 402], [14, 500], [15, 299], [17, 512]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1525], ['no price yet', [11, [[10, 345], [11, 350], [12, 402], [14, 500], [15, 299], [17, 512]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], None], ['shared edge', [3, [[1, 450]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1500], ['generated mix 32', [14, [[11, 350], [12, 402], [14, 500], [15, 299], [17, 512], [18, 530]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1400], ['generated mix 40', [14, [[10, 345], [11, 350], [12, 402], [14, 500], [15, 299], [17, 512], [13, 499]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1400]], [['generated mix 36', [18, [[10, 345], [12, 402], [14, 500], [15, 299], [17, 512], [18, 505]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 0], ['generated mix 39', [13, [[12, 402], [14, 500], [17, 512], [16, 450]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], None], ['below table', [17, [[10, 345], [11, 350], [12, 402], [14, 500], [15, 299], [17, 512]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 0], ['above table steps', [19, [[10, 345], [11, 350], [12, 402], [14, 500], [15, 299], [17, 512]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1575], ['two week lag', [13, [[10, 345], [11, 350], [12, 402], [14, 500], [15, 299], [17, 512]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1300], ['missing week fallback', [15, [[10, 345], [11, 350], [12, 402], [14, 500], [15, 299], [17, 512]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1400], ['generated mix 43', [14, [[10, 345], [12, 402], [14, 500], [15, 299], [13, 349]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1400], ['generated mix 51', [19, [[10, 345], [11, 350], [14, 500], [15, 299], [17, 512], [16, 299]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1575]]]
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
two week lag14001300Failed
band lower edge14001200Failed
missing week fallback01400Failed
below table15750Failed
above table steps15751575Passed
above table at hi01525Failed
generated mix 613001575Failed
generated mix 1415251575Failed

SHA-256 / c5abb927aaaff2b137a1cf6dedea42cb9dca6718110dfcb16c64dcfdb74b7ac6

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(week, prices, bands):
    target = week - 1
    avail = [pc for pc in prices if pc[0] <= target]
    if not avail:
        return None
    p = max(avail)[1]
    for lo, hi, bp in bands:
        if lo <= p < hi:
            return bp
    top_hi, top_bp = bands[-1][1], bands[-1][2]
    if p >= top_hi:
        return top_bp + ((p - top_hi) // 5 + 1) * 25
    return 0
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['two week lag', [13, [[10, 345], [11, 350], [12, 402], [14, 500], [15, 299], [17, 512]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1300], ['band lower edge', [12, [[10, 345], [11, 350], [12, 402], [14, 500], [15, 299], [17, 512]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1200], ['missing week fallback', [15, [[10, 345], [11, 350], [12, 402], [14, 500], [15, 299], [17, 512]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1400], ['below table', [17, [[10, 345], [11, 350], [12, 402], [14, 500], [15, 299], [17, 512]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 0], ['above table steps', [19, [[10, 345], [11, 350], [12, 402], [14, 500], [15, 299], [17, 512]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1575], ['above table at hi', [16, [[10, 345], [11, 350], [12, 402], [14, 500], [15, 299], [17, 512]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1525], ['generated mix 6', [19, [[10, 345], [11, 350], [14, 500], [15, 299], [17, 512], [18, 350]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1575], ['generated mix 14', [19, [[10, 345], [11, 350], [12, 402], [15, 299], [17, 512], [18, 504]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1575]], [['generated mix 5', [11, [[11, 350], [14, 500], [17, 512], [18, 505]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], None], ['generated mix 6', [19, [[10, 345], [11, 350], [14, 500], [15, 299], [17, 512], [18, 350]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1575], ['above table at hi', [16, [[10, 345], [11, 350], [12, 402], [14, 500], [15, 299], [17, 512]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1525], ['no price yet', [11, [[10, 345], [11, 350], [12, 402], [14, 500], [15, 299], [17, 512]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], None], ['shared edge', [3, [[1, 450]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1500], ['band lower edge', [12, [[10, 345], [11, 350], [12, 402], [14, 500], [15, 299], [17, 512]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1200], ['generated mix 10', [20, [[10, 345], [11, 350], [12, 402], [14, 500], [17, 512], [16, 300]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1575], ['generated mix 18', [20, [[10, 345], [14, 500], [15, 299], [17, 512], [16, 350]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1575]], [['generated mix 16', [12, [[10, 345], [11, 350], [14, 500], [15, 299], [17, 512], [18, 499]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1200], ['generated mix 17', [12, [[10, 345], [11, 350], [12, 402], [15, 299], [17, 512], [16, 504]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1200], ['above table steps', [19, [[10, 345], [11, 350], [12, 402], [14, 500], [15, 299], [17, 512]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1575], ['two week lag', [13, [[10, 345], [11, 350], [12, 402], [14, 500], [15, 299], [17, 512]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1300], ['missing week fallback', [15, [[10, 345], [11, 350], [12, 402], [14, 500], [15, 299], [17, 512]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1400], ['below table', [17, [[10, 345], [11, 350], [12, 402], [14, 500], [15, 299], [17, 512]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 0], ['generated mix 21', [17, [[10, 345], [11, 350], [12, 402], [15, 299], [17, 512], [13, 530]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 0], ['generated mix 29', [13, [[10, 345], [12, 402], [14, 500], [17, 512], [16, 499]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1200]], [['generated mix 24', [16, [[11, 350], [12, 402], [14, 500], [15, 299], [17, 512], [13, 299]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1525], ['generated mix 31', [12, [[10, 345], [11, 350], [12, 402], [14, 500], [18, 300]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1200], ['band lower edge', [12, [[10, 345], [11, 350], [12, 402], [14, 500], [15, 299], [17, 512]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1200], ['above table at hi', [16, [[10, 345], [11, 350], [12, 402], [14, 500], [15, 299], [17, 512]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1525], ['no price yet', [11, [[10, 345], [11, 350], [12, 402], [14, 500], [15, 299], [17, 512]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], None], ['shared edge', [3, [[1, 450]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1500], ['generated mix 32', [14, [[11, 350], [12, 402], [14, 500], [15, 299], [17, 512], [18, 530]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1400], ['generated mix 40', [14, [[10, 345], [11, 350], [12, 402], [14, 500], [15, 299], [17, 512], [13, 499]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1400]], [['generated mix 36', [18, [[10, 345], [12, 402], [14, 500], [15, 299], [17, 512], [18, 505]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 0], ['generated mix 39', [13, [[12, 402], [14, 500], [17, 512], [16, 450]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], None], ['below table', [17, [[10, 345], [11, 350], [12, 402], [14, 500], [15, 299], [17, 512]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 0], ['above table steps', [19, [[10, 345], [11, 350], [12, 402], [14, 500], [15, 299], [17, 512]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1575], ['two week lag', [13, [[10, 345], [11, 350], [12, 402], [14, 500], [15, 299], [17, 512]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1300], ['missing week fallback', [15, [[10, 345], [11, 350], [12, 402], [14, 500], [15, 299], [17, 512]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1400], ['generated mix 43', [14, [[10, 345], [12, 402], [14, 500], [15, 299], [13, 349]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1400], ['generated mix 51', [19, [[10, 345], [11, 350], [14, 500], [15, 299], [17, 512], [16, 299]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1575]]]
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
two week lag14001300Failed
band lower edge13001200Failed
missing week fallback15251400Failed
below table00Passed
above table steps15751575Passed
above table at hi01525Failed
generated mix 613001575Failed
generated mix 1415251575Failed

SHA-256 / ed9fd972778941866d49aad83485522d3c676e017968ac414f9fb3445376007a

3 / The verified repair

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

N = 1
observations = []
def solve(week, prices, bands):
    target = week - 2
    avail = [pc for pc in prices if pc[0] <= target]
    if not avail:
        return None
    p = max(avail)[1]
    for lo, hi, bp in bands:
        if lo <= p < hi:
            return bp
    top_hi, top_bp = bands[-1][1], bands[-1][2]
    if p >= top_hi:
        return top_bp + ((p - top_hi) // 5 + 1) * 25
    return 0
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['two week lag', [13, [[10, 345], [11, 350], [12, 402], [14, 500], [15, 299], [17, 512]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1300], ['band lower edge', [12, [[10, 345], [11, 350], [12, 402], [14, 500], [15, 299], [17, 512]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1200], ['missing week fallback', [15, [[10, 345], [11, 350], [12, 402], [14, 500], [15, 299], [17, 512]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1400], ['below table', [17, [[10, 345], [11, 350], [12, 402], [14, 500], [15, 299], [17, 512]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 0], ['above table steps', [19, [[10, 345], [11, 350], [12, 402], [14, 500], [15, 299], [17, 512]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1575], ['above table at hi', [16, [[10, 345], [11, 350], [12, 402], [14, 500], [15, 299], [17, 512]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1525], ['generated mix 6', [19, [[10, 345], [11, 350], [14, 500], [15, 299], [17, 512], [18, 350]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1575], ['generated mix 14', [19, [[10, 345], [11, 350], [12, 402], [15, 299], [17, 512], [18, 504]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1575]], [['generated mix 5', [11, [[11, 350], [14, 500], [17, 512], [18, 505]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], None], ['generated mix 6', [19, [[10, 345], [11, 350], [14, 500], [15, 299], [17, 512], [18, 350]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1575], ['above table at hi', [16, [[10, 345], [11, 350], [12, 402], [14, 500], [15, 299], [17, 512]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1525], ['no price yet', [11, [[10, 345], [11, 350], [12, 402], [14, 500], [15, 299], [17, 512]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], None], ['shared edge', [3, [[1, 450]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1500], ['band lower edge', [12, [[10, 345], [11, 350], [12, 402], [14, 500], [15, 299], [17, 512]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1200], ['generated mix 10', [20, [[10, 345], [11, 350], [12, 402], [14, 500], [17, 512], [16, 300]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1575], ['generated mix 18', [20, [[10, 345], [14, 500], [15, 299], [17, 512], [16, 350]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1575]], [['generated mix 16', [12, [[10, 345], [11, 350], [14, 500], [15, 299], [17, 512], [18, 499]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1200], ['generated mix 17', [12, [[10, 345], [11, 350], [12, 402], [15, 299], [17, 512], [16, 504]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1200], ['above table steps', [19, [[10, 345], [11, 350], [12, 402], [14, 500], [15, 299], [17, 512]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1575], ['two week lag', [13, [[10, 345], [11, 350], [12, 402], [14, 500], [15, 299], [17, 512]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1300], ['missing week fallback', [15, [[10, 345], [11, 350], [12, 402], [14, 500], [15, 299], [17, 512]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1400], ['below table', [17, [[10, 345], [11, 350], [12, 402], [14, 500], [15, 299], [17, 512]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 0], ['generated mix 21', [17, [[10, 345], [11, 350], [12, 402], [15, 299], [17, 512], [13, 530]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 0], ['generated mix 29', [13, [[10, 345], [12, 402], [14, 500], [17, 512], [16, 499]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1200]], [['generated mix 24', [16, [[11, 350], [12, 402], [14, 500], [15, 299], [17, 512], [13, 299]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1525], ['generated mix 31', [12, [[10, 345], [11, 350], [12, 402], [14, 500], [18, 300]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1200], ['band lower edge', [12, [[10, 345], [11, 350], [12, 402], [14, 500], [15, 299], [17, 512]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1200], ['above table at hi', [16, [[10, 345], [11, 350], [12, 402], [14, 500], [15, 299], [17, 512]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1525], ['no price yet', [11, [[10, 345], [11, 350], [12, 402], [14, 500], [15, 299], [17, 512]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], None], ['shared edge', [3, [[1, 450]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1500], ['generated mix 32', [14, [[11, 350], [12, 402], [14, 500], [15, 299], [17, 512], [18, 530]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1400], ['generated mix 40', [14, [[10, 345], [11, 350], [12, 402], [14, 500], [15, 299], [17, 512], [13, 499]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1400]], [['generated mix 36', [18, [[10, 345], [12, 402], [14, 500], [15, 299], [17, 512], [18, 505]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 0], ['generated mix 39', [13, [[12, 402], [14, 500], [17, 512], [16, 450]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], None], ['below table', [17, [[10, 345], [11, 350], [12, 402], [14, 500], [15, 299], [17, 512]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 0], ['above table steps', [19, [[10, 345], [11, 350], [12, 402], [14, 500], [15, 299], [17, 512]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1575], ['two week lag', [13, [[10, 345], [11, 350], [12, 402], [14, 500], [15, 299], [17, 512]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1300], ['missing week fallback', [15, [[10, 345], [11, 350], [12, 402], [14, 500], [15, 299], [17, 512]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1400], ['generated mix 43', [14, [[10, 345], [12, 402], [14, 500], [15, 299], [13, 349]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1400], ['generated mix 51', [19, [[10, 345], [11, 350], [14, 500], [15, 299], [17, 512], [16, 299]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1575]]]
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
two week lag13001300Passed
band lower edge12001200Passed
missing week fallback14001400Passed
below table00Passed
above table steps15751575Passed
above table at hi15251525Passed
generated mix 615751575Passed
generated mix 1415751575Passed

SHA-256 / 4fa692017fc587710869a206933958b34dc7eb73daa942793019ee82e7b442bc

Verification & scope

Stipulated bands and step size. 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:52:16.693139+00:00.

Case digest / 2715070d861ed816e31719e89338f8300c8531ae7e21fe82ee7e38f094df56a3