{"abstract":"Mistyped ISBN-10 values are converted into valid-looking ISBN-13 numbers.","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":"Checking the source with mod 10 rejects valid X-terminated numbers and admits many bad ones.","family":"w2-check_digit_algorithms-isbn10-to-13-source-validation","id":"FA-72446","implementations":{"attempt":{"sha256":"df6416e25365cadd673845614b0e06156edb1a08cde8c591b2c14edd380deb13","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)) % 10:\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(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 [\"5892872930\"]', ['5892872930'], None], ['regression [\"2399553951\"]', ['2399553951'], None], ['partial-repair [\"5892872939\"]', ['5892872939'], '9785892872935'], ['partial-repair [\"2399553950\"]', ['2399553950'], '9782399553954'], ['control [\"0000000000\"]', ['0000000000'], '9780000000002'], ['control [\"123456789X\"]', ['123456789X'], '9781234567897'], ['control [\"12345\"]', ['12345'], None], ['control [\"1-84356-028-3\"]', ['1-84356-028-3'], '9781843560289']], [['regression [\"8292844660\"]', ['8292844660'], None], ['regression [\"9379774827\"]', ['9379774827'], None], ['partial-repair [\"829284466X\"]', ['829284466X'], '9788292844663'], ['partial-repair [\"9379774826\"]', ['9379774826'], '9789379774828'], ['control [\"123456789X\"]', ['123456789X'], '9781234567897'], ['control [\"12345\"]', ['12345'], None], ['control [\"1-84356-028-3\"]', ['1-84356-028-3'], '9781843560289'], ['control [\"0000000000\"]', ['0000000000'], '9780000000002']], [['regression [\"0306406153\"]', ['0306406153'], None], ['regression [\"5892872930\"]', ['5892872930'], None], ['partial-repair [\"2892681790\"]', ['2892681790'], '9782892681796'], ['partial-repair [\"5900307905\"]', ['5900307905'], '9785900307909'], ['control [\"12345\"]', ['12345'], None], ['control [\"1-84356-028-3\"]', ['1-84356-028-3'], '9781843560289'], ['control [\"0000000000\"]', ['0000000000'], '9780000000002'], ['control [\"123456789X\"]', ['123456789X'], '9781234567897']], [['regression [\"9465545440\"]', ['9465545440'], None], ['regression [\"8292844660\"]', ['8292844660'], None], ['partial-repair [\"7113753523\"]', ['7113753523'], '9787113753528'], ['partial-repair [\"1475433131\"]', ['1475433131'], '9781475433135'], ['control [\"1-84356-028-3\"]', ['1-84356-028-3'], '9781843560289'], ['control [\"0000000000\"]', ['0000000000'], '9780000000002'], ['control [\"123456789X\"]', ['123456789X'], '9781234567897'], ['control [\"12345\"]', ['12345'], None]], [['regression [\"2266685687\"]', ['2266685687'], None], ['regression [\"0306406153\"]', ['0306406153'], None], ['partial-repair [\"8449627923\"]', ['8449627923'], '9788449627927'], ['partial-repair [\"0436178273\"]', ['0436178273'], '9780436178276'], ['control [\"0000000000\"]', ['0000000000'], '9780000000002'], ['control [\"123456789X\"]', ['123456789X'], '9781234567897'], ['control [\"12345\"]', ['12345'], None], ['control [\"1-84356-028-3\"]', ['1-84356-028-3'], '9781843560289']]]\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":"9d87391557de5f180bccedf89f78395016a0923ca4b3f3362a27fefbe8c646f4","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 and False:\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(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 [\"5892872930\"]', ['5892872930'], None], ['regression [\"2399553951\"]', ['2399553951'], None], ['partial-repair [\"5892872939\"]', ['5892872939'], '9785892872935'], ['partial-repair [\"2399553950\"]', ['2399553950'], '9782399553954'], ['control [\"0000000000\"]', ['0000000000'], '9780000000002'], ['control [\"123456789X\"]', ['123456789X'], '9781234567897'], ['control [\"12345\"]', ['12345'], None], ['control [\"1-84356-028-3\"]', ['1-84356-028-3'], '9781843560289']], [['regression [\"8292844660\"]', ['8292844660'], None], ['regression [\"9379774827\"]', ['9379774827'], None], ['partial-repair [\"829284466X\"]', ['829284466X'], '9788292844663'], ['partial-repair [\"9379774826\"]', ['9379774826'], '9789379774828'], ['control [\"123456789X\"]', ['123456789X'], '9781234567897'], ['control [\"12345\"]', ['12345'], None], ['control [\"1-84356-028-3\"]', ['1-84356-028-3'], '9781843560289'], ['control [\"0000000000\"]', ['0000000000'], '9780000000002']], [['regression [\"0306406153\"]', ['0306406153'], None], ['regression [\"5892872930\"]', ['5892872930'], None], ['partial-repair [\"2892681790\"]', ['2892681790'], '9782892681796'], ['partial-repair [\"5900307905\"]', ['5900307905'], '9785900307909'], ['control [\"12345\"]', ['12345'], None], ['control [\"1-84356-028-3\"]', ['1-84356-028-3'], '9781843560289'], ['control [\"0000000000\"]', ['0000000000'], '9780000000002'], ['control [\"123456789X\"]', ['123456789X'], '9781234567897']], [['regression [\"9465545440\"]', ['9465545440'], None], ['regression [\"8292844660\"]', ['8292844660'], None], ['partial-repair [\"7113753523\"]', ['7113753523'], '9787113753528'], ['partial-repair [\"1475433131\"]', ['1475433131'], '9781475433135'], ['control [\"1-84356-028-3\"]', ['1-84356-028-3'], '9781843560289'], ['control [\"0000000000\"]', ['0000000000'], '9780000000002'], ['control [\"123456789X\"]', ['123456789X'], '9781234567897'], ['control [\"12345\"]', ['12345'], None]], [['regression [\"2266685687\"]', ['2266685687'], None], ['regression [\"0306406153\"]', ['0306406153'], None], ['partial-repair [\"8449627923\"]', ['8449627923'], '9788449627927'], ['partial-repair [\"0436178273\"]', ['0436178273'], '9780436178276'], ['control [\"0000000000\"]', ['0000000000'], '9780000000002'], ['control [\"123456789X\"]', ['123456789X'], '9781234567897'], ['control [\"12345\"]', ['12345'], None], ['control [\"1-84356-028-3\"]', ['1-84356-028-3'], '9781843560289']]]\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-source-validation","generated_at":"2026-09-29T14:48:38.555836+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 mod-11 check of the source ISBN-10 is skipped, so the error is laundered by the new check digit.","sha256":"161ccf7966ac22758578fab9ab12961ec63bcbe588c39b78f9d0221c332bc3a0","title":"ISBN-13 conversion accepts an invalid ISBN-10 · 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.728,"exit_code":1,"observations":[{"actual":null,"check":"regression [\"5892872930\"]","expected":null,"passed":true},{"actual":null,"check":"regression [\"2399553951\"]","expected":null,"passed":true},{"actual":null,"check":"partial-repair [\"5892872939\"]","expected":"9785892872935","passed":false},{"actual":null,"check":"partial-repair [\"2399553950\"]","expected":"9782399553954","passed":false},{"actual":"9780000000002","check":"control [\"0000000000\"]","expected":"9780000000002","passed":true},{"actual":"9781234567897","check":"control [\"123456789X\"]","expected":"9781234567897","passed":true},{"actual":null,"check":"control [\"12345\"]","expected":null,"passed":true},{"actual":"9781843560289","check":"control [\"1-84356-028-3\"]","expected":"9781843560289","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression [\\\"5892872930\\\"]\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"regression [\\\"2399553951\\\"]\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"partial-repair [\\\"5892872939\\\"]\", \"actual\": null, \"expected\": \"9785892872935\", \"passed\": false}, {\"check\": \"partial-repair [\\\"2399553950\\\"]\", \"actual\": null, \"expected\": \"9782399553954\", \"passed\": false}, {\"check\": \"control [\\\"0000000000\\\"]\", \"actual\": \"9780000000002\", \"expected\": \"9780000000002\", \"passed\": true}, {\"check\": \"control [\\\"123456789X\\\"]\", \"actual\": \"9781234567897\", \"expected\": \"9781234567897\", \"passed\": true}, {\"check\": \"control [\\\"12345\\\"]\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"control [\\\"1-84356-028-3\\\"]\", \"actual\": \"9781843560289\", \"expected\": \"9781843560289\", \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":39.166,"exit_code":1,"observations":[{"actual":"9785892872935","check":"regression [\"5892872930\"]","expected":null,"passed":false},{"actual":"9782399553954","check":"regression [\"2399553951\"]","expected":null,"passed":false},{"actual":"9785892872935","check":"partial-repair [\"5892872939\"]","expected":"9785892872935","passed":true},{"actual":"9782399553954","check":"partial-repair [\"2399553950\"]","expected":"9782399553954","passed":true},{"actual":"9780000000002","check":"control [\"0000000000\"]","expected":"9780000000002","passed":true},{"actual":"9781234567897","check":"control [\"123456789X\"]","expected":"9781234567897","passed":true},{"actual":null,"check":"control [\"12345\"]","expected":null,"passed":true},{"actual":"9781843560289","check":"control [\"1-84356-028-3\"]","expected":"9781843560289","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression [\\\"5892872930\\\"]\", \"actual\": \"9785892872935\", \"expected\": null, \"passed\": false}, {\"check\": \"regression [\\\"2399553951\\\"]\", \"actual\": \"9782399553954\", \"expected\": null, \"passed\": false}, {\"check\": \"partial-repair [\\\"5892872939\\\"]\", \"actual\": \"9785892872935\", \"expected\": \"9785892872935\", \"passed\": true}, {\"check\": \"partial-repair [\\\"2399553950\\\"]\", \"actual\": \"9782399553954\", \"expected\": \"9782399553954\", \"passed\": true}, {\"check\": \"control [\\\"0000000000\\\"]\", \"actual\": \"9780000000002\", \"expected\": \"9780000000002\", \"passed\": true}, {\"check\": \"control [\\\"123456789X\\\"]\", \"actual\": \"9781234567897\", \"expected\": \"9781234567897\", \"passed\": true}, {\"check\": \"control [\\\"12345\\\"]\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"control [\\\"1-84356-028-3\\\"]\", \"actual\": \"9781843560289\", \"expected\": \"9781843560289\", \"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."}}