FAILURE MAP
← Case archive

FA-95466 / Shipping rate zone lookup / Open access

Size classes: oversize also billed dimension handling · case 01

Oversize parcels are double charged with an additional handling dimension fee.

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

ROOT CAUSE

The dimension handling test is not in the else branch of the oversize test.

VERIFIED REPAIR

Apply AHS_DIM only when the parcel is not OVERSIZE.

Unsuccessful approach: Suppressing the weight fee for any coded parcel drops a charge that is independent.

Case contract

dims inches (any order), weight lb. length = longest side, girth = 2*(other two). UNSHIPPABLE if length > 108, length+girth > 165 or weight > 150. Otherwise OVERSIZE if length+girth > 130; else AHS_DIM if length > 48 or second-longest > 30. AHS_WEIGHT if weight > 50 (independent). Return list of codes.

Why this case matters

Size and weight classes decide handling fees and service eligibility.

1 / The failure

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

N = 1
observations = []
def solve(dims, weight):
    L, s2, s3 = sorted(dims, reverse=True)
    size = L + 2 * (s2 + s3)
    if L > 108 or size > 165 or weight > 150:
        return ['UNSHIPPABLE']
    codes = []
    if size > 130:
        codes.append('OVERSIZE')
    if L > 48 or s2 > 30:
        codes.append('AHS_DIM')
    if weight > 50:
        codes.append('AHS_WEIGHT')
    return codes
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['oversize', [[10, 60, 30], 10], ['OVERSIZE']], ['oversize and heavy', [[60, 20, 20], 70], ['OVERSIZE', 'AHS_WEIGHT']], ['second side', [[40, 31, 10], 5], ['AHS_DIM']], ['weight flags both', [[49, 10, 10], 50.5], ['AHS_DIM', 'AHS_WEIGHT']], ['girth limit', [[110, 10, 10], 5], ['UNSHIPPABLE']], ['length edge', [[48, 20, 10], 5], []], ['generated mix 6', [[110, 108, 110], 70], ['UNSHIPPABLE']], ['generated mix 14', [[80, 80, 40], 70], ['UNSHIPPABLE']]], [['oversize', [[10, 60, 30], 10], ['OVERSIZE']], ['oversize and heavy', [[60, 20, 20], 70], ['OVERSIZE', 'AHS_WEIGHT']], ['too heavy', [[10, 10, 10], 151], ['UNSHIPPABLE']], ['exact 130', [[50, 20, 20], 5], ['AHS_DIM']], ['length edge', [[48, 20, 10], 5], []], ['generated mix 9', [[40, 40, 20], 70], ['OVERSIZE', 'AHS_WEIGHT']], ['generated mix 17', [[80, 80, 100], 70], ['UNSHIPPABLE']], ['generated mix 25', [[40, 108, 100], 151], ['UNSHIPPABLE']]], [['oversize', [[10, 60, 30], 10], ['OVERSIZE']], ['oversize and heavy', [[60, 20, 20], 70], ['OVERSIZE', 'AHS_WEIGHT']], ['second side', [[40, 31, 10], 5], ['AHS_DIM']], ['weight flags both', [[49, 10, 10], 50.5], ['AHS_DIM', 'AHS_WEIGHT']], ['girth limit', [[110, 10, 10], 5], ['UNSHIPPABLE']], ['generated mix 20', [[100, 60, 60], 50.5], ['UNSHIPPABLE']], ['generated mix 28', [[100, 31, 40], 5], ['UNSHIPPABLE']], ['generated mix 36', [[80, 60, 80], 151], ['UNSHIPPABLE']]], [['oversize', [[10, 60, 30], 10], ['OVERSIZE']], ['oversize and heavy', [[60, 20, 20], 70], ['OVERSIZE', 'AHS_WEIGHT']], ['too heavy', [[10, 10, 10], 151], ['UNSHIPPABLE']], ['exact 130', [[50, 20, 20], 5], ['AHS_DIM']], ['length edge', [[48, 20, 10], 5], []], ['generated mix 31', [[48, 30, 10], 150], ['AHS_WEIGHT']], ['generated mix 39', [[60, 60, 49], 70], ['UNSHIPPABLE']], ['generated mix 47', [[60, 110, 10], 150], ['UNSHIPPABLE']]], [['oversize', [[10, 60, 30], 10], ['OVERSIZE']], ['oversize and heavy', [[60, 20, 20], 70], ['OVERSIZE', 'AHS_WEIGHT']], ['second side', [[40, 31, 10], 5], ['AHS_DIM']], ['weight flags both', [[49, 10, 10], 50.5], ['AHS_DIM', 'AHS_WEIGHT']], ['girth limit', [[110, 10, 10], 5], ['UNSHIPPABLE']], ['generated mix 42', [[80, 60, 49], 49.5], ['UNSHIPPABLE']], ['generated mix 50', [[48, 10, 60], 151], ['UNSHIPPABLE']], ['generated mix 58', [[108, 80, 49], 50.5], ['UNSHIPPABLE']]]]
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
oversize['OVERSIZE', 'AHS_DIM']['OVERSIZE']Failed
oversize and heavy['OVERSIZE', 'AHS_DIM', 'AHS_WEIGHT']['OVERSIZE', 'AHS_WEIGHT']Failed
second side['AHS_DIM']['AHS_DIM']Passed
weight flags both['AHS_DIM', 'AHS_WEIGHT']['AHS_DIM', 'AHS_WEIGHT']Passed
girth limit['UNSHIPPABLE']['UNSHIPPABLE']Passed
length edge[][]Passed
generated mix 6['UNSHIPPABLE']['UNSHIPPABLE']Passed
generated mix 14['UNSHIPPABLE']['UNSHIPPABLE']Passed

