FA-95766 / Shipping rate zone lookup / Open access
Fuel table: missing publication week drops surcharge · case 01
Weeks without a published price return no surcharge.
ROOT CAUSE
Only an exact week match is accepted.
VERIFIED REPAIR
Fall back to the most recent price published at or before the target week.
Unsuccessful approach: Using the latest price overall includes future publications.
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 - 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 = [[['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], ['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], ['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], ['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 28', [20, [[10, 345], [11, 350], [12, 402], [15, 299], [16, 349]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1200], ['generated mix 1', [13, [[10, 345], [11, 350], [14, 500], [15, 299], [17, 512], [18, 300]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1300], ['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 9', [15, [[12, 402], [14, 500], [15, 299], [17, 512], [18, 504]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1400], ['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]], [['generated mix 54', [13, [[10, 345], [14, 500], [15, 299], [18, 499]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1200], ['generated mix 8', [18, [[10, 345], [11, 350], [12, 402], [14, 500], [15, 299], [17, 512], [16, 530]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1675], ['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 20', [17, [[10, 345], [12, 402], [14, 500], [15, 299], [17, 512], [16, 299]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 0], ['generated mix 28', [20, [[10, 345], [11, 350], [12, 402], [15, 299], [16, 349]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1200]], [['generated mix 71', [18, [[12, 402], [15, 299], [17, 512], [13, 499]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 0], ['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], ['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 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], ['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]], [['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 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], ['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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| missing week fallback | None | 1400 | Failed |
| band lower edge | 1200 | 1200 | Passed |
| two week lag | 1300 | 1300 | Passed |
| below table | 0 | 0 | Passed |
| above table steps | 1575 | 1575 | Passed |
| above table at hi | 1525 | 1525 | Passed |
| generated mix 6 | 1575 | 1575 | Passed |
| generated mix 14 | 1575 | 1575 | Passed |
SHA-256 / 4930373d0ff14b2fce287802034300ef02f3749201557cf54418ca25771b52fb
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 - 2
avail = list(prices)
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 = [[['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], ['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], ['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], ['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 28', [20, [[10, 345], [11, 350], [12, 402], [15, 299], [16, 349]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1200], ['generated mix 1', [13, [[10, 345], [11, 350], [14, 500], [15, 299], [17, 512], [18, 300]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1300], ['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 9', [15, [[12, 402], [14, 500], [15, 299], [17, 512], [18, 504]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1400], ['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]], [['generated mix 54', [13, [[10, 345], [14, 500], [15, 299], [18, 499]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1200], ['generated mix 8', [18, [[10, 345], [11, 350], [12, 402], [14, 500], [15, 299], [17, 512], [16, 530]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1675], ['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 20', [17, [[10, 345], [12, 402], [14, 500], [15, 299], [17, 512], [16, 299]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 0], ['generated mix 28', [20, [[10, 345], [11, 350], [12, 402], [15, 299], [16, 349]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1200]], [['generated mix 71', [18, [[12, 402], [15, 299], [17, 512], [13, 499]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 0], ['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], ['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 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], ['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]], [['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 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], ['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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| missing week fallback | 1575 | 1400 | Failed |
| band lower edge | 1575 | 1200 | Failed |
| two week lag | 1575 | 1300 | Failed |
| below table | 1575 | 0 | Failed |
| above table steps | 1575 | 1575 | Passed |
| above table at hi | 1575 | 1525 | Failed |
| generated mix 6 | 1300 | 1575 | Failed |
| generated mix 14 | 1525 | 1575 | Failed |
SHA-256 / 48c24f0e3b134fdbb82fe7492d65e4acc4345a4c9f08bbbc2d1b060757fa3190
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 = [[['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], ['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], ['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], ['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 28', [20, [[10, 345], [11, 350], [12, 402], [15, 299], [16, 349]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1200], ['generated mix 1', [13, [[10, 345], [11, 350], [14, 500], [15, 299], [17, 512], [18, 300]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1300], ['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 9', [15, [[12, 402], [14, 500], [15, 299], [17, 512], [18, 504]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1400], ['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]], [['generated mix 54', [13, [[10, 345], [14, 500], [15, 299], [18, 499]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1200], ['generated mix 8', [18, [[10, 345], [11, 350], [12, 402], [14, 500], [15, 299], [17, 512], [16, 530]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1675], ['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 20', [17, [[10, 345], [12, 402], [14, 500], [15, 299], [17, 512], [16, 299]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 0], ['generated mix 28', [20, [[10, 345], [11, 350], [12, 402], [15, 299], [16, 349]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 1200]], [['generated mix 71', [18, [[12, 402], [15, 299], [17, 512], [13, 499]], [[300, 350, 1200], [350, 400, 1300], [400, 450, 1400], [450, 500, 1500]]], 0], ['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], ['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 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], ['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]], [['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 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], ['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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| missing week fallback | 1400 | 1400 | Passed |
| band lower edge | 1200 | 1200 | Passed |
| two week lag | 1300 | 1300 | Passed |
| below table | 0 | 0 | Passed |
| above table steps | 1575 | 1575 | Passed |
| above table at hi | 1525 | 1525 | Passed |
| generated mix 6 | 1575 | 1575 | Passed |
| generated mix 14 | 1575 | 1575 | Passed |
SHA-256 / 90fd808dca5ccbc6514a699001a8ed3f248ca6b2c867fe4e95c6622d3f94311b
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.693681+00:00.
Case digest / 335a6814dfe8fdb6dfab73afd14bacad9fb793b6c319aabfc8b8222926771337