FA-79736 / Barcode symbology encoding / Open access
EAN-2 separator starts with a bar · case 01
The second digit is misaligned by one module and fails to decode.
ROOT CAUSE
The delineator between add-on characters is written 10 instead of 01.
VERIFIED REPAIR
Separate the characters with space-bar 01.
Unsuccessful approach: A four-module separator shifts the second character.
Case 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.
Why this case matters
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.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(s):
if len(s) != 2 or not all(c in '0123456789' for c in s):
return None
L = ['0001101', '0011001', '0010011', '0111101', '0100011', '0110001', '0101111', '0111011', '0110111', '0001011']
G = ['0100111', '0110011', '0011011', '0100001', '0011101', '0111001', '0000101', '0010001', '0001001', '0010111']
par = ['LL', 'LG', 'GL', 'GG'][int(s) % 4]
a = (L if par[0] == 'L' else G)[int(s[0])]
b = (L if par[1] == 'L' else G)[int(s[1])]
return '1011' + a + '10' + b
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['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']]]
labels = ["regression: character separator", "repair trap", "combined fault", "control", "control", "boundary", "boundary", "control"]
for i, (args, expected) in enumerate(fixtures[N-1]):
check("%s %d" % (labels[i % len(labels)], i), solve(args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression: character separator 0 | 10110111011100100001 | 10110111011010100001 | Failed |
| repair trap 1 | 10110001011100010011 | 10110001011010010011 | Failed |
| combined fault 2 | None | None | Passed |
| control 3 | None | None | Passed |
| control 4 | None | None | Passed |
| boundary 5 | 10110111001100111001 | 10110111001010111001 | Failed |
| boundary 6 | 10110011011100010001 | 10110011011010010001 | Failed |
| control 7 | 10110011101100010011 | 10110011101010010011 | Failed |
SHA-256 / 043897dfc52c8d4f00cb50a6bf409af93e36196271f41f7c874068a7fa5c9f39
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(s):
if len(s) != 2 or not all(c in '0123456789' for c in s):
return None
L = ['0001101', '0011001', '0010011', '0111101', '0100011', '0110001', '0101111', '0111011', '0110111', '0001011']
G = ['0100111', '0110011', '0011011', '0100001', '0011101', '0111001', '0000101', '0010001', '0001001', '0010111']
par = ['LL', 'LG', 'GL', 'GG'][int(s) % 4]
a = (L if par[0] == 'L' else G)[int(s[0])]
b = (L if par[1] == 'L' else G)[int(s[1])]
return '1011' + a + '0101' + b
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['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']]]
labels = ["regression: character separator", "repair trap", "combined fault", "control", "control", "boundary", "boundary", "control"]
for i, (args, expected) in enumerate(fixtures[N-1]):
check("%s %d" % (labels[i % len(labels)], i), solve(args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression: character separator 0 | 1011011101101010100001 | 10110111011010100001 | Failed |
| repair trap 1 | 1011000101101010010011 | 10110001011010010011 | Failed |
| combined fault 2 | None | None | Passed |
| control 3 | None | None | Passed |
| control 4 | None | None | Passed |
| boundary 5 | 1011011100101010111001 | 10110111001010111001 | Failed |
| boundary 6 | 1011001101101010010001 | 10110011011010010001 | Failed |
| control 7 | 1011001110101010010011 | 10110011101010010011 | Failed |
SHA-256 / 85369f898fff12627186dd5ea1b8f03ed7974a00e2bb90ee25314a134d59e7b2
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(s):
if len(s) != 2 or not all(c in '0123456789' for c in s):
return None
L = ['0001101', '0011001', '0010011', '0111101', '0100011', '0110001', '0101111', '0111011', '0110111', '0001011']
G = ['0100111', '0110011', '0011011', '0100001', '0011101', '0111001', '0000101', '0010001', '0001001', '0010111']
par = ['LL', 'LG', 'GL', 'GG'][int(s) % 4]
a = (L if par[0] == 'L' else G)[int(s[0])]
b = (L if par[1] == 'L' else G)[int(s[1])]
return '1011' + a + '01' + b
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['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']]]
labels = ["regression: character separator", "repair trap", "combined fault", "control", "control", "boundary", "boundary", "control"]
for i, (args, expected) in enumerate(fixtures[N-1]):
check("%s %d" % (labels[i % len(labels)], i), solve(args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression: character separator 0 | 10110111011010100001 | 10110111011010100001 | Passed |
| repair trap 1 | 10110001011010010011 | 10110001011010010011 | Passed |
| combined fault 2 | None | None | Passed |
| control 3 | None | None | Passed |
| control 4 | None | None | Passed |
| boundary 5 | 10110111001010111001 | 10110111001010111001 | Passed |
| boundary 6 | 10110011011010010001 | 10110011011010010001 | Passed |
| control 7 | 10110011101010010011 | 10110011101010010011 | Passed |
SHA-256 / 7d7ede907600589bf89bba4c2c260e89d6bfa046c6531ec5047cc1979ac91929
Verification & scope
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.
Observations recorded using Python 3.12.14 at 2026-09-29T14:49:47.272660+00:00.
Case digest / d6bf7efb9f5ad4a9cba704202311b429ed7346fe0be021f43685f49fb91a16e3