FA-79356 / Barcode symbology encoding / Open access
EAN-13 centre guard starts with a bar · case 01
Scanners reject every symbol because the centre guard pattern is inverted.
ROOT CAUSE
The centre guard is written as 10101 instead of 01010.
VERIFIED REPAIR
The centre guard is space-bar-space-bar-space: 01010.
Unsuccessful approach: A four-module guard shifts the right half by one module.
Case contract
Encode a 13-character string of ASCII digits (the check digit is taken as given, not verified) as the 95-module EAN-13 pattern: start guard 101, six left digits in L or G sets chosen by the parity row of the leading digit, centre guard 01010, six right digits in the R set, end guard 101. R is the bitwise complement of L and G is R reversed. Anything else 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(code):
if len(code) != 13 or not all(ch in '0123456789' for ch in code):
return None
L = ['0001101', '0011001', '0010011', '0111101', '0100011', '0110001', '0101111', '0111011', '0110111', '0001011']
R = [''.join('1' if b == '0' else '0' for b in p) for p in L]
G = [p[::-1] for p in R]
parity = ['LLLLLL', 'LLGLGG', 'LLGGLG', 'LLGGGL', 'LGLLGG', 'LGGLLG', 'LGGGLL', 'LGLGLG', 'LGLGGL', 'LGGLGL']
pat = parity[int(code[0])]
left = ''.join((L if pat[i] == 'L' else G)[int(code[1 + i])] for i in range(6))
right = ''.join(R[int(ch)] for ch in code[7:])
return '101' + left + '10101' + right + '101'
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['5569719879594', '10101100010000101001011101110110011001001011101010100100010001001110100100111011101001011100101'], ['3339552094472', '10101111010111101001011101110010111001001001101010111001011101001011100101110010001001101100101'], ['4006381333931', None], ['12345678901٣2', None], ['123456789012', None], ['12345678901234', None], ['', None], ['5564657964331', '10101100010000101001110101011110110001001000101010111010010100001011100100001010000101100110101']], [['0777861705172', '10101110110111011011101101101110101111001100101010100010011100101001110110011010001001101100101'], ['4641860725337', '10101011110011101001100101101110000101010011101010100010011011001001110100001010000101000100101'], ['12345678901٣2', None], ['123456789012', None], ['12345678901234', None], ['', None], ['4006381333931', None], ['6141838617595', '10100110010011101011001100010010111101011011101010101000011001101000100100111011101001001110101']], [['3716511088176', '10101110110011001000010101110010110011001100101010111001010010001001000110011010001001010000101'], ['7062168881750', '10100011010000101001001101100110101111000100101010100100010010001100110100010010011101110010101'], ['123456789012', None], ['12345678901234', None], ['', None], ['4006381333931', None], ['12345678901٣2', None], ['6191360813603', '10100110010010111011001101000010101111000110101010100100011001101000010101000011100101000010101']], [['1986892142891', '10100010110110111000010101101110010111001101101010110011010111001101100100100011101001100110101'], ['6274612745694', '10100100110010001001110100001010011001001001101010100010010111001001110101000011101001011100101'], ['12345678901234', None], ['', None], ['4006381333931', None], ['12345678901٣2', None], ['123456789012', None], ['6346382380419', '10101111010011101000010101000010110111001001101010100001010010001110010101110011001101110100101']], [['8746102916553', '10101110110011101010111101100110100111001001101010111010011001101010000100111010011101000010101'], ['4502760148617', '10101100010100111001001101110110000101010011101010110011010111001001000101000011001101000100101'], ['', None], ['4006381333931', None], ['12345678901٣2', None], ['123456789012', None], ['12345678901234', None], ['3842111701831', '10101101110100011001101101100110110011001100101010100010011100101100110100100010000101100110101']]]
labels = ["regression: centre guard pattern", "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: centre guard pattern 0 | 10101100010000101001011101110110011001001011110101100100010001001110100100111011101001011100101 | 10101100010000101001011101110110011001001011101010100100010001001110100100111011101001011100101 | Failed |
| repair trap 1 | 10101111010111101001011101110010111001001001110101111001011101001011100101110010001001101100101 | 10101111010111101001011101110010111001001001101010111001011101001011100101110010001001101100101 | Failed |
| combined fault 2 | None | None | Passed |
| control 3 | None | None | Passed |
| control 4 | None | None | Passed |
| boundary 5 | None | None | Passed |
| boundary 6 | None | None | Passed |
| control 7 | 10101100010000101001110101011110110001001000110101111010010100001011100100001010000101100110101 | 10101100010000101001110101011110110001001000101010111010010100001011100100001010000101100110101 | Failed |
SHA-256 / faea22c0c2b8f9046285e6cd7eb53003fcfbc84b41c41f1a64dd1c22cb7d58dc
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(code):
if len(code) != 13 or not all(ch in '0123456789' for ch in code):
return None
L = ['0001101', '0011001', '0010011', '0111101', '0100011', '0110001', '0101111', '0111011', '0110111', '0001011']
R = [''.join('1' if b == '0' else '0' for b in p) for p in L]
G = [p[::-1] for p in R]
parity = ['LLLLLL', 'LLGLGG', 'LLGGLG', 'LLGGGL', 'LGLLGG', 'LGGLLG', 'LGGGLL', 'LGLGLG', 'LGLGGL', 'LGGLGL']
pat = parity[int(code[0])]
left = ''.join((L if pat[i] == 'L' else G)[int(code[1 + i])] for i in range(6))
right = ''.join(R[int(ch)] for ch in code[7:])
return '101' + left + '0101' + right + '101'
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['5569719879594', '10101100010000101001011101110110011001001011101010100100010001001110100100111011101001011100101'], ['3339552094472', '10101111010111101001011101110010111001001001101010111001011101001011100101110010001001101100101'], ['4006381333931', None], ['12345678901٣2', None], ['123456789012', None], ['12345678901234', None], ['', None], ['5564657964331', '10101100010000101001110101011110110001001000101010111010010100001011100100001010000101100110101']], [['0777861705172', '10101110110111011011101101101110101111001100101010100010011100101001110110011010001001101100101'], ['4641860725337', '10101011110011101001100101101110000101010011101010100010011011001001110100001010000101000100101'], ['12345678901٣2', None], ['123456789012', None], ['12345678901234', None], ['', None], ['4006381333931', None], ['6141838617595', '10100110010011101011001100010010111101011011101010101000011001101000100100111011101001001110101']], [['3716511088176', '10101110110011001000010101110010110011001100101010111001010010001001000110011010001001010000101'], ['7062168881750', '10100011010000101001001101100110101111000100101010100100010010001100110100010010011101110010101'], ['123456789012', None], ['12345678901234', None], ['', None], ['4006381333931', None], ['12345678901٣2', None], ['6191360813603', '10100110010010111011001101000010101111000110101010100100011001101000010101000011100101000010101']], [['1986892142891', '10100010110110111000010101101110010111001101101010110011010111001101100100100011101001100110101'], ['6274612745694', '10100100110010001001110100001010011001001001101010100010010111001001110101000011101001011100101'], ['12345678901234', None], ['', None], ['4006381333931', None], ['12345678901٣2', None], ['123456789012', None], ['6346382380419', '10101111010011101000010101000010110111001001101010100001010010001110010101110011001101110100101']], [['8746102916553', '10101110110011101010111101100110100111001001101010111010011001101010000100111010011101000010101'], ['4502760148617', '10101100010100111001001101110110000101010011101010110011010111001001000101000011001101000100101'], ['', None], ['4006381333931', None], ['12345678901٣2', None], ['123456789012', None], ['12345678901234', None], ['3842111701831', '10101101110100011001101101100110110011001100101010100010011100101100110100100010000101100110101']]]
labels = ["regression: centre guard pattern", "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: centre guard pattern 0 | 1010110001000010100101110111011001100100101110101100100010001001110100100111011101001011100101 | 10101100010000101001011101110110011001001011101010100100010001001110100100111011101001011100101 | Failed |
| repair trap 1 | 1010111101011110100101110111001011100100100110101111001011101001011100101110010001001101100101 | 10101111010111101001011101110010111001001001101010111001011101001011100101110010001001101100101 | Failed |
| combined fault 2 | None | None | Passed |
| control 3 | None | None | Passed |
| control 4 | None | None | Passed |
| boundary 5 | None | None | Passed |
| boundary 6 | None | None | Passed |
| control 7 | 1010110001000010100111010101111011000100100010101111010010100001011100100001010000101100110101 | 10101100010000101001110101011110110001001000101010111010010100001011100100001010000101100110101 | Failed |
SHA-256 / ba35246a46d297a8de4c1bed9ef8d33d3f4ee49d1a0c0871e7449c68d946f090
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(code):
if len(code) != 13 or not all(ch in '0123456789' for ch in code):
return None
L = ['0001101', '0011001', '0010011', '0111101', '0100011', '0110001', '0101111', '0111011', '0110111', '0001011']
R = [''.join('1' if b == '0' else '0' for b in p) for p in L]
G = [p[::-1] for p in R]
parity = ['LLLLLL', 'LLGLGG', 'LLGGLG', 'LLGGGL', 'LGLLGG', 'LGGLLG', 'LGGGLL', 'LGLGLG', 'LGLGGL', 'LGGLGL']
pat = parity[int(code[0])]
left = ''.join((L if pat[i] == 'L' else G)[int(code[1 + i])] for i in range(6))
right = ''.join(R[int(ch)] for ch in code[7:])
return '101' + left + '01010' + right + '101'
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['5569719879594', '10101100010000101001011101110110011001001011101010100100010001001110100100111011101001011100101'], ['3339552094472', '10101111010111101001011101110010111001001001101010111001011101001011100101110010001001101100101'], ['4006381333931', None], ['12345678901٣2', None], ['123456789012', None], ['12345678901234', None], ['', None], ['5564657964331', '10101100010000101001110101011110110001001000101010111010010100001011100100001010000101100110101']], [['0777861705172', '10101110110111011011101101101110101111001100101010100010011100101001110110011010001001101100101'], ['4641860725337', '10101011110011101001100101101110000101010011101010100010011011001001110100001010000101000100101'], ['12345678901٣2', None], ['123456789012', None], ['12345678901234', None], ['', None], ['4006381333931', None], ['6141838617595', '10100110010011101011001100010010111101011011101010101000011001101000100100111011101001001110101']], [['3716511088176', '10101110110011001000010101110010110011001100101010111001010010001001000110011010001001010000101'], ['7062168881750', '10100011010000101001001101100110101111000100101010100100010010001100110100010010011101110010101'], ['123456789012', None], ['12345678901234', None], ['', None], ['4006381333931', None], ['12345678901٣2', None], ['6191360813603', '10100110010010111011001101000010101111000110101010100100011001101000010101000011100101000010101']], [['1986892142891', '10100010110110111000010101101110010111001101101010110011010111001101100100100011101001100110101'], ['6274612745694', '10100100110010001001110100001010011001001001101010100010010111001001110101000011101001011100101'], ['12345678901234', None], ['', None], ['4006381333931', None], ['12345678901٣2', None], ['123456789012', None], ['6346382380419', '10101111010011101000010101000010110111001001101010100001010010001110010101110011001101110100101']], [['8746102916553', '10101110110011101010111101100110100111001001101010111010011001101010000100111010011101000010101'], ['4502760148617', '10101100010100111001001101110110000101010011101010110011010111001001000101000011001101000100101'], ['', None], ['4006381333931', None], ['12345678901٣2', None], ['123456789012', None], ['12345678901234', None], ['3842111701831', '10101101110100011001101101100110110011001100101010100010011100101100110100100010000101100110101']]]
labels = ["regression: centre guard pattern", "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: centre guard pattern 0 | 10101100010000101001011101110110011001001011101010100100010001001110100100111011101001011100101 | 10101100010000101001011101110110011001001011101010100100010001001110100100111011101001011100101 | Passed |
| repair trap 1 | 10101111010111101001011101110010111001001001101010111001011101001011100101110010001001101100101 | 10101111010111101001011101110010111001001001101010111001011101001011100101110010001001101100101 | Passed |
| combined fault 2 | None | None | Passed |
| control 3 | None | None | Passed |
| control 4 | None | None | Passed |
| boundary 5 | None | None | Passed |
| boundary 6 | None | None | Passed |
| control 7 | 10101100010000101001110101011110110001001000101010111010010100001011100100001010000101100110101 | 10101100010000101001110101011110110001001000101010111010010100001011100100001010000101100110101 | Passed |
SHA-256 / dc93b3cc112392e239637ab260971871f8f3bd7bbadf39a9b3353a54f996cefa
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:43.801711+00:00.
Case digest / 193228eee656c9b0633a1133457c727aab79db0b7b1dbf0dafd49c34e2ab8b1a