{"abstract":"Most CUSIPs are rejected.","category":"Check-digit algorithms","checks":8,"contract":"CUSIP check: nine ASCII characters, the ninth a digit. Payload values: digits face value, A-Z 10-35, * 36, @ 37, # 38 (anything else \"malformed\"). Every second payload character (1-based even position) is doubled, and the decimal digits of each value are summed. Return [(10 - sum % 10) % 10, whether it equals the ninth digit].","contract_signature":"s","evaluation_group":"w2-check_digit_algorithms-cusip","failed_approach":"Doubling only numeric characters at the right positions skips letters that must also be doubled.","family":"w2-check_digit_algorithms-cusip-doubling-scope","id":"FA-72541","implementations":{"attempt":{"sha256":"d1ee500a19ab569595811a1b49f1045056d44c2ad10904302003056d710c4ac5","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(s):\n    if len(s) != 9 or not s.isascii() or not s[8].isdigit():\n        return 'malformed'\n    total = 0\n    for i, ch in enumerate(s[:8]):\n        if ch.isdigit():\n            v = int(ch)\n        elif 'A' <= ch <= 'Z':\n            v = ord(ch) - 55\n        elif ch in '*@#':\n            v = 36 + '*@#'.index(ch)\n        else:\n            return 'malformed'\n        if i % 2 == 1 and ch.isdigit():\n            v *= 2\n        total += v // 10 + v % 10\n    check = (10 - total % 10) % 10\n    return [check, check == int(s[8])]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression [\"317997MK3\"]', ['317997MK3'], [7, False]], ['regression [\"624143L53\"]', ['624143L53'], [0, False]], ['partial-repair [\"7900294Q7\"]', ['7900294Q7'], [2, False]], ['control [\"595693682\"]', ['595693682'], [0, False]], ['control [\"445197417\"]', ['445197417'], [1, False]], ['control [\"523003XR4\"]', ['523003XR4'], [7, False]], ['control [\"03783310\"]', ['03783310'], 'malformed'], ['control [\"0378331a0\"]', ['0378331a0'], 'malformed']], [['regression [\"161949AV8\"]', ['161949AV8'], [4, False]], ['regression [\"907215RM1\"]', ['907215RM1'], [1, True]], ['partial-repair [\"088857YN7\"]', ['088857YN7'], [1, False]], ['control [\"595693682\"]', ['595693682'], [0, False]], ['control [\"445197417\"]', ['445197417'], [1, False]], ['control [\"523003XR4\"]', ['523003XR4'], [7, False]], ['control [\"03783310\"]', ['03783310'], 'malformed'], ['control [\"0378331a0\"]', ['0378331a0'], 'malformed']], [['regression [\"462107IA0\"]', ['462107IA0'], [3, False]], ['regression [\"6OZ44LI17\"]', ['6OZ44LI17'], [5, False]], ['partial-repair [\"V0SRK56U5\"]', ['V0SRK56U5'], [2, False]], ['control [\"595693682\"]', ['595693682'], [0, False]], ['control [\"445197417\"]', ['445197417'], [1, False]], ['control [\"523003XR4\"]', ['523003XR4'], [7, False]], ['control [\"03783310\"]', ['03783310'], 'malformed'], ['control [\"0378331a0\"]', ['0378331a0'], 'malformed']], [['regression [\"U243EIXI1\"]', ['U243EIXI1'], [4, False]], ['regression [\"6PI3M7KT7\"]', ['6PI3M7KT7'], [0, False]], ['partial-repair [\"KU9BYOL70\"]', ['KU9BYOL70'], [2, False]], ['partial-repair [\"7WKYMG#Y7\"]', ['7WKYMG#Y7'], [3, False]], ['control [\"595693682\"]', ['595693682'], [0, False]], ['control [\"445197417\"]', ['445197417'], [1, False]], ['control [\"523003XR4\"]', ['523003XR4'], [7, False]], ['control [\"03783310\"]', ['03783310'], 'malformed']], [['regression [\"KU9BYOL70\"]', ['KU9BYOL70'], [2, False]], ['regression [\"XIXEC2WW3\"]', ['XIXEC2WW3'], [7, False]], ['partial-repair [\"68389X105\"]', ['68389X105'], [5, True]], ['partial-repair [\"ZZZZZZZZ0\"]', ['ZZZZZZZZ0'], [0, True]], ['control [\"595693682\"]', ['595693682'], [0, False]], ['control [\"445197417\"]', ['445197417'], [1, False]], ['control [\"523003XR4\"]', ['523003XR4'], [7, False]], ['control [\"03783310\"]', ['03783310'], 'malformed']]]\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":"ab27e007f8ef0d0c05f8230f4f4cb4b5d23a6e268be2f8acce6ab880b7757de2","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(s):\n    if len(s) != 9 or not s.isascii() or not s[8].isdigit():\n        return 'malformed'\n    total = 0\n    for i, ch in enumerate(s[:8]):\n        if ch.isdigit():\n            v = int(ch)\n        elif 'A' <= ch <= 'Z':\n            v = ord(ch) - 55\n        elif ch in '*@#':\n            v = 36 + '*@#'.index(ch)\n        else:\n            return 'malformed'\n        if i % 2 == 0:\n            v *= 2\n        total += v // 10 + v % 10\n    check = (10 - total % 10) % 10\n    return [check, check == int(s[8])]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression [\"317997MK3\"]', ['317997MK3'], [7, False]], ['regression [\"624143L53\"]', ['624143L53'], [0, False]], ['partial-repair [\"7900294Q7\"]', ['7900294Q7'], [2, False]], ['control [\"595693682\"]', ['595693682'], [0, False]], ['control [\"445197417\"]', ['445197417'], [1, False]], ['control [\"523003XR4\"]', ['523003XR4'], [7, False]], ['control [\"03783310\"]', ['03783310'], 'malformed'], ['control [\"0378331a0\"]', ['0378331a0'], 'malformed']], [['regression [\"161949AV8\"]', ['161949AV8'], [4, False]], ['regression [\"907215RM1\"]', ['907215RM1'], [1, True]], ['partial-repair [\"088857YN7\"]', ['088857YN7'], [1, False]], ['control [\"595693682\"]', ['595693682'], [0, False]], ['control [\"445197417\"]', ['445197417'], [1, False]], ['control [\"523003XR4\"]', ['523003XR4'], [7, False]], ['control [\"03783310\"]', ['03783310'], 'malformed'], ['control [\"0378331a0\"]', ['0378331a0'], 'malformed']], [['regression [\"462107IA0\"]', ['462107IA0'], [3, False]], ['regression [\"6OZ44LI17\"]', ['6OZ44LI17'], [5, False]], ['partial-repair [\"V0SRK56U5\"]', ['V0SRK56U5'], [2, False]], ['control [\"595693682\"]', ['595693682'], [0, False]], ['control [\"445197417\"]', ['445197417'], [1, False]], ['control [\"523003XR4\"]', ['523003XR4'], [7, False]], ['control [\"03783310\"]', ['03783310'], 'malformed'], ['control [\"0378331a0\"]', ['0378331a0'], 'malformed']], [['regression [\"U243EIXI1\"]', ['U243EIXI1'], [4, False]], ['regression [\"6PI3M7KT7\"]', ['6PI3M7KT7'], [0, False]], ['partial-repair [\"KU9BYOL70\"]', ['KU9BYOL70'], [2, False]], ['partial-repair [\"7WKYMG#Y7\"]', ['7WKYMG#Y7'], [3, False]], ['control [\"595693682\"]', ['595693682'], [0, False]], ['control [\"445197417\"]', ['445197417'], [1, False]], ['control [\"523003XR4\"]', ['523003XR4'], [7, False]], ['control [\"03783310\"]', ['03783310'], 'malformed']], [['regression [\"KU9BYOL70\"]', ['KU9BYOL70'], [2, False]], ['regression [\"XIXEC2WW3\"]', ['XIXEC2WW3'], [7, False]], ['partial-repair [\"68389X105\"]', ['68389X105'], [5, True]], ['partial-repair [\"ZZZZZZZZ0\"]', ['ZZZZZZZZ0'], [0, True]], ['control [\"595693682\"]', ['595693682'], [0, False]], ['control [\"445197417\"]', ['445197417'], [1, False]], ['control [\"523003XR4\"]', ['523003XR4'], [7, False]], ['control [\"03783310\"]', ['03783310'], 'malformed']]]\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-cusip-doubling-scope","generated_at":"2026-09-29T14:48:39.408275+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Clearing and custody systems validate North American security identifiers.","root_cause":"Doubling is applied at 0-based even indices (odd 1-based positions).","sha256":"2bc69e1c0505f7fe460e89334747f01f9466ed2327dd23f96c848d676e6c235b","title":"CUSIP doubles the first character of each pair · 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":38.415,"exit_code":1,"observations":[{"actual":[9,false],"check":"regression [\"317997MK3\"]","expected":[7,false],"passed":false},{"actual":[0,false],"check":"regression [\"624143L53\"]","expected":[0,false],"passed":true},{"actual":[1,false],"check":"partial-repair [\"7900294Q7\"]","expected":[2,false],"passed":false},{"actual":[0,false],"check":"control [\"595693682\"]","expected":[0,false],"passed":true},{"actual":[1,false],"check":"control [\"445197417\"]","expected":[1,false],"passed":true},{"actual":[7,false],"check":"control [\"523003XR4\"]","expected":[7,false],"passed":true},{"actual":"malformed","check":"control [\"03783310\"]","expected":"malformed","passed":true},{"actual":"malformed","check":"control [\"0378331a0\"]","expected":"malformed","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression [\\\"317997MK3\\\"]\", \"actual\": [9, false], \"expected\": [7, false], \"passed\": false}, {\"check\": \"regression [\\\"624143L53\\\"]\", \"actual\": [0, false], \"expected\": [0, false], \"passed\": true}, {\"check\": \"partial-repair [\\\"7900294Q7\\\"]\", \"actual\": [1, false], \"expected\": [2, false], \"passed\": false}, {\"check\": \"control [\\\"595693682\\\"]\", \"actual\": [0, false], \"expected\": [0, false], \"passed\": true}, {\"check\": \"control [\\\"445197417\\\"]\", \"actual\": [1, false], \"expected\": [1, false], \"passed\": true}, {\"check\": \"control [\\\"523003XR4\\\"]\", \"actual\": [7, false], \"expected\": [7, false], \"passed\": true}, {\"check\": \"control [\\\"03783310\\\"]\", \"actual\": \"malformed\", \"expected\": \"malformed\", \"passed\": true}, {\"check\": \"control [\\\"0378331a0\\\"]\", \"actual\": \"malformed\", \"expected\": \"malformed\", \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":39.311,"exit_code":1,"observations":[{"actual":[3,true],"check":"regression [\"317997MK3\"]","expected":[7,false],"passed":false},{"actual":[4,false],"check":"regression [\"624143L53\"]","expected":[0,false],"passed":false},{"actual":[7,true],"check":"partial-repair [\"7900294Q7\"]","expected":[2,false],"passed":false},{"actual":[0,false],"check":"control [\"595693682\"]","expected":[0,false],"passed":true},{"actual":[1,false],"check":"control [\"445197417\"]","expected":[1,false],"passed":true},{"actual":[7,false],"check":"control [\"523003XR4\"]","expected":[7,false],"passed":true},{"actual":"malformed","check":"control [\"03783310\"]","expected":"malformed","passed":true},{"actual":"malformed","check":"control [\"0378331a0\"]","expected":"malformed","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression [\\\"317997MK3\\\"]\", \"actual\": [3, true], \"expected\": [7, false], \"passed\": false}, {\"check\": \"regression [\\\"624143L53\\\"]\", \"actual\": [4, false], \"expected\": [0, false], \"passed\": false}, {\"check\": \"partial-repair [\\\"7900294Q7\\\"]\", \"actual\": [7, true], \"expected\": [2, false], \"passed\": false}, {\"check\": \"control [\\\"595693682\\\"]\", \"actual\": [0, false], \"expected\": [0, false], \"passed\": true}, {\"check\": \"control [\\\"445197417\\\"]\", \"actual\": [1, false], \"expected\": [1, false], \"passed\": true}, {\"check\": \"control [\\\"523003XR4\\\"]\", \"actual\": [7, false], \"expected\": [7, false], \"passed\": true}, {\"check\": \"control [\\\"03783310\\\"]\", \"actual\": \"malformed\", \"expected\": \"malformed\", \"passed\": true}, {\"check\": \"control [\\\"0378331a0\\\"]\", \"actual\": \"malformed\", \"expected\": \"malformed\", \"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."}}