FA-95456 / Shipping rate zone lookup / Open access
Size classes: first listed side taken as length · case 01
Girth is computed around the longest side when dims are not entered longest-first.
ROOT CAUSE
Dimensions are used in entry order instead of sorting the longest side first.
VERIFIED REPAIR
Sort dimensions descending; the longest is length.
Unsuccessful approach: Sorting ascending treats the shortest side as length.
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 = dims
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']], ['second side', [[40, 31, 10], 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']], ['weight flags both', [[49, 10, 10], 50.5], ['AHS_DIM', 'AHS_WEIGHT']], ['generated mix 6', [[110, 108, 110], 70], ['UNSHIPPABLE']], ['generated mix 14', [[80, 80, 40], 70], ['UNSHIPPABLE']]], [['generated mix 1', [[10, 40, 40], 50], ['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']], ['second side', [[40, 31, 10], 5], ['AHS_DIM']], ['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']]], [['generated mix 46', [[10, 10, 100], 150], ['OVERSIZE', 'AHS_WEIGHT']], ['oversize', [[10, 60, 30], 10], ['OVERSIZE']], ['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']]], [['oversize', [[10, 60, 30], 10], ['OVERSIZE']], ['exact 130', [[50, 20, 20], 5], ['AHS_DIM']], ['oversize and heavy', [[60, 20, 20], 70], ['OVERSIZE', 'AHS_WEIGHT']], ['girth limit', [[110, 10, 10], 5], ['UNSHIPPABLE']], ['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']]], [['generated mix 1', [[10, 40, 40], 50], ['OVERSIZE']], ['generated mix 46', [[10, 10, 100], 150], ['OVERSIZE', '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']], ['length edge', [[48, 20, 10], 5], []], ['generated mix 42', [[80, 60, 49], 49.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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| oversize | ['UNSHIPPABLE'] | ['OVERSIZE'] | Failed |
| second side | ['AHS_DIM'] | ['AHS_DIM'] | Passed |
| length edge | [] | [] | Passed |
| oversize and heavy | ['OVERSIZE', 'AHS_WEIGHT'] | ['OVERSIZE', 'AHS_WEIGHT'] | Passed |
| girth limit | ['UNSHIPPABLE'] | ['UNSHIPPABLE'] | Passed |
| weight flags both | ['AHS_DIM', 'AHS_WEIGHT'] | ['AHS_DIM', 'AHS_WEIGHT'] | Passed |
| generated mix 6 | ['UNSHIPPABLE'] | ['UNSHIPPABLE'] | Passed |
| generated mix 14 | ['UNSHIPPABLE'] | ['UNSHIPPABLE'] | Passed |
SHA-256 / 78ae06733f0df1823bf02b2bf35c435d765d49c23308e40d0a90a4f1f98fc8ee
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)
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']], ['second side', [[40, 31, 10], 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']], ['weight flags both', [[49, 10, 10], 50.5], ['AHS_DIM', 'AHS_WEIGHT']], ['generated mix 6', [[110, 108, 110], 70], ['UNSHIPPABLE']], ['generated mix 14', [[80, 80, 40], 70], ['UNSHIPPABLE']]], [['generated mix 1', [[10, 40, 40], 50], ['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']], ['second side', [[40, 31, 10], 5], ['AHS_DIM']], ['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']]], [['generated mix 46', [[10, 10, 100], 150], ['OVERSIZE', 'AHS_WEIGHT']], ['oversize', [[10, 60, 30], 10], ['OVERSIZE']], ['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']]], [['oversize', [[10, 60, 30], 10], ['OVERSIZE']], ['exact 130', [[50, 20, 20], 5], ['AHS_DIM']], ['oversize and heavy', [[60, 20, 20], 70], ['OVERSIZE', 'AHS_WEIGHT']], ['girth limit', [[110, 10, 10], 5], ['UNSHIPPABLE']], ['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']]], [['generated mix 1', [[10, 40, 40], 50], ['OVERSIZE']], ['generated mix 46', [[10, 10, 100], 150], ['OVERSIZE', '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']], ['length edge', [[48, 20, 10], 5], []], ['generated mix 42', [[80, 60, 49], 49.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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| oversize | ['UNSHIPPABLE'] | ['OVERSIZE'] | Failed |
| second side | ['OVERSIZE'] | ['AHS_DIM'] | Failed |
| length edge | ['OVERSIZE'] | [] | Failed |
| oversize and heavy | ['UNSHIPPABLE'] | ['OVERSIZE', 'AHS_WEIGHT'] | Failed |
| girth limit | ['UNSHIPPABLE'] | ['UNSHIPPABLE'] | Passed |
| weight flags both | ['AHS_WEIGHT'] | ['AHS_DIM', 'AHS_WEIGHT'] | Failed |
| generated mix 6 | ['UNSHIPPABLE'] | ['UNSHIPPABLE'] | Passed |
| generated mix 14 | ['UNSHIPPABLE'] | ['UNSHIPPABLE'] | Passed |
SHA-256 / 3a6291641a18eacd7d94990c0e2001b0f354603cc90d47b4244bd5011ca17dd8
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']], ['second side', [[40, 31, 10], 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']], ['weight flags both', [[49, 10, 10], 50.5], ['AHS_DIM', 'AHS_WEIGHT']], ['generated mix 6', [[110, 108, 110], 70], ['UNSHIPPABLE']], ['generated mix 14', [[80, 80, 40], 70], ['UNSHIPPABLE']]], [['generated mix 1', [[10, 40, 40], 50], ['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']], ['second side', [[40, 31, 10], 5], ['AHS_DIM']], ['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']]], [['generated mix 46', [[10, 10, 100], 150], ['OVERSIZE', 'AHS_WEIGHT']], ['oversize', [[10, 60, 30], 10], ['OVERSIZE']], ['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']]], [['oversize', [[10, 60, 30], 10], ['OVERSIZE']], ['exact 130', [[50, 20, 20], 5], ['AHS_DIM']], ['oversize and heavy', [[60, 20, 20], 70], ['OVERSIZE', 'AHS_WEIGHT']], ['girth limit', [[110, 10, 10], 5], ['UNSHIPPABLE']], ['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']]], [['generated mix 1', [[10, 40, 40], 50], ['OVERSIZE']], ['generated mix 46', [[10, 10, 100], 150], ['OVERSIZE', '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']], ['length edge', [[48, 20, 10], 5], []], ['generated mix 42', [[80, 60, 49], 49.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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| oversize | ['OVERSIZE'] | ['OVERSIZE'] | Passed |
| second side | ['AHS_DIM'] | ['AHS_DIM'] | Passed |
| length edge | [] | [] | Passed |
| oversize and heavy | ['OVERSIZE', 'AHS_WEIGHT'] | ['OVERSIZE', 'AHS_WEIGHT'] | Passed |
| girth limit | ['UNSHIPPABLE'] | ['UNSHIPPABLE'] | Passed |
| weight flags both | ['AHS_DIM', 'AHS_WEIGHT'] | ['AHS_DIM', 'AHS_WEIGHT'] | Passed |
| generated mix 6 | ['UNSHIPPABLE'] | ['UNSHIPPABLE'] | Passed |
| generated mix 14 | ['UNSHIPPABLE'] | ['UNSHIPPABLE'] | Passed |
SHA-256 / a85469f39116a9a69f00cbcb65251c29a4cfefc55c0f95d95230d0af41399035
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.803695+00:00.
Case digest / 86066bd78a54a2954d36fdc8747764a993ac359e007f91773cb532bd44dddc5e