FAILURE MAP
← Case archive

FA-95531 / Shipping rate zone lookup / Open access

International zones: economy sold to unsupported group · case 01

Economy service is quoted to rest-of-world destinations where it is not offered.

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

ROOT CAUSE

The group 9 economy restriction is not enforced.

THE FAILURE

The group 9 economy restriction is not enforced.

Unsuccessful approach: Applying the restriction to PRIORITY blocks the only service that is offered.

Case contract

country is an ISO alpha-2 code in any case with optional whitespace; "UK" is an alias of GB. US territories (US, PR, GU, VI, AS, MP) are DOMESTIC; embargoed CU, KP, IR, SY are BLOCKED. Listed countries map to groups 1-6; any other two-letter code is group 9; anything else INVALID. ECON is not offered to group 9 (NO_SERVICE). Return "Z<group>".

Why this case matters

International rating maps destination countries to zone groups.

1 / The failure

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

N = 1
observations = []
def solve(country, service):
    GROUPS = {'CA': 1, 'MX': 2, 'GB': 3, 'DE': 3, 'FR': 3, 'IE': 3, 'NL': 3, 'JP': 4, 'AU': 5, 'BR': 6}
    DOMESTIC = {'US', 'PR', 'GU', 'VI', 'AS', 'MP'}
    EMBARGO = {'CU', 'KP', 'IR', 'SY'}
    code = country.strip().upper()
    if code == 'UK':
        code = 'GB'
    if code in DOMESTIC:
        return 'DOMESTIC'
    if code in EMBARGO:
        return 'BLOCKED'
    zone = GROUPS.get(code)
    if zone is None:
        if len(code) == 2 and code.isalpha():
            zone = 9
        else:
            return 'INVALID'
    return 'Z%d' % zone
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['econ rest of world', ['ZA', 'ECON'], 'NO_SERVICE'], ['priority rest of world', ['ZA', 'PRIORITY'], 'Z9'], ['padded lowercase', [' gb ', 'PRIORITY'], 'Z3'], ['territory', ['PR', 'ECON'], 'DOMESTIC'], ['alpha3 invalid', ['USA', 'PRIORITY'], 'INVALID'], ['embargo lowercase', ['cu', 'PRIORITY'], 'BLOCKED'], ['uk alias', ['uk', 'ECON'], 'Z3'], ['generated mix 5', ['\tcu ', 'ECON'], 'BLOCKED']], [['generated mix 8', [' nz ', 'ECON'], 'NO_SERVICE'], ['generated mix 66', [' nz ', 'PRIORITY'], 'Z9'], ['pacific territory', ['GU', 'PRIORITY'], 'DOMESTIC'], ['priority rest of world', ['ZA', 'PRIORITY'], 'Z9'], ['digits invalid', ['12', 'PRIORITY'], 'INVALID'], ['canada econ', ['CA', 'ECON'], 'Z1'], ['generated mix 6', ['\tUK', 'PRIORITY'], 'Z3'], ['generated mix 15', ['\tBR', 'PRIORITY'], 'Z6']], [['econ rest of world', ['ZA', 'ECON'], 'NO_SERVICE'], ['generated mix 41', [' ZA ', 'PRIORITY'], 'Z9'], ['digits invalid', ['12', 'PRIORITY'], 'INVALID'], ['canada econ', ['CA', 'ECON'], 'Z1'], ['uk alias', ['uk', 'ECON'], 'Z3'], ['pacific territory', ['GU', 'PRIORITY'], 'DOMESTIC'], ['generated mix 18', [' US\n', 'ECON'], 'DOMESTIC'], ['generated mix 26', ['\tau\n', 'PRIORITY'], 'Z5']], [['generated mix 8', [' nz ', 'ECON'], 'NO_SERVICE'], ['canada econ', ['CA', 'ECON'], 'Z1'], ['uk alias', ['uk', 'ECON'], 'Z3'], ['pacific territory', ['GU', 'PRIORITY'], 'DOMESTIC'], ['priority rest of world', ['ZA', 'PRIORITY'], 'Z9'], ['generated mix 29', ['ca\n', 'PRIORITY'], 'Z1'], ['generated mix 37', ['UK\n', 'ECON'], 'Z3'], ['generated mix 45', [' BR', 'ECON'], 'Z6']], [['econ rest of world', ['ZA', 'ECON'], 'NO_SERVICE'], ['pacific territory', ['GU', 'PRIORITY'], 'DOMESTIC'], ['alpha3 invalid', ['USA', 'PRIORITY'], 'INVALID'], ['embargo lowercase', ['cu', 'PRIORITY'], 'BLOCKED'], ['padded lowercase', [' gb ', 'PRIORITY'], 'Z3'], ['generated mix 40', ['\tIE\n', 'PRIORITY'], 'Z3'], ['generated mix 48', ['\tBR\n', 'PRIORITY'], 'Z6'], ['generated mix 56', [' 12', 'PRIORITY'], 'INVALID']]]
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
econ rest of worldZ9NO_SERVICEFailed
priority rest of worldZ9Z9Passed
padded lowercaseZ3Z3Passed
territoryDOMESTICDOMESTICPassed
alpha3 invalidINVALIDINVALIDPassed
embargo lowercaseBLOCKEDBLOCKEDPassed
uk aliasZ3Z3Passed
generated mix 5BLOCKEDBLOCKEDPassed

