FAILURE MAP
← Case archive

FA-95426 / Shipping rate zone lookup / Open access

Surcharges: fuel on base rate only · case 01

Fuel surcharge is under-collected on residential and remote deliveries.

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

ROOT CAUSE

The fuel percentage is applied to the base rate, excluding residential and delivery area fees.

VERIFIED REPAIR

Apply fuel to base plus residential plus delivery area charges.

Unsuccessful approach: Adding declared value dollars to the fuel base mixes units and taxes insurance.

Case contract

Cents. Residential 550; delivery area DAS 395 or EXT 510, plus 100 when the delivery is residential. Fuel = fuel_bp basis points of (base + residential + delivery area), rounded half up to the cent. Declared value (whole dollars): first $100 free, then 105 cents per $100 or part. Return [fuel, declared_value_fee, total].

Why this case matters

Accessorials and fuel are layered on the zone rate in a fixed order.

1 / The failure

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

N = 1
observations = []
def solve(base, residential, das, declared, fuel_bp):
    res = 550 if residential else 0
    das_fee = {'NONE': 0, 'DAS': 395, 'EXT': 510}[das]
    if residential and das != 'NONE':
        das_fee += 100
    subject = base + res + das_fee
    fuel = (base * fuel_bp + 5000) // 10000
    excess = max(0, declared - 100)
    dv = -(-excess // 100) * 105
    return [fuel, dv, subject + fuel + dv]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['commercial das', [1000, False, 'DAS', 0, 1500], [209, 0, 1604]], ['declared exactly 100', [2000, False, 'NONE', 100, 1000], [200, 0, 2200]], ['residential ext uplift', [1000, True, 'EXT', 0, 1000], [216, 0, 2376]], ['fuel exact half', [1012, False, 'NONE', 0, 1250], [127, 0, 1139]], ['declared 250', [2000, True, 'NONE', 250, 1000], [255, 210, 3015]], ['half cent up', [1000, False, 'NONE', 0, 1250], [125, 0, 1125]], ['declared part hundred', [2000, False, 'NONE', 101, 1000], [200, 105, 2305]], ['generated mix 8', [1234, False, 'DAS', 200, 1250], [204, 105, 1938]]], [['generated mix 6', [1500, True, 'EXT', 100, 1500], [399, 0, 3059]], ['fuel exact half', [1012, False, 'NONE', 0, 1250], [127, 0, 1139]], ['declared exactly 100', [2000, False, 'NONE', 100, 1000], [200, 0, 2200]], ['commercial das', [1000, False, 'DAS', 0, 1500], [209, 0, 1604]], ['half cent up', [1000, False, 'NONE', 0, 1250], [125, 0, 1125]], ['generated mix 10', [1000, False, 'DAS', 50, 1850], [258, 0, 1653]], ['generated mix 18', [1234, True, 'EXT', 1000, 1000], [239, 945, 3578]], ['generated mix 26', [2000, True, 'NONE', 250, 1000], [255, 210, 3015]]], [['generated mix 13', [2000, True, 'EXT', 1000, 1250], [395, 945, 4500]], ['declared 250', [2000, True, 'NONE', 250, 1000], [255, 210, 3015]], ['residential ext uplift', [1000, True, 'EXT', 0, 1000], [216, 0, 2376]], ['fuel exact half', [1012, False, 'NONE', 0, 1250], [127, 0, 1139]], ['declared exactly 100', [2000, False, 'NONE', 100, 1000], [200, 0, 2200]], ['generated mix 21', [1500, False, 'NONE', 250, 1850], [278, 210, 1988]], ['generated mix 29', [1500, True, 'NONE', 50, 1625], [333, 0, 2383]], ['generated mix 37', [2345, False, 'DAS', 1000, 1625], [445, 945, 4130]]], [['generated mix 20', [1000, True, 'DAS', 250, 1500], [307, 210, 2562]], ['generated mix 18', [1234, True, 'EXT', 1000, 1000], [239, 945, 3578]], ['half cent up', [1000, False, 'NONE', 0, 1250], [125, 0, 1125]], ['declared part hundred', [2000, False, 'NONE', 101, 1000], [200, 105, 2305]], ['declared 250', [2000, True, 'NONE', 250, 1000], [255, 210, 3015]], ['residential ext uplift', [1000, True, 'EXT', 0, 1000], [216, 0, 2376]], ['generated mix 33', [2000, True, 'EXT', 101, 1850], [585, 105, 3850]], ['generated mix 41', [1234, True, 'EXT', 101, 1850], [443, 105, 2942]]], [['generated mix 29', [1500, True, 'NONE', 50, 1625], [333, 0, 2383]], ['generated mix 23', [2000, False, 'EXT', 100, 1850], [464, 0, 2974]], ['declared exactly 100', [2000, False, 'NONE', 100, 1000], [200, 0, 2200]], ['commercial das', [1000, False, 'DAS', 0, 1500], [209, 0, 1604]], ['half cent up', [1000, False, 'NONE', 0, 1250], [125, 0, 1125]], ['declared part hundred', [2000, False, 'NONE', 101, 1000], [200, 105, 2305]], ['generated mix 44', [2345, False, 'EXT', 0, 1850], [528, 0, 3383]], ['generated mix 52', [1500, True, 'NONE', 1000, 1250], [256, 945, 3251]]]]
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
commercial das[150, 0, 1545][209, 0, 1604]Failed
declared exactly 100[200, 0, 2200][200, 0, 2200]Passed
residential ext uplift[100, 0, 2260][216, 0, 2376]Failed
fuel exact half[127, 0, 1139][127, 0, 1139]Passed
declared 250[200, 210, 2960][255, 210, 3015]Failed
half cent up[125, 0, 1125][125, 0, 1125]Passed
declared part hundred[200, 105, 2305][200, 105, 2305]Passed
generated mix 8[154, 105, 1888][204, 105, 1938]Failed

