Skip to main content

Module workspace_scan

Module workspace_scan 

Source
Expand description

Scan the workspace for files relevant to the task.

Two-pass strategy:

  1. Mentioned files. Walk the workspace once for source files (extensions in SCAN_EXTENSIONS); if the task prompt mentions any of their relative paths, file names, or stems, return only those (precision wins for targeted refactors like “rename greet to hello in src/lib.rs”).

  2. Fallback. If no file matches, return every source file in the workspace (rg-style: skip target/, node_modules/, and hidden dirs). The prompt builder applies the DEFAULT_CONTEXT_CAP_CHARS budget on top, so even a large workspace gets bounded context.

Paths returned are relative to the workspace root so the prompt and the apply step can share the same identifiers.

Functions§

scan_workspace_for_files
Two-pass scan: prefer mentioned files; fall back to all source.