{"abstract":"Paths that would fit are shortened with an ellipsis.","category":"Text diff and three-way merge","checks":7,"contract":"A path longer than width is shown as \"...\" plus its last width-3 characters, further shortened to start at the first \"/\" inside that tail when there is one (keeping the slash). Paths not longer than width are unchanged.","evaluation_group":"w2-text-diff-merge-diffstat-name-truncation","failed_approach":"Reserving room for the ellipsis before deciding still truncates paths that fit.","family":"w2-text-diff-merge-diffstat-name-truncation-fits-boundary","id":"FA-75826","implementations":{"attempt":{"sha256":"c860a655a65cd1fea4c257fb500765dda5ae81f9528100308b0aab5cc710de22","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(names, width):\n    res = []\n    for name in names:\n        if len(name) <= width - 3:\n            res.append(name)\n            continue\n        keep = width - 3\n        tail = name[len(name) - keep:] if keep > 0 else ''\n        slash = tail.find('/')\n        if slash >= 0:\n            tail = tail[slash:]\n        res.append('...' + tail)\n    return res\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = {\n    1: [('short name unchanged', [['src/a.c'], 20], ['src/a.c']), ('name exactly the width', [['abcdefghij'], 10], ['abcdefghij']), ('long name cut at a directory boundary', [['src/module/deep/file_name.py'], 18], ['.../file_name.py']), ('no slash in the kept tail', [['averyveryverylongfilename.txt'], 12], ['...ename.txt']), ('several names', [['a/b/c/d/e/f/g/h.txt', 'x.c', 'dir/yyyyyyyyyyy'], 12], ['.../g/h.txt', 'x.c', '...yyyyyyyyy']), ('tail starts exactly at a slash', [['aaaa/bbbb/cc'], 8], ['.../cc']), ('width just above the name', [['p/q/r.txt'], 10], ['p/q/r.txt'])],\n    2: [('short name unchanged', [['src/a.c'], 20], ['src/a.c']), ('name exactly the width', [['abcdefghij'], 10], ['abcdefghij']), ('long name cut at a directory boundary', [['src/module/deep/file_name.py'], 18], ['.../file_name.py']), ('no slash in the kept tail', [['averyveryverylongfilename.txt'], 12], ['...ename.txt']), ('several names', [['a/b/c/d/e/f/g/h.txt', 'x.c', 'dir/yyyyyyyyyyyy'], 12], ['.../g/h.txt', 'x.c', '...yyyyyyyyy']), ('tail starts exactly at a slash', [['aaaa/bbbb/cc'], 8], ['.../cc']), ('width just above the name', [['p/q/r.txt'], 10], ['p/q/r.txt'])],\n    3: [('short name unchanged', [['src/a.c'], 20], ['src/a.c']), ('name exactly the width', [['abcdefghij'], 10], ['abcdefghij']), ('long name cut at a directory boundary', [['src/module/deep/file_name.py'], 18], ['.../file_name.py']), ('no slash in the kept tail', [['averyveryverylongfilename.txt'], 12], ['...ename.txt']), ('several names', [['a/b/c/d/e/f/g/h.txt', 'x.c', 'dir/yyyyyyyyyyyyy'], 12], ['.../g/h.txt', 'x.c', '...yyyyyyyyy']), ('tail starts exactly at a slash', [['aaaa/bbbb/cc'], 8], ['.../cc']), ('width just above the name', [['p/q/r.txt'], 10], ['p/q/r.txt'])],\n    4: [('short name unchanged', [['src/a.c'], 20], ['src/a.c']), ('name exactly the width', [['abcdefghij'], 10], ['abcdefghij']), ('long name cut at a directory boundary', [['src/module/deep/file_name.py'], 18], ['.../file_name.py']), ('no slash in the kept tail', [['averyveryverylongfilename.txt'], 12], ['...ename.txt']), ('several names', [['a/b/c/d/e/f/g/h.txt', 'x.c', 'dir/yyyyyyyyyyyyyy'], 12], ['.../g/h.txt', 'x.c', '...yyyyyyyyy']), ('tail starts exactly at a slash', [['aaaa/bbbb/cc'], 8], ['.../cc']), ('width just above the name', [['p/q/r.txt'], 10], ['p/q/r.txt'])],\n    5: [('short name unchanged', [['src/a.c'], 20], ['src/a.c']), ('name exactly the width', [['abcdefghij'], 10], ['abcdefghij']), ('long name cut at a directory boundary', [['src/module/deep/file_name.py'], 18], ['.../file_name.py']), ('no slash in the kept tail', [['averyveryverylongfilename.txt'], 12], ['...ename.txt']), ('several names', [['a/b/c/d/e/f/g/h.txt', 'x.c', 'dir/yyyyyyyyyyyyyyy'], 12], ['.../g/h.txt', 'x.c', '...yyyyyyyyy']), ('tail starts exactly at a slash', [['aaaa/bbbb/cc'], 8], ['.../cc']), ('width just above the name', [['p/q/r.txt'], 10], ['p/q/r.txt'])],\n}[N]\nfor label, args, expected in cases:\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":"acf51ed903e4bc4a2c4200615a740756b3924f6c8dde2a35957d895f6e9c8190","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(names, width):\n    res = []\n    for name in names:\n        if len(name) < width:\n            res.append(name)\n            continue\n        keep = width - 3\n        tail = name[len(name) - keep:] if keep > 0 else ''\n        slash = tail.find('/')\n        if slash >= 0:\n            tail = tail[slash:]\n        res.append('...' + tail)\n    return res\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = {\n    1: [('short name unchanged', [['src/a.c'], 20], ['src/a.c']), ('name exactly the width', [['abcdefghij'], 10], ['abcdefghij']), ('long name cut at a directory boundary', [['src/module/deep/file_name.py'], 18], ['.../file_name.py']), ('no slash in the kept tail', [['averyveryverylongfilename.txt'], 12], ['...ename.txt']), ('several names', [['a/b/c/d/e/f/g/h.txt', 'x.c', 'dir/yyyyyyyyyyy'], 12], ['.../g/h.txt', 'x.c', '...yyyyyyyyy']), ('tail starts exactly at a slash', [['aaaa/bbbb/cc'], 8], ['.../cc']), ('width just above the name', [['p/q/r.txt'], 10], ['p/q/r.txt'])],\n    2: [('short name unchanged', [['src/a.c'], 20], ['src/a.c']), ('name exactly the width', [['abcdefghij'], 10], ['abcdefghij']), ('long name cut at a directory boundary', [['src/module/deep/file_name.py'], 18], ['.../file_name.py']), ('no slash in the kept tail', [['averyveryverylongfilename.txt'], 12], ['...ename.txt']), ('several names', [['a/b/c/d/e/f/g/h.txt', 'x.c', 'dir/yyyyyyyyyyyy'], 12], ['.../g/h.txt', 'x.c', '...yyyyyyyyy']), ('tail starts exactly at a slash', [['aaaa/bbbb/cc'], 8], ['.../cc']), ('width just above the name', [['p/q/r.txt'], 10], ['p/q/r.txt'])],\n    3: [('short name unchanged', [['src/a.c'], 20], ['src/a.c']), ('name exactly the width', [['abcdefghij'], 10], ['abcdefghij']), ('long name cut at a directory boundary', [['src/module/deep/file_name.py'], 18], ['.../file_name.py']), ('no slash in the kept tail', [['averyveryverylongfilename.txt'], 12], ['...ename.txt']), ('several names', [['a/b/c/d/e/f/g/h.txt', 'x.c', 'dir/yyyyyyyyyyyyy'], 12], ['.../g/h.txt', 'x.c', '...yyyyyyyyy']), ('tail starts exactly at a slash', [['aaaa/bbbb/cc'], 8], ['.../cc']), ('width just above the name', [['p/q/r.txt'], 10], ['p/q/r.txt'])],\n    4: [('short name unchanged', [['src/a.c'], 20], ['src/a.c']), ('name exactly the width', [['abcdefghij'], 10], ['abcdefghij']), ('long name cut at a directory boundary', [['src/module/deep/file_name.py'], 18], ['.../file_name.py']), ('no slash in the kept tail', [['averyveryverylongfilename.txt'], 12], ['...ename.txt']), ('several names', [['a/b/c/d/e/f/g/h.txt', 'x.c', 'dir/yyyyyyyyyyyyyy'], 12], ['.../g/h.txt', 'x.c', '...yyyyyyyyy']), ('tail starts exactly at a slash', [['aaaa/bbbb/cc'], 8], ['.../cc']), ('width just above the name', [['p/q/r.txt'], 10], ['p/q/r.txt'])],\n    5: [('short name unchanged', [['src/a.c'], 20], ['src/a.c']), ('name exactly the width', [['abcdefghij'], 10], ['abcdefghij']), ('long name cut at a directory boundary', [['src/module/deep/file_name.py'], 18], ['.../file_name.py']), ('no slash in the kept tail', [['averyveryverylongfilename.txt'], 12], ['...ename.txt']), ('several names', [['a/b/c/d/e/f/g/h.txt', 'x.c', 'dir/yyyyyyyyyyyyyyy'], 12], ['.../g/h.txt', 'x.c', '...yyyyyyyyy']), ('tail starts exactly at a slash', [['aaaa/bbbb/cc'], 8], ['.../cc']), ('width just above the name', [['p/q/r.txt'], 10], ['p/q/r.txt'])],\n}[N]\nfor label, args, expected in cases:\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"},"fixed":{"sha256":"ff162986d34f41572b7f9289a68e9da9931d4ac6dd15db61df73d5a9e83f9967","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(names, width):\n    res = []\n    for name in names:\n        if len(name) <= width:\n            res.append(name)\n            continue\n        keep = width - 3\n        tail = name[len(name) - keep:] if keep > 0 else ''\n        slash = tail.find('/')\n        if slash >= 0:\n            tail = tail[slash:]\n        res.append('...' + tail)\n    return res\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = {\n    1: [('short name unchanged', [['src/a.c'], 20], ['src/a.c']), ('name exactly the width', [['abcdefghij'], 10], ['abcdefghij']), ('long name cut at a directory boundary', [['src/module/deep/file_name.py'], 18], ['.../file_name.py']), ('no slash in the kept tail', [['averyveryverylongfilename.txt'], 12], ['...ename.txt']), ('several names', [['a/b/c/d/e/f/g/h.txt', 'x.c', 'dir/yyyyyyyyyyy'], 12], ['.../g/h.txt', 'x.c', '...yyyyyyyyy']), ('tail starts exactly at a slash', [['aaaa/bbbb/cc'], 8], ['.../cc']), ('width just above the name', [['p/q/r.txt'], 10], ['p/q/r.txt'])],\n    2: [('short name unchanged', [['src/a.c'], 20], ['src/a.c']), ('name exactly the width', [['abcdefghij'], 10], ['abcdefghij']), ('long name cut at a directory boundary', [['src/module/deep/file_name.py'], 18], ['.../file_name.py']), ('no slash in the kept tail', [['averyveryverylongfilename.txt'], 12], ['...ename.txt']), ('several names', [['a/b/c/d/e/f/g/h.txt', 'x.c', 'dir/yyyyyyyyyyyy'], 12], ['.../g/h.txt', 'x.c', '...yyyyyyyyy']), ('tail starts exactly at a slash', [['aaaa/bbbb/cc'], 8], ['.../cc']), ('width just above the name', [['p/q/r.txt'], 10], ['p/q/r.txt'])],\n    3: [('short name unchanged', [['src/a.c'], 20], ['src/a.c']), ('name exactly the width', [['abcdefghij'], 10], ['abcdefghij']), ('long name cut at a directory boundary', [['src/module/deep/file_name.py'], 18], ['.../file_name.py']), ('no slash in the kept tail', [['averyveryverylongfilename.txt'], 12], ['...ename.txt']), ('several names', [['a/b/c/d/e/f/g/h.txt', 'x.c', 'dir/yyyyyyyyyyyyy'], 12], ['.../g/h.txt', 'x.c', '...yyyyyyyyy']), ('tail starts exactly at a slash', [['aaaa/bbbb/cc'], 8], ['.../cc']), ('width just above the name', [['p/q/r.txt'], 10], ['p/q/r.txt'])],\n    4: [('short name unchanged', [['src/a.c'], 20], ['src/a.c']), ('name exactly the width', [['abcdefghij'], 10], ['abcdefghij']), ('long name cut at a directory boundary', [['src/module/deep/file_name.py'], 18], ['.../file_name.py']), ('no slash in the kept tail', [['averyveryverylongfilename.txt'], 12], ['...ename.txt']), ('several names', [['a/b/c/d/e/f/g/h.txt', 'x.c', 'dir/yyyyyyyyyyyyyy'], 12], ['.../g/h.txt', 'x.c', '...yyyyyyyyy']), ('tail starts exactly at a slash', [['aaaa/bbbb/cc'], 8], ['.../cc']), ('width just above the name', [['p/q/r.txt'], 10], ['p/q/r.txt'])],\n    5: [('short name unchanged', [['src/a.c'], 20], ['src/a.c']), ('name exactly the width', [['abcdefghij'], 10], ['abcdefghij']), ('long name cut at a directory boundary', [['src/module/deep/file_name.py'], 18], ['.../file_name.py']), ('no slash in the kept tail', [['averyveryverylongfilename.txt'], 12], ['...ename.txt']), ('several names', [['a/b/c/d/e/f/g/h.txt', 'x.c', 'dir/yyyyyyyyyyyyyyy'], 12], ['.../g/h.txt', 'x.c', '...yyyyyyyyy']), ('tail starts exactly at a slash', [['aaaa/bbbb/cc'], 8], ['.../cc']), ('width just above the name', [['p/q/r.txt'], 10], ['p/q/r.txt'])],\n}[N]\nfor label, args, expected in cases:\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 one diff, patch or merge rule with stipulated conventions; it is not a production diff or version-control implementation and makes no claim of conformance to any specific tool. 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-text-diff-merge-diffstat-name-truncation-fits-boundary","generated_at":"2026-09-29T14:49:10.396666+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Narrow terminals truncate long paths in diffstat output; the rule keeps the most informative part of the path.","repair":"Leave paths whose length is at most the width unchanged.","root_cause":"The fit test is strict, so a path of exactly width characters is truncated.","sha256":"5be533b9fa12d6ab015a9a176ee7b33b264242e3f7bde0bd31c766c59df0da91","title":"Diffstat path truncation: a path exactly as wide as the column is truncated · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":39.416,"exit_code":1,"observations":[{"actual":["src/a.c"],"check":"short name unchanged","expected":["src/a.c"],"passed":true},{"actual":["...defghij"],"check":"name exactly the width","expected":["abcdefghij"],"passed":false},{"actual":[".../file_name.py"],"check":"long name cut at a directory boundary","expected":[".../file_name.py"],"passed":true},{"actual":["...ename.txt"],"check":"no slash in the kept tail","expected":["...ename.txt"],"passed":true},{"actual":[".../g/h.txt","x.c","...yyyyyyyyy"],"check":"several names","expected":[".../g/h.txt","x.c","...yyyyyyyyy"],"passed":true},{"actual":[".../cc"],"check":"tail starts exactly at a slash","expected":[".../cc"],"passed":true},{"actual":[".../r.txt"],"check":"width just above the name","expected":["p/q/r.txt"],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"short name unchanged\", \"actual\": [\"src/a.c\"], \"expected\": [\"src/a.c\"], \"passed\": true}, {\"check\": \"name exactly the width\", \"actual\": [\"...defghij\"], \"expected\": [\"abcdefghij\"], \"passed\": false}, {\"check\": \"long name cut at a directory boundary\", \"actual\": [\".../file_name.py\"], \"expected\": [\".../file_name.py\"], \"passed\": true}, {\"check\": \"no slash in the kept tail\", \"actual\": [\"...ename.txt\"], \"expected\": [\"...ename.txt\"], \"passed\": true}, {\"check\": \"several names\", \"actual\": [\".../g/h.txt\", \"x.c\", \"...yyyyyyyyy\"], \"expected\": [\".../g/h.txt\", \"x.c\", \"...yyyyyyyyy\"], \"passed\": true}, {\"check\": \"tail starts exactly at a slash\", \"actual\": [\".../cc\"], \"expected\": [\".../cc\"], \"passed\": true}, {\"check\": \"width just above the name\", \"actual\": [\".../r.txt\"], \"expected\": [\"p/q/r.txt\"], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":41.051,"exit_code":1,"observations":[{"actual":["src/a.c"],"check":"short name unchanged","expected":["src/a.c"],"passed":true},{"actual":["...defghij"],"check":"name exactly the width","expected":["abcdefghij"],"passed":false},{"actual":[".../file_name.py"],"check":"long name cut at a directory boundary","expected":[".../file_name.py"],"passed":true},{"actual":["...ename.txt"],"check":"no slash in the kept tail","expected":["...ename.txt"],"passed":true},{"actual":[".../g/h.txt","x.c","...yyyyyyyyy"],"check":"several names","expected":[".../g/h.txt","x.c","...yyyyyyyyy"],"passed":true},{"actual":[".../cc"],"check":"tail starts exactly at a slash","expected":[".../cc"],"passed":true},{"actual":["p/q/r.txt"],"check":"width just above the name","expected":["p/q/r.txt"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"short name unchanged\", \"actual\": [\"src/a.c\"], \"expected\": [\"src/a.c\"], \"passed\": true}, {\"check\": \"name exactly the width\", \"actual\": [\"...defghij\"], \"expected\": [\"abcdefghij\"], \"passed\": false}, {\"check\": \"long name cut at a directory boundary\", \"actual\": [\".../file_name.py\"], \"expected\": [\".../file_name.py\"], \"passed\": true}, {\"check\": \"no slash in the kept tail\", \"actual\": [\"...ename.txt\"], \"expected\": [\"...ename.txt\"], \"passed\": true}, {\"check\": \"several names\", \"actual\": [\".../g/h.txt\", \"x.c\", \"...yyyyyyyyy\"], \"expected\": [\".../g/h.txt\", \"x.c\", \"...yyyyyyyyy\"], \"passed\": true}, {\"check\": \"tail starts exactly at a slash\", \"actual\": [\".../cc\"], \"expected\": [\".../cc\"], \"passed\": true}, {\"check\": \"width just above the name\", \"actual\": [\"p/q/r.txt\"], \"expected\": [\"p/q/r.txt\"], \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":42.749,"exit_code":0,"observations":[{"actual":["src/a.c"],"check":"short name unchanged","expected":["src/a.c"],"passed":true},{"actual":["abcdefghij"],"check":"name exactly the width","expected":["abcdefghij"],"passed":true},{"actual":[".../file_name.py"],"check":"long name cut at a directory boundary","expected":[".../file_name.py"],"passed":true},{"actual":["...ename.txt"],"check":"no slash in the kept tail","expected":["...ename.txt"],"passed":true},{"actual":[".../g/h.txt","x.c","...yyyyyyyyy"],"check":"several names","expected":[".../g/h.txt","x.c","...yyyyyyyyy"],"passed":true},{"actual":[".../cc"],"check":"tail starts exactly at a slash","expected":[".../cc"],"passed":true},{"actual":["p/q/r.txt"],"check":"width just above the name","expected":["p/q/r.txt"],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"short name unchanged\", \"actual\": [\"src/a.c\"], \"expected\": [\"src/a.c\"], \"passed\": true}, {\"check\": \"name exactly the width\", \"actual\": [\"abcdefghij\"], \"expected\": [\"abcdefghij\"], \"passed\": true}, {\"check\": \"long name cut at a directory boundary\", \"actual\": [\".../file_name.py\"], \"expected\": [\".../file_name.py\"], \"passed\": true}, {\"check\": \"no slash in the kept tail\", \"actual\": [\"...ename.txt\"], \"expected\": [\"...ename.txt\"], \"passed\": true}, {\"check\": \"several names\", \"actual\": [\".../g/h.txt\", \"x.c\", \"...yyyyyyyyy\"], \"expected\": [\".../g/h.txt\", \"x.c\", \"...yyyyyyyyy\"], \"passed\": true}, {\"check\": \"tail starts exactly at a slash\", \"actual\": [\".../cc\"], \"expected\": [\".../cc\"], \"passed\": true}, {\"check\": \"width just above the name\", \"actual\": [\"p/q/r.txt\"], \"expected\": [\"p/q/r.txt\"], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}