{"abstract":"Numeric barcodes in set C get the wrong check symbol.","category":"Check-digit algorithms","checks":8,"contract":"Code 128 symbol check value. Start codes A/B/C have values 103/104/105 (other codes: None). Code B accepts characters 32..127 (value ord - 32); code A accepts 0..95 (values ord - 32, controls ord + 64); code C accepts an even number of ASCII digits taken in pairs (value 0..99). The checksum is (start + sum(position * value)) mod 103 with positions starting at 1 after the start code. Invalid data returns None.","evaluation_group":"w2-check_digit_algorithms-code128-checksum","failed_approach":"Sliding a two-digit window by one digit produces overlapping pairs.","family":"w2-check_digit_algorithms-code128-checksum-code-c-pairing","id":"FA-72636","implementations":{"attempt":{"sha256":"4c128d20e5a2b877550d13ca4e3c7fb928b160fc09e1c953ed66aee5d34d16e6","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(code, data):\n    starts = {'A': 103, 'B': 104, 'C': 105}\n    if code not in starts:\n        return None\n    if code == 'C':\n        if len(data) % 2 or not data.isascii() or not data.isdigit():\n            return None\n        values = [int(data[i:i + 2]) for i in range(len(data) - 1)]\n    elif code == 'B':\n        if any(not 32 <= ord(ch) <= 127 for ch in data):\n            return None\n        values = [ord(ch) - 32 for ch in data]\n    else:\n        if any(not 0 <= ord(ch) <= 95 for ch in data):\n            return None\n        values = [ord(ch) - 32 if ord(ch) >= 32 else ord(ch) + 64 for ch in data]\n    total = starts[code]\n    for pos, v in enumerate(values, 1):\n        total += pos * v\n    return total % 103\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression [\"C\", \"9158\"]', ['C', '9158'], 3], ['regression [\"C\", \"32273629\"]', ['C', '32273629'], 3], ['control [\"B\", \"@w~\\'\"]', ['B', \"@w~'\"], 2], ['control [\"B\", \"Ht?\"]', ['B', 'Ht?'], 96], ['control [\"B\", \"U?tS;F\"]', ['B', 'U?tS;F'], 8], ['control [\"B\", \")r\"]', ['B', ')r'], 71], ['control [\"B\", \"YyUx>VrW{?\"]', ['B', 'YyUx>VrW{?'], 68], ['control [\"B\", \"4Y&P%jOM+J/\"]', ['B', '4Y&P%jOM+J/'], 24]], [['regression [\"C\", \"209091\"]', ['C', '209091'], 63], ['regression [\"C\", \"5357244392\"]', ['C', '5357244392'], 49], ['control [\"B\", \"4Y&P%jOM+J/\"]', ['B', '4Y&P%jOM+J/'], 24], ['control [\"B\", \"wm$|^uemYo/\"]', ['B', 'wm$|^uemYo/'], 95], ['control [\"B\", \"UI}*7pnZebjZ\"]', ['B', 'UI}*7pnZebjZ'], 10], ['control [\"B\", \"GOJ%^JsFlN=\"]', ['B', 'GOJ%^JsFlN='], 100], ['control [\"B\", \"{j]OWCR\"]', ['B', '{j]OWCR'], 4], ['control [\"A\", \"0%!J\\\\u0011\"]', ['A', '0%!J\\x11'], 87]], [['regression [\"C\", \"123456\"]', ['C', '123456'], 44], ['regression [\"C\", \"9158\"]', ['C', '9158'], 3], ['partial-repair [\"C\", \"32273629\"]', ['C', '32273629'], 3], ['control [\"A\", \"0%!J\\\\u0011\"]', ['A', '0%!J\\x11'], 87], ['control [\"A\", \"\\\\u0005\\\\u00000_;V\"]', ['A', '\\x05\\x000_;V'], 29], ['control [\"A\", \"\\\\u0005\\\\u0017F\"]', ['A', '\\x05\\x17F'], 48], ['control [\"A\", \",B\\\\u001e\\\\u000e_#Y\"]', ['A', ',B\\x1e\\x0e_#Y'], 67], ['control [\"A\", \"\\\\u0010\\\\u0015>D\\\\u0001\\\\u0013\"]', ['A', '\\x10\\x15>D\\x01\\x13'], 71]], [['regression [\"C\", \"976797\"]', ['C', '976797'], 9], ['regression [\"C\", \"209091\"]', ['C', '209091'], 63], ['partial-repair [\"C\", \"5357244392\"]', ['C', '5357244392'], 49], ['control [\"A\", \"H\\\\u0010\\\\u001c7F\"]', ['A', 'H\\x10\\x1c7F'], 37], ['control [\"B\", \"PJJ123C\"]', ['B', 'PJJ123C'], 55], ['control [\"B\", \"Wikipedia\"]', ['B', 'Wikipedia'], 88], ['control [\"C\", \"12345\"]', ['C', '12345'], None], ['control [\"A\", \"AB\\\\t1\"]', ['A', 'AB\\t1'], 79]], [['regression [\"C\", \"68\"]', ['C', '68'], 70], ['regression [\"C\", \"123456\"]', ['C', '123456'], 44], ['partial-repair [\"C\", \"9158\"]', ['C', '9158'], 3], ['partial-repair [\"C\", \"32273629\"]', ['C', '32273629'], 3], ['control [\"A\", \"\\\\u0000\"]', ['A', '\\x00'], 64], ['control [\"B\", \"a\\x7f\"]', ['B', 'a\\x7f'], 50], ['control [\"B\", \"\\x7f\"]', ['B', '\\x7f'], 96], ['control [\"B\", \"\"]', ['B', ''], 1]]]\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":"fc81901d9c11a9b9280d19001e1a0ac477f60da5bd94bcef22646107e5af4b93","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(code, data):\n    starts = {'A': 103, 'B': 104, 'C': 105}\n    if code not in starts:\n        return None\n    if code == 'C':\n        if len(data) % 2 or not data.isascii() or not data.isdigit():\n            return None\n        values = [int(ch) for ch in data]\n    elif code == 'B':\n        if any(not 32 <= ord(ch) <= 127 for ch in data):\n            return None\n        values = [ord(ch) - 32 for ch in data]\n    else:\n        if any(not 0 <= ord(ch) <= 95 for ch in data):\n            return None\n        values = [ord(ch) - 32 if ord(ch) >= 32 else ord(ch) + 64 for ch in data]\n    total = starts[code]\n    for pos, v in enumerate(values, 1):\n        total += pos * v\n    return total % 103\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression [\"C\", \"9158\"]', ['C', '9158'], 3], ['regression [\"C\", \"32273629\"]', ['C', '32273629'], 3], ['control [\"B\", \"@w~\\'\"]', ['B', \"@w~'\"], 2], ['control [\"B\", \"Ht?\"]', ['B', 'Ht?'], 96], ['control [\"B\", \"U?tS;F\"]', ['B', 'U?tS;F'], 8], ['control [\"B\", \")r\"]', ['B', ')r'], 71], ['control [\"B\", \"YyUx>VrW{?\"]', ['B', 'YyUx>VrW{?'], 68], ['control [\"B\", \"4Y&P%jOM+J/\"]', ['B', '4Y&P%jOM+J/'], 24]], [['regression [\"C\", \"209091\"]', ['C', '209091'], 63], ['regression [\"C\", \"5357244392\"]', ['C', '5357244392'], 49], ['control [\"B\", \"4Y&P%jOM+J/\"]', ['B', '4Y&P%jOM+J/'], 24], ['control [\"B\", \"wm$|^uemYo/\"]', ['B', 'wm$|^uemYo/'], 95], ['control [\"B\", \"UI}*7pnZebjZ\"]', ['B', 'UI}*7pnZebjZ'], 10], ['control [\"B\", \"GOJ%^JsFlN=\"]', ['B', 'GOJ%^JsFlN='], 100], ['control [\"B\", \"{j]OWCR\"]', ['B', '{j]OWCR'], 4], ['control [\"A\", \"0%!J\\\\u0011\"]', ['A', '0%!J\\x11'], 87]], [['regression [\"C\", \"123456\"]', ['C', '123456'], 44], ['regression [\"C\", \"9158\"]', ['C', '9158'], 3], ['partial-repair [\"C\", \"32273629\"]', ['C', '32273629'], 3], ['control [\"A\", \"0%!J\\\\u0011\"]', ['A', '0%!J\\x11'], 87], ['control [\"A\", \"\\\\u0005\\\\u00000_;V\"]', ['A', '\\x05\\x000_;V'], 29], ['control [\"A\", \"\\\\u0005\\\\u0017F\"]', ['A', '\\x05\\x17F'], 48], ['control [\"A\", \",B\\\\u001e\\\\u000e_#Y\"]', ['A', ',B\\x1e\\x0e_#Y'], 67], ['control [\"A\", \"\\\\u0010\\\\u0015>D\\\\u0001\\\\u0013\"]', ['A', '\\x10\\x15>D\\x01\\x13'], 71]], [['regression [\"C\", \"976797\"]', ['C', '976797'], 9], ['regression [\"C\", \"209091\"]', ['C', '209091'], 63], ['partial-repair [\"C\", \"5357244392\"]', ['C', '5357244392'], 49], ['control [\"A\", \"H\\\\u0010\\\\u001c7F\"]', ['A', 'H\\x10\\x1c7F'], 37], ['control [\"B\", \"PJJ123C\"]', ['B', 'PJJ123C'], 55], ['control [\"B\", \"Wikipedia\"]', ['B', 'Wikipedia'], 88], ['control [\"C\", \"12345\"]', ['C', '12345'], None], ['control [\"A\", \"AB\\\\t1\"]', ['A', 'AB\\t1'], 79]], [['regression [\"C\", \"68\"]', ['C', '68'], 70], ['regression [\"C\", \"123456\"]', ['C', '123456'], 44], ['partial-repair [\"C\", \"9158\"]', ['C', '9158'], 3], ['partial-repair [\"C\", \"32273629\"]', ['C', '32273629'], 3], ['control [\"A\", \"\\\\u0000\"]', ['A', '\\x00'], 64], ['control [\"B\", \"a\\x7f\"]', ['B', 'a\\x7f'], 50], ['control [\"B\", \"\\x7f\"]', ['B', '\\x7f'], 96], ['control [\"B\", \"\"]', ['B', ''], 1]]]\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":"fd4640651b54cd4820419950dd4fe6dea3ecdbc2381534868a57692fe3fcaf3d","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(code, data):\n    starts = {'A': 103, 'B': 104, 'C': 105}\n    if code not in starts:\n        return None\n    if code == 'C':\n        if len(data) % 2 or not data.isascii() or not data.isdigit():\n            return None\n        values = [int(data[i:i + 2]) for i in range(0, len(data), 2)]\n    elif code == 'B':\n        if any(not 32 <= ord(ch) <= 127 for ch in data):\n            return None\n        values = [ord(ch) - 32 for ch in data]\n    else:\n        if any(not 0 <= ord(ch) <= 95 for ch in data):\n            return None\n        values = [ord(ch) - 32 if ord(ch) >= 32 else ord(ch) + 64 for ch in data]\n    total = starts[code]\n    for pos, v in enumerate(values, 1):\n        total += pos * v\n    return total % 103\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression [\"C\", \"9158\"]', ['C', '9158'], 3], ['regression [\"C\", \"32273629\"]', ['C', '32273629'], 3], ['control [\"B\", \"@w~\\'\"]', ['B', \"@w~'\"], 2], ['control [\"B\", \"Ht?\"]', ['B', 'Ht?'], 96], ['control [\"B\", \"U?tS;F\"]', ['B', 'U?tS;F'], 8], ['control [\"B\", \")r\"]', ['B', ')r'], 71], ['control [\"B\", \"YyUx>VrW{?\"]', ['B', 'YyUx>VrW{?'], 68], ['control [\"B\", \"4Y&P%jOM+J/\"]', ['B', '4Y&P%jOM+J/'], 24]], [['regression [\"C\", \"209091\"]', ['C', '209091'], 63], ['regression [\"C\", \"5357244392\"]', ['C', '5357244392'], 49], ['control [\"B\", \"4Y&P%jOM+J/\"]', ['B', '4Y&P%jOM+J/'], 24], ['control [\"B\", \"wm$|^uemYo/\"]', ['B', 'wm$|^uemYo/'], 95], ['control [\"B\", \"UI}*7pnZebjZ\"]', ['B', 'UI}*7pnZebjZ'], 10], ['control [\"B\", \"GOJ%^JsFlN=\"]', ['B', 'GOJ%^JsFlN='], 100], ['control [\"B\", \"{j]OWCR\"]', ['B', '{j]OWCR'], 4], ['control [\"A\", \"0%!J\\\\u0011\"]', ['A', '0%!J\\x11'], 87]], [['regression [\"C\", \"123456\"]', ['C', '123456'], 44], ['regression [\"C\", \"9158\"]', ['C', '9158'], 3], ['partial-repair [\"C\", \"32273629\"]', ['C', '32273629'], 3], ['control [\"A\", \"0%!J\\\\u0011\"]', ['A', '0%!J\\x11'], 87], ['control [\"A\", \"\\\\u0005\\\\u00000_;V\"]', ['A', '\\x05\\x000_;V'], 29], ['control [\"A\", \"\\\\u0005\\\\u0017F\"]', ['A', '\\x05\\x17F'], 48], ['control [\"A\", \",B\\\\u001e\\\\u000e_#Y\"]', ['A', ',B\\x1e\\x0e_#Y'], 67], ['control [\"A\", \"\\\\u0010\\\\u0015>D\\\\u0001\\\\u0013\"]', ['A', '\\x10\\x15>D\\x01\\x13'], 71]], [['regression [\"C\", \"976797\"]', ['C', '976797'], 9], ['regression [\"C\", \"209091\"]', ['C', '209091'], 63], ['partial-repair [\"C\", \"5357244392\"]', ['C', '5357244392'], 49], ['control [\"A\", \"H\\\\u0010\\\\u001c7F\"]', ['A', 'H\\x10\\x1c7F'], 37], ['control [\"B\", \"PJJ123C\"]', ['B', 'PJJ123C'], 55], ['control [\"B\", \"Wikipedia\"]', ['B', 'Wikipedia'], 88], ['control [\"C\", \"12345\"]', ['C', '12345'], None], ['control [\"A\", \"AB\\\\t1\"]', ['A', 'AB\\t1'], 79]], [['regression [\"C\", \"68\"]', ['C', '68'], 70], ['regression [\"C\", \"123456\"]', ['C', '123456'], 44], ['partial-repair [\"C\", \"9158\"]', ['C', '9158'], 3], ['partial-repair [\"C\", \"32273629\"]', ['C', '32273629'], 3], ['control [\"A\", \"\\\\u0000\"]', ['A', '\\x00'], 64], ['control [\"B\", \"a\\x7f\"]', ['B', 'a\\x7f'], 50], ['control [\"B\", \"\\x7f\"]', ['B', '\\x7f'], 96], ['control [\"B\", \"\"]', ['B', ''], 1]]]\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-code128-checksum-code-c-pairing","generated_at":"2026-09-29T14:48:40.277034+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Label printers compute the Code 128 check symbol before rendering shipping barcodes.","repair":"Take digits two at a time; each pair is one symbol value 00..99.","root_cause":"Set C values are built from individual digits instead of digit pairs.","sha256":"534d7cb74483c32038d9a7b057e17b94dcd1a595fc485eee31f70d0169d45765","title":"Code 128 set C encodes single digits · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":39.136,"exit_code":1,"observations":[{"actual":91,"check":"regression [\"C\", \"9158\"]","expected":3,"passed":false},{"actual":73,"check":"regression [\"C\", \"32273629\"]","expected":3,"passed":false},{"actual":2,"check":"control [\"B\", \"@w~'\"]","expected":2,"passed":true},{"actual":96,"check":"control [\"B\", \"Ht?\"]","expected":96,"passed":true},{"actual":8,"check":"control [\"B\", \"U?tS;F\"]","expected":8,"passed":true},{"actual":71,"check":"control [\"B\", \")r\"]","expected":71,"passed":true},{"actual":68,"check":"control [\"B\", \"YyUx>VrW{?\"]","expected":68,"passed":true},{"actual":24,"check":"control [\"B\", \"4Y&P%jOM+J/\"]","expected":24,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression [\\\"C\\\", \\\"9158\\\"]\", \"actual\": 91, \"expected\": 3, \"passed\": false}, {\"check\": \"regression [\\\"C\\\", \\\"32273629\\\"]\", \"actual\": 73, \"expected\": 3, \"passed\": false}, {\"check\": \"control [\\\"B\\\", \\\"@w~'\\\"]\", \"actual\": 2, \"expected\": 2, \"passed\": true}, {\"check\": \"control [\\\"B\\\", \\\"Ht?\\\"]\", \"actual\": 96, \"expected\": 96, \"passed\": true}, {\"check\": \"control [\\\"B\\\", \\\"U?tS;F\\\"]\", \"actual\": 8, \"expected\": 8, \"passed\": true}, {\"check\": \"control [\\\"B\\\", \\\")r\\\"]\", \"actual\": 71, \"expected\": 71, \"passed\": true}, {\"check\": \"control [\\\"B\\\", \\\"YyUx>VrW{?\\\"]\", \"actual\": 68, \"expected\": 68, \"passed\": true}, {\"check\": \"control [\\\"B\\\", \\\"4Y&P%jOM+J/\\\"]\", \"actual\": 24, \"expected\": 24, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":37.828,"exit_code":1,"observations":[{"actual":60,"check":"regression [\"C\", \"9158\"]","expected":3,"passed":false},{"actual":77,"check":"regression [\"C\", \"32273629\"]","expected":3,"passed":false},{"actual":2,"check":"control [\"B\", \"@w~'\"]","expected":2,"passed":true},{"actual":96,"check":"control [\"B\", \"Ht?\"]","expected":96,"passed":true},{"actual":8,"check":"control [\"B\", \"U?tS;F\"]","expected":8,"passed":true},{"actual":71,"check":"control [\"B\", \")r\"]","expected":71,"passed":true},{"actual":68,"check":"control [\"B\", \"YyUx>VrW{?\"]","expected":68,"passed":true},{"actual":24,"check":"control [\"B\", \"4Y&P%jOM+J/\"]","expected":24,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression [\\\"C\\\", \\\"9158\\\"]\", \"actual\": 60, \"expected\": 3, \"passed\": false}, {\"check\": \"regression [\\\"C\\\", \\\"32273629\\\"]\", \"actual\": 77, \"expected\": 3, \"passed\": false}, {\"check\": \"control [\\\"B\\\", \\\"@w~'\\\"]\", \"actual\": 2, \"expected\": 2, \"passed\": true}, {\"check\": \"control [\\\"B\\\", \\\"Ht?\\\"]\", \"actual\": 96, \"expected\": 96, \"passed\": true}, {\"check\": \"control [\\\"B\\\", \\\"U?tS;F\\\"]\", \"actual\": 8, \"expected\": 8, \"passed\": true}, {\"check\": \"control [\\\"B\\\", \\\")r\\\"]\", \"actual\": 71, \"expected\": 71, \"passed\": true}, {\"check\": \"control [\\\"B\\\", \\\"YyUx>VrW{?\\\"]\", \"actual\": 68, \"expected\": 68, \"passed\": true}, {\"check\": \"control [\\\"B\\\", \\\"4Y&P%jOM+J/\\\"]\", \"actual\": 24, \"expected\": 24, \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":42.173,"exit_code":0,"observations":[{"actual":3,"check":"regression [\"C\", \"9158\"]","expected":3,"passed":true},{"actual":3,"check":"regression [\"C\", \"32273629\"]","expected":3,"passed":true},{"actual":2,"check":"control [\"B\", \"@w~'\"]","expected":2,"passed":true},{"actual":96,"check":"control [\"B\", \"Ht?\"]","expected":96,"passed":true},{"actual":8,"check":"control [\"B\", \"U?tS;F\"]","expected":8,"passed":true},{"actual":71,"check":"control [\"B\", \")r\"]","expected":71,"passed":true},{"actual":68,"check":"control [\"B\", \"YyUx>VrW{?\"]","expected":68,"passed":true},{"actual":24,"check":"control [\"B\", \"4Y&P%jOM+J/\"]","expected":24,"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression [\\\"C\\\", \\\"9158\\\"]\", \"actual\": 3, \"expected\": 3, \"passed\": true}, {\"check\": \"regression [\\\"C\\\", \\\"32273629\\\"]\", \"actual\": 3, \"expected\": 3, \"passed\": true}, {\"check\": \"control [\\\"B\\\", \\\"@w~'\\\"]\", \"actual\": 2, \"expected\": 2, \"passed\": true}, {\"check\": \"control [\\\"B\\\", \\\"Ht?\\\"]\", \"actual\": 96, \"expected\": 96, \"passed\": true}, {\"check\": \"control [\\\"B\\\", \\\"U?tS;F\\\"]\", \"actual\": 8, \"expected\": 8, \"passed\": true}, {\"check\": \"control [\\\"B\\\", \\\")r\\\"]\", \"actual\": 71, \"expected\": 71, \"passed\": true}, {\"check\": \"control [\\\"B\\\", \\\"YyUx>VrW{?\\\"]\", \"actual\": 68, \"expected\": 68, \"passed\": true}, {\"check\": \"control [\\\"B\\\", \\\"4Y&P%jOM+J/\\\"]\", \"actual\": 24, \"expected\": 24, \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}