SHA-256 / 2df6bafa26c52ab39f4f01a23e20ec09a7b70dc235d3588b81103990775c5daa

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(base, residential, das, declared, fuel_bp):
    res = 550 if residential else 0
    das_fee = {'NONE': 0, 'DAS': 395, 'EXT': 510}[das]
    if residential and das != 'NONE':
        das_fee += 100
    subject = base + res + das_fee
    fuel = ((subject + declared) * fuel_bp + 5000) // 10000
    excess = max(0, declared - 100)
    dv = -(-excess // 100) * 105
    return [fuel, dv, subject + fuel + dv]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['commercial das', [1000, False, 'DAS', 0, 1500], [209, 0, 1604]], ['declared exactly 100', [2000, False, 'NONE', 100, 1000], [200, 0, 2200]], ['residential ext uplift', [1000, True, 'EXT', 0, 1000], [216, 0, 2376]], ['fuel exact half', [1012, False, 'NONE', 0, 1250], [127, 0, 1139]], ['declared 250', [2000, True, 'NONE', 250, 1000], [255, 210, 3015]], ['half cent up', [1000, False, 'NONE', 0, 1250], [125, 0, 1125]], ['declared part hundred', [2000, False, 'NONE', 101, 1000], [200, 105, 2305]], ['generated mix 8', [1234, False, 'DAS', 200, 1250], [204, 105, 1938]]], [['generated mix 6', [1500, True, 'EXT', 100, 1500], [399, 0, 3059]], ['fuel exact half', [1012, False, 'NONE', 0, 1250], [127, 0, 1139]], ['declared exactly 100', [2000, False, 'NONE', 100, 1000], [200, 0, 2200]], ['commercial das', [1000, False, 'DAS', 0, 1500], [209, 0, 1604]], ['half cent up', [1000, False, 'NONE', 0, 1250], [125, 0, 1125]], ['generated mix 10', [1000, False, 'DAS', 50, 1850], [258, 0, 1653]], ['generated mix 18', [1234, True, 'EXT', 1000, 1000], [239, 945, 3578]], ['generated mix 26', [2000, True, 'NONE', 250, 1000], [255, 210, 3015]]], [['generated mix 13', [2000, True, 'EXT', 1000, 1250], [395, 945, 4500]], ['declared 250', [2000, True, 'NONE', 250, 1000], [255, 210, 3015]], ['residential ext uplift', [1000, True, 'EXT', 0, 1000], [216, 0, 2376]], ['fuel exact half', [1012, False, 'NONE', 0, 1250], [127, 0, 1139]], ['declared exactly 100', [2000, False, 'NONE', 100, 1000], [200, 0, 2200]], ['generated mix 21', [1500, False, 'NONE', 250, 1850], [278, 210, 1988]], ['generated mix 29', [1500, True, 'NONE', 50, 1625], [333, 0, 2383]], ['generated mix 37', [2345, False, 'DAS', 1000, 1625], [445, 945, 4130]]], [['generated mix 20', [1000, True, 'DAS', 250, 1500], [307, 210, 2562]], ['generated mix 18', [1234, True, 'EXT', 1000, 1000], [239, 945, 3578]], ['half cent up', [1000, False, 'NONE', 0, 1250], [125, 0, 1125]], ['declared part hundred', [2000, False, 'NONE', 101, 1000], [200, 105, 2305]], ['declared 250', [2000, True, 'NONE', 250, 1000], [255, 210, 3015]], ['residential ext uplift', [1000, True, 'EXT', 0, 1000], [216, 0, 2376]], ['generated mix 33', [2000, True, 'EXT', 101, 1850], [585, 105, 3850]], ['generated mix 41', [1234, True, 'EXT', 101, 1850], [443, 105, 2942]]], [['generated mix 29', [1500, True, 'NONE', 50, 1625], [333, 0, 2383]], ['generated mix 23', [2000, False, 'EXT', 100, 1850], [464, 0, 2974]], ['declared exactly 100', [2000, False, 'NONE', 100, 1000], [200, 0, 2200]], ['commercial das', [1000, False, 'DAS', 0, 1500], [209, 0, 1604]], ['half cent up', [1000, False, 'NONE', 0, 1250], [125, 0, 1125]], ['declared part hundred', [2000, False, 'NONE', 101, 1000], [200, 105, 2305]], ['generated mix 44', [2345, False, 'EXT', 0, 1850], [528, 0, 3383]], ['generated mix 52', [1500, True, 'NONE', 1000, 1250], [256, 945, 3251]]]]
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
commercial das[209, 0, 1604][209, 0, 1604]Passed
declared exactly 100[210, 0, 2210][200, 0, 2200]Failed
residential ext uplift[216, 0, 2376][216, 0, 2376]Passed
fuel exact half[127, 0, 1139][127, 0, 1139]Passed
declared 250[280, 210, 3040][255, 210, 3015]Failed
half cent up[125, 0, 1125][125, 0, 1125]Passed
declared part hundred[210, 105, 2315][200, 105, 2305]Failed
generated mix 8[229, 105, 1963][204, 105, 1938]Failed

