{"abstract":"Converted ISBN-13 numbers fail barcode scanners.","category":"Check-digit algorithms","checks":8,"contract":"Convert a hyphenated or plain ISBN-10 to ISBN-13. The input must be a valid ISBN-10 (mod 11, X allowed as the final character) or None is returned. The result is \"978\" + the nine ISBN-10 payload digits + a freshly computed EAN-13 check digit (weights 1,3 alternating from the left).","contract_signature":"s","evaluation_group":"w2-check_digit_algorithms-isbn10-to-13","failed_approach":"Weighting from the right of the 12-digit body by 1,3 is the same wrong phase in disguise.","family":"w2-check_digit_algorithms-isbn10-to-13-ean-weight-phase","id":"FA-72441","implementations":{"attempt":{"sha256":"84274641d8f1d7bb1b07f9eab319a7c89b2ccc728bb981406f81324ed9410891","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(s):\n    t = s.replace('-', '')\n    if len(t) != 10 or not t.isascii() or not t[:9].isdigit() or not (t[9].isdigit() or t[9] == 'X'):\n        return None\n    if sum((10 - i) * (10 if ch == 'X' else int(ch)) for i, ch in enumerate(t)) % 11:\n        return None\n    body = '978' + t[:9]\n    total = sum(int(ch) * (1 if i % 2 == 0 else 3) for i, ch in enumerate(reversed(body)))\n    return body + str((10 - total % 10) % 10)\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression [\"5892872939\"]', ['5892872939'], '9785892872935'], ['regression [\"2399553950\"]', ['2399553950'], '9782399553954'], ['control [\"2266685686\"]', ['2266685686'], '9782266685689'], ['control [\"1475433131\"]', ['1475433131'], '9781475433135'], ['control [\"0436178273\"]', ['0436178273'], '9780436178276'], ['control [\"0306406152\"]', ['0306406152'], '9780306406157'], ['control [\"0000000000\"]', ['0000000000'], '9780000000002'], ['control [\"123456789X\"]', ['123456789X'], '9781234567897']], [['regression [\"829284466X\"]', ['829284466X'], '9788292844663'], ['regression [\"9379774826\"]', ['9379774826'], '9789379774828'], ['control [\"123456789X\"]', ['123456789X'], '9781234567897'], ['control [\"5892872930\"]', ['5892872930'], None], ['control [\"2399553951\"]', ['2399553951'], None], ['control [\"9465545440\"]', ['9465545440'], None], ['control [\"8292844660\"]', ['8292844660'], None], ['control [\"9379774827\"]', ['9379774827'], None]], [['regression [\"5900307905\"]', ['5900307905'], '9785900307909'], ['regression [\"3905987139\"]', ['3905987139'], '9783905987133'], ['control [\"9379774827\"]', ['9379774827'], None], ['control [\"2266685687\"]', ['2266685687'], None], ['control [\"0-306-40615-2\"]', ['0-306-40615-2'], '9780306406157'], ['control [\"0306406153\"]', ['0306406153'], None], ['control [\"12345\"]', ['12345'], None], ['control [\"2266685686\"]', ['2266685686'], '9782266685689']], [['regression [\"3407375115\"]', ['3407375115'], '9783407375117'], ['regression [\"8449627923\"]', ['8449627923'], '9788449627927'], ['control [\"2266685686\"]', ['2266685686'], '9782266685689'], ['control [\"1475433131\"]', ['1475433131'], '9781475433135'], ['control [\"0436178273\"]', ['0436178273'], '9780436178276'], ['control [\"0306406152\"]', ['0306406152'], '9780306406157'], ['control [\"0000000000\"]', ['0000000000'], '9780000000002'], ['control [\"123456789X\"]', ['123456789X'], '9781234567897']], [['regression [\"9999999999\"]', ['9999999999'], '9789999999991'], ['regression [\"097522980X\"]', ['097522980X'], '9780975229804'], ['control [\"123456789X\"]', ['123456789X'], '9781234567897'], ['control [\"5892872930\"]', ['5892872930'], None], ['control [\"2399553951\"]', ['2399553951'], None], ['control [\"9465545440\"]', ['9465545440'], None], ['control [\"8292844660\"]', ['8292844660'], None], ['control [\"9379774827\"]', ['9379774827'], None]]]\nfor label, args, expected in fixtures[N - 1]:\n    check(label, 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":"1758875ab130b9dd0e03d4d73d4dad1117c912696222666bc172c0fe0c0397ba","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(s):\n    t = s.replace('-', '')\n    if len(t) != 10 or not t.isascii() or not t[:9].isdigit() or not (t[9].isdigit() or t[9] == 'X'):\n        return None\n    if sum((10 - i) * (10 if ch == 'X' else int(ch)) for i, ch in enumerate(t)) % 11:\n        return None\n    body = '978' + t[:9]\n    total = sum(int(ch) * (3 if i % 2 == 0 else 1) for i, ch in enumerate(body))\n    return body + str((10 - total % 10) % 10)\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression [\"5892872939\"]', ['5892872939'], '9785892872935'], ['regression [\"2399553950\"]', ['2399553950'], '9782399553954'], ['control [\"2266685686\"]', ['2266685686'], '9782266685689'], ['control [\"1475433131\"]', ['1475433131'], '9781475433135'], ['control [\"0436178273\"]', ['0436178273'], '9780436178276'], ['control [\"0306406152\"]', ['0306406152'], '9780306406157'], ['control [\"0000000000\"]', ['0000000000'], '9780000000002'], ['control [\"123456789X\"]', ['123456789X'], '9781234567897']], [['regression [\"829284466X\"]', ['829284466X'], '9788292844663'], ['regression [\"9379774826\"]', ['9379774826'], '9789379774828'], ['control [\"123456789X\"]', ['123456789X'], '9781234567897'], ['control [\"5892872930\"]', ['5892872930'], None], ['control [\"2399553951\"]', ['2399553951'], None], ['control [\"9465545440\"]', ['9465545440'], None], ['control [\"8292844660\"]', ['8292844660'], None], ['control [\"9379774827\"]', ['9379774827'], None]], [['regression [\"5900307905\"]', ['5900307905'], '9785900307909'], ['regression [\"3905987139\"]', ['3905987139'], '9783905987133'], ['control [\"9379774827\"]', ['9379774827'], None], ['control [\"2266685687\"]', ['2266685687'], None], ['control [\"0-306-40615-2\"]', ['0-306-40615-2'], '9780306406157'], ['control [\"0306406153\"]', ['0306406153'], None], ['control [\"12345\"]', ['12345'], None], ['control [\"2266685686\"]', ['2266685686'], '9782266685689']], [['regression [\"3407375115\"]', ['3407375115'], '9783407375117'], ['regression [\"8449627923\"]', ['8449627923'], '9788449627927'], ['control [\"2266685686\"]', ['2266685686'], '9782266685689'], ['control [\"1475433131\"]', ['1475433131'], '9781475433135'], ['control [\"0436178273\"]', ['0436178273'], '9780436178276'], ['control [\"0306406152\"]', ['0306406152'], '9780306406157'], ['control [\"0000000000\"]', ['0000000000'], '9780000000002'], ['control [\"123456789X\"]', ['123456789X'], '9781234567897']], [['regression [\"9999999999\"]', ['9999999999'], '9789999999991'], ['regression [\"097522980X\"]', ['097522980X'], '9780975229804'], ['control [\"123456789X\"]', ['123456789X'], '9781234567897'], ['control [\"5892872930\"]', ['5892872930'], None], ['control [\"2399553951\"]', ['2399553951'], None], ['control [\"9465545440\"]', ['9465545440'], None], ['control [\"8292844660\"]', ['8292844660'], None], ['control [\"9379774827\"]', ['9379774827'], None]]]\nfor label, args, expected in fixtures[N - 1]:\n    check(label, 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 of the named scheme under the stated contract; not a certified validator. 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-check_digit_algorithms-isbn10-to-13-ean-weight-phase","generated_at":"2026-09-29T14:48:38.555500+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Library and retail systems migrate legacy ISBN-10 records to 13-digit EAN identifiers.","root_cause":"The EAN weights start with 3 at the leftmost digit instead of 1.","sha256":"708b9d6ab9251f9f7cea6206de7054173370b1f3b24f906eb3dbc8e52b781d40","title":"ISBN-13 conversion weights the prefix digit by three · 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":37.726,"exit_code":1,"observations":[{"actual":"9785892872937","check":"regression [\"5892872939\"]","expected":"9785892872935","passed":false},{"actual":"9782399553950","check":"regression [\"2399553950\"]","expected":"9782399553954","passed":false},{"actual":"9782266685689","check":"control [\"2266685686\"]","expected":"9782266685689","passed":true},{"actual":"9781475433135","check":"control [\"1475433131\"]","expected":"9781475433135","passed":true},{"actual":"9780436178276","check":"control [\"0436178273\"]","expected":"9780436178276","passed":true},{"actual":"9780306406157","check":"control [\"0306406152\"]","expected":"9780306406157","passed":true},{"actual":"9780000000002","check":"control [\"0000000000\"]","expected":"9780000000002","passed":true},{"actual":"9781234567897","check":"control [\"123456789X\"]","expected":"9781234567897","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression [\\\"5892872939\\\"]\", \"actual\": \"9785892872937\", \"expected\": \"9785892872935\", \"passed\": false}, {\"check\": \"regression [\\\"2399553950\\\"]\", \"actual\": \"9782399553950\", \"expected\": \"9782399553954\", \"passed\": false}, {\"check\": \"control [\\\"2266685686\\\"]\", \"actual\": \"9782266685689\", \"expected\": \"9782266685689\", \"passed\": true}, {\"check\": \"control [\\\"1475433131\\\"]\", \"actual\": \"9781475433135\", \"expected\": \"9781475433135\", \"passed\": true}, {\"check\": \"control [\\\"0436178273\\\"]\", \"actual\": \"9780436178276\", \"expected\": \"9780436178276\", \"passed\": true}, {\"check\": \"control [\\\"0306406152\\\"]\", \"actual\": \"9780306406157\", \"expected\": \"9780306406157\", \"passed\": true}, {\"check\": \"control [\\\"0000000000\\\"]\", \"actual\": \"9780000000002\", \"expected\": \"9780000000002\", \"passed\": true}, {\"check\": \"control [\\\"123456789X\\\"]\", \"actual\": \"9781234567897\", \"expected\": \"9781234567897\", \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":38.673,"exit_code":1,"observations":[{"actual":"9785892872937","check":"regression [\"5892872939\"]","expected":"9785892872935","passed":false},{"actual":"9782399553950","check":"regression [\"2399553950\"]","expected":"9782399553954","passed":false},{"actual":"9782266685689","check":"control [\"2266685686\"]","expected":"9782266685689","passed":true},{"actual":"9781475433135","check":"control [\"1475433131\"]","expected":"9781475433135","passed":true},{"actual":"9780436178276","check":"control [\"0436178273\"]","expected":"9780436178276","passed":true},{"actual":"9780306406157","check":"control [\"0306406152\"]","expected":"9780306406157","passed":true},{"actual":"9780000000002","check":"control [\"0000000000\"]","expected":"9780000000002","passed":true},{"actual":"9781234567897","check":"control [\"123456789X\"]","expected":"9781234567897","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression [\\\"5892872939\\\"]\", \"actual\": \"9785892872937\", \"expected\": \"9785892872935\", \"passed\": false}, {\"check\": \"regression [\\\"2399553950\\\"]\", \"actual\": \"9782399553950\", \"expected\": \"9782399553954\", \"passed\": false}, {\"check\": \"control [\\\"2266685686\\\"]\", \"actual\": \"9782266685689\", \"expected\": \"9782266685689\", \"passed\": true}, {\"check\": \"control [\\\"1475433131\\\"]\", \"actual\": \"9781475433135\", \"expected\": \"9781475433135\", \"passed\": true}, {\"check\": \"control [\\\"0436178273\\\"]\", \"actual\": \"9780436178276\", \"expected\": \"9780436178276\", \"passed\": true}, {\"check\": \"control [\\\"0306406152\\\"]\", \"actual\": \"9780306406157\", \"expected\": \"9780306406157\", \"passed\": true}, {\"check\": \"control [\\\"0000000000\\\"]\", \"actual\": \"9780000000002\", \"expected\": \"9780000000002\", \"passed\": true}, {\"check\": \"control [\\\"123456789X\\\"]\", \"actual\": \"9781234567897\", \"expected\": \"9781234567897\", \"passed\": true}], \"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."}}