perf(read_file): make compact gutter the only format; drop HERMES_READ_GUTTER (#35532)

The compact "<n>|content" gutter from #35368 is now the sole behavior.
Removes the HERMES_READ_GUTTER=padded escape hatch and its env lookup —
no legacy fixed-width path to maintain. Padding was pure token overhead
(~48% more tokens than bare content, ~16% more than compact) with no
measured accuracy gain in the original A/B.

- file_operations.py: drop env lookup + os import; gutter always f"{i}|{line}"
- tests: drop the padded env-override test; compact assertions retained
This commit is contained in:
Teknium
2026-05-30 14:38:30 -07:00
committed by GitHub
parent 5921d66785
commit b1a25404b6
2 changed files with 2 additions and 13 deletions
-7
View File
@@ -356,13 +356,6 @@ class TestShellFileOpsHelpers:
assert "50|continued" in result
assert "51|more" in result
def test_add_line_numbers_padded_env_override(self, file_ops, monkeypatch):
# Legacy fixed-width format available via HERMES_READ_GUTTER=padded.
monkeypatch.setenv("HERMES_READ_GUTTER", "padded")
result = file_ops._add_line_numbers("line one\nline two")
assert " 1|line one" in result
assert " 2|line two" in result
def test_add_line_numbers_truncates_long_lines(self, file_ops):
long_line = "x" * (MAX_LINE_LENGTH + 100)
result = file_ops._add_line_numbers(long_line)