codescout icon indicating copy to clipboard operation
codescout copied to clipboard

grep: the zero-result warning recommends include_hidden without checking it could help

Open mareurs opened this issue 2 months ago • 0 comments

Repro (2026-09-24): grep(pattern="zqxv-no-such-token-anywhere-7731") returns 0 matches plus this warning:

this zero describes what was searched, not the pattern. Hidden paths were not searched, including .buddy/, .cargo/, .claude/ … Pass include_hidden=true to search them …

None of the listed hidden directories contains that token, so include_hidden=true would still return 0. The warning recommends a remedy it never checked could help. (Careful when reproducing: codescout logs your own query into .codescout/usage.db and .codescout/debug.log, so a raw grep -r "finds" the token there. .codescout is excluded from the warning's list, so that isn't a counterexample.)

Where: WalkAudit::completeness_warning in src/tools/grep.rs.

Task: only assert the include_hidden remedy when hidden pruning could explain the zero. One option is a cheap pass over just the pruned hidden roots, but the cost/benefit call is yours. Whatever you choose, the warning must stay accurate about what was searched. That part is correct today and is the point of docs/adrs/2026-08-27-negative-results-name-their-scope.md: read it first.

Acceptance, two tests:

  1. A pattern present only under a hidden directory: the warning still recommends include_hidden.
  2. A pattern present nowhere: no include_hidden recommendation.

Test 1 is what stops the fix from simply deleting the advice.

Bug file: docs/issues/2026-09-24-residual-grep-hidden-paths-warning-checks-its-premise.md.

Base your branch on a fresh origin/experiments.

mareurs avatar Sep 24 '26 19:09 mareurs