{"abstract":"Nearly every identity number is rejected.","category":"Check-digit algorithms","checks":8,"contract":"Check character of an 18-character resident identity number: seventeen ASCII digits followed by a digit or X (lowercase x accepted). Weights are 2^(17-i) mod 11 for 0-based i; the check character is \"10X98765432\"[sum % 11]. Return [check character, whether the 18th character matches case-insensitively].","contract_signature":"s","evaluation_group":"w2-check_digit_algorithms-cn-resident-id","failed_approach":"Reversing the exponent (2^i) assigns the heaviest weights to the wrong end.","family":"w2-check_digit_algorithms-cn-resident-id-weight-exponent","id":"FA-72581","implementations":{"attempt":{"sha256":"66f38f0b6a819b39f90e5f4f41cf2984d5da27e01ace48b610c0205c48b8c294","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(s):\n    if len(s) != 18 or not s.isascii() or not s[:17].isdigit():\n        return 'malformed'\n    total = sum(int(ch) * pow(2, i, 11) for i, ch in enumerate(s[:17]))\n    check = '10X98765432'[total % 11]\n    return [check, check == s[17].upper()]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression [\"268310199103143528\"]', ['268310199103143528'], ['9', False]], ['regression [\"297547197007199229\"]', ['297547197007199229'], ['2', False]], ['control [\"11010519491231002\"]', ['11010519491231002'], 'malformed'], ['control [\"1101051949123100XX\"]', ['1101051949123100XX'], 'malformed'], ['control [\"518849198106269933\"]', ['518849198106269933'], ['6', False]], ['control [\"405799197903155930\"]', ['405799197903155930'], ['7', False]], ['control [\"445793197510028320\"]', ['445793197510028320'], ['X', False]], ['control [\"309071197409120443\"]', ['309071197409120443'], ['3', True]]], [['regression [\"405799197903155930\"]', ['405799197903155930'], ['7', False]], ['regression [\"445793197510028320\"]', ['445793197510028320'], ['X', False]], ['partial-repair [\"309071197409120443\"]', ['309071197409120443'], ['3', True]], ['control [\"1101051949123100XX\"]', ['1101051949123100XX'], 'malformed'], ['control [\"11010519491231002\"]', ['11010519491231002'], 'malformed'], ['control [\"458825200412201114\"]', ['458825200412201114'], ['5', False]], ['control [\"373498196811139070\"]', ['373498196811139070'], ['5', False]], ['control [\"18951819720314318X\"]', ['18951819720314318X'], ['3', False]]], [['regression [\"594570196107138355\"]', ['594570196107138355'], ['2', False]], ['regression [\"458825200412201114\"]', ['458825200412201114'], ['5', False]], ['partial-repair [\"373498196811139070\"]', ['373498196811139070'], ['5', False]], ['partial-repair [\"18951819720314318X\"]', ['18951819720314318X'], ['3', False]], ['control [\"11010519491231002\"]', ['11010519491231002'], 'malformed'], ['control [\"1101051949123100XX\"]', ['1101051949123100XX'], 'malformed'], ['control [\"197110195609245785\"]', ['197110195609245785'], ['6', False]], ['control [\"37858219960314414X\"]', ['37858219960314414X'], ['7', False]]], [['regression [\"18951819720314318X\"]', ['18951819720314318X'], ['3', False]], ['regression [\"50937819800315206x\"]', ['50937819800315206x'], ['9', False]], ['partial-repair [\"600025197711283200\"]', ['600025197711283200'], ['5', False]], ['partial-repair [\"197110195609245785\"]', ['197110195609245785'], ['6', False]], ['control [\"1101051949123100XX\"]', ['1101051949123100XX'], 'malformed'], ['control [\"11010519491231002\"]', ['11010519491231002'], 'malformed'], ['control [\"261917197009053555\"]', ['261917197009053555'], ['3', False]], ['control [\"607248198301138071\"]', ['607248198301138071'], ['9', False]]], [['regression [\"197110195609245785\"]', ['197110195609245785'], ['6', False]], ['regression [\"37858219960314414X\"]', ['37858219960314414X'], ['7', False]], ['partial-repair [\"22100419730209591X\"]', ['22100419730209591X'], ['4', False]], ['partial-repair [\"653847197508233493\"]', ['653847197508233493'], ['2', False]], ['control [\"11010519491231002\"]', ['11010519491231002'], 'malformed'], ['control [\"1101051949123100XX\"]', ['1101051949123100XX'], 'malformed'], ['control [\"11010519491231002X\"]', ['11010519491231002X'], ['X', True]], ['control [\"11010519491231002x\"]', ['11010519491231002x'], ['X', 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":"b03b7f2ee38a80849096c8e018480ca23c268407870f63362523ea1c561895dc","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(s):\n    if len(s) != 18 or not s.isascii() or not s[:17].isdigit():\n        return 'malformed'\n    total = sum(int(ch) * pow(2, 16 - i, 11) for i, ch in enumerate(s[:17]))\n    check = '10X98765432'[total % 11]\n    return [check, check == s[17].upper()]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression [\"268310199103143528\"]', ['268310199103143528'], ['9', False]], ['regression [\"297547197007199229\"]', ['297547197007199229'], ['2', False]], ['control [\"11010519491231002\"]', ['11010519491231002'], 'malformed'], ['control [\"1101051949123100XX\"]', ['1101051949123100XX'], 'malformed'], ['control [\"518849198106269933\"]', ['518849198106269933'], ['6', False]], ['control [\"405799197903155930\"]', ['405799197903155930'], ['7', False]], ['control [\"445793197510028320\"]', ['445793197510028320'], ['X', False]], ['control [\"309071197409120443\"]', ['309071197409120443'], ['3', True]]], [['regression [\"405799197903155930\"]', ['405799197903155930'], ['7', False]], ['regression [\"445793197510028320\"]', ['445793197510028320'], ['X', False]], ['partial-repair [\"309071197409120443\"]', ['309071197409120443'], ['3', True]], ['control [\"1101051949123100XX\"]', ['1101051949123100XX'], 'malformed'], ['control [\"11010519491231002\"]', ['11010519491231002'], 'malformed'], ['control [\"458825200412201114\"]', ['458825200412201114'], ['5', False]], ['control [\"373498196811139070\"]', ['373498196811139070'], ['5', False]], ['control [\"18951819720314318X\"]', ['18951819720314318X'], ['3', False]]], [['regression [\"594570196107138355\"]', ['594570196107138355'], ['2', False]], ['regression [\"458825200412201114\"]', ['458825200412201114'], ['5', False]], ['partial-repair [\"373498196811139070\"]', ['373498196811139070'], ['5', False]], ['partial-repair [\"18951819720314318X\"]', ['18951819720314318X'], ['3', False]], ['control [\"11010519491231002\"]', ['11010519491231002'], 'malformed'], ['control [\"1101051949123100XX\"]', ['1101051949123100XX'], 'malformed'], ['control [\"197110195609245785\"]', ['197110195609245785'], ['6', False]], ['control [\"37858219960314414X\"]', ['37858219960314414X'], ['7', False]]], [['regression [\"18951819720314318X\"]', ['18951819720314318X'], ['3', False]], ['regression [\"50937819800315206x\"]', ['50937819800315206x'], ['9', False]], ['partial-repair [\"600025197711283200\"]', ['600025197711283200'], ['5', False]], ['partial-repair [\"197110195609245785\"]', ['197110195609245785'], ['6', False]], ['control [\"1101051949123100XX\"]', ['1101051949123100XX'], 'malformed'], ['control [\"11010519491231002\"]', ['11010519491231002'], 'malformed'], ['control [\"261917197009053555\"]', ['261917197009053555'], ['3', False]], ['control [\"607248198301138071\"]', ['607248198301138071'], ['9', False]]], [['regression [\"197110195609245785\"]', ['197110195609245785'], ['6', False]], ['regression [\"37858219960314414X\"]', ['37858219960314414X'], ['7', False]], ['partial-repair [\"22100419730209591X\"]', ['22100419730209591X'], ['4', False]], ['partial-repair [\"653847197508233493\"]', ['653847197508233493'], ['2', False]], ['control [\"11010519491231002\"]', ['11010519491231002'], 'malformed'], ['control [\"1101051949123100XX\"]', ['1101051949123100XX'], 'malformed'], ['control [\"11010519491231002X\"]', ['11010519491231002X'], ['X', True]], ['control [\"11010519491231002x\"]', ['11010519491231002x'], ['X', 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-cn-resident-id-weight-exponent","generated_at":"2026-09-29T14:48:39.770506+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Account opening flows validate national identity numbers before identity verification.","root_cause":"Weights are computed as 2^(16-i) mod 11, shifting the exponent by one.","sha256":"9298149c7fe1892221c9e39fcd014a08d83c27fbfa7c9e3b17acb94112bfba2c","title":"Resident ID weights use one power of two too few · 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":35.549,"exit_code":1,"observations":[{"actual":["4",false],"check":"regression [\"268310199103143528\"]","expected":["9",false],"passed":false},{"actual":["8",false],"check":"regression [\"297547197007199229\"]","expected":["2",false],"passed":false},{"actual":"malformed","check":"control [\"11010519491231002\"]","expected":"malformed","passed":true},{"actual":"malformed","check":"control [\"1101051949123100XX\"]","expected":"malformed","passed":true},{"actual":["6",false],"check":"control [\"518849198106269933\"]","expected":["6",false],"passed":true},{"actual":["8",false],"check":"control [\"405799197903155930\"]","expected":["7",false],"passed":false},{"actual":["6",false],"check":"control [\"445793197510028320\"]","expected":["X",false],"passed":false},{"actual":["5",false],"check":"control [\"309071197409120443\"]","expected":["3",true],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression [\\\"268310199103143528\\\"]\", \"actual\": [\"4\", false], \"expected\": [\"9\", false], \"passed\": false}, {\"check\": \"regression [\\\"297547197007199229\\\"]\", \"actual\": [\"8\", false], \"expected\": [\"2\", false], \"passed\": false}, {\"check\": \"control [\\\"11010519491231002\\\"]\", \"actual\": \"malformed\", \"expected\": \"malformed\", \"passed\": true}, {\"check\": \"control [\\\"1101051949123100XX\\\"]\", \"actual\": \"malformed\", \"expected\": \"malformed\", \"passed\": true}, {\"check\": \"control [\\\"518849198106269933\\\"]\", \"actual\": [\"6\", false], \"expected\": [\"6\", false], \"passed\": true}, {\"check\": \"control [\\\"405799197903155930\\\"]\", \"actual\": [\"8\", false], \"expected\": [\"7\", false], \"passed\": false}, {\"check\": \"control [\\\"445793197510028320\\\"]\", \"actual\": [\"6\", false], \"expected\": [\"X\", false], \"passed\": false}, {\"check\": \"control [\\\"309071197409120443\\\"]\", \"actual\": [\"5\", false], \"expected\": [\"3\", true], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":37.982,"exit_code":1,"observations":[{"actual":["5",false],"check":"regression [\"268310199103143528\"]","expected":["9",false],"passed":false},{"actual":["7",false],"check":"regression [\"297547197007199229\"]","expected":["2",false],"passed":false},{"actual":"malformed","check":"control [\"11010519491231002\"]","expected":"malformed","passed":true},{"actual":"malformed","check":"control [\"1101051949123100XX\"]","expected":"malformed","passed":true},{"actual":["9",false],"check":"control [\"518849198106269933\"]","expected":["6",false],"passed":false},{"actual":["4",false],"check":"control [\"405799197903155930\"]","expected":["7",false],"passed":false},{"actual":["0",true],"check":"control [\"445793197510028320\"]","expected":["X",false],"passed":false},{"actual":["2",false],"check":"control [\"309071197409120443\"]","expected":["3",true],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression [\\\"268310199103143528\\\"]\", \"actual\": [\"5\", false], \"expected\": [\"9\", false], \"passed\": false}, {\"check\": \"regression [\\\"297547197007199229\\\"]\", \"actual\": [\"7\", false], \"expected\": [\"2\", false], \"passed\": false}, {\"check\": \"control [\\\"11010519491231002\\\"]\", \"actual\": \"malformed\", \"expected\": \"malformed\", \"passed\": true}, {\"check\": \"control [\\\"1101051949123100XX\\\"]\", \"actual\": \"malformed\", \"expected\": \"malformed\", \"passed\": true}, {\"check\": \"control [\\\"518849198106269933\\\"]\", \"actual\": [\"9\", false], \"expected\": [\"6\", false], \"passed\": false}, {\"check\": \"control [\\\"405799197903155930\\\"]\", \"actual\": [\"4\", false], \"expected\": [\"7\", false], \"passed\": false}, {\"check\": \"control [\\\"445793197510028320\\\"]\", \"actual\": [\"0\", true], \"expected\": [\"X\", false], \"passed\": false}, {\"check\": \"control [\\\"309071197409120443\\\"]\", \"actual\": [\"2\", false], \"expected\": [\"3\", true], \"passed\": false}], \"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."}}