SHA-256 / 1d11ccc933735a2265d1c1b6a1955a7e3d042d757beeafbea61dd7d28b6ef70a

3 / The verified repair

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

N = 1
observations = []
def solve(base, residential, das, declared, fuel_bp):
    res = 550 if residential else 0
    das_fee = {'NONE': 0, 'DAS': 395, 'EXT': 510}[das]
    if residential and das != 'NONE':
        das_fee += 100
    subject = base + res + das_fee
    fuel = (subject * fuel_bp + 5000) // 10000
    excess = max(0, declared - 100)
    dv = -(-excess // 100) * 105
    return [fuel, dv, subject + fuel + dv]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['commercial das', [1000, False, 'DAS', 0, 1500], [209, 0, 1604]], ['declared exactly 100', [2000, False, 'NONE', 100, 1000], [200, 0, 2200]], ['residential ext uplift', [1000, True, 'EXT', 0, 1000], [216, 0, 2376]], ['fuel exact half', [1012, False, 'NONE', 0, 1250], [127, 0, 1139]], ['declared 250', [2000, True, 'NONE', 250, 1000], [255, 210, 3015]], ['half cent up', [1000, False, 'NONE', 0, 1250], [125, 0, 1125]], ['declared part hundred', [2000, False, 'NONE', 101, 1000], [200, 105, 2305]], ['generated mix 8', [1234, False, 'DAS', 200, 1250], [204, 105, 1938]]], [['generated mix 6', [1500, True, 'EXT', 100, 1500], [399, 0, 3059]], ['fuel exact half', [1012, False, 'NONE', 0, 1250], [127, 0, 1139]], ['declared exactly 100', [2000, False, 'NONE', 100, 1000], [200, 0, 2200]], ['commercial das', [1000, False, 'DAS', 0, 1500], [209, 0, 1604]], ['half cent up', [1000, False, 'NONE', 0, 1250], [125, 0, 1125]], ['generated mix 10', [1000, False, 'DAS', 50, 1850], [258, 0, 1653]], ['generated mix 18', [1234, True, 'EXT', 1000, 1000], [239, 945, 3578]], ['generated mix 26', [2000, True, 'NONE', 250, 1000], [255, 210, 3015]]], [['generated mix 13', [2000, True, 'EXT', 1000, 1250], [395, 945, 4500]], ['declared 250', [2000, True, 'NONE', 250, 1000], [255, 210, 3015]], ['residential ext uplift', [1000, True, 'EXT', 0, 1000], [216, 0, 2376]], ['fuel exact half', [1012, False, 'NONE', 0, 1250], [127, 0, 1139]], ['declared exactly 100', [2000, False, 'NONE', 100, 1000], [200, 0, 2200]], ['generated mix 21', [1500, False, 'NONE', 250, 1850], [278, 210, 1988]], ['generated mix 29', [1500, True, 'NONE', 50, 1625], [333, 0, 2383]], ['generated mix 37', [2345, False, 'DAS', 1000, 1625], [445, 945, 4130]]], [['generated mix 20', [1000, True, 'DAS', 250, 1500], [307, 210, 2562]], ['generated mix 18', [1234, True, 'EXT', 1000, 1000], [239, 945, 3578]], ['half cent up', [1000, False, 'NONE', 0, 1250], [125, 0, 1125]], ['declared part hundred', [2000, False, 'NONE', 101, 1000], [200, 105, 2305]], ['declared 250', [2000, True, 'NONE', 250, 1000], [255, 210, 3015]], ['residential ext uplift', [1000, True, 'EXT', 0, 1000], [216, 0, 2376]], ['generated mix 33', [2000, True, 'EXT', 101, 1850], [585, 105, 3850]], ['generated mix 41', [1234, True, 'EXT', 101, 1850], [443, 105, 2942]]], [['generated mix 29', [1500, True, 'NONE', 50, 1625], [333, 0, 2383]], ['generated mix 23', [2000, False, 'EXT', 100, 1850], [464, 0, 2974]], ['declared exactly 100', [2000, False, 'NONE', 100, 1000], [200, 0, 2200]], ['commercial das', [1000, False, 'DAS', 0, 1500], [209, 0, 1604]], ['half cent up', [1000, False, 'NONE', 0, 1250], [125, 0, 1125]], ['declared part hundred', [2000, False, 'NONE', 101, 1000], [200, 105, 2305]], ['generated mix 44', [2345, False, 'EXT', 0, 1850], [528, 0, 3383]], ['generated mix 52', [1500, True, 'NONE', 1000, 1250], [256, 945, 3251]]]]
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
commercial das[209, 0, 1604][209, 0, 1604]Passed
declared exactly 100[200, 0, 2200][200, 0, 2200]Passed
residential ext uplift[216, 0, 2376][216, 0, 2376]Passed
fuel exact half[127, 0, 1139][127, 0, 1139]Passed
declared 250[255, 210, 3015][255, 210, 3015]Passed
half cent up[125, 0, 1125][125, 0, 1125]Passed
declared part hundred[200, 105, 2305][200, 105, 2305]Passed
generated mix 8[204, 105, 1938][204, 105, 1938]Passed

SHA-256 / fec4736e5b054ceadfcfc819b4789de58df438794bceb8878e6992903c81de8a

Verification & scope

Stipulated fee amounts and ordering. 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:13.639979+00:00.

Case digest / 2c6b0b97bb166ff50f77507beb744b32c9f40e5bc0e65ea7c0e15d6f26353067