{"abstract":"Text edit distance counts only length difference.","category":"Text processing","checks":4,"contract":"Return Levenshtein distance for two strings, unit insertion/deletion/substitution.","evaluation_group":"model-342052a1a29b35d7","failed_approach":"The attempted repair handles the primary example but still violates a separate boundary of the same contract.","family":"xp-edit-distance-substitution","id":"FA-3981","implementations":{"attempt":{"sha256":"6dd42b11da3f2ee525ba2426838b2d29dc6e14c0be1504514f24fea85e2ae4d2","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport re, unicodedata, json, csv, io, html, base64, binascii, codecs, struct\nfrom urllib.parse import quote, unquote, unquote_to_bytes, urlencode, parse_qsl, urlsplit, urlunsplit\nfrom email.header import decode_header, make_header\nfrom email.utils import getaddresses\nfrom xml.etree import ElementTree as ET\nimport shlex, string, textwrap\n\nN = 1\nobservations = []\ndef solve(x):\n    try:\n        return sum(a!=b for a,b in zip(*x))+abs(len(x[0])-len(x[1]))\n    except Exception as exc:\n        return {\"error\": type(exc).__name__}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('boundary 1', solve(['cat', 'cut']), 1)\ncheck('boundary 2', solve(['abc', 'bca']), 2)\ncheck('boundary 3', solve(['', 'ab']), 2)\ncheck('boundary 4', solve(['same', 'same']), 0)\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":"beb0785252c98a7b73f9419e133e90a9cbfbfb54e5101f3e71029329d6ac64ac","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport re, unicodedata, json, csv, io, html, base64, binascii, codecs, struct\nfrom urllib.parse import quote, unquote, unquote_to_bytes, urlencode, parse_qsl, urlsplit, urlunsplit\nfrom email.header import decode_header, make_header\nfrom email.utils import getaddresses\nfrom xml.etree import ElementTree as ET\nimport shlex, string, textwrap\n\nN = 1\nobservations = []\ndef solve(x):\n    try:\n        return abs(len(x[0])-len(x[1]))\n    except Exception as exc:\n        return {\"error\": type(exc).__name__}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('boundary 1', solve(['cat', 'cut']), 1)\ncheck('boundary 2', solve(['abc', 'bca']), 2)\ncheck('boundary 3', solve(['', 'ab']), 2)\ncheck('boundary 4', solve(['same', 'same']), 0)\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":"348c7c3af922f8051f041e6e73676908337a07a4d4282613616370ba60e974f5","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport re, unicodedata, json, csv, io, html, base64, binascii, codecs, struct\nfrom urllib.parse import quote, unquote, unquote_to_bytes, urlencode, parse_qsl, urlsplit, urlunsplit\nfrom email.header import decode_header, make_header\nfrom email.utils import getaddresses\nfrom xml.etree import ElementTree as ET\nimport shlex, string, textwrap\n\nN = 1\nobservations = []\ndef solve(x):\n    try:\n        a,b=x\n        row=list(range(len(b)+1))\n        for i,ca in enumerate(a,1):\n            nxt=[i]\n            for j,cb in enumerate(b,1): nxt.append(min(nxt[-1]+1,row[j]+1,row[j-1]+(ca!=cb)))\n            row=nxt\n        return row[-1]\n    except Exception as exc:\n        return {\"error\": type(exc).__name__}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('boundary 1', solve(['cat', 'cut']), 1)\ncheck('boundary 2', solve(['abc', 'bca']), 2)\ncheck('boundary 3', solve(['', 'ab']), 2)\ncheck('boundary 4', solve(['same', 'same']), 0)\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":" 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":"xp-edit-distance-substitution","generated_at":"2026-09-29T14:37:33.632899+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"A local executable model for consumers of structured text; oracle values are authored literals, not outputs copied from the repaired implementation.","repair":"Implement the complete stated contract, including the boundary fixtures: Return Levenshtein distance for two strings, unit insertion/deletion/substitution.","root_cause":"The implementation applies an operation whose text or grammar semantics violate this contract: Return Levenshtein distance for two strings, unit insertion/deletion/substitution.","sha256":"020082370294d1c8524a488260b70d80fc204b7ced2d37ef8af674e91f9ab7ab","title":"Text edit distance counts only length difference · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":58.508,"exit_code":1,"observations":[{"actual":1,"check":"boundary 1","expected":1,"passed":true},{"actual":3,"check":"boundary 2","expected":2,"passed":false},{"actual":2,"check":"boundary 3","expected":2,"passed":true},{"actual":0,"check":"boundary 4","expected":0,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"boundary 1\", \"actual\": 1, \"expected\": 1, \"passed\": true}, {\"check\": \"boundary 2\", \"actual\": 3, \"expected\": 2, \"passed\": false}, {\"check\": \"boundary 3\", \"actual\": 2, \"expected\": 2, \"passed\": true}, {\"check\": \"boundary 4\", \"actual\": 0, \"expected\": 0, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":131.095,"exit_code":1,"observations":[{"actual":0,"check":"boundary 1","expected":1,"passed":false},{"actual":0,"check":"boundary 2","expected":2,"passed":false},{"actual":2,"check":"boundary 3","expected":2,"passed":true},{"actual":0,"check":"boundary 4","expected":0,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"boundary 1\", \"actual\": 0, \"expected\": 1, \"passed\": false}, {\"check\": \"boundary 2\", \"actual\": 0, \"expected\": 2, \"passed\": false}, {\"check\": \"boundary 3\", \"actual\": 2, \"expected\": 2, \"passed\": true}, {\"check\": \"boundary 4\", \"actual\": 0, \"expected\": 0, \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":57.921,"exit_code":0,"observations":[{"actual":1,"check":"boundary 1","expected":1,"passed":true},{"actual":2,"check":"boundary 2","expected":2,"passed":true},{"actual":2,"check":"boundary 3","expected":2,"passed":true},{"actual":0,"check":"boundary 4","expected":0,"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"boundary 1\", \"actual\": 1, \"expected\": 1, \"passed\": true}, {\"check\": \"boundary 2\", \"actual\": 2, \"expected\": 2, \"passed\": true}, {\"check\": \"boundary 3\", \"actual\": 2, \"expected\": 2, \"passed\": true}, {\"check\": \"boundary 4\", \"actual\": 0, \"expected\": 0, \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}