FAILURE MAP
← Case archive

FA-95461 / Shipping rate zone lookup / Open access

Size classes: girth not doubled · case 01

Parcels far above the oversize threshold are treated as standard.

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

ROOT CAUSE

Girth is the sum of the two shorter sides instead of twice that sum.

VERIFIED REPAIR

Girth is 2*(width + height).

Unsuccessful approach: Doubling only the second side still undercounts girth.

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 + 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']]], [['generated mix 21', [[49, 48, 10], 50.5], ['OVERSIZE', 'AHS_WEIGHT']], ['generated mix 43', [[31, 20, 80], 5], ['UNSHIPPABLE']], ['weight flags both', [[49, 10, 10], 50.5], ['AHS_DIM', 'AHS_WEIGHT']], ['too heavy', [[10, 10, 10], 151], ['UNSHIPPABLE']], ['exact 130', [[50, 20, 20], 5], ['AHS_DIM']], ['second side', [[40, 31, 10], 5], ['AHS_DIM']], ['generated mix 8', [[49, 48, 20], 50.5], ['UNSHIPPABLE']], ['generated mix 16', [[30, 31, 100], 151], ['UNSHIPPABLE']]], [['generated mix 43', [[31, 20, 80], 5], ['UNSHIPPABLE']], ['generated mix 72', [[60, 40, 20], 70], ['UNSHIPPABLE']], ['girth limit', [[110, 10, 10], 5], ['UNSHIPPABLE']], ['oversize', [[10, 60, 30], 10], ['OVERSIZE']], ['length edge', [[48, 20, 10], 5], []], ['oversize and heavy', [[60, 20, 20], 70], ['OVERSIZE', 'AHS_WEIGHT']], ['generated mix 19', [[49, 100, 60], 70], ['UNSHIPPABLE']], ['generated mix 27', [[10, 60, 100], 150], ['UNSHIPPABLE']]], [['generated mix 70', [[31, 31, 48], 50.5], ['UNSHIPPABLE']], ['generated mix 8', [[49, 48, 20], 50.5], ['UNSHIPPABLE']], ['second side', [[40, 31, 10], 5], ['AHS_DIM']], ['weight flags both', [[49, 10, 10], 50.5], ['AHS_DIM', 'AHS_WEIGHT']], ['too heavy', [[10, 10, 10], 151], ['UNSHIPPABLE']], ['exact 130', [[50, 20, 20], 5], ['AHS_DIM']], ['generated mix 31', [[48, 30, 10], 150], ['AHS_WEIGHT']], ['generated mix 39', [[60, 60, 49], 70], ['UNSHIPPABLE']]], [['oversize and heavy', [[60, 20, 20], 70], ['OVERSIZE', 'AHS_WEIGHT']], ['generated mix 55', [[31, 30, 60], 150], ['UNSHIPPABLE']], ['girth limit', [[110, 10, 10], 5], ['UNSHIPPABLE']], ['oversize', [[10, 60, 30], 10], ['OVERSIZE']], ['length edge', [[48, 20, 10], 5], []], ['too heavy', [[10, 10, 10], 151], ['UNSHIPPABLE']], ['generated mix 42', [[80, 60, 49], 49.5], ['UNSHIPPABLE']], ['generated mix 50', [[48, 10, 60], 151], ['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['AHS_DIM']['OVERSIZE']Failed
oversize and heavy['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 / 2788254cb78068c4a0ea0859e7917b8898e10a0f43af8b844cacd0865c76d037

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:
        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']]], [['generated mix 21', [[49, 48, 10], 50.5], ['OVERSIZE', 'AHS_WEIGHT']], ['generated mix 43', [[31, 20, 80], 5], ['UNSHIPPABLE']], ['weight flags both', [[49, 10, 10], 50.5], ['AHS_DIM', 'AHS_WEIGHT']], ['too heavy', [[10, 10, 10], 151], ['UNSHIPPABLE']], ['exact 130', [[50, 20, 20], 5], ['AHS_DIM']], ['second side', [[40, 31, 10], 5], ['AHS_DIM']], ['generated mix 8', [[49, 48, 20], 50.5], ['UNSHIPPABLE']], ['generated mix 16', [[30, 31, 100], 151], ['UNSHIPPABLE']]], [['generated mix 43', [[31, 20, 80], 5], ['UNSHIPPABLE']], ['generated mix 72', [[60, 40, 20], 70], ['UNSHIPPABLE']], ['girth limit', [[110, 10, 10], 5], ['UNSHIPPABLE']], ['oversize', [[10, 60, 30], 10], ['OVERSIZE']], ['length edge', [[48, 20, 10], 5], []], ['oversize and heavy', [[60, 20, 20], 70], ['OVERSIZE', 'AHS_WEIGHT']], ['generated mix 19', [[49, 100, 60], 70], ['UNSHIPPABLE']], ['generated mix 27', [[10, 60, 100], 150], ['UNSHIPPABLE']]], [['generated mix 70', [[31, 31, 48], 50.5], ['UNSHIPPABLE']], ['generated mix 8', [[49, 48, 20], 50.5], ['UNSHIPPABLE']], ['second side', [[40, 31, 10], 5], ['AHS_DIM']], ['weight flags both', [[49, 10, 10], 50.5], ['AHS_DIM', 'AHS_WEIGHT']], ['too heavy', [[10, 10, 10], 151], ['UNSHIPPABLE']], ['exact 130', [[50, 20, 20], 5], ['AHS_DIM']], ['generated mix 31', [[48, 30, 10], 150], ['AHS_WEIGHT']], ['generated mix 39', [[60, 60, 49], 70], ['UNSHIPPABLE']]], [['oversize and heavy', [[60, 20, 20], 70], ['OVERSIZE', 'AHS_WEIGHT']], ['generated mix 55', [[31, 30, 60], 150], ['UNSHIPPABLE']], ['girth limit', [[110, 10, 10], 5], ['UNSHIPPABLE']], ['oversize', [[10, 60, 30], 10], ['OVERSIZE']], ['length edge', [[48, 20, 10], 5], []], ['too heavy', [[10, 10, 10], 151], ['UNSHIPPABLE']], ['generated mix 42', [[80, 60, 49], 49.5], ['UNSHIPPABLE']], ['generated mix 50', [[48, 10, 60], 151], ['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['AHS_DIM']['OVERSIZE']Failed
oversize and heavy['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 / ffe2f5e85f92cd3ac60286e27f974151472c8760b991f104809b92c2467d4106

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']]], [['generated mix 21', [[49, 48, 10], 50.5], ['OVERSIZE', 'AHS_WEIGHT']], ['generated mix 43', [[31, 20, 80], 5], ['UNSHIPPABLE']], ['weight flags both', [[49, 10, 10], 50.5], ['AHS_DIM', 'AHS_WEIGHT']], ['too heavy', [[10, 10, 10], 151], ['UNSHIPPABLE']], ['exact 130', [[50, 20, 20], 5], ['AHS_DIM']], ['second side', [[40, 31, 10], 5], ['AHS_DIM']], ['generated mix 8', [[49, 48, 20], 50.5], ['UNSHIPPABLE']], ['generated mix 16', [[30, 31, 100], 151], ['UNSHIPPABLE']]], [['generated mix 43', [[31, 20, 80], 5], ['UNSHIPPABLE']], ['generated mix 72', [[60, 40, 20], 70], ['UNSHIPPABLE']], ['girth limit', [[110, 10, 10], 5], ['UNSHIPPABLE']], ['oversize', [[10, 60, 30], 10], ['OVERSIZE']], ['length edge', [[48, 20, 10], 5], []], ['oversize and heavy', [[60, 20, 20], 70], ['OVERSIZE', 'AHS_WEIGHT']], ['generated mix 19', [[49, 100, 60], 70], ['UNSHIPPABLE']], ['generated mix 27', [[10, 60, 100], 150], ['UNSHIPPABLE']]], [['generated mix 70', [[31, 31, 48], 50.5], ['UNSHIPPABLE']], ['generated mix 8', [[49, 48, 20], 50.5], ['UNSHIPPABLE']], ['second side', [[40, 31, 10], 5], ['AHS_DIM']], ['weight flags both', [[49, 10, 10], 50.5], ['AHS_DIM', 'AHS_WEIGHT']], ['too heavy', [[10, 10, 10], 151], ['UNSHIPPABLE']], ['exact 130', [[50, 20, 20], 5], ['AHS_DIM']], ['generated mix 31', [[48, 30, 10], 150], ['AHS_WEIGHT']], ['generated mix 39', [[60, 60, 49], 70], ['UNSHIPPABLE']]], [['oversize and heavy', [[60, 20, 20], 70], ['OVERSIZE', 'AHS_WEIGHT']], ['generated mix 55', [[31, 30, 60], 150], ['UNSHIPPABLE']], ['girth limit', [[110, 10, 10], 5], ['UNSHIPPABLE']], ['oversize', [[10, 60, 30], 10], ['OVERSIZE']], ['length edge', [[48, 20, 10], 5], []], ['too heavy', [[10, 10, 10], 151], ['UNSHIPPABLE']], ['generated mix 42', [[80, 60, 49], 49.5], ['UNSHIPPABLE']], ['generated mix 50', [[48, 10, 60], 151], ['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 / 62dcac5c05adaa3aa2e3e97cdd7bcf95924e6211068d1f5020528eb624d443c8

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.886816+00:00.

Case digest / 4b84d7e8027c30daffbe73df33051dd54783390dd909d0322ccd38eb1c981eaa