FAILURE MAP
← Case archive

FA-95471 / Shipping rate zone lookup / Open access

Size classes: shortest side used for width rule · case 01

Wide flat boxes escape the additional handling fee.

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

ROOT CAUSE

The width rule tests the shortest side instead of the second longest.

THE FAILURE

The width rule tests the shortest side instead of the second longest.

Unsuccessful approach: Making the comparison inclusive flags boxes exactly 30 inches wide.

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')
    elif L > 48 or s3 > 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 = [[['second side', [[40, 31, 10], 5], ['AHS_DIM']], ['generated mix 31', [[48, 30, 10], 150], ['AHS_WEIGHT']], ['oversize', [[10, 60, 30], 10], ['OVERSIZE']], ['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']], ['length edge', [[48, 20, 10], 5], []], ['generated mix 6', [[110, 108, 110], 70], ['UNSHIPPABLE']]], [['second side', [[40, 31, 10], 5], ['AHS_DIM']], ['generated mix 31', [[48, 30, 10], 150], ['AHS_WEIGHT']], ['oversize and heavy', [[60, 20, 20], 70], ['OVERSIZE', 'AHS_WEIGHT']], ['girth limit', [[110, 10, 10], 5], ['UNSHIPPABLE']], ['oversize', [[10, 60, 30], 10], ['OVERSIZE']], ['weight flags both', [[49, 10, 10], 50.5], ['AHS_DIM', 'AHS_WEIGHT']], ['generated mix 9', [[40, 40, 20], 70], ['OVERSIZE', 'AHS_WEIGHT']], ['generated mix 17', [[80, 80, 100], 70], ['UNSHIPPABLE']]], [['second side', [[40, 31, 10], 5], ['AHS_DIM']], ['generated mix 31', [[48, 30, 10], 150], ['AHS_WEIGHT']], ['exact 130', [[50, 20, 20], 5], ['AHS_DIM']], ['length edge', [[48, 20, 10], 5], []], ['oversize and heavy', [[60, 20, 20], 70], ['OVERSIZE', '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']]], [['second side', [[40, 31, 10], 5], ['AHS_DIM']], ['generated mix 31', [[48, 30, 10], 150], ['AHS_WEIGHT']], ['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']], ['length edge', [[48, 20, 10], 5], []], ['generated mix 32', [[108, 80, 31], 151], ['UNSHIPPABLE']], ['generated mix 40', [[48, 110, 30], 50.5], ['UNSHIPPABLE']]], [['second side', [[40, 31, 10], 5], ['AHS_DIM']], ['generated mix 31', [[48, 30, 10], 150], ['AHS_WEIGHT']], ['girth limit', [[110, 10, 10], 5], ['UNSHIPPABLE']], ['oversize', [[10, 60, 30], 10], ['OVERSIZE']], ['weight flags both', [[49, 10, 10], 50.5], ['AHS_DIM', 'AHS_WEIGHT']], ['too heavy', [[10, 10, 10], 151], ['UNSHIPPABLE']], ['generated mix 43', [[31, 20, 80], 5], ['UNSHIPPABLE']], ['generated mix 51', [[100, 49, 48], 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
second side[]['AHS_DIM']Failed
generated mix 31['AHS_WEIGHT']['AHS_WEIGHT']Passed
oversize['OVERSIZE']['OVERSIZE']Passed
weight flags both['AHS_DIM', 'AHS_WEIGHT']['AHS_DIM', 'AHS_WEIGHT']Passed
too heavy['UNSHIPPABLE']['UNSHIPPABLE']Passed
exact 130['AHS_DIM']['AHS_DIM']Passed
length edge[][]Passed
generated mix 6['UNSHIPPABLE']['UNSHIPPABLE']Passed

SHA-256 / 5fb71d53defdb65e1e1f8e857edd8c3af3f1f7a879b1530bf0dcb6d857f5d32b

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 = [[['second side', [[40, 31, 10], 5], ['AHS_DIM']], ['generated mix 31', [[48, 30, 10], 150], ['AHS_WEIGHT']], ['oversize', [[10, 60, 30], 10], ['OVERSIZE']], ['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']], ['length edge', [[48, 20, 10], 5], []], ['generated mix 6', [[110, 108, 110], 70], ['UNSHIPPABLE']]], [['second side', [[40, 31, 10], 5], ['AHS_DIM']], ['generated mix 31', [[48, 30, 10], 150], ['AHS_WEIGHT']], ['oversize and heavy', [[60, 20, 20], 70], ['OVERSIZE', 'AHS_WEIGHT']], ['girth limit', [[110, 10, 10], 5], ['UNSHIPPABLE']], ['oversize', [[10, 60, 30], 10], ['OVERSIZE']], ['weight flags both', [[49, 10, 10], 50.5], ['AHS_DIM', 'AHS_WEIGHT']], ['generated mix 9', [[40, 40, 20], 70], ['OVERSIZE', 'AHS_WEIGHT']], ['generated mix 17', [[80, 80, 100], 70], ['UNSHIPPABLE']]], [['second side', [[40, 31, 10], 5], ['AHS_DIM']], ['generated mix 31', [[48, 30, 10], 150], ['AHS_WEIGHT']], ['exact 130', [[50, 20, 20], 5], ['AHS_DIM']], ['length edge', [[48, 20, 10], 5], []], ['oversize and heavy', [[60, 20, 20], 70], ['OVERSIZE', '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']]], [['second side', [[40, 31, 10], 5], ['AHS_DIM']], ['generated mix 31', [[48, 30, 10], 150], ['AHS_WEIGHT']], ['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']], ['length edge', [[48, 20, 10], 5], []], ['generated mix 32', [[108, 80, 31], 151], ['UNSHIPPABLE']], ['generated mix 40', [[48, 110, 30], 50.5], ['UNSHIPPABLE']]], [['second side', [[40, 31, 10], 5], ['AHS_DIM']], ['generated mix 31', [[48, 30, 10], 150], ['AHS_WEIGHT']], ['girth limit', [[110, 10, 10], 5], ['UNSHIPPABLE']], ['oversize', [[10, 60, 30], 10], ['OVERSIZE']], ['weight flags both', [[49, 10, 10], 50.5], ['AHS_DIM', 'AHS_WEIGHT']], ['too heavy', [[10, 10, 10], 151], ['UNSHIPPABLE']], ['generated mix 43', [[31, 20, 80], 5], ['UNSHIPPABLE']], ['generated mix 51', [[100, 49, 48], 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
second side['AHS_DIM']['AHS_DIM']Passed
generated mix 31['AHS_DIM', 'AHS_WEIGHT']['AHS_WEIGHT']Failed
oversize['OVERSIZE']['OVERSIZE']Passed
weight flags both['AHS_DIM', 'AHS_WEIGHT']['AHS_DIM', 'AHS_WEIGHT']Passed
too heavy['UNSHIPPABLE']['UNSHIPPABLE']Passed
exact 130['AHS_DIM']['AHS_DIM']Passed
length edge[][]Passed
generated mix 6['UNSHIPPABLE']['UNSHIPPABLE']Passed

SHA-256 / efe9a1635c11c82b030dd70a8d3c5b54eddce9a665246b23b3bba76fa1105d04

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 8 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.

Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.

Member access is invitation-based. Sign in with your invited account to inspect the repair.

Sign in to the archive ↗

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

Case digest / 46be3dac046baafe24504ed18c3c4acfec2fc3aeb0ec86146b00a0ab6ef48a90