harness: documentation reads through grep count (grep prefixes stripped before matching)

This commit is contained in:
dev committed 2026-10-05 21:40:34 +03:00
1 parent 0972ed2a5e
commit a2d72628e0
3 files changed
+22 -2

No files matched your search

+4 -1
View File
@@ -38,6 +38,9 @@ import re
from . import util
_PREFIX = re.compile(r"^\s*\d+\s*[:\t→│|]\s?")
# grep/ripgrep output and the agents' grep tools: `path:12:text`, context
# lines `path-12-text`, and `path:text` when several files are searched.
_GREP = re.compile(r"^(?:/docs/\S+?|\S+\.md)(?::\d+[:-]|-\d+-|:)")
def _tokenizer():
@@ -51,7 +54,7 @@ def _tokenizer():
def _norm(line):
return _PREFIX.sub("", line).strip()
return _PREFIX.sub("", _GREP.sub("", line, count=1)).strip()
def tool_events_track_a(events_path):