{"abstract":"Barcodes carrying tab or other control characters in set A get wrong check symbols.","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.","contract_signature":"code, data","evaluation_group":"w2-check_digit_algorithms-code128-checksum","failed_approach":"Adding 96 overshoots into the function-code values.","family":"w2-check_digit_algorithms-code128-checksum-code-a-controls","id":"FA-72641","implementations":{"attempt":{"sha256":"7a238fae76cee09e7de28bed92fbc07da0451e81b2157c0ff8875769314cf6f9","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) + 96 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 [\"A\", \"0%!J\\\\u0011\"]', ['A', '0%!J\\x11'], 87], ['regression [\"A\", \"\\\\u0005\\\\u00000_;V\"]', ['A', '\\x05\\x000_;V'], 29], ['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 [\"A\", \",B\\\\u001e\\\\u000e_#Y\"]', ['A', ',B\\x1e\\x0e_#Y'], 67], ['regression [\"A\", \"\\\\u0010\\\\u0015>D\\\\u0001\\\\u0013\"]', ['A', '\\x10\\x15>D\\x01\\x13'], 71], ['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 [\"C\", \"9158\"]', ['C', '9158'], 3]], [['regression [\"A\", \"AB\\\\t1\"]', ['A', 'AB\\t1'], 79], ['regression [\"A\", \"\\\\u0000\"]', ['A', '\\x00'], 64], ['control [\"C\", \"9158\"]', ['C', '9158'], 3], ['control [\"C\", \"32273629\"]', ['C', '32273629'], 3], ['control [\"C\", \"976797\"]', ['C', '976797'], 9], ['control [\"C\", \"209091\"]', ['C', '209091'], 63], ['control [\"C\", \"5357244392\"]', ['C', '5357244392'], 49], ['control [\"C\", \"68\"]', ['C', '68'], 70]], [['regression [\"A\", \"\\\\u0005\\\\u00000_;V\"]', ['A', '\\x05\\x000_;V'], 29], ['regression [\"A\", \"\\\\u0005\\\\u0017F\"]', ['A', '\\x05\\x17F'], 48], ['control [\"C\", \"68\"]', ['C', '68'], 70], ['control [\"B\", \"PJJ123C\"]', ['B', 'PJJ123C'], 55], ['control [\"B\", \"Wikipedia\"]', ['B', 'Wikipedia'], 88], ['control [\"C\", \"123456\"]', ['C', '123456'], 44], ['control [\"C\", \"12345\"]', ['C', '12345'], None], ['control [\"B\", \"a\\x7f\"]', ['B', 'a\\x7f'], 50]], [['regression [\"A\", \"\\\\u0010\\\\u0015>D\\\\u0001\\\\u0013\"]', ['A', '\\x10\\x15>D\\x01\\x13'], 71], ['regression [\"A\", \"H\\\\u0010\\\\u001c7F\"]', ['A', 'H\\x10\\x1c7F'], 37], ['control [\"B\", \"a\\x7f\"]', ['B', 'a\\x7f'], 50], ['control [\"B\", \"\\x7f\"]', ['B', '\\x7f'], 96], ['control [\"B\", \"\"]', ['B', ''], 1], ['control [\"D\", \"X\"]', ['D', 'X'], None], ['control [\"A\", \"abc\"]', ['A', 'abc'], None], ['control [\"C\", \"00\"]', ['C', '00'], 2]]]\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":"c9c529d9e1310e414c67f149387e0e3b1babf2f600deddcb2092ac7a7dc0db77","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) 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 [\"A\", \"0%!J\\\\u0011\"]', ['A', '0%!J\\x11'], 87], ['regression [\"A\", \"\\\\u0005\\\\u00000_;V\"]', ['A', '\\x05\\x000_;V'], 29], ['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 [\"A\", \",B\\\\u001e\\\\u000e_#Y\"]', ['A', ',B\\x1e\\x0e_#Y'], 67], ['regression [\"A\", \"\\\\u0010\\\\u0015>D\\\\u0001\\\\u0013\"]', ['A', '\\x10\\x15>D\\x01\\x13'], 71], ['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 [\"C\", \"9158\"]', ['C', '9158'], 3]], [['regression [\"A\", \"AB\\\\t1\"]', ['A', 'AB\\t1'], 79], ['regression [\"A\", \"\\\\u0000\"]', ['A', '\\x00'], 64], ['control [\"C\", \"9158\"]', ['C', '9158'], 3], ['control [\"C\", \"32273629\"]', ['C', '32273629'], 3], ['control [\"C\", \"976797\"]', ['C', '976797'], 9], ['control [\"C\", \"209091\"]', ['C', '209091'], 63], ['control [\"C\", \"5357244392\"]', ['C', '5357244392'], 49], ['control [\"C\", \"68\"]', ['C', '68'], 70]], [['regression [\"A\", \"\\\\u0005\\\\u00000_;V\"]', ['A', '\\x05\\x000_;V'], 29], ['regression [\"A\", \"\\\\u0005\\\\u0017F\"]', ['A', '\\x05\\x17F'], 48], ['control [\"C\", \"68\"]', ['C', '68'], 70], ['control [\"B\", \"PJJ123C\"]', ['B', 'PJJ123C'], 55], ['control [\"B\", \"Wikipedia\"]', ['B', 'Wikipedia'], 88], ['control [\"C\", \"123456\"]', ['C', '123456'], 44], ['control [\"C\", \"12345\"]', ['C', '12345'], None], ['control [\"B\", \"a\\x7f\"]', ['B', 'a\\x7f'], 50]], [['regression [\"A\", \"\\\\u0010\\\\u0015>D\\\\u0001\\\\u0013\"]', ['A', '\\x10\\x15>D\\x01\\x13'], 71], ['regression [\"A\", \"H\\\\u0010\\\\u001c7F\"]', ['A', 'H\\x10\\x1c7F'], 37], ['control [\"B\", \"a\\x7f\"]', ['B', 'a\\x7f'], 50], ['control [\"B\", \"\\x7f\"]', ['B', '\\x7f'], 96], ['control [\"B\", \"\"]', ['B', ''], 1], ['control [\"D\", \"X\"]', ['D', 'X'], None], ['control [\"A\", \"abc\"]', ['A', 'abc'], None], ['control [\"C\", \"00\"]', ['C', '00'], 2]]]\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-a-controls","generated_at":"2026-09-29T14:48:40.277245+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.","root_cause":"Control characters use ord(ch) directly, but in set A they occupy values 64..95.","sha256":"5191feecefe52d40f8e8a9bafdb02ef69709d59e4ca6d57ab02ba0edb93dbb2e","title":"Code 128 set A scores control characters by code point · 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":39.681,"exit_code":1,"observations":[{"actual":41,"check":"regression [\"A\", \"0%!J\\u0011\"]","expected":87,"passed":false},{"actual":22,"check":"regression [\"A\", \"\\u0005\\u00000_;V\"]","expected":29,"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 [\\\"A\\\", \\\"0%!J\\\\u0011\\\"]\", \"actual\": 41, \"expected\": 87, \"passed\": false}, {\"check\": \"regression [\\\"A\\\", \\\"\\\\u0005\\\\u00000_;V\\\"]\", \"actual\": 22, \"expected\": 29, \"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":38.613,"exit_code":1,"observations":[{"actual":76,"check":"regression [\"A\", \"0%!J\\u0011\"]","expected":87,"passed":false},{"actual":43,"check":"regression [\"A\", \"\\u0005\\u00000_;V\"]","expected":29,"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 [\\\"A\\\", \\\"0%!J\\\\u0011\\\"]\", \"actual\": 76, \"expected\": 87, \"passed\": false}, {\"check\": \"regression [\\\"A\\\", \\\"\\\\u0005\\\\u00000_;V\\\"]\", \"actual\": 43, \"expected\": 29, \"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"}},"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."}}