FA-95646 / Shipping rate zone lookup / Open access
Destination zones: private carrier quoted to APO · case 01
Ground service is sold to military addresses that only the postal network delivers.
ROOT CAUSE
Military destinations are accepted for any service.
VERIFIED REPAIR
Return MILITARY only for POSTAL service and NO_SERVICE otherwise.
Unsuccessful approach: Inverting the service test refuses postal and accepts private carriers.
Case contract
Military states AA/AE/AP are served only by POSTAL ("MILITARY") else "NO_SERVICE". HI must be ZIP3 967-968 (zone 14); AK must be 995-999 with 995-996 zone 17 and 997-999 zone 18; PR and VI must be 006-009 (zone 22). A state/ZIP3 conflict is "MISMATCH". Other states return base_zone.
Why this case matters
Noncontiguous and military destinations have their own zones and service restrictions.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(zip5, state, base_zone, service):
z3 = int(zip5[:3])
if state in ('AA', 'AE', 'AP'):
return 'MILITARY'
if state == 'HI':
return 14 if 967 <= z3 <= 968 else 'MISMATCH'
if state == 'AK':
if not 995 <= z3 <= 999:
return 'MISMATCH'
return 17 if z3 <= 996 else 18
if state in ('PR', 'VI'):
return 22 if 6 <= z3 <= 9 else 'MISMATCH'
return base_zone
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['military ground', ['96201', 'AP', 5, 'GROUND'], 'NO_SERVICE'], ['military postal', ['09001', 'AE', 5, 'POSTAL'], 'MILITARY'], ['honolulu', ['96813', 'HI', 8, 'GROUND'], 14], ['anchorage', ['99501', 'AK', 8, 'GROUND'], 17], ['ak remote', ['99701', 'AK', 8, 'GROUND'], 18], ['americas military', ['34001', 'AA', 5, 'POSTAL'], 'MILITARY'], ['generated mix 3', ['96701', 'HI', 2, 'AIR'], 14], ['generated mix 11', ['00801', 'VI', 5, 'GROUND'], 22]], [['generated mix 38', ['09001', 'AE', 6, 'AIR'], 'NO_SERVICE'], ['generated mix 15', ['09001', 'AE', 2, 'POSTAL'], 'MILITARY'], ['honolulu', ['96813', 'HI', 8, 'GROUND'], 14], ['anchorage', ['99501', 'AK', 8, 'GROUND'], 17], ['ak remote', ['99701', 'AK', 8, 'GROUND'], 18], ['virgin islands', ['00801', 'VI', 8, 'GROUND'], 22], ['generated mix 5', ['99701', 'AK', 3, 'AIR'], 18], ['generated mix 13', ['34001', 'AA', 4, 'AIR'], 'NO_SERVICE']], [['generated mix 14', ['34001', 'AA', 6, 'AIR'], 'NO_SERVICE'], ['generated mix 36', ['34001', 'AA', 7, 'GROUND'], 'NO_SERVICE'], ['ak 996', ['99601', 'AK', 8, 'GROUND'], 17], ['san juan', ['00901', 'PR', 8, 'GROUND'], 22], ['contiguous', ['10001', 'NY', 5, 'GROUND'], 5], ['military ground', ['96201', 'AP', 5, 'GROUND'], 'NO_SERVICE'], ['generated mix 17', ['10001', 'NY', 2, 'POSTAL'], 2], ['generated mix 25', ['99601', 'AK', 6, 'POSTAL'], 17]], [['generated mix 59', ['09001', 'AE', 5, 'AIR'], 'NO_SERVICE'], ['virgin islands', ['00801', 'VI', 8, 'GROUND'], 22], ['military postal', ['09001', 'AE', 5, 'POSTAL'], 'MILITARY'], ['americas military', ['34001', 'AA', 5, 'POSTAL'], 'MILITARY'], ['hawaii mismatch', ['96901', 'HI', 8, 'GROUND'], 'MISMATCH'], ['generated mix 27', ['96201', 'AP', 6, 'POSTAL'], 'MILITARY'], ['generated mix 35', ['00601', 'PR', 2, 'GROUND'], 22], ['generated mix 43', ['96201', 'AP', 6, 'GROUND'], 'NO_SERVICE']], [['generated mix 36', ['34001', 'AA', 7, 'GROUND'], 'NO_SERVICE'], ['military ground', ['96201', 'AP', 5, 'GROUND'], 'NO_SERVICE'], ['honolulu', ['96813', 'HI', 8, 'GROUND'], 14], ['anchorage', ['99501', 'AK', 8, 'GROUND'], 17], ['ak remote', ['99701', 'AK', 8, 'GROUND'], 18], ['virgin islands', ['00801', 'VI', 8, 'GROUND'], 22], ['generated mix 40', ['99601', 'AK', 7, 'POSTAL'], 17], ['generated mix 48', ['00901', 'PR', 2, 'POSTAL'], 22]]]
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 |
|---|---|---|---|
| military ground | MILITARY | NO_SERVICE | Failed |
| military postal | MILITARY | MILITARY | Passed |
| honolulu | 14 | 14 | Passed |
| anchorage | 17 | 17 | Passed |
| ak remote | 18 | 18 | Passed |
| americas military | MILITARY | MILITARY | Passed |
| generated mix 3 | 14 | 14 | Passed |
| generated mix 11 | 22 | 22 | Passed |
SHA-256 / e0b19b46361f7d580201445980179cfbf3e93e2e45d3fd6ed6948184efb76bf5
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(zip5, state, base_zone, service):
z3 = int(zip5[:3])
if state in ('AA', 'AE', 'AP'):
return 'MILITARY' if service != 'POSTAL' else 'NO_SERVICE'
if state == 'HI':
return 14 if 967 <= z3 <= 968 else 'MISMATCH'
if state == 'AK':
if not 995 <= z3 <= 999:
return 'MISMATCH'
return 17 if z3 <= 996 else 18
if state in ('PR', 'VI'):
return 22 if 6 <= z3 <= 9 else 'MISMATCH'
return base_zone
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['military ground', ['96201', 'AP', 5, 'GROUND'], 'NO_SERVICE'], ['military postal', ['09001', 'AE', 5, 'POSTAL'], 'MILITARY'], ['honolulu', ['96813', 'HI', 8, 'GROUND'], 14], ['anchorage', ['99501', 'AK', 8, 'GROUND'], 17], ['ak remote', ['99701', 'AK', 8, 'GROUND'], 18], ['americas military', ['34001', 'AA', 5, 'POSTAL'], 'MILITARY'], ['generated mix 3', ['96701', 'HI', 2, 'AIR'], 14], ['generated mix 11', ['00801', 'VI', 5, 'GROUND'], 22]], [['generated mix 38', ['09001', 'AE', 6, 'AIR'], 'NO_SERVICE'], ['generated mix 15', ['09001', 'AE', 2, 'POSTAL'], 'MILITARY'], ['honolulu', ['96813', 'HI', 8, 'GROUND'], 14], ['anchorage', ['99501', 'AK', 8, 'GROUND'], 17], ['ak remote', ['99701', 'AK', 8, 'GROUND'], 18], ['virgin islands', ['00801', 'VI', 8, 'GROUND'], 22], ['generated mix 5', ['99701', 'AK', 3, 'AIR'], 18], ['generated mix 13', ['34001', 'AA', 4, 'AIR'], 'NO_SERVICE']], [['generated mix 14', ['34001', 'AA', 6, 'AIR'], 'NO_SERVICE'], ['generated mix 36', ['34001', 'AA', 7, 'GROUND'], 'NO_SERVICE'], ['ak 996', ['99601', 'AK', 8, 'GROUND'], 17], ['san juan', ['00901', 'PR', 8, 'GROUND'], 22], ['contiguous', ['10001', 'NY', 5, 'GROUND'], 5], ['military ground', ['96201', 'AP', 5, 'GROUND'], 'NO_SERVICE'], ['generated mix 17', ['10001', 'NY', 2, 'POSTAL'], 2], ['generated mix 25', ['99601', 'AK', 6, 'POSTAL'], 17]], [['generated mix 59', ['09001', 'AE', 5, 'AIR'], 'NO_SERVICE'], ['virgin islands', ['00801', 'VI', 8, 'GROUND'], 22], ['military postal', ['09001', 'AE', 5, 'POSTAL'], 'MILITARY'], ['americas military', ['34001', 'AA', 5, 'POSTAL'], 'MILITARY'], ['hawaii mismatch', ['96901', 'HI', 8, 'GROUND'], 'MISMATCH'], ['generated mix 27', ['96201', 'AP', 6, 'POSTAL'], 'MILITARY'], ['generated mix 35', ['00601', 'PR', 2, 'GROUND'], 22], ['generated mix 43', ['96201', 'AP', 6, 'GROUND'], 'NO_SERVICE']], [['generated mix 36', ['34001', 'AA', 7, 'GROUND'], 'NO_SERVICE'], ['military ground', ['96201', 'AP', 5, 'GROUND'], 'NO_SERVICE'], ['honolulu', ['96813', 'HI', 8, 'GROUND'], 14], ['anchorage', ['99501', 'AK', 8, 'GROUND'], 17], ['ak remote', ['99701', 'AK', 8, 'GROUND'], 18], ['virgin islands', ['00801', 'VI', 8, 'GROUND'], 22], ['generated mix 40', ['99601', 'AK', 7, 'POSTAL'], 17], ['generated mix 48', ['00901', 'PR', 2, 'POSTAL'], 22]]]
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 |
|---|---|---|---|
| military ground | MILITARY | NO_SERVICE | Failed |
| military postal | NO_SERVICE | MILITARY | Failed |
| honolulu | 14 | 14 | Passed |
| anchorage | 17 | 17 | Passed |
| ak remote | 18 | 18 | Passed |
| americas military | NO_SERVICE | MILITARY | Failed |
| generated mix 3 | 14 | 14 | Passed |
| generated mix 11 | 22 | 22 | Passed |
SHA-256 / cd0b6ad88c6a88942a2ab1e18f7130e05061ea0b539e59e01a9d16505af122ea
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(zip5, state, base_zone, service):
z3 = int(zip5[:3])
if state in ('AA', 'AE', 'AP'):
return 'MILITARY' if service == 'POSTAL' else 'NO_SERVICE'
if state == 'HI':
return 14 if 967 <= z3 <= 968 else 'MISMATCH'
if state == 'AK':
if not 995 <= z3 <= 999:
return 'MISMATCH'
return 17 if z3 <= 996 else 18
if state in ('PR', 'VI'):
return 22 if 6 <= z3 <= 9 else 'MISMATCH'
return base_zone
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['military ground', ['96201', 'AP', 5, 'GROUND'], 'NO_SERVICE'], ['military postal', ['09001', 'AE', 5, 'POSTAL'], 'MILITARY'], ['honolulu', ['96813', 'HI', 8, 'GROUND'], 14], ['anchorage', ['99501', 'AK', 8, 'GROUND'], 17], ['ak remote', ['99701', 'AK', 8, 'GROUND'], 18], ['americas military', ['34001', 'AA', 5, 'POSTAL'], 'MILITARY'], ['generated mix 3', ['96701', 'HI', 2, 'AIR'], 14], ['generated mix 11', ['00801', 'VI', 5, 'GROUND'], 22]], [['generated mix 38', ['09001', 'AE', 6, 'AIR'], 'NO_SERVICE'], ['generated mix 15', ['09001', 'AE', 2, 'POSTAL'], 'MILITARY'], ['honolulu', ['96813', 'HI', 8, 'GROUND'], 14], ['anchorage', ['99501', 'AK', 8, 'GROUND'], 17], ['ak remote', ['99701', 'AK', 8, 'GROUND'], 18], ['virgin islands', ['00801', 'VI', 8, 'GROUND'], 22], ['generated mix 5', ['99701', 'AK', 3, 'AIR'], 18], ['generated mix 13', ['34001', 'AA', 4, 'AIR'], 'NO_SERVICE']], [['generated mix 14', ['34001', 'AA', 6, 'AIR'], 'NO_SERVICE'], ['generated mix 36', ['34001', 'AA', 7, 'GROUND'], 'NO_SERVICE'], ['ak 996', ['99601', 'AK', 8, 'GROUND'], 17], ['san juan', ['00901', 'PR', 8, 'GROUND'], 22], ['contiguous', ['10001', 'NY', 5, 'GROUND'], 5], ['military ground', ['96201', 'AP', 5, 'GROUND'], 'NO_SERVICE'], ['generated mix 17', ['10001', 'NY', 2, 'POSTAL'], 2], ['generated mix 25', ['99601', 'AK', 6, 'POSTAL'], 17]], [['generated mix 59', ['09001', 'AE', 5, 'AIR'], 'NO_SERVICE'], ['virgin islands', ['00801', 'VI', 8, 'GROUND'], 22], ['military postal', ['09001', 'AE', 5, 'POSTAL'], 'MILITARY'], ['americas military', ['34001', 'AA', 5, 'POSTAL'], 'MILITARY'], ['hawaii mismatch', ['96901', 'HI', 8, 'GROUND'], 'MISMATCH'], ['generated mix 27', ['96201', 'AP', 6, 'POSTAL'], 'MILITARY'], ['generated mix 35', ['00601', 'PR', 2, 'GROUND'], 22], ['generated mix 43', ['96201', 'AP', 6, 'GROUND'], 'NO_SERVICE']], [['generated mix 36', ['34001', 'AA', 7, 'GROUND'], 'NO_SERVICE'], ['military ground', ['96201', 'AP', 5, 'GROUND'], 'NO_SERVICE'], ['honolulu', ['96813', 'HI', 8, 'GROUND'], 14], ['anchorage', ['99501', 'AK', 8, 'GROUND'], 17], ['ak remote', ['99701', 'AK', 8, 'GROUND'], 18], ['virgin islands', ['00801', 'VI', 8, 'GROUND'], 22], ['generated mix 40', ['99601', 'AK', 7, 'POSTAL'], 17], ['generated mix 48', ['00901', 'PR', 2, 'POSTAL'], 22]]]
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 |
|---|---|---|---|
| military ground | NO_SERVICE | NO_SERVICE | Passed |
| military postal | MILITARY | MILITARY | Passed |
| honolulu | 14 | 14 | Passed |
| anchorage | 17 | 17 | Passed |
| ak remote | 18 | 18 | Passed |
| americas military | MILITARY | MILITARY | Passed |
| generated mix 3 | 14 | 14 | Passed |
| generated mix 11 | 22 | 22 | Passed |
SHA-256 / beee29e1bb458f30f28dea738e7b860268c8a4da4d0b23b4528b0cfb5da0c4a8
Verification & scope
Stipulated ZIP3 ranges and zone numbers. 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:15.540191+00:00.
Case digest / 77f8a9f30962aba1f34f38f16fb560953502ea00b9ccb0b764f326a1000f8b11