FA-79566 / Barcode symbology encoding / Open access
Codabar start and stop characters are sized like digits · case 01
Every symbol is two wide elements shorter than printed, so the layout clips the stop character.
ROOT CAUSE
Start/stop letters are given two wide elements instead of three.
THE FAILURE
Start/stop letters are given two wide elements instead of three.
Unsuccessful approach: Four wide elements would make them nine-element characters.
Case contract
Validate and size a Codabar symbol text with a wide:narrow ratio between 2 and 3 inclusive. The first and last characters must be start/stop letters A-D (uppercase only, at least two characters); body characters are 0-9 - $ : / . +. Each character has 7 elements: digits, "-" and "$" have 2 wide elements, ": / . +" and A-D have 3. One narrow gap separates adjacent characters. Return the total width in narrow modules or an error.
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(text, ratio):
if not 2 <= ratio <= 3:
return {'error': 'ratio'}
if len(text) < 2:
return {'error': 'short'}
if text[0] not in 'ABCD' or text[-1] not in 'ABCD':
return {'error': 'start-stop'}
body = text[1:-1]
for ch in body:
if ch not in '0123456789-$:/.+':
return {'error': 'char', 'char': ch}
total = 0
for ch in text:
wides = 2 if ch in '0123456789-$' else (2 if ch in 'ABCD' else 3)
total += (7 - wides) + wides * ratio
return {'modules': total + len(text) - 1}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[[('C+B', 3), {'modules': 41}], [('B:0C', 3), {'modules': 53}], [('DA/40D', 2.5), {'error': 'char', 'char': 'A'}], [('AE2$5C', 3), {'error': 'char', 'char': 'E'}], [('a+d', 2.5), {'error': 'start-stop'}], [('ad', 3), {'error': 'start-stop'}], [('C5525D', 1.5), {'error': 'ratio'}], [('B5355D', 3), {'modules': 75}]], [[('CD', 2), {'modules': 21}], [('C//5D', 2.5), {'modules': 60.0}], [('AAA$03d', 4), {'error': 'ratio'}], [('A+3d', 2), {'error': 'start-stop'}], [('a3/AC', 3), {'error': 'start-stop'}], [('A/59$T', 3), {'error': 'start-stop'}], [('C773C', 1.5), {'error': 'ratio'}], [('CA', 3), {'modules': 27}]], [[('B957A', 2.5), {'modules': 57.0}], [('B53C', 2), {'modules': 41}], [('A$7:+d', 1.5), {'error': 'ratio'}], [('a+A', 4), {'error': 'ratio'}], [('a958$3C', 1.5), {'error': 'ratio'}], [('D5357T', 1.5), {'error': 'ratio'}], [('a5C', 2), {'error': 'start-stop'}], [('D5-B', 2.5), {'modules': 46.0}]], [[('A:5B', 2), {'modules': 42}], [('B$D', 2), {'modules': 31}], [('aT', 2.5), {'error': 'start-stop'}], [('D3$20d', 3), {'error': 'start-stop'}], [('C58d', 1.5), {'error': 'ratio'}], [('D/5:3B', 4), {'error': 'ratio'}], [('AA', 1.5), {'error': 'ratio'}], [('A1D', 3), {'modules': 39}]], [[('A-31A', 3), {'modules': 63}], [('A905C', 3), {'modules': 63}], [('aB', 3), {'error': 'start-stop'}], [('Cd', 2), {'error': 'start-stop'}], [('a/D', 3), {'error': 'start-stop'}], [('A117.T', 2.5), {'error': 'start-stop'}], [('aD', 3), {'error': 'start-stop'}], [('C55C', 3), {'modules': 51}]]]
labels = ["regression: start and stop wide count", "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: start and stop wide count 0 | {'modules': 37} | {'modules': 41} | Failed |
| repair trap 1 | {'modules': 49} | {'modules': 53} | Failed |
| combined fault 2 | {'char': 'A', 'error': 'char'} | {'char': 'A', 'error': 'char'} | Passed |
| control 3 | {'char': 'E', 'error': 'char'} | {'char': 'E', 'error': 'char'} | Passed |
| control 4 | {'error': 'start-stop'} | {'error': 'start-stop'} | Passed |
| boundary 5 | {'error': 'start-stop'} | {'error': 'start-stop'} | Passed |
| boundary 6 | {'error': 'ratio'} | {'error': 'ratio'} | Passed |
| control 7 | {'modules': 71} | {'modules': 75} | Failed |
SHA-256 / 2ad09bdf5008af1caa0fad8ec72ef3583b26ec238e11d2498eb70700830080ac
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(text, ratio):
if not 2 <= ratio <= 3:
return {'error': 'ratio'}
if len(text) < 2:
return {'error': 'short'}
if text[0] not in 'ABCD' or text[-1] not in 'ABCD':
return {'error': 'start-stop'}
body = text[1:-1]
for ch in body:
if ch not in '0123456789-$:/.+':
return {'error': 'char', 'char': ch}
total = 0
for ch in text:
wides = 2 if ch in '0123456789-$' else (4 if ch in 'ABCD' else 3)
total += (7 - wides) + wides * ratio
return {'modules': total + len(text) - 1}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[[('C+B', 3), {'modules': 41}], [('B:0C', 3), {'modules': 53}], [('DA/40D', 2.5), {'error': 'char', 'char': 'A'}], [('AE2$5C', 3), {'error': 'char', 'char': 'E'}], [('a+d', 2.5), {'error': 'start-stop'}], [('ad', 3), {'error': 'start-stop'}], [('C5525D', 1.5), {'error': 'ratio'}], [('B5355D', 3), {'modules': 75}]], [[('CD', 2), {'modules': 21}], [('C//5D', 2.5), {'modules': 60.0}], [('AAA$03d', 4), {'error': 'ratio'}], [('A+3d', 2), {'error': 'start-stop'}], [('a3/AC', 3), {'error': 'start-stop'}], [('A/59$T', 3), {'error': 'start-stop'}], [('C773C', 1.5), {'error': 'ratio'}], [('CA', 3), {'modules': 27}]], [[('B957A', 2.5), {'modules': 57.0}], [('B53C', 2), {'modules': 41}], [('A$7:+d', 1.5), {'error': 'ratio'}], [('a+A', 4), {'error': 'ratio'}], [('a958$3C', 1.5), {'error': 'ratio'}], [('D5357T', 1.5), {'error': 'ratio'}], [('a5C', 2), {'error': 'start-stop'}], [('D5-B', 2.5), {'modules': 46.0}]], [[('A:5B', 2), {'modules': 42}], [('B$D', 2), {'modules': 31}], [('aT', 2.5), {'error': 'start-stop'}], [('D3$20d', 3), {'error': 'start-stop'}], [('C58d', 1.5), {'error': 'ratio'}], [('D/5:3B', 4), {'error': 'ratio'}], [('AA', 1.5), {'error': 'ratio'}], [('A1D', 3), {'modules': 39}]], [[('A-31A', 3), {'modules': 63}], [('A905C', 3), {'modules': 63}], [('aB', 3), {'error': 'start-stop'}], [('Cd', 2), {'error': 'start-stop'}], [('a/D', 3), {'error': 'start-stop'}], [('A117.T', 2.5), {'error': 'start-stop'}], [('aD', 3), {'error': 'start-stop'}], [('C55C', 3), {'modules': 51}]]]
labels = ["regression: start and stop wide count", "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: start and stop wide count 0 | {'modules': 45} | {'modules': 41} | Failed |
| repair trap 1 | {'modules': 57} | {'modules': 53} | Failed |
| combined fault 2 | {'char': 'A', 'error': 'char'} | {'char': 'A', 'error': 'char'} | Passed |
| control 3 | {'char': 'E', 'error': 'char'} | {'char': 'E', 'error': 'char'} | Passed |
| control 4 | {'error': 'start-stop'} | {'error': 'start-stop'} | Passed |
| boundary 5 | {'error': 'start-stop'} | {'error': 'start-stop'} | Passed |
| boundary 6 | {'error': 'ratio'} | {'error': 'ratio'} | Passed |
| control 7 | {'modules': 79} | {'modules': 75} | Failed |
SHA-256 / abd219c04d1e00391dba4e9e43946ed1ac3aa8c723322f04f3a582d67f115056
HELD IN THE MEMBER ARCHIVE
The verified repair and its recorded checks are member-only.
This mechanism has 8 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.
Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.
Member access is invitation-based. Sign in with your invited account to inspect the repair.
Sign in to the archive ↗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:45.716276+00:00.
Case digest / cae33d788f635e0dbba92ae834854e1f4dda566921597b2c68e875372a8e5fd3