{"abstract":"Alpha-3 codes like \"USA\" are rated as rest of world.","category":"Shipping rate zone lookup","checks":8,"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>\".","evaluation_group":"w2-shipping-zone-intl-groups","failed_approach":"Checking length alone accepts digit codes.","family":"w2-shipping-zone-intl-groups-code-shape","id":"FA-95536","implementations":{"attempt":{"sha256":"d6e2338cfed3a8c3abe97ee9fa0aff243961df67a1b259f341023ef0adb626ea","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(country, service):\n    GROUPS = {'CA': 1, 'MX': 2, 'GB': 3, 'DE': 3, 'FR': 3, 'IE': 3, 'NL': 3, 'JP': 4, 'AU': 5, 'BR': 6}\n    DOMESTIC = {'US', 'PR', 'GU', 'VI', 'AS', 'MP'}\n    EMBARGO = {'CU', 'KP', 'IR', 'SY'}\n    code = country.strip().upper()\n    if code == 'UK':\n        code = 'GB'\n    if code in DOMESTIC:\n        return 'DOMESTIC'\n    if code in EMBARGO:\n        return 'BLOCKED'\n    zone = GROUPS.get(code)\n    if zone is None:\n        if len(code) == 2:\n            zone = 9\n        else:\n            return 'INVALID'\n    if service == 'ECON' and zone == 9:\n        return 'NO_SERVICE'\n    return 'Z%d' % zone\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['alpha3 invalid', ['USA', 'PRIORITY'], 'INVALID'], ['generated mix 4', [' 12 ', 'ECON'], 'INVALID'], ['padded lowercase', [' gb ', 'PRIORITY'], 'Z3'], ['territory', ['PR', 'ECON'], 'DOMESTIC'], ['econ rest of world', ['ZA', 'ECON'], 'NO_SERVICE'], ['digits invalid', ['12', 'PRIORITY'], 'INVALID'], ['uk alias', ['uk', 'ECON'], 'Z3'], ['generated mix 5', ['\\tcu ', 'ECON'], 'BLOCKED']], [['alpha3 invalid', ['USA', 'PRIORITY'], 'INVALID'], ['generated mix 51', [' 12', 'ECON'], 'INVALID'], ['pacific territory', ['GU', 'PRIORITY'], 'DOMESTIC'], ['priority rest of world', ['ZA', 'PRIORITY'], 'Z9'], ['embargo lowercase', ['cu', 'PRIORITY'], 'BLOCKED'], ['padded lowercase', [' gb ', 'PRIORITY'], 'Z3'], ['generated mix 7', ['uk\\n', 'ECON'], 'Z3'], ['generated mix 15', ['\\tBR', 'PRIORITY'], 'Z6']], [['alpha3 invalid', ['USA', 'PRIORITY'], 'INVALID'], ['generated mix 21', ['\\tZ9 ', 'PRIORITY'], 'INVALID'], ['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 27', ['IE\\n', 'PRIORITY'], 'Z3']], [['alpha3 invalid', ['USA', 'PRIORITY'], 'INVALID'], ['digits invalid', ['12', 'PRIORITY'], 'INVALID'], ['uk alias', ['uk', 'ECON'], 'Z3'], ['pacific territory', ['GU', 'PRIORITY'], 'DOMESTIC'], ['priority rest of world', ['ZA', 'PRIORITY'], 'Z9'], ['canada econ', ['CA', 'ECON'], 'Z1'], ['generated mix 30', ['JP\\n', 'PRIORITY'], 'Z4'], ['generated mix 38', ['\\tBR\\n', 'PRIORITY'], 'Z6']], [['alpha3 invalid', ['USA', 'PRIORITY'], 'INVALID'], ['generated mix 42', ['\\tZ9 ', 'PRIORITY'], 'INVALID'], ['pacific territory', ['GU', 'PRIORITY'], 'DOMESTIC'], ['priority rest of world', ['ZA', 'PRIORITY'], 'Z9'], ['embargo lowercase', ['cu', 'PRIORITY'], 'BLOCKED'], ['padded lowercase', [' gb ', 'PRIORITY'], 'Z3'], ['generated mix 40', ['\\tIE\\n', 'PRIORITY'], 'Z3'], ['generated mix 49', [' de', 'ECON'], 'Z3']]]\nfor label, args, expected in fixtures[N-1]:\n    check(label, solve(*args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"broken":{"sha256":"38cfc5bf8c65eb03e0ba5889437fa5422bc93204a9a65db7be2a771a644c9f5e","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(country, service):\n    GROUPS = {'CA': 1, 'MX': 2, 'GB': 3, 'DE': 3, 'FR': 3, 'IE': 3, 'NL': 3, 'JP': 4, 'AU': 5, 'BR': 6}\n    DOMESTIC = {'US', 'PR', 'GU', 'VI', 'AS', 'MP'}\n    EMBARGO = {'CU', 'KP', 'IR', 'SY'}\n    code = country.strip().upper()\n    if code == 'UK':\n        code = 'GB'\n    if code in DOMESTIC:\n        return 'DOMESTIC'\n    if code in EMBARGO:\n        return 'BLOCKED'\n    zone = GROUPS.get(code)\n    if zone is None:\n        if code.isalpha():\n            zone = 9\n        else:\n            return 'INVALID'\n    if service == 'ECON' and zone == 9:\n        return 'NO_SERVICE'\n    return 'Z%d' % zone\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['alpha3 invalid', ['USA', 'PRIORITY'], 'INVALID'], ['generated mix 4', [' 12 ', 'ECON'], 'INVALID'], ['padded lowercase', [' gb ', 'PRIORITY'], 'Z3'], ['territory', ['PR', 'ECON'], 'DOMESTIC'], ['econ rest of world', ['ZA', 'ECON'], 'NO_SERVICE'], ['digits invalid', ['12', 'PRIORITY'], 'INVALID'], ['uk alias', ['uk', 'ECON'], 'Z3'], ['generated mix 5', ['\\tcu ', 'ECON'], 'BLOCKED']], [['alpha3 invalid', ['USA', 'PRIORITY'], 'INVALID'], ['generated mix 51', [' 12', 'ECON'], 'INVALID'], ['pacific territory', ['GU', 'PRIORITY'], 'DOMESTIC'], ['priority rest of world', ['ZA', 'PRIORITY'], 'Z9'], ['embargo lowercase', ['cu', 'PRIORITY'], 'BLOCKED'], ['padded lowercase', [' gb ', 'PRIORITY'], 'Z3'], ['generated mix 7', ['uk\\n', 'ECON'], 'Z3'], ['generated mix 15', ['\\tBR', 'PRIORITY'], 'Z6']], [['alpha3 invalid', ['USA', 'PRIORITY'], 'INVALID'], ['generated mix 21', ['\\tZ9 ', 'PRIORITY'], 'INVALID'], ['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 27', ['IE\\n', 'PRIORITY'], 'Z3']], [['alpha3 invalid', ['USA', 'PRIORITY'], 'INVALID'], ['digits invalid', ['12', 'PRIORITY'], 'INVALID'], ['uk alias', ['uk', 'ECON'], 'Z3'], ['pacific territory', ['GU', 'PRIORITY'], 'DOMESTIC'], ['priority rest of world', ['ZA', 'PRIORITY'], 'Z9'], ['canada econ', ['CA', 'ECON'], 'Z1'], ['generated mix 30', ['JP\\n', 'PRIORITY'], 'Z4'], ['generated mix 38', ['\\tBR\\n', 'PRIORITY'], 'Z6']], [['alpha3 invalid', ['USA', 'PRIORITY'], 'INVALID'], ['generated mix 42', ['\\tZ9 ', 'PRIORITY'], 'INVALID'], ['pacific territory', ['GU', 'PRIORITY'], 'DOMESTIC'], ['priority rest of world', ['ZA', 'PRIORITY'], 'Z9'], ['embargo lowercase', ['cu', 'PRIORITY'], 'BLOCKED'], ['padded lowercase', [' gb ', 'PRIORITY'], 'Z3'], ['generated mix 40', ['\\tIE\\n', 'PRIORITY'], 'Z3'], ['generated mix 49', [' de', 'ECON'], 'Z3']]]\nfor label, args, expected in fixtures[N-1]:\n    check(label, solve(*args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"fixed":{"sha256":"eb4664482e0b3629a1627e8c98d08f06622bf23beae591f98c57ca5048c4f14a","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(country, service):\n    GROUPS = {'CA': 1, 'MX': 2, 'GB': 3, 'DE': 3, 'FR': 3, 'IE': 3, 'NL': 3, 'JP': 4, 'AU': 5, 'BR': 6}\n    DOMESTIC = {'US', 'PR', 'GU', 'VI', 'AS', 'MP'}\n    EMBARGO = {'CU', 'KP', 'IR', 'SY'}\n    code = country.strip().upper()\n    if code == 'UK':\n        code = 'GB'\n    if code in DOMESTIC:\n        return 'DOMESTIC'\n    if code in EMBARGO:\n        return 'BLOCKED'\n    zone = GROUPS.get(code)\n    if zone is None:\n        if len(code) == 2 and code.isalpha():\n            zone = 9\n        else:\n            return 'INVALID'\n    if service == 'ECON' and zone == 9:\n        return 'NO_SERVICE'\n    return 'Z%d' % zone\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['alpha3 invalid', ['USA', 'PRIORITY'], 'INVALID'], ['generated mix 4', [' 12 ', 'ECON'], 'INVALID'], ['padded lowercase', [' gb ', 'PRIORITY'], 'Z3'], ['territory', ['PR', 'ECON'], 'DOMESTIC'], ['econ rest of world', ['ZA', 'ECON'], 'NO_SERVICE'], ['digits invalid', ['12', 'PRIORITY'], 'INVALID'], ['uk alias', ['uk', 'ECON'], 'Z3'], ['generated mix 5', ['\\tcu ', 'ECON'], 'BLOCKED']], [['alpha3 invalid', ['USA', 'PRIORITY'], 'INVALID'], ['generated mix 51', [' 12', 'ECON'], 'INVALID'], ['pacific territory', ['GU', 'PRIORITY'], 'DOMESTIC'], ['priority rest of world', ['ZA', 'PRIORITY'], 'Z9'], ['embargo lowercase', ['cu', 'PRIORITY'], 'BLOCKED'], ['padded lowercase', [' gb ', 'PRIORITY'], 'Z3'], ['generated mix 7', ['uk\\n', 'ECON'], 'Z3'], ['generated mix 15', ['\\tBR', 'PRIORITY'], 'Z6']], [['alpha3 invalid', ['USA', 'PRIORITY'], 'INVALID'], ['generated mix 21', ['\\tZ9 ', 'PRIORITY'], 'INVALID'], ['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 27', ['IE\\n', 'PRIORITY'], 'Z3']], [['alpha3 invalid', ['USA', 'PRIORITY'], 'INVALID'], ['digits invalid', ['12', 'PRIORITY'], 'INVALID'], ['uk alias', ['uk', 'ECON'], 'Z3'], ['pacific territory', ['GU', 'PRIORITY'], 'DOMESTIC'], ['priority rest of world', ['ZA', 'PRIORITY'], 'Z9'], ['canada econ', ['CA', 'ECON'], 'Z1'], ['generated mix 30', ['JP\\n', 'PRIORITY'], 'Z4'], ['generated mix 38', ['\\tBR\\n', 'PRIORITY'], 'Z6']], [['alpha3 invalid', ['USA', 'PRIORITY'], 'INVALID'], ['generated mix 42', ['\\tZ9 ', 'PRIORITY'], 'INVALID'], ['pacific territory', ['GU', 'PRIORITY'], 'DOMESTIC'], ['priority rest of world', ['ZA', 'PRIORITY'], 'Z9'], ['embargo lowercase', ['cu', 'PRIORITY'], 'BLOCKED'], ['padded lowercase', [' gb ', 'PRIORITY'], 'Z3'], ['generated mix 40', ['\\tIE\\n', 'PRIORITY'], 'Z3'], ['generated mix 49', [' de', 'ECON'], 'Z3']]]\nfor label, args, expected in fixtures[N-1]:\n    check(label, solve(*args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"}},"limitations":"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.","method":"Deterministic executable model with adversarial boundary fixtures.","provenance":{"created_by":"Failure Map","dependencies":"Python standard library","family":"w2-shipping-zone-intl-groups-code-shape","generated_at":"2026-09-29T14:52:14.572134+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"International rating maps destination countries to zone groups.","repair":"Only two-letter alphabetic codes fall back to group 9.","root_cause":"The fallback group accepts any alphabetic string regardless of length.","sha256":"6c45843ccbd28155ca5869e6b904ede6927cc6f31e46327e2e2af0e534029075","title":"International zones: three-letter codes accepted · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":43.406,"exit_code":1,"observations":[{"actual":"INVALID","check":"alpha3 invalid","expected":"INVALID","passed":true},{"actual":"NO_SERVICE","check":"generated mix 4","expected":"INVALID","passed":false},{"actual":"Z3","check":"padded lowercase","expected":"Z3","passed":true},{"actual":"DOMESTIC","check":"territory","expected":"DOMESTIC","passed":true},{"actual":"NO_SERVICE","check":"econ rest of world","expected":"NO_SERVICE","passed":true},{"actual":"Z9","check":"digits invalid","expected":"INVALID","passed":false},{"actual":"Z3","check":"uk alias","expected":"Z3","passed":true},{"actual":"BLOCKED","check":"generated mix 5","expected":"BLOCKED","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"alpha3 invalid\", \"actual\": \"INVALID\", \"expected\": \"INVALID\", \"passed\": true}, {\"check\": \"generated mix 4\", \"actual\": \"NO_SERVICE\", \"expected\": \"INVALID\", \"passed\": false}, {\"check\": \"padded lowercase\", \"actual\": \"Z3\", \"expected\": \"Z3\", \"passed\": true}, {\"check\": \"territory\", \"actual\": \"DOMESTIC\", \"expected\": \"DOMESTIC\", \"passed\": true}, {\"check\": \"econ rest of world\", \"actual\": \"NO_SERVICE\", \"expected\": \"NO_SERVICE\", \"passed\": true}, {\"check\": \"digits invalid\", \"actual\": \"Z9\", \"expected\": \"INVALID\", \"passed\": false}, {\"check\": \"uk alias\", \"actual\": \"Z3\", \"expected\": \"Z3\", \"passed\": true}, {\"check\": \"generated mix 5\", \"actual\": \"BLOCKED\", \"expected\": \"BLOCKED\", \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":41.557,"exit_code":1,"observations":[{"actual":"Z9","check":"alpha3 invalid","expected":"INVALID","passed":false},{"actual":"INVALID","check":"generated mix 4","expected":"INVALID","passed":true},{"actual":"Z3","check":"padded lowercase","expected":"Z3","passed":true},{"actual":"DOMESTIC","check":"territory","expected":"DOMESTIC","passed":true},{"actual":"NO_SERVICE","check":"econ rest of world","expected":"NO_SERVICE","passed":true},{"actual":"INVALID","check":"digits invalid","expected":"INVALID","passed":true},{"actual":"Z3","check":"uk alias","expected":"Z3","passed":true},{"actual":"BLOCKED","check":"generated mix 5","expected":"BLOCKED","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"alpha3 invalid\", \"actual\": \"Z9\", \"expected\": \"INVALID\", \"passed\": false}, {\"check\": \"generated mix 4\", \"actual\": \"INVALID\", \"expected\": \"INVALID\", \"passed\": true}, {\"check\": \"padded lowercase\", \"actual\": \"Z3\", \"expected\": \"Z3\", \"passed\": true}, {\"check\": \"territory\", \"actual\": \"DOMESTIC\", \"expected\": \"DOMESTIC\", \"passed\": true}, {\"check\": \"econ rest of world\", \"actual\": \"NO_SERVICE\", \"expected\": \"NO_SERVICE\", \"passed\": true}, {\"check\": \"digits invalid\", \"actual\": \"INVALID\", \"expected\": \"INVALID\", \"passed\": true}, {\"check\": \"uk alias\", \"actual\": \"Z3\", \"expected\": \"Z3\", \"passed\": true}, {\"check\": \"generated mix 5\", \"actual\": \"BLOCKED\", \"expected\": \"BLOCKED\", \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":38.927,"exit_code":0,"observations":[{"actual":"INVALID","check":"alpha3 invalid","expected":"INVALID","passed":true},{"actual":"INVALID","check":"generated mix 4","expected":"INVALID","passed":true},{"actual":"Z3","check":"padded lowercase","expected":"Z3","passed":true},{"actual":"DOMESTIC","check":"territory","expected":"DOMESTIC","passed":true},{"actual":"NO_SERVICE","check":"econ rest of world","expected":"NO_SERVICE","passed":true},{"actual":"INVALID","check":"digits invalid","expected":"INVALID","passed":true},{"actual":"Z3","check":"uk alias","expected":"Z3","passed":true},{"actual":"BLOCKED","check":"generated mix 5","expected":"BLOCKED","passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"alpha3 invalid\", \"actual\": \"INVALID\", \"expected\": \"INVALID\", \"passed\": true}, {\"check\": \"generated mix 4\", \"actual\": \"INVALID\", \"expected\": \"INVALID\", \"passed\": true}, {\"check\": \"padded lowercase\", \"actual\": \"Z3\", \"expected\": \"Z3\", \"passed\": true}, {\"check\": \"territory\", \"actual\": \"DOMESTIC\", \"expected\": \"DOMESTIC\", \"passed\": true}, {\"check\": \"econ rest of world\", \"actual\": \"NO_SERVICE\", \"expected\": \"NO_SERVICE\", \"passed\": true}, {\"check\": \"digits invalid\", \"actual\": \"INVALID\", \"expected\": \"INVALID\", \"passed\": true}, {\"check\": \"uk alias\", \"actual\": \"Z3\", \"expected\": \"Z3\", \"passed\": true}, {\"check\": \"generated mix 5\", \"actual\": \"BLOCKED\", \"expected\": \"BLOCKED\", \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}