{"abstract":"Truncated paths are three characters wider than the column.","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":"Keeping width - 2 characters still overflows by one.","family":"w2-text-diff-merge-diffstat-name-truncation-ellipsis-budget","id":"FA-75831","implementations":{"attempt":{"sha256":"ef9c0b036a4019d233a397bc950312d65b7f16427bf27feca1fdfc4fe343b83a","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 - 2\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":"a723e2da4f01e4a883842ea8b20e3734dda6a1803efe4fec31a8c029d4aac149","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\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-ellipsis-budget","generated_at":"2026-09-29T14:49:10.415670+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":"Keep width - 3 characters so the ellipsis fits in the width.","root_cause":"The kept tail uses the full width and then the ellipsis is added.","sha256":"24fcd0d4fa3801c2a192dcfd834825bd30f005a13e5308a94a4d6b98f6bda45f","title":"Diffstat path truncation: the ellipsis is not counted in the width · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":40.39,"exit_code":1,"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":["...lename.txt"],"check":"no slash in the kept tail","expected":["...ename.txt"],"passed":false},{"actual":[".../f/g/h.txt","x.c","...yyyyyyyyyy"],"check":"several names","expected":[".../g/h.txt","x.c","...yyyyyyyyy"],"passed":false},{"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\": [\"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\": [\"...lename.txt\"], \"expected\": [\"...ename.txt\"], \"passed\": false}, {\"check\": \"several names\", \"actual\": [\".../f/g/h.txt\", \"x.c\", \"...yyyyyyyyyy\"], \"expected\": [\".../g/h.txt\", \"x.c\", \"...yyyyyyyyy\"], \"passed\": false}, {\"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"},"broken":{"elapsed_ms":40.086,"exit_code":1,"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":[".../deep/file_name.py"],"check":"long name cut at a directory boundary","expected":[".../file_name.py"],"passed":false},{"actual":["...filename.txt"],"check":"no slash in the kept tail","expected":["...ename.txt"],"passed":false},{"actual":[".../e/f/g/h.txt","x.c",".../yyyyyyyyyyy"],"check":"several names","expected":[".../g/h.txt","x.c","...yyyyyyyyy"],"passed":false},{"actual":[".../bbbb/cc"],"check":"tail starts exactly at a slash","expected":[".../cc"],"passed":false},{"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\": [\"abcdefghij\"], \"expected\": [\"abcdefghij\"], \"passed\": true}, {\"check\": \"long name cut at a directory boundary\", \"actual\": [\".../deep/file_name.py\"], \"expected\": [\".../file_name.py\"], \"passed\": false}, {\"check\": \"no slash in the kept tail\", \"actual\": [\"...filename.txt\"], \"expected\": [\"...ename.txt\"], \"passed\": false}, {\"check\": \"several names\", \"actual\": [\".../e/f/g/h.txt\", \"x.c\", \".../yyyyyyyyyyy\"], \"expected\": [\".../g/h.txt\", \"x.c\", \"...yyyyyyyyy\"], \"passed\": false}, {\"check\": \"tail starts exactly at a slash\", \"actual\": [\".../bbbb/cc\"], \"expected\": [\".../cc\"], \"passed\": false}, {\"check\": \"width just above the name\", \"actual\": [\"p/q/r.txt\"], \"expected\": [\"p/q/r.txt\"], \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":41.86,"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"}