{"abstract":"Every digit pair scans reversed, so 1234 reads as 2143.","category":"Barcode symbology encoding","checks":8,"contract":"Encode ASCII digits as Interleaved 2 of 5 element widths (narrow 1, wide = ratio in {2, 2.5, 3}). An odd-length input gets a leading 0. Start is narrow bar/space/bar/space; each digit pair interleaves the first digit's pattern in the bars with the second digit's pattern in the spaces; stop is wide bar, narrow space, narrow bar. Digit patterns use weights 1,2,4,7 plus parity (0 = NNWWN). Invalid input returns None.","contract_signature":"digits, ratio","evaluation_group":"w2-barcode-symbology-encoding-itf-interleave","failed_approach":"Reading the space pattern backwards corrupts the second digit.","family":"w2-barcode-symbology-encoding-itf-interleave-interleave-order","id":"FA-79516","implementations":{"attempt":{"sha256":"f99ac391f2b1f4a1eefd81fdd8d517094230ddd7568599fb9fa02201283f38c5","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(digits, ratio):\n    if not digits or not all(c in '0123456789' for c in digits) or ratio not in (2, 2.5, 3):\n        return None\n    P = {'0': 'NNWWN', '1': 'WNNNW', '2': 'NWNNW', '3': 'WWNNN', '4': 'NNWNW',\n         '5': 'WNWNN', '6': 'NWWNN', '7': 'NNNWW', '8': 'WNNWN', '9': 'NWNWN'}\n    if len(digits) % 2:\n        digits = '0' + digits\n    wid = {'N': 1, 'W': ratio}\n    out = [1, 1, 1, 1]\n    for i in range(0, len(digits), 2):\n        a, b = P[digits[i]], P[digits[i + 1]]\n        for k in range(5):\n            out.append(wid[a[k]])\n            out.append(wid[b[4 - k]])\n    out += [ratio, 1, 1]\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[[('809220', 3), [1, 1, 1, 1, 3, 1, 1, 1, 1, 3, 3, 3, 1, 1, 1, 1, 3, 3, 1, 1, 3, 1, 1, 3, 1, 1, 3, 1, 1, 3, 1, 3, 3, 1, 3, 1, 1]], [('2', 2.5), [1, 1, 1, 1, 1, 1, 1, 2.5, 2.5, 1, 2.5, 1, 1, 2.5, 2.5, 1, 1]], [('596257', 4), None], [('37775', 4), None], [('683', 4), None], [('395208', 4), None], [('4528', 4), None], [('960081', 3), [1, 1, 1, 1, 1, 1, 3, 3, 1, 3, 3, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 1, 1, 3, 3, 1, 1, 1, 1, 3, 1, 1, 3, 3, 1, 1]]], [[('954', 3), [1, 1, 1, 1, 1, 1, 1, 3, 3, 1, 3, 3, 1, 1, 3, 1, 1, 1, 3, 3, 1, 1, 1, 3, 3, 1, 1]], [('246919', 2), [1, 1, 1, 1, 1, 1, 2, 1, 1, 2, 1, 1, 2, 2, 1, 1, 2, 2, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 1, 2, 2, 1, 2, 1, 1]], [('13', 4), None], [('296045', 4), None], [('402165', 4), None], [('044955', 4), None], [('803415', 4), None], [('5377', 2), [1, 1, 1, 1, 2, 2, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 1, 1]]], [[('486862', 3), [1, 1, 1, 1, 1, 3, 1, 1, 3, 1, 1, 3, 3, 1, 1, 3, 3, 1, 3, 1, 1, 3, 1, 1, 1, 1, 3, 3, 3, 1, 1, 1, 1, 3, 3, 1, 1]], [('05', 2), [1, 1, 1, 1, 1, 2, 1, 1, 2, 2, 2, 1, 1, 1, 2, 1, 1]], [('820280', 4), None], [('5694', 4), None], [('977', 4), None], [('80', 4), None], [('159055', 4), None], [('15', 3), [1, 1, 1, 1, 3, 3, 1, 1, 1, 3, 1, 1, 3, 1, 3, 1, 1]]], [[('6298', 3), [1, 1, 1, 1, 1, 1, 3, 3, 3, 1, 1, 1, 1, 3, 1, 3, 3, 1, 1, 1, 3, 3, 1, 1, 3, 1, 1]], [('74', 2.5), [1, 1, 1, 1, 1, 1, 1, 1, 1, 2.5, 2.5, 1, 2.5, 2.5, 2.5, 1, 1]], [('00', 4), None], [('909384', 4), None], [('4', 4), None], [('72', 4), None], [('69867', 4), None], [('17', 3), [1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 1, 1]]], [[('48', 3), [1, 1, 1, 1, 1, 3, 1, 1, 3, 1, 1, 3, 3, 1, 3, 1, 1]], [('151516', 2.5), [1, 1, 1, 1, 2.5, 2.5, 1, 1, 1, 2.5, 1, 1, 2.5, 1, 2.5, 2.5, 1, 1, 1, 2.5, 1, 1, 2.5, 1, 2.5, 1, 1, 2.5, 1, 2.5, 1, 1, 2.5, 1, 2.5, 1, 1]], [('6', 4), None], [('2527', 4), None], [('156', 4), None], [('8', 4), None], [('460', 4), None], [('420', 3), [1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 1, 1, 3, 1, 1, 3, 1, 1, 3, 1, 3, 3, 1, 3, 1, 1]]]]\nlabels = [\"regression: bar and space interleaving\", \"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":"7bc4731f47c33e2d131f6cf9a0e9bd1151b0cd759ac4011298ea8cf6c5544ad7","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(digits, ratio):\n    if not digits or not all(c in '0123456789' for c in digits) or ratio not in (2, 2.5, 3):\n        return None\n    P = {'0': 'NNWWN', '1': 'WNNNW', '2': 'NWNNW', '3': 'WWNNN', '4': 'NNWNW',\n         '5': 'WNWNN', '6': 'NWWNN', '7': 'NNNWW', '8': 'WNNWN', '9': 'NWNWN'}\n    if len(digits) % 2:\n        digits = '0' + digits\n    wid = {'N': 1, 'W': ratio}\n    out = [1, 1, 1, 1]\n    for i in range(0, len(digits), 2):\n        a, b = P[digits[i]], P[digits[i + 1]]\n        for k in range(5):\n            out.append(wid[b[k]])\n            out.append(wid[a[k]])\n    out += [ratio, 1, 1]\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[[('809220', 3), [1, 1, 1, 1, 3, 1, 1, 1, 1, 3, 3, 3, 1, 1, 1, 1, 3, 3, 1, 1, 3, 1, 1, 3, 1, 1, 3, 1, 1, 3, 1, 3, 3, 1, 3, 1, 1]], [('2', 2.5), [1, 1, 1, 1, 1, 1, 1, 2.5, 2.5, 1, 2.5, 1, 1, 2.5, 2.5, 1, 1]], [('596257', 4), None], [('37775', 4), None], [('683', 4), None], [('395208', 4), None], [('4528', 4), None], [('960081', 3), [1, 1, 1, 1, 1, 1, 3, 3, 1, 3, 3, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 1, 1, 3, 3, 1, 1, 1, 1, 3, 1, 1, 3, 3, 1, 1]]], [[('954', 3), [1, 1, 1, 1, 1, 1, 1, 3, 3, 1, 3, 3, 1, 1, 3, 1, 1, 1, 3, 3, 1, 1, 1, 3, 3, 1, 1]], [('246919', 2), [1, 1, 1, 1, 1, 1, 2, 1, 1, 2, 1, 1, 2, 2, 1, 1, 2, 2, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 1, 2, 2, 1, 2, 1, 1]], [('13', 4), None], [('296045', 4), None], [('402165', 4), None], [('044955', 4), None], [('803415', 4), None], [('5377', 2), [1, 1, 1, 1, 2, 2, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 1, 1]]], [[('486862', 3), [1, 1, 1, 1, 1, 3, 1, 1, 3, 1, 1, 3, 3, 1, 1, 3, 3, 1, 3, 1, 1, 3, 1, 1, 1, 1, 3, 3, 3, 1, 1, 1, 1, 3, 3, 1, 1]], [('05', 2), [1, 1, 1, 1, 1, 2, 1, 1, 2, 2, 2, 1, 1, 1, 2, 1, 1]], [('820280', 4), None], [('5694', 4), None], [('977', 4), None], [('80', 4), None], [('159055', 4), None], [('15', 3), [1, 1, 1, 1, 3, 3, 1, 1, 1, 3, 1, 1, 3, 1, 3, 1, 1]]], [[('6298', 3), [1, 1, 1, 1, 1, 1, 3, 3, 3, 1, 1, 1, 1, 3, 1, 3, 3, 1, 1, 1, 3, 3, 1, 1, 3, 1, 1]], [('74', 2.5), [1, 1, 1, 1, 1, 1, 1, 1, 1, 2.5, 2.5, 1, 2.5, 2.5, 2.5, 1, 1]], [('00', 4), None], [('909384', 4), None], [('4', 4), None], [('72', 4), None], [('69867', 4), None], [('17', 3), [1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 1, 1]]], [[('48', 3), [1, 1, 1, 1, 1, 3, 1, 1, 3, 1, 1, 3, 3, 1, 3, 1, 1]], [('151516', 2.5), [1, 1, 1, 1, 2.5, 2.5, 1, 1, 1, 2.5, 1, 1, 2.5, 1, 2.5, 2.5, 1, 1, 1, 2.5, 1, 1, 2.5, 1, 2.5, 1, 1, 2.5, 1, 2.5, 1, 1, 2.5, 1, 2.5, 1, 1]], [('6', 4), None], [('2527', 4), None], [('156', 4), None], [('8', 4), None], [('460', 4), None], [('420', 3), [1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 1, 1, 3, 1, 1, 3, 1, 1, 3, 1, 3, 3, 1, 3, 1, 1]]]]\nlabels = [\"regression: bar and space interleaving\", \"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-itf-interleave-interleave-order","generated_at":"2026-09-29T14:49:45.119868+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.","root_cause":"Bars take the second digit's pattern and spaces the first.","sha256":"6c2224fab7c50e118dd7c010b2ff64f0981b0909c90134938275c5f53446ab66","title":"ITF puts the second digit of each pair in the bars · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verified":true,"visibility":"public","verification":{"attempt":{"elapsed_ms":39.991,"exit_code":1,"observations":[{"actual":[1,1,1,1,3,1,1,3,1,3,3,1,1,1,1,3,3,1,1,1,3,3,1,1,1,1,3,3,1,3,1,1,3,1,3,1,1],"check":"regression: bar and space interleaving 0","expected":[1,1,1,1,3,1,1,1,1,3,3,3,1,1,1,1,3,3,1,1,3,1,1,3,1,1,3,1,1,3,1,3,3,1,3,1,1],"passed":false},{"actual":[1,1,1,1,1,2.5,1,1,2.5,1,2.5,2.5,1,1,2.5,1,1],"check":"repair trap 1","expected":[1,1,1,1,1,1,1,2.5,2.5,1,2.5,1,1,2.5,2.5,1,1],"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":null,"check":"boundary 5","expected":null,"passed":true},{"actual":null,"check":"boundary 6","expected":null,"passed":true},{"actual":[1,1,1,1,1,1,3,1,1,3,3,3,1,1,1,1,1,3,3,3,3,1,1,1,3,3,1,1,1,1,3,1,1,3,3,1,1],"check":"control 7","expected":[1,1,1,1,1,1,3,3,1,3,3,1,1,1,1,1,1,1,3,3,3,3,1,1,3,3,1,1,1,1,3,1,1,3,3,1,1],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: bar and space interleaving 0\", \"actual\": [1, 1, 1, 1, 3, 1, 1, 3, 1, 3, 3, 1, 1, 1, 1, 3, 3, 1, 1, 1, 3, 3, 1, 1, 1, 1, 3, 3, 1, 3, 1, 1, 3, 1, 3, 1, 1], \"expected\": [1, 1, 1, 1, 3, 1, 1, 1, 1, 3, 3, 3, 1, 1, 1, 1, 3, 3, 1, 1, 3, 1, 1, 3, 1, 1, 3, 1, 1, 3, 1, 3, 3, 1, 3, 1, 1], \"passed\": false}, {\"check\": \"repair trap 1\", \"actual\": [1, 1, 1, 1, 1, 2.5, 1, 1, 2.5, 1, 2.5, 2.5, 1, 1, 2.5, 1, 1], \"expected\": [1, 1, 1, 1, 1, 1, 1, 2.5, 2.5, 1, 2.5, 1, 1, 2.5, 2.5, 1, 1], \"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\": null, \"expected\": null, \"passed\": true}, {\"check\": \"boundary 6\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"control 7\", \"actual\": [1, 1, 1, 1, 1, 1, 3, 1, 1, 3, 3, 3, 1, 1, 1, 1, 1, 3, 3, 3, 3, 1, 1, 1, 3, 3, 1, 1, 1, 1, 3, 1, 1, 3, 3, 1, 1], \"expected\": [1, 1, 1, 1, 1, 1, 3, 3, 1, 3, 3, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 1, 1, 3, 3, 1, 1, 1, 1, 3, 1, 1, 3, 3, 1, 1], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":40.647,"exit_code":1,"observations":[{"actual":[1,1,1,1,1,3,1,1,3,1,3,3,1,1,1,1,3,3,1,1,1,3,3,1,1,1,1,3,3,1,3,1,1,3,3,1,1],"check":"regression: bar and space interleaving 0","expected":[1,1,1,1,3,1,1,1,1,3,3,3,1,1,1,1,3,3,1,1,3,1,1,3,1,1,3,1,1,3,1,3,3,1,3,1,1],"passed":false},{"actual":[1,1,1,1,1,1,2.5,1,1,2.5,1,2.5,2.5,1,2.5,1,1],"check":"repair trap 1","expected":[1,1,1,1,1,1,1,2.5,2.5,1,2.5,1,1,2.5,2.5,1,1],"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":null,"check":"boundary 5","expected":null,"passed":true},{"actual":null,"check":"boundary 6","expected":null,"passed":true},{"actual":[1,1,1,1,1,1,3,3,3,1,1,3,1,1,1,1,1,1,3,3,3,3,1,1,3,3,1,1,1,1,1,3,3,1,3,1,1],"check":"control 7","expected":[1,1,1,1,1,1,3,3,1,3,3,1,1,1,1,1,1,1,3,3,3,3,1,1,3,3,1,1,1,1,3,1,1,3,3,1,1],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: bar and space interleaving 0\", \"actual\": [1, 1, 1, 1, 1, 3, 1, 1, 3, 1, 3, 3, 1, 1, 1, 1, 3, 3, 1, 1, 1, 3, 3, 1, 1, 1, 1, 3, 3, 1, 3, 1, 1, 3, 3, 1, 1], \"expected\": [1, 1, 1, 1, 3, 1, 1, 1, 1, 3, 3, 3, 1, 1, 1, 1, 3, 3, 1, 1, 3, 1, 1, 3, 1, 1, 3, 1, 1, 3, 1, 3, 3, 1, 3, 1, 1], \"passed\": false}, {\"check\": \"repair trap 1\", \"actual\": [1, 1, 1, 1, 1, 1, 2.5, 1, 1, 2.5, 1, 2.5, 2.5, 1, 2.5, 1, 1], \"expected\": [1, 1, 1, 1, 1, 1, 1, 2.5, 2.5, 1, 2.5, 1, 1, 2.5, 2.5, 1, 1], \"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\": null, \"expected\": null, \"passed\": true}, {\"check\": \"boundary 6\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"control 7\", \"actual\": [1, 1, 1, 1, 1, 1, 3, 3, 3, 1, 1, 3, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 1, 1, 3, 3, 1, 1, 1, 1, 1, 3, 3, 1, 3, 1, 1], \"expected\": [1, 1, 1, 1, 1, 1, 3, 3, 1, 3, 3, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 1, 1, 3, 3, 1, 1, 1, 1, 3, 1, 1, 3, 3, 1, 1], \"passed\": false}], \"passed\": false}\n"}},"member_only":{"stages":["fixed"],"fields":["implementations.fixed","verification.fixed","harness","repair"],"note":"The verified repair, its recorded checks, the repair description, and the scoring harness are available to members."}}