{"abstract":"The second digit is misaligned by one module and fails to decode.","category":"Barcode symbology encoding","checks":8,"contract":"Encode a two-digit EAN-2 add-on (issue number) as modules: start 1011, first character, separator 01, second character. The parity pattern is chosen by the two-digit value modulo 4: 0 LL, 1 LG, 2 GL, 3 GG, using the EAN L and G code sets. Invalid input returns None.","evaluation_group":"w2-barcode-symbology-encoding-ean2-addon","failed_approach":"A four-module separator shifts the second character.","family":"w2-barcode-symbology-encoding-ean2-addon-separator","id":"FA-79736","implementations":{"attempt":{"sha256":"85369f898fff12627186dd5ea1b8f03ed7974a00e2bb90ee25314a134d59e7b2","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(s):\n    if len(s) != 2 or not all(c in '0123456789' for c in s):\n        return None\n    L = ['0001101', '0011001', '0010011', '0111101', '0100011', '0110001', '0101111', '0111011', '0110111', '0001011']\n    G = ['0100111', '0110011', '0011011', '0100001', '0011101', '0111001', '0000101', '0010001', '0001001', '0010111']\n    par = ['LL', 'LG', 'GL', 'GG'][int(s) % 4]\n    a = (L if par[0] == 'L' else G)[int(s[0])]\n    b = (L if par[1] == 'L' else G)[int(s[1])]\n    return '1011' + a + '0101' + b\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['73', '10110111011010100001'], ['92', '10110001011010010011'], ['7', None], ['123', None], ['a1', None], ['55', '10110111001010111001'], ['27', '10110011011010010001'], ['42', '10110011101010010011']], [['24', '10110010011010100011'], ['29', '10110010011010010111'], ['123', None], ['a1', None], ['7', None], ['19', '10110110011010010111'], ['22', '10110011011010010011'], ['98', '10110010111010110111']], [['38', '10110100001010110111'], ['11', '10110110011010110011'], ['a1', None], ['7', None], ['123', None], ['17', '10110011001010010001'], ['64', '10110101111010100011'], ['01', '10110001101010110011']], [['66', '10110000101010101111'], ['51', '10110111001010110011'], ['7', None], ['123', None], ['a1', None], ['13', '10110011001010100001'], ['78', '10110010001010110111'], ['20', '10110010011010001101']], [['86', '10110001001010101111'], ['94', '10110010111010100011'], ['123', None], ['a1', None], ['7', None], ['81', '10110110111010110011'], ['29', '10110010011010010111'], ['30', '10110100001010001101']]]\nlabels = [\"regression: character separator\", \"repair trap\", \"combined fault\", \"control\", \"control\", \"boundary\", \"boundary\", \"control\"]\nfor i, (args, expected) in enumerate(fixtures[N-1]):\n    check(\"%s %d\" % (labels[i % len(labels)], i), 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":"043897dfc52c8d4f00cb50a6bf409af93e36196271f41f7c874068a7fa5c9f39","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(s):\n    if len(s) != 2 or not all(c in '0123456789' for c in s):\n        return None\n    L = ['0001101', '0011001', '0010011', '0111101', '0100011', '0110001', '0101111', '0111011', '0110111', '0001011']\n    G = ['0100111', '0110011', '0011011', '0100001', '0011101', '0111001', '0000101', '0010001', '0001001', '0010111']\n    par = ['LL', 'LG', 'GL', 'GG'][int(s) % 4]\n    a = (L if par[0] == 'L' else G)[int(s[0])]\n    b = (L if par[1] == 'L' else G)[int(s[1])]\n    return '1011' + a + '10' + b\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['73', '10110111011010100001'], ['92', '10110001011010010011'], ['7', None], ['123', None], ['a1', None], ['55', '10110111001010111001'], ['27', '10110011011010010001'], ['42', '10110011101010010011']], [['24', '10110010011010100011'], ['29', '10110010011010010111'], ['123', None], ['a1', None], ['7', None], ['19', '10110110011010010111'], ['22', '10110011011010010011'], ['98', '10110010111010110111']], [['38', '10110100001010110111'], ['11', '10110110011010110011'], ['a1', None], ['7', None], ['123', None], ['17', '10110011001010010001'], ['64', '10110101111010100011'], ['01', '10110001101010110011']], [['66', '10110000101010101111'], ['51', '10110111001010110011'], ['7', None], ['123', None], ['a1', None], ['13', '10110011001010100001'], ['78', '10110010001010110111'], ['20', '10110010011010001101']], [['86', '10110001001010101111'], ['94', '10110010111010100011'], ['123', None], ['a1', None], ['7', None], ['81', '10110110111010110011'], ['29', '10110010011010010111'], ['30', '10110100001010001101']]]\nlabels = [\"regression: character separator\", \"repair trap\", \"combined fault\", \"control\", \"control\", \"boundary\", \"boundary\", \"control\"]\nfor i, (args, expected) in enumerate(fixtures[N-1]):\n    check(\"%s %d\" % (labels[i % len(labels)], i), 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":"7d7ede907600589bf89bba4c2c260e89d6bfa046c6531ec5047cc1979ac91929","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(s):\n    if len(s) != 2 or not all(c in '0123456789' for c in s):\n        return None\n    L = ['0001101', '0011001', '0010011', '0111101', '0100011', '0110001', '0101111', '0111011', '0110111', '0001011']\n    G = ['0100111', '0110011', '0011011', '0100001', '0011101', '0111001', '0000101', '0010001', '0001001', '0010111']\n    par = ['LL', 'LG', 'GL', 'GG'][int(s) % 4]\n    a = (L if par[0] == 'L' else G)[int(s[0])]\n    b = (L if par[1] == 'L' else G)[int(s[1])]\n    return '1011' + a + '01' + b\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['73', '10110111011010100001'], ['92', '10110001011010010011'], ['7', None], ['123', None], ['a1', None], ['55', '10110111001010111001'], ['27', '10110011011010010001'], ['42', '10110011101010010011']], [['24', '10110010011010100011'], ['29', '10110010011010010111'], ['123', None], ['a1', None], ['7', None], ['19', '10110110011010010111'], ['22', '10110011011010010011'], ['98', '10110010111010110111']], [['38', '10110100001010110111'], ['11', '10110110011010110011'], ['a1', None], ['7', None], ['123', None], ['17', '10110011001010010001'], ['64', '10110101111010100011'], ['01', '10110001101010110011']], [['66', '10110000101010101111'], ['51', '10110111001010110011'], ['7', None], ['123', None], ['a1', None], ['13', '10110011001010100001'], ['78', '10110010001010110111'], ['20', '10110010011010001101']], [['86', '10110001001010101111'], ['94', '10110010111010100011'], ['123', None], ['a1', None], ['7', None], ['81', '10110110111010110011'], ['29', '10110010011010010111'], ['30', '10110100001010001101']]]\nlabels = [\"regression: character separator\", \"repair trap\", \"combined fault\", \"control\", \"control\", \"boundary\", \"boundary\", \"control\"]\nfor i, (args, expected) in enumerate(fixtures[N-1]):\n    check(\"%s %d\" % (labels[i % len(labels)], i), 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 with a stipulated contract; it makes no claim of conformance to any published specification. 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-barcode-symbology-encoding-ean2-addon-separator","generated_at":"2026-09-29T14:49:47.272660+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Retail, logistics, pharmacy and document workflows depend on encoders that produce exactly the module pattern, code-set switches, separators and quiet zones scanners expect; one misplaced module or separator makes a label unreadable or, worse, scan as different data.","repair":"Separate the characters with space-bar 01.","root_cause":"The delineator between add-on characters is written 10 instead of 01.","sha256":"d6bf7efb9f5ad4a9cba704202311b429ed7346fe0be021f43685f49fb91a16e3","title":"EAN-2 separator starts with a bar · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":37.932,"exit_code":1,"observations":[{"actual":"1011011101101010100001","check":"regression: character separator 0","expected":"10110111011010100001","passed":false},{"actual":"1011000101101010010011","check":"repair trap 1","expected":"10110001011010010011","passed":false},{"actual":null,"check":"combined fault 2","expected":null,"passed":true},{"actual":null,"check":"control 3","expected":null,"passed":true},{"actual":null,"check":"control 4","expected":null,"passed":true},{"actual":"1011011100101010111001","check":"boundary 5","expected":"10110111001010111001","passed":false},{"actual":"1011001101101010010001","check":"boundary 6","expected":"10110011011010010001","passed":false},{"actual":"1011001110101010010011","check":"control 7","expected":"10110011101010010011","passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: character separator 0\", \"actual\": \"1011011101101010100001\", \"expected\": \"10110111011010100001\", \"passed\": false}, {\"check\": \"repair trap 1\", \"actual\": \"1011000101101010010011\", \"expected\": \"10110001011010010011\", \"passed\": false}, {\"check\": \"combined fault 2\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"control 3\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"control 4\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"boundary 5\", \"actual\": \"1011011100101010111001\", \"expected\": \"10110111001010111001\", \"passed\": false}, {\"check\": \"boundary 6\", \"actual\": \"1011001101101010010001\", \"expected\": \"10110011011010010001\", \"passed\": false}, {\"check\": \"control 7\", \"actual\": \"1011001110101010010011\", \"expected\": \"10110011101010010011\", \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":39.579,"exit_code":1,"observations":[{"actual":"10110111011100100001","check":"regression: character separator 0","expected":"10110111011010100001","passed":false},{"actual":"10110001011100010011","check":"repair trap 1","expected":"10110001011010010011","passed":false},{"actual":null,"check":"combined fault 2","expected":null,"passed":true},{"actual":null,"check":"control 3","expected":null,"passed":true},{"actual":null,"check":"control 4","expected":null,"passed":true},{"actual":"10110111001100111001","check":"boundary 5","expected":"10110111001010111001","passed":false},{"actual":"10110011011100010001","check":"boundary 6","expected":"10110011011010010001","passed":false},{"actual":"10110011101100010011","check":"control 7","expected":"10110011101010010011","passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: character separator 0\", \"actual\": \"10110111011100100001\", \"expected\": \"10110111011010100001\", \"passed\": false}, {\"check\": \"repair trap 1\", \"actual\": \"10110001011100010011\", \"expected\": \"10110001011010010011\", \"passed\": false}, {\"check\": \"combined fault 2\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"control 3\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"control 4\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"boundary 5\", \"actual\": \"10110111001100111001\", \"expected\": \"10110111001010111001\", \"passed\": false}, {\"check\": \"boundary 6\", \"actual\": \"10110011011100010001\", \"expected\": \"10110011011010010001\", \"passed\": false}, {\"check\": \"control 7\", \"actual\": \"10110011101100010011\", \"expected\": \"10110011101010010011\", \"passed\": false}], \"passed\": false}\n"},"fixed":{"elapsed_ms":39.804,"exit_code":0,"observations":[{"actual":"10110111011010100001","check":"regression: character separator 0","expected":"10110111011010100001","passed":true},{"actual":"10110001011010010011","check":"repair trap 1","expected":"10110001011010010011","passed":true},{"actual":null,"check":"combined fault 2","expected":null,"passed":true},{"actual":null,"check":"control 3","expected":null,"passed":true},{"actual":null,"check":"control 4","expected":null,"passed":true},{"actual":"10110111001010111001","check":"boundary 5","expected":"10110111001010111001","passed":true},{"actual":"10110011011010010001","check":"boundary 6","expected":"10110011011010010001","passed":true},{"actual":"10110011101010010011","check":"control 7","expected":"10110011101010010011","passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: character separator 0\", \"actual\": \"10110111011010100001\", \"expected\": \"10110111011010100001\", \"passed\": true}, {\"check\": \"repair trap 1\", \"actual\": \"10110001011010010011\", \"expected\": \"10110001011010010011\", \"passed\": true}, {\"check\": \"combined fault 2\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"control 3\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"control 4\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"boundary 5\", \"actual\": \"10110111001010111001\", \"expected\": \"10110111001010111001\", \"passed\": true}, {\"check\": \"boundary 6\", \"actual\": \"10110011011010010001\", \"expected\": \"10110011011010010001\", \"passed\": true}, {\"check\": \"control 7\", \"actual\": \"10110011101010010011\", \"expected\": \"10110011101010010011\", \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}