SHA-256 / a41adaffeccedf09f77f92b78e69ef6b991599e0b7277cb1a3a22c0127a7f265

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(dims, weight):
    L, s2, s3 = sorted(dims, reverse=True)
    size = L + 2 * (s2 + s3)
    if L > 108 or size > 165 or weight > 150:
        return ['UNSHIPPABLE']
    codes = []
    if size > 130:
        codes.append('OVERSIZE')
    elif L > 48 or s2 > 30:
        codes.append('AHS_DIM')
    if weight > 50 and not codes:
        codes.append('AHS_WEIGHT')
    return codes
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['oversize', [[10, 60, 30], 10], ['OVERSIZE']], ['oversize and heavy', [[60, 20, 20], 70], ['OVERSIZE', 'AHS_WEIGHT']], ['second side', [[40, 31, 10], 5], ['AHS_DIM']], ['weight flags both', [[49, 10, 10], 50.5], ['AHS_DIM', 'AHS_WEIGHT']], ['girth limit', [[110, 10, 10], 5], ['UNSHIPPABLE']], ['length edge', [[48, 20, 10], 5], []], ['generated mix 6', [[110, 108, 110], 70], ['UNSHIPPABLE']], ['generated mix 14', [[80, 80, 40], 70], ['UNSHIPPABLE']]], [['oversize', [[10, 60, 30], 10], ['OVERSIZE']], ['oversize and heavy', [[60, 20, 20], 70], ['OVERSIZE', 'AHS_WEIGHT']], ['too heavy', [[10, 10, 10], 151], ['UNSHIPPABLE']], ['exact 130', [[50, 20, 20], 5], ['AHS_DIM']], ['length edge', [[48, 20, 10], 5], []], ['generated mix 9', [[40, 40, 20], 70], ['OVERSIZE', 'AHS_WEIGHT']], ['generated mix 17', [[80, 80, 100], 70], ['UNSHIPPABLE']], ['generated mix 25', [[40, 108, 100], 151], ['UNSHIPPABLE']]], [['oversize', [[10, 60, 30], 10], ['OVERSIZE']], ['oversize and heavy', [[60, 20, 20], 70], ['OVERSIZE', 'AHS_WEIGHT']], ['second side', [[40, 31, 10], 5], ['AHS_DIM']], ['weight flags both', [[49, 10, 10], 50.5], ['AHS_DIM', 'AHS_WEIGHT']], ['girth limit', [[110, 10, 10], 5], ['UNSHIPPABLE']], ['generated mix 20', [[100, 60, 60], 50.5], ['UNSHIPPABLE']], ['generated mix 28', [[100, 31, 40], 5], ['UNSHIPPABLE']], ['generated mix 36', [[80, 60, 80], 151], ['UNSHIPPABLE']]], [['oversize', [[10, 60, 30], 10], ['OVERSIZE']], ['oversize and heavy', [[60, 20, 20], 70], ['OVERSIZE', 'AHS_WEIGHT']], ['too heavy', [[10, 10, 10], 151], ['UNSHIPPABLE']], ['exact 130', [[50, 20, 20], 5], ['AHS_DIM']], ['length edge', [[48, 20, 10], 5], []], ['generated mix 31', [[48, 30, 10], 150], ['AHS_WEIGHT']], ['generated mix 39', [[60, 60, 49], 70], ['UNSHIPPABLE']], ['generated mix 47', [[60, 110, 10], 150], ['UNSHIPPABLE']]], [['oversize', [[10, 60, 30], 10], ['OVERSIZE']], ['oversize and heavy', [[60, 20, 20], 70], ['OVERSIZE', 'AHS_WEIGHT']], ['second side', [[40, 31, 10], 5], ['AHS_DIM']], ['weight flags both', [[49, 10, 10], 50.5], ['AHS_DIM', 'AHS_WEIGHT']], ['girth limit', [[110, 10, 10], 5], ['UNSHIPPABLE']], ['generated mix 42', [[80, 60, 49], 49.5], ['UNSHIPPABLE']], ['generated mix 50', [[48, 10, 60], 151], ['UNSHIPPABLE']], ['generated mix 58', [[108, 80, 49], 50.5], ['UNSHIPPABLE']]]]
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
oversize['OVERSIZE']['OVERSIZE']Passed
oversize and heavy['OVERSIZE']['OVERSIZE', 'AHS_WEIGHT']Failed
second side['AHS_DIM']['AHS_DIM']Passed
weight flags both['AHS_DIM']['AHS_DIM', 'AHS_WEIGHT']Failed
girth limit['UNSHIPPABLE']['UNSHIPPABLE']Passed
length edge[][]Passed
generated mix 6['UNSHIPPABLE']['UNSHIPPABLE']Passed
generated mix 14['UNSHIPPABLE']['UNSHIPPABLE']Passed

