Measured 2026-10-10 (cyc20261010-220909) on master 2673769b, in this checkout.
grep's glob parameter answers two different questions under one name: it filters the
directory branch, and it is ignored by the file branch while the summary still says it
was applied — and the pattern its own description advertises selects nothing at all.
1. A named file is not filtered, and the reading says it was
$ # emrg/tools/read_tool.py holds one "def definition"
$ grep pattern="def definition" path=emrg/tools/read_tool.py
Found 1 matches ... (searched 1 files)
$ grep pattern="def definition" path=emrg/tools/read_tool.py glob="*.py"
Found 1 matches ... (searched 1 files)
$ grep pattern="def definition" path=emrg/tools/read_tool.py glob="*.nomatch"
Found 1 matches ... (searched 1 files) <- identical to no filter at all
*.nomatch matches nothing in any tree, so the third call is a search of a file the
caller's own filter excludes. When the file happens to hold no match, the same call reads:
No matches for 'def main' in .../read_tool.py (searched 1 files) matching '*.nomatch'
matching '*.nomatch' is a claim about a filter that never ran. The description says
"Only search files matching this glob pattern", and the code (master):
if root.is_file():
files = [root] # `file_glob` is not consulted
else:
files = self._collect_files(root, file_glob)
The directory branch applies it, so the same parameter means two things depending on
whether path names a file.
2. The pattern the description advertises selects nothing
The glob parameter's description lists its examples as
Examples: '*.py', '*.{py,rs}', 'src/**/*.ts'. — and the walk is Path.rglob, whose
pattern language has no brace expansion. *.{py,rs} is not two patterns; it is one
literal string that matches no file whose name contains a brace. Over emrg/tools/:
glob='*.py' -> Found 9 matches for 'def definition' ... (searched 15 files)
glob='*.{py,rs}' -> No matches for 'def definition' ... (searched 0 files)
No matches is the sentence a real absence produces, so a model that follows the
description's own example is told "this pattern does not occur in the tree" about a
question the tool never asked. Nothing in the repo passes a brace pattern — the
description is its only user.
The same holds for glob's sibling: glob pattern='**/*.{py,md}' answers
No files matched pattern '**/*.{py,md}' on a tree that plainly holds both kinds of file.
Acceptance
- the
glob filter is applied to a named file too (the same predicate the directory
branch uses), so glob means one thing;
- a search that names one file and is excluded by the filter says which of the two
readings it is (searched 0 files plus the reason), rather than printing a filter it
did not apply;
- a brace pattern is refused with the reason by both
grep and glob — never
searched to an empty answer that reads like a true one — through one shared rule;
- the description's examples are true: a test reads the advertised list out of the schema
and runs each one against a tree holding the file it names, so an unreadable form cannot
re-enter it.
Measured 2026-10-10 (
cyc20261010-220909) on master2673769b, in this checkout.grep'sglobparameter answers two different questions under one name: it filters thedirectory branch, and it is ignored by the file branch while the summary still says it
was applied — and the pattern its own description advertises selects nothing at all.
1. A named file is not filtered, and the reading says it was
*.nomatchmatches nothing in any tree, so the third call is a search of a file thecaller's own filter excludes. When the file happens to hold no match, the same call reads:
matching '*.nomatch'is a claim about a filter that never ran. The description says"Only search files matching this glob pattern", and the code (master):
The directory branch applies it, so the same parameter means two things depending on
whether
pathnames a file.2. The pattern the description advertises selects nothing
The
globparameter's description lists its examples asExamples: '*.py', '*.{py,rs}', 'src/**/*.ts'.— and the walk isPath.rglob, whosepattern language has no brace expansion.
*.{py,rs}is not two patterns; it is oneliteral string that matches no file whose name contains a brace. Over
emrg/tools/:No matchesis the sentence a real absence produces, so a model that follows thedescription's own example is told "this pattern does not occur in the tree" about a
question the tool never asked. Nothing in the repo passes a brace pattern — the
description is its only user.
The same holds for
glob's sibling:glob pattern='**/*.{py,md}'answersNo files matched pattern '**/*.{py,md}'on a tree that plainly holds both kinds of file.Acceptance
globfilter is applied to a named file too (the same predicate the directorybranch uses), so
globmeans one thing;readings it is (
searched 0 filesplus the reason), rather than printing a filter itdid not apply;
grepandglob— neversearched to an empty answer that reads like a true one — through one shared rule;
and runs each one against a tree holding the file it names, so an unreadable form cannot
re-enter it.