Skip to main content

Module glob

Module glob 

Source
Expand description

glob tool — find files by glob pattern (e.g. **/*.py, src/*.rs).

Why: The engineer’s tool registry historically had NO native file discovery, so every find/ls -R went through the bash tool — the dominant agent-turn sink on the L1 bake-off (bash was 53-71% of every turn). A structured glob tool lets the model enumerate files in one typed call whose result the harness can pin and reason about, instead of parsing arbitrary shell output. (#1027.) What: GlobTool walks the working directory with a gitignore-aware walker (ripgrep’s ignore crate — hidden files and .gitignored paths are skipped by default) and returns every project-relative path matching the supplied glob. An optional path scopes the walk to a subdirectory. Test: See #[cfg(test)] below — covers a recursive match, a single-level match, subdirectory scoping, no-match, and path traversal.

Structs§

GlobTool
ToolExecutor that lists files matching a glob pattern.

Constants§

MAX_GLOB_MATCHES
Maximum number of paths GlobTool returns in a single call.