SHA-256 / c330afd6b4def3522ca219e9804e4f756487df6cb0707e9343fda86d74ff26bf

3 / The verified repair

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

N = 1
observations = []
def solve(dims, weight):
    L, s2, s3 = sorted(dims, reverse=True)
    size = L + 2 * (s2 + s3)
    if L > 108 or size > 165 or weight > 150:
        return ['UNSHIPPABLE']
    codes = []
    if size > 130:
        codes.append('OVERSIZE')
    elif L > 48 or s2 > 30:
        codes.append('AHS_DIM')
    if weight > 50:
        codes.append('AHS_WEIGHT')
    return codes
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['oversize', [[10, 60, 30], 10], ['OVERSIZE']], ['oversize and heavy', [[60, 20, 20], 70], ['OVERSIZE', 'AHS_WEIGHT']], ['second side', [[40, 31, 10], 5], ['AHS_DIM']], ['weight flags both', [[49, 10, 10], 50.5], ['AHS_DIM', 'AHS_WEIGHT']], ['girth limit', [[110, 10, 10], 5], ['UNSHIPPABLE']], ['length edge', [[48, 20, 10], 5], []], ['generated mix 6', [[110, 108, 110], 70], ['UNSHIPPABLE']], ['generated mix 14', [[80, 80, 40], 70], ['UNSHIPPABLE']]], [['oversize', [[10, 60, 30], 10], ['OVERSIZE']], ['oversize and heavy', [[60, 20, 20], 70], ['OVERSIZE', 'AHS_WEIGHT']], ['too heavy', [[10, 10, 10], 151], ['UNSHIPPABLE']], ['exact 130', [[50, 20, 20], 5], ['AHS_DIM']], ['length edge', [[48, 20, 10], 5], []], ['generated mix 9', [[40, 40, 20], 70], ['OVERSIZE', 'AHS_WEIGHT']], ['generated mix 17', [[80, 80, 100], 70], ['UNSHIPPABLE']], ['generated mix 25', [[40, 108, 100], 151], ['UNSHIPPABLE']]], [['oversize', [[10, 60, 30], 10], ['OVERSIZE']], ['oversize and heavy', [[60, 20, 20], 70], ['OVERSIZE', 'AHS_WEIGHT']], ['second side', [[40, 31, 10], 5], ['AHS_DIM']], ['weight flags both', [[49, 10, 10], 50.5], ['AHS_DIM', 'AHS_WEIGHT']], ['girth limit', [[110, 10, 10], 5], ['UNSHIPPABLE']], ['generated mix 20', [[100, 60, 60], 50.5], ['UNSHIPPABLE']], ['generated mix 28', [[100, 31, 40], 5], ['UNSHIPPABLE']], ['generated mix 36', [[80, 60, 80], 151], ['UNSHIPPABLE']]], [['oversize', [[10, 60, 30], 10], ['OVERSIZE']], ['oversize and heavy', [[60, 20, 20], 70], ['OVERSIZE', 'AHS_WEIGHT']], ['too heavy', [[10, 10, 10], 151], ['UNSHIPPABLE']], ['exact 130', [[50, 20, 20], 5], ['AHS_DIM']], ['length edge', [[48, 20, 10], 5], []], ['generated mix 31', [[48, 30, 10], 150], ['AHS_WEIGHT']], ['generated mix 39', [[60, 60, 49], 70], ['UNSHIPPABLE']], ['generated mix 47', [[60, 110, 10], 150], ['UNSHIPPABLE']]], [['oversize', [[10, 60, 30], 10], ['OVERSIZE']], ['oversize and heavy', [[60, 20, 20], 70], ['OVERSIZE', 'AHS_WEIGHT']], ['second side', [[40, 31, 10], 5], ['AHS_DIM']], ['weight flags both', [[49, 10, 10], 50.5], ['AHS_DIM', 'AHS_WEIGHT']], ['girth limit', [[110, 10, 10], 5], ['UNSHIPPABLE']], ['generated mix 42', [[80, 60, 49], 49.5], ['UNSHIPPABLE']], ['generated mix 50', [[48, 10, 60], 151], ['UNSHIPPABLE']], ['generated mix 58', [[108, 80, 49], 50.5], ['UNSHIPPABLE']]]]
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
oversize['OVERSIZE']['OVERSIZE']Passed
oversize and heavy['OVERSIZE', 'AHS_WEIGHT']['OVERSIZE', 'AHS_WEIGHT']Passed
second side['AHS_DIM']['AHS_DIM']Passed
weight flags both['AHS_DIM', 'AHS_WEIGHT']['AHS_DIM', 'AHS_WEIGHT']Passed
girth limit['UNSHIPPABLE']['UNSHIPPABLE']Passed
length edge[][]Passed
generated mix 6['UNSHIPPABLE']['UNSHIPPABLE']Passed
generated mix 14['UNSHIPPABLE']['UNSHIPPABLE']Passed

SHA-256 / 44f29621164a778e627e0075c2e3655a95829dd23f63ff7c428bf67ef94186f8

Verification & scope

Stipulated thresholds; not a carrier service guide. 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.926608+00:00.

Case digest / 5e61d669a998b6a283832ccfa104c05329adbebc5c4a4e7e7063fe794b323fdf