{"abstract":"Symbols framed with lowercase letters are passed to a font that has no glyphs for them.","category":"Barcode symbology encoding","checks":8,"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.","evaluation_group":"w2-barcode-symbology-encoding-codabar-width","failed_approach":"Admitting the alternate T N * E notation violates the A-D contract.","family":"w2-barcode-symbology-encoding-codabar-width-start-stop-set","id":"FA-79551","implementations":{"attempt":{"sha256":"caa45c1cc3a09b643e0a0b1ecaef0f34f68bdc31882896aba6602750995eec7e","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(text, ratio):\n    if not 2 <= ratio <= 3:\n        return {'error': 'ratio'}\n    if len(text) < 2:\n        return {'error': 'short'}\n    if text[0] not in 'ABCDTN*E' or text[-1] not in 'ABCDTN*E':\n        return {'error': 'start-stop'}\n    body = text[1:-1]\n    for ch in body:\n        if ch not in '0123456789-$:/.+':\n            return {'error': 'char', 'char': ch}\n    total = 0\n    for ch in text:\n        wides = 2 if ch in '0123456789-$' else 3\n        total += (7 - wides) + wides * ratio\n    return {'modules': total + len(text) - 1}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[[('a+d', 2.5), {'error': 'start-stop'}], [('A+53T', 3), {'error': 'start-stop'}], [('DA/40D', 2.5), {'error': 'char', 'char': 'A'}], [('AE2$5C', 3), {'error': 'char', 'char': 'E'}], [('C5525D', 1.5), {'error': 'ratio'}], [('D$554A', 4), {'error': 'ratio'}], [('C+B', 3), {'modules': 41}], [('ad', 3), {'error': 'start-stop'}]], [[('a3/AC', 3), {'error': 'start-stop'}], [('BT', 3), {'error': 'start-stop'}], [('a$5D', 1.5), {'error': 'ratio'}], [('CD', 2), {'modules': 21}], [('AAA$03d', 4), {'error': 'ratio'}], [('C773C', 1.5), {'error': 'ratio'}], [('a2$A', 1.5), {'error': 'ratio'}], [('BE3Ed', 2.5), {'error': 'start-stop'}]], [[('B55d', 2.5), {'error': 'start-stop'}], [('C35355T', 3), {'error': 'start-stop'}], [('a+A', 4), {'error': 'ratio'}], [('A9505D', 2), {'modules': 61}], [('a958$3C', 1.5), {'error': 'ratio'}], [('D5357T', 1.5), {'error': 'ratio'}], [('a6C', 4), {'error': 'ratio'}], [('a5C', 2), {'error': 'start-stop'}]], [[('a2/C', 2), {'error': 'start-stop'}], [('A3AA+3T', 2.5), {'error': 'start-stop'}], [('B+-+-5B', 1.5), {'error': 'ratio'}], [('A95-42T', 1.5), {'error': 'ratio'}], [('aT', 2.5), {'error': 'start-stop'}], [('A:5B', 2), {'modules': 42}], [('C528+D', 2), {'modules': 62}], [('D3$20d', 3), {'error': 'start-stop'}]], [[('a/D', 3), {'error': 'start-stop'}], [('A9T', 2.5), {'error': 'start-stop'}], [('B5C', 3), {'modules': 39}], [('A-$1A', 3), {'modules': 63}], [('A035/$C', 1.5), {'error': 'ratio'}], [('C55-T', 4), {'error': 'ratio'}], [('a/803T', 3), {'error': 'start-stop'}], [('A97+$5d', 2.5), {'error': 'start-stop'}]]]\nlabels = [\"regression: start and stop letters\", \"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":"2c301c4066a2a19029eea338841610fa3b13cfd9a9301d12730a19739976fa06","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(text, ratio):\n    if not 2 <= ratio <= 3:\n        return {'error': 'ratio'}\n    if len(text) < 2:\n        return {'error': 'short'}\n    if text[0].upper() not in 'ABCD' or text[-1].upper() not in 'ABCD':\n        return {'error': 'start-stop'}\n    body = text[1:-1]\n    for ch in body:\n        if ch not in '0123456789-$:/.+':\n            return {'error': 'char', 'char': ch}\n    total = 0\n    for ch in text:\n        wides = 2 if ch in '0123456789-$' else 3\n        total += (7 - wides) + wides * ratio\n    return {'modules': total + len(text) - 1}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[[('a+d', 2.5), {'error': 'start-stop'}], [('A+53T', 3), {'error': 'start-stop'}], [('DA/40D', 2.5), {'error': 'char', 'char': 'A'}], [('AE2$5C', 3), {'error': 'char', 'char': 'E'}], [('C5525D', 1.5), {'error': 'ratio'}], [('D$554A', 4), {'error': 'ratio'}], [('C+B', 3), {'modules': 41}], [('ad', 3), {'error': 'start-stop'}]], [[('a3/AC', 3), {'error': 'start-stop'}], [('BT', 3), {'error': 'start-stop'}], [('a$5D', 1.5), {'error': 'ratio'}], [('CD', 2), {'modules': 21}], [('AAA$03d', 4), {'error': 'ratio'}], [('C773C', 1.5), {'error': 'ratio'}], [('a2$A', 1.5), {'error': 'ratio'}], [('BE3Ed', 2.5), {'error': 'start-stop'}]], [[('B55d', 2.5), {'error': 'start-stop'}], [('C35355T', 3), {'error': 'start-stop'}], [('a+A', 4), {'error': 'ratio'}], [('A9505D', 2), {'modules': 61}], [('a958$3C', 1.5), {'error': 'ratio'}], [('D5357T', 1.5), {'error': 'ratio'}], [('a6C', 4), {'error': 'ratio'}], [('a5C', 2), {'error': 'start-stop'}]], [[('a2/C', 2), {'error': 'start-stop'}], [('A3AA+3T', 2.5), {'error': 'start-stop'}], [('B+-+-5B', 1.5), {'error': 'ratio'}], [('A95-42T', 1.5), {'error': 'ratio'}], [('aT', 2.5), {'error': 'start-stop'}], [('A:5B', 2), {'modules': 42}], [('C528+D', 2), {'modules': 62}], [('D3$20d', 3), {'error': 'start-stop'}]], [[('a/D', 3), {'error': 'start-stop'}], [('A9T', 2.5), {'error': 'start-stop'}], [('B5C', 3), {'modules': 39}], [('A-$1A', 3), {'modules': 63}], [('A035/$C', 1.5), {'error': 'ratio'}], [('C55-T', 4), {'error': 'ratio'}], [('a/803T', 3), {'error': 'start-stop'}], [('A97+$5d', 2.5), {'error': 'start-stop'}]]]\nlabels = [\"regression: start and stop letters\", \"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":"11e051797ecb47429010837444f20a3fd620b565a3e4c64f782fb39525e04d13","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(text, ratio):\n    if not 2 <= ratio <= 3:\n        return {'error': 'ratio'}\n    if len(text) < 2:\n        return {'error': 'short'}\n    if text[0] not in 'ABCD' or text[-1] not in 'ABCD':\n        return {'error': 'start-stop'}\n    body = text[1:-1]\n    for ch in body:\n        if ch not in '0123456789-$:/.+':\n            return {'error': 'char', 'char': ch}\n    total = 0\n    for ch in text:\n        wides = 2 if ch in '0123456789-$' else 3\n        total += (7 - wides) + wides * ratio\n    return {'modules': total + len(text) - 1}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[[('a+d', 2.5), {'error': 'start-stop'}], [('A+53T', 3), {'error': 'start-stop'}], [('DA/40D', 2.5), {'error': 'char', 'char': 'A'}], [('AE2$5C', 3), {'error': 'char', 'char': 'E'}], [('C5525D', 1.5), {'error': 'ratio'}], [('D$554A', 4), {'error': 'ratio'}], [('C+B', 3), {'modules': 41}], [('ad', 3), {'error': 'start-stop'}]], [[('a3/AC', 3), {'error': 'start-stop'}], [('BT', 3), {'error': 'start-stop'}], [('a$5D', 1.5), {'error': 'ratio'}], [('CD', 2), {'modules': 21}], [('AAA$03d', 4), {'error': 'ratio'}], [('C773C', 1.5), {'error': 'ratio'}], [('a2$A', 1.5), {'error': 'ratio'}], [('BE3Ed', 2.5), {'error': 'start-stop'}]], [[('B55d', 2.5), {'error': 'start-stop'}], [('C35355T', 3), {'error': 'start-stop'}], [('a+A', 4), {'error': 'ratio'}], [('A9505D', 2), {'modules': 61}], [('a958$3C', 1.5), {'error': 'ratio'}], [('D5357T', 1.5), {'error': 'ratio'}], [('a6C', 4), {'error': 'ratio'}], [('a5C', 2), {'error': 'start-stop'}]], [[('a2/C', 2), {'error': 'start-stop'}], [('A3AA+3T', 2.5), {'error': 'start-stop'}], [('B+-+-5B', 1.5), {'error': 'ratio'}], [('A95-42T', 1.5), {'error': 'ratio'}], [('aT', 2.5), {'error': 'start-stop'}], [('A:5B', 2), {'modules': 42}], [('C528+D', 2), {'modules': 62}], [('D3$20d', 3), {'error': 'start-stop'}]], [[('a/D', 3), {'error': 'start-stop'}], [('A9T', 2.5), {'error': 'start-stop'}], [('B5C', 3), {'modules': 39}], [('A-$1A', 3), {'modules': 63}], [('A035/$C', 1.5), {'error': 'ratio'}], [('C55-T', 4), {'error': 'ratio'}], [('a/803T', 3), {'error': 'start-stop'}], [('A97+$5d', 2.5), {'error': 'start-stop'}]]]\nlabels = [\"regression: start and stop letters\", \"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-codabar-width-start-stop-set","generated_at":"2026-09-29T14:49:45.664300+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":"Accept only uppercase A-D as start/stop characters.","root_cause":"Start/stop characters are upper-cased before validation.","sha256":"a8039f90cfd3b127359294b653189a7a61a359874e77286f13da2fe65949830e","title":"Codabar accepts lowercase start and stop letters · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":40.22,"exit_code":1,"observations":[{"actual":{"error":"start-stop"},"check":"regression: start and stop letters 0","expected":{"error":"start-stop"},"passed":true},{"actual":{"modules":65},"check":"repair trap 1","expected":{"error":"start-stop"},"passed":false},{"actual":{"char":"A","error":"char"},"check":"combined fault 2","expected":{"char":"A","error":"char"},"passed":true},{"actual":{"char":"E","error":"char"},"check":"control 3","expected":{"char":"E","error":"char"},"passed":true},{"actual":{"error":"ratio"},"check":"control 4","expected":{"error":"ratio"},"passed":true},{"actual":{"error":"ratio"},"check":"boundary 5","expected":{"error":"ratio"},"passed":true},{"actual":{"modules":41},"check":"boundary 6","expected":{"modules":41},"passed":true},{"actual":{"error":"start-stop"},"check":"control 7","expected":{"error":"start-stop"},"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: start and stop letters 0\", \"actual\": {\"error\": \"start-stop\"}, \"expected\": {\"error\": \"start-stop\"}, \"passed\": true}, {\"check\": \"repair trap 1\", \"actual\": {\"modules\": 65}, \"expected\": {\"error\": \"start-stop\"}, \"passed\": false}, {\"check\": \"combined fault 2\", \"actual\": {\"error\": \"char\", \"char\": \"A\"}, \"expected\": {\"error\": \"char\", \"char\": \"A\"}, \"passed\": true}, {\"check\": \"control 3\", \"actual\": {\"error\": \"char\", \"char\": \"E\"}, \"expected\": {\"error\": \"char\", \"char\": \"E\"}, \"passed\": true}, {\"check\": \"control 4\", \"actual\": {\"error\": \"ratio\"}, \"expected\": {\"error\": \"ratio\"}, \"passed\": true}, {\"check\": \"boundary 5\", \"actual\": {\"error\": \"ratio\"}, \"expected\": {\"error\": \"ratio\"}, \"passed\": true}, {\"check\": \"boundary 6\", \"actual\": {\"modules\": 41}, \"expected\": {\"modules\": 41}, \"passed\": true}, {\"check\": \"control 7\", \"actual\": {\"error\": \"start-stop\"}, \"expected\": {\"error\": \"start-stop\"}, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":39.258,"exit_code":1,"observations":[{"actual":{"modules":36.5},"check":"regression: start and stop letters 0","expected":{"error":"start-stop"},"passed":false},{"actual":{"error":"start-stop"},"check":"repair trap 1","expected":{"error":"start-stop"},"passed":true},{"actual":{"char":"A","error":"char"},"check":"combined fault 2","expected":{"char":"A","error":"char"},"passed":true},{"actual":{"char":"E","error":"char"},"check":"control 3","expected":{"char":"E","error":"char"},"passed":true},{"actual":{"error":"ratio"},"check":"control 4","expected":{"error":"ratio"},"passed":true},{"actual":{"error":"ratio"},"check":"boundary 5","expected":{"error":"ratio"},"passed":true},{"actual":{"modules":41},"check":"boundary 6","expected":{"modules":41},"passed":true},{"actual":{"modules":27},"check":"control 7","expected":{"error":"start-stop"},"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: start and stop letters 0\", \"actual\": {\"modules\": 36.5}, \"expected\": {\"error\": \"start-stop\"}, \"passed\": false}, {\"check\": \"repair trap 1\", \"actual\": {\"error\": \"start-stop\"}, \"expected\": {\"error\": \"start-stop\"}, \"passed\": true}, {\"check\": \"combined fault 2\", \"actual\": {\"error\": \"char\", \"char\": \"A\"}, \"expected\": {\"error\": \"char\", \"char\": \"A\"}, \"passed\": true}, {\"check\": \"control 3\", \"actual\": {\"error\": \"char\", \"char\": \"E\"}, \"expected\": {\"error\": \"char\", \"char\": \"E\"}, \"passed\": true}, {\"check\": \"control 4\", \"actual\": {\"error\": \"ratio\"}, \"expected\": {\"error\": \"ratio\"}, \"passed\": true}, {\"check\": \"boundary 5\", \"actual\": {\"error\": \"ratio\"}, \"expected\": {\"error\": \"ratio\"}, \"passed\": true}, {\"check\": \"boundary 6\", \"actual\": {\"modules\": 41}, \"expected\": {\"modules\": 41}, \"passed\": true}, {\"check\": \"control 7\", \"actual\": {\"modules\": 27}, \"expected\": {\"error\": \"start-stop\"}, \"passed\": false}], \"passed\": false}\n"},"fixed":{"elapsed_ms":40.898,"exit_code":0,"observations":[{"actual":{"error":"start-stop"},"check":"regression: start and stop letters 0","expected":{"error":"start-stop"},"passed":true},{"actual":{"error":"start-stop"},"check":"repair trap 1","expected":{"error":"start-stop"},"passed":true},{"actual":{"char":"A","error":"char"},"check":"combined fault 2","expected":{"char":"A","error":"char"},"passed":true},{"actual":{"char":"E","error":"char"},"check":"control 3","expected":{"char":"E","error":"char"},"passed":true},{"actual":{"error":"ratio"},"check":"control 4","expected":{"error":"ratio"},"passed":true},{"actual":{"error":"ratio"},"check":"boundary 5","expected":{"error":"ratio"},"passed":true},{"actual":{"modules":41},"check":"boundary 6","expected":{"modules":41},"passed":true},{"actual":{"error":"start-stop"},"check":"control 7","expected":{"error":"start-stop"},"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: start and stop letters 0\", \"actual\": {\"error\": \"start-stop\"}, \"expected\": {\"error\": \"start-stop\"}, \"passed\": true}, {\"check\": \"repair trap 1\", \"actual\": {\"error\": \"start-stop\"}, \"expected\": {\"error\": \"start-stop\"}, \"passed\": true}, {\"check\": \"combined fault 2\", \"actual\": {\"error\": \"char\", \"char\": \"A\"}, \"expected\": {\"error\": \"char\", \"char\": \"A\"}, \"passed\": true}, {\"check\": \"control 3\", \"actual\": {\"error\": \"char\", \"char\": \"E\"}, \"expected\": {\"error\": \"char\", \"char\": \"E\"}, \"passed\": true}, {\"check\": \"control 4\", \"actual\": {\"error\": \"ratio\"}, \"expected\": {\"error\": \"ratio\"}, \"passed\": true}, {\"check\": \"boundary 5\", \"actual\": {\"error\": \"ratio\"}, \"expected\": {\"error\": \"ratio\"}, \"passed\": true}, {\"check\": \"boundary 6\", \"actual\": {\"modules\": 41}, \"expected\": {\"modules\": 41}, \"passed\": true}, {\"check\": \"control 7\", \"actual\": {\"error\": \"start-stop\"}, \"expected\": {\"error\": \"start-stop\"}, \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}