{"abstract":"Identifiers without an alphabetic country code are checksummed as if they were ISINs.","category":"Check-digit algorithms","checks":8,"contract":"Input a 12-character ISIN: two uppercase ASCII letters (country), nine uppercase alphanumerics, one check digit; anything else is \"malformed\". Letters expand to two digits (A=10 .. Z=35), then Luhn doubling starts at the rightmost digit of the expanded 11-character payload. Return [computed check digit, whether it matches].","contract_signature":"s","evaluation_group":"w2-check_digit_algorithms-isin-check","failed_approach":"Checking only the first character still admits a digit in the second country position.","family":"w2-check_digit_algorithms-isin-check-country-prefix-gate","id":"FA-72381","implementations":{"attempt":{"sha256":"90e3b2fb9245afc7fe34d7339428e8813c8e1e9f64b85d140cd6dc33f9389495","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(s):\n    if len(s) != 12 or not s.isascii() or not s[0].isalpha() or not s[0].isupper():\n        return 'malformed'\n    if not s[2:11].isalnum() or s[2:11] != s[2:11].upper() or not s[11].isdigit():\n        return 'malformed'\n    digits = ''\n    for ch in s[:11]:\n        digits += ch if ch.isdigit() else str(ord(ch) - 55)\n    total = 0\n    for i, ch in enumerate(reversed(digits)):\n        d = int(ch)\n        if i % 2 == 0:\n            d *= 2\n            if d > 9:\n                d -= 9\n        total += d\n    check = (10 - total % 10) % 10\n    return [check, check == int(s[11])]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression [\"1S0378331005\"]', ['1S0378331005'], 'malformed'], ['regression [\"U10378331005\"]', ['U10378331005'], 'malformed'], ['control [\"US4V5PGS4IX8\"]', ['US4V5PGS4IX8'], [0, False]], ['control [\"GBOV8F5J6090\"]', ['GBOV8F5J6090'], [7, False]], ['control [\"DEC85GG2TSS1\"]', ['DEC85GG2TSS1'], [4, False]], ['control [\"JPFWKDL124I1\"]', ['JPFWKDL124I1'], [1, True]], ['control [\"CHXVXSVIT016\"]', ['CHXVXSVIT016'], [1, False]], ['control [\"FRLWNIYHPT37\"]', ['FRLWNIYHPT37'], [5, False]]], [['regression [\"U10378331005\"]', ['U10378331005'], 'malformed'], ['regression [\"1S0378331005\"]', ['1S0378331005'], 'malformed'], ['control [\"FRLWNIYHPT37\"]', ['FRLWNIYHPT37'], [5, False]], ['control [\"XS0K4JDSXBN1\"]', ['XS0K4JDSXBN1'], [4, False]], ['control [\"NL5BVKR8BB60\"]', ['NL5BVKR8BB60'], [3, False]], ['control [\"AUKWRNHD2XR3\"]', ['AUKWRNHD2XR3'], [8, False]], ['control [\"CA3CKMM2IAN8\"]', ['CA3CKMM2IAN8'], [0, False]], ['control [\"US6754047769\"]', ['US6754047769'], [8, False]]], [['regression [\"1S0378331005\"]', ['1S0378331005'], 'malformed'], ['regression [\"U10378331005\"]', ['U10378331005'], 'malformed'], ['control [\"US6754047769\"]', ['US6754047769'], [8, False]], ['control [\"IE9141151847\"]', ['IE9141151847'], [0, False]], ['control [\"LU7763909076\"]', ['LU7763909076'], [8, False]], ['control [\"KY3791880781\"]', ['KY3791880781'], [4, False]], ['control [\"BM9170095145\"]', ['BM9170095145'], [7, False]], ['control [\"US0378331005\"]', ['US0378331005'], [5, True]]], [['regression [\"U10378331005\"]', ['U10378331005'], 'malformed'], ['regression [\"1S0378331005\"]', ['1S0378331005'], 'malformed'], ['control [\"US0378331005\"]', ['US0378331005'], [5, True]], ['control [\"US5949181045\"]', ['US5949181045'], [5, True]], ['control [\"GB0002634946\"]', ['GB0002634946'], [6, True]], ['control [\"AU0000XVGZA3\"]', ['AU0000XVGZA3'], [3, True]], ['control [\"DE000BAY0017\"]', ['DE000BAY0017'], [7, True]], ['control [\"US037833100\"]', ['US037833100'], 'malformed']], [['regression [\"1S0378331005\"]', ['1S0378331005'], 'malformed'], ['regression [\"U10378331005\"]', ['U10378331005'], 'malformed'], ['control [\"US037833100\"]', ['US037833100'], 'malformed'], ['control [\"us0378331005\"]', ['us0378331005'], 'malformed'], ['control [\"US03783310a5\"]', ['US03783310a5'], 'malformed'], ['control [\"12Q037833100\"]', ['12Q037833100'], 'malformed'], ['control [\"XS2021832634\"]', ['XS2021832634'], [4, True]], ['control [\"US38259P5089\"]', ['US38259P5089'], [9, True]]]]\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":"06ea00a8ea8828b11c5c36aa44b1a10bed5dff1082d7b3382049049b94d9f6b6","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(s):\n    if len(s) != 12 or not s.isascii() or not s[:2].isupper():\n        return 'malformed'\n    if not s[2:11].isalnum() or s[2:11] != s[2:11].upper() or not s[11].isdigit():\n        return 'malformed'\n    digits = ''\n    for ch in s[:11]:\n        digits += ch if ch.isdigit() else str(ord(ch) - 55)\n    total = 0\n    for i, ch in enumerate(reversed(digits)):\n        d = int(ch)\n        if i % 2 == 0:\n            d *= 2\n            if d > 9:\n                d -= 9\n        total += d\n    check = (10 - total % 10) % 10\n    return [check, check == int(s[11])]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression [\"1S0378331005\"]', ['1S0378331005'], 'malformed'], ['regression [\"U10378331005\"]', ['U10378331005'], 'malformed'], ['control [\"US4V5PGS4IX8\"]', ['US4V5PGS4IX8'], [0, False]], ['control [\"GBOV8F5J6090\"]', ['GBOV8F5J6090'], [7, False]], ['control [\"DEC85GG2TSS1\"]', ['DEC85GG2TSS1'], [4, False]], ['control [\"JPFWKDL124I1\"]', ['JPFWKDL124I1'], [1, True]], ['control [\"CHXVXSVIT016\"]', ['CHXVXSVIT016'], [1, False]], ['control [\"FRLWNIYHPT37\"]', ['FRLWNIYHPT37'], [5, False]]], [['regression [\"U10378331005\"]', ['U10378331005'], 'malformed'], ['regression [\"1S0378331005\"]', ['1S0378331005'], 'malformed'], ['control [\"FRLWNIYHPT37\"]', ['FRLWNIYHPT37'], [5, False]], ['control [\"XS0K4JDSXBN1\"]', ['XS0K4JDSXBN1'], [4, False]], ['control [\"NL5BVKR8BB60\"]', ['NL5BVKR8BB60'], [3, False]], ['control [\"AUKWRNHD2XR3\"]', ['AUKWRNHD2XR3'], [8, False]], ['control [\"CA3CKMM2IAN8\"]', ['CA3CKMM2IAN8'], [0, False]], ['control [\"US6754047769\"]', ['US6754047769'], [8, False]]], [['regression [\"1S0378331005\"]', ['1S0378331005'], 'malformed'], ['regression [\"U10378331005\"]', ['U10378331005'], 'malformed'], ['control [\"US6754047769\"]', ['US6754047769'], [8, False]], ['control [\"IE9141151847\"]', ['IE9141151847'], [0, False]], ['control [\"LU7763909076\"]', ['LU7763909076'], [8, False]], ['control [\"KY3791880781\"]', ['KY3791880781'], [4, False]], ['control [\"BM9170095145\"]', ['BM9170095145'], [7, False]], ['control [\"US0378331005\"]', ['US0378331005'], [5, True]]], [['regression [\"U10378331005\"]', ['U10378331005'], 'malformed'], ['regression [\"1S0378331005\"]', ['1S0378331005'], 'malformed'], ['control [\"US0378331005\"]', ['US0378331005'], [5, True]], ['control [\"US5949181045\"]', ['US5949181045'], [5, True]], ['control [\"GB0002634946\"]', ['GB0002634946'], [6, True]], ['control [\"AU0000XVGZA3\"]', ['AU0000XVGZA3'], [3, True]], ['control [\"DE000BAY0017\"]', ['DE000BAY0017'], [7, True]], ['control [\"US037833100\"]', ['US037833100'], 'malformed']], [['regression [\"1S0378331005\"]', ['1S0378331005'], 'malformed'], ['regression [\"U10378331005\"]', ['U10378331005'], 'malformed'], ['control [\"US037833100\"]', ['US037833100'], 'malformed'], ['control [\"us0378331005\"]', ['us0378331005'], 'malformed'], ['control [\"US03783310a5\"]', ['US03783310a5'], 'malformed'], ['control [\"12Q037833100\"]', ['12Q037833100'], 'malformed'], ['control [\"XS2021832634\"]', ['XS2021832634'], [4, True]], ['control [\"US38259P5089\"]', ['US38259P5089'], [9, True]]]]\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":"A deterministic, bounded teaching model of the named scheme under the stated contract; not a certified validator. 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-check_digit_algorithms-isin-check-country-prefix-gate","generated_at":"2026-09-29T14:48:37.932315+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Securities settlement systems reject ISINs whose check digit does not match before routing trades.","root_cause":"The alphabetic test on the two-character country code was dropped.","sha256":"28d02e10bfc1f0fa9e2388e0d813a625f1cdd9692a4aff467966ca791595bb8b","title":"ISIN country prefix accepts a digit · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verified":true,"visibility":"public","verification":{"attempt":{"elapsed_ms":40.816,"exit_code":1,"observations":[{"actual":"malformed","check":"regression [\"1S0378331005\"]","expected":"malformed","passed":true},{"actual":[9,false],"check":"regression [\"U10378331005\"]","expected":"malformed","passed":false},{"actual":[0,false],"check":"control [\"US4V5PGS4IX8\"]","expected":[0,false],"passed":true},{"actual":[7,false],"check":"control [\"GBOV8F5J6090\"]","expected":[7,false],"passed":true},{"actual":[4,false],"check":"control [\"DEC85GG2TSS1\"]","expected":[4,false],"passed":true},{"actual":[1,true],"check":"control [\"JPFWKDL124I1\"]","expected":[1,true],"passed":true},{"actual":[1,false],"check":"control [\"CHXVXSVIT016\"]","expected":[1,false],"passed":true},{"actual":[5,false],"check":"control [\"FRLWNIYHPT37\"]","expected":[5,false],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression [\\\"1S0378331005\\\"]\", \"actual\": \"malformed\", \"expected\": \"malformed\", \"passed\": true}, {\"check\": \"regression [\\\"U10378331005\\\"]\", \"actual\": [9, false], \"expected\": \"malformed\", \"passed\": false}, {\"check\": \"control [\\\"US4V5PGS4IX8\\\"]\", \"actual\": [0, false], \"expected\": [0, false], \"passed\": true}, {\"check\": \"control [\\\"GBOV8F5J6090\\\"]\", \"actual\": [7, false], \"expected\": [7, false], \"passed\": true}, {\"check\": \"control [\\\"DEC85GG2TSS1\\\"]\", \"actual\": [4, false], \"expected\": [4, false], \"passed\": true}, {\"check\": \"control [\\\"JPFWKDL124I1\\\"]\", \"actual\": [1, true], \"expected\": [1, true], \"passed\": true}, {\"check\": \"control [\\\"CHXVXSVIT016\\\"]\", \"actual\": [1, false], \"expected\": [1, false], \"passed\": true}, {\"check\": \"control [\\\"FRLWNIYHPT37\\\"]\", \"actual\": [5, false], \"expected\": [5, false], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":38.905,"exit_code":1,"observations":[{"actual":[0,false],"check":"regression [\"1S0378331005\"]","expected":"malformed","passed":false},{"actual":[9,false],"check":"regression [\"U10378331005\"]","expected":"malformed","passed":false},{"actual":[0,false],"check":"control [\"US4V5PGS4IX8\"]","expected":[0,false],"passed":true},{"actual":[7,false],"check":"control [\"GBOV8F5J6090\"]","expected":[7,false],"passed":true},{"actual":[4,false],"check":"control [\"DEC85GG2TSS1\"]","expected":[4,false],"passed":true},{"actual":[1,true],"check":"control [\"JPFWKDL124I1\"]","expected":[1,true],"passed":true},{"actual":[1,false],"check":"control [\"CHXVXSVIT016\"]","expected":[1,false],"passed":true},{"actual":[5,false],"check":"control [\"FRLWNIYHPT37\"]","expected":[5,false],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression [\\\"1S0378331005\\\"]\", \"actual\": [0, false], \"expected\": \"malformed\", \"passed\": false}, {\"check\": \"regression [\\\"U10378331005\\\"]\", \"actual\": [9, false], \"expected\": \"malformed\", \"passed\": false}, {\"check\": \"control [\\\"US4V5PGS4IX8\\\"]\", \"actual\": [0, false], \"expected\": [0, false], \"passed\": true}, {\"check\": \"control [\\\"GBOV8F5J6090\\\"]\", \"actual\": [7, false], \"expected\": [7, false], \"passed\": true}, {\"check\": \"control [\\\"DEC85GG2TSS1\\\"]\", \"actual\": [4, false], \"expected\": [4, false], \"passed\": true}, {\"check\": \"control [\\\"JPFWKDL124I1\\\"]\", \"actual\": [1, true], \"expected\": [1, true], \"passed\": true}, {\"check\": \"control [\\\"CHXVXSVIT016\\\"]\", \"actual\": [1, false], \"expected\": [1, false], \"passed\": true}, {\"check\": \"control [\\\"FRLWNIYHPT37\\\"]\", \"actual\": [5, false], \"expected\": [5, false], \"passed\": true}], \"passed\": false}\n"}},"member_only":{"stages":["fixed"],"fields":["implementations.fixed","verification.fixed","harness","repair"],"note":"The verified repair, its recorded checks, the repair description, and the scoring harness are available to members."}}