SHA-256 / 8287b038acaf4381bb73dcadf2517c17dd8477fb0067c52bf7252e19265ae2c5

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(country, service):
    GROUPS = {'CA': 1, 'MX': 2, 'GB': 3, 'DE': 3, 'FR': 3, 'IE': 3, 'NL': 3, 'JP': 4, 'AU': 5, 'BR': 6}
    DOMESTIC = {'US', 'PR', 'GU', 'VI', 'AS', 'MP'}
    EMBARGO = {'CU', 'KP', 'IR', 'SY'}
    code = country.strip().upper()
    if code == 'UK':
        code = 'GB'
    if code in DOMESTIC:
        return 'DOMESTIC'
    if code in EMBARGO:
        return 'BLOCKED'
    zone = GROUPS.get(code)
    if zone is None:
        if len(code) == 2 and code.isalpha():
            zone = 9
        else:
            return 'INVALID'
    if service == 'PRIORITY' and zone == 9:
        return 'NO_SERVICE'
    return 'Z%d' % zone
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['econ rest of world', ['ZA', 'ECON'], 'NO_SERVICE'], ['priority rest of world', ['ZA', 'PRIORITY'], 'Z9'], ['padded lowercase', [' gb ', 'PRIORITY'], 'Z3'], ['territory', ['PR', 'ECON'], 'DOMESTIC'], ['alpha3 invalid', ['USA', 'PRIORITY'], 'INVALID'], ['embargo lowercase', ['cu', 'PRIORITY'], 'BLOCKED'], ['uk alias', ['uk', 'ECON'], 'Z3'], ['generated mix 5', ['\tcu ', 'ECON'], 'BLOCKED']], [['generated mix 8', [' nz ', 'ECON'], 'NO_SERVICE'], ['generated mix 66', [' nz ', 'PRIORITY'], 'Z9'], ['pacific territory', ['GU', 'PRIORITY'], 'DOMESTIC'], ['priority rest of world', ['ZA', 'PRIORITY'], 'Z9'], ['digits invalid', ['12', 'PRIORITY'], 'INVALID'], ['canada econ', ['CA', 'ECON'], 'Z1'], ['generated mix 6', ['\tUK', 'PRIORITY'], 'Z3'], ['generated mix 15', ['\tBR', 'PRIORITY'], 'Z6']], [['econ rest of world', ['ZA', 'ECON'], 'NO_SERVICE'], ['generated mix 41', [' ZA ', 'PRIORITY'], 'Z9'], ['digits invalid', ['12', 'PRIORITY'], 'INVALID'], ['canada econ', ['CA', 'ECON'], 'Z1'], ['uk alias', ['uk', 'ECON'], 'Z3'], ['pacific territory', ['GU', 'PRIORITY'], 'DOMESTIC'], ['generated mix 18', [' US\n', 'ECON'], 'DOMESTIC'], ['generated mix 26', ['\tau\n', 'PRIORITY'], 'Z5']], [['generated mix 8', [' nz ', 'ECON'], 'NO_SERVICE'], ['canada econ', ['CA', 'ECON'], 'Z1'], ['uk alias', ['uk', 'ECON'], 'Z3'], ['pacific territory', ['GU', 'PRIORITY'], 'DOMESTIC'], ['priority rest of world', ['ZA', 'PRIORITY'], 'Z9'], ['generated mix 29', ['ca\n', 'PRIORITY'], 'Z1'], ['generated mix 37', ['UK\n', 'ECON'], 'Z3'], ['generated mix 45', [' BR', 'ECON'], 'Z6']], [['econ rest of world', ['ZA', 'ECON'], 'NO_SERVICE'], ['pacific territory', ['GU', 'PRIORITY'], 'DOMESTIC'], ['alpha3 invalid', ['USA', 'PRIORITY'], 'INVALID'], ['embargo lowercase', ['cu', 'PRIORITY'], 'BLOCKED'], ['padded lowercase', [' gb ', 'PRIORITY'], 'Z3'], ['generated mix 40', ['\tIE\n', 'PRIORITY'], 'Z3'], ['generated mix 48', ['\tBR\n', 'PRIORITY'], 'Z6'], ['generated mix 56', [' 12', 'PRIORITY'], 'INVALID']]]
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
econ rest of worldZ9NO_SERVICEFailed
priority rest of worldNO_SERVICEZ9Failed
padded lowercaseZ3Z3Passed
territoryDOMESTICDOMESTICPassed
alpha3 invalidINVALIDINVALIDPassed
embargo lowercaseBLOCKEDBLOCKEDPassed
uk aliasZ3Z3Passed
generated mix 5BLOCKEDBLOCKEDPassed

SHA-256 / c312632a0ce58b3a48076c465cb5974178972028a99e947d859690febd06589d

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 country table; not a sanctions or carrier coverage list. 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:14.534471+00:00.

Case digest / 589104fa1ee010c105ad2839de169c2d31cfad85853a9aa050c766a2c62686c7