Skip to content

Suggest path-glob fixes when search filters produce no matches #3814

@Widthdom

Description

@Widthdom

Found while dogfooding the locally built cdidx on branch codex/search-audit-issues-20260619.

Duplicate check: no open issue found for search path glob no results hint exact path pattern.

Observation:
During this audit, cdidx search ... --path src/CodeIndex returned zero results until the filter was corrected to --path src/CodeIndex/**.

Problem:
When a path filter looks like a directory but matches no indexed files, search output could suggest the likely glob shape instead of silently returning no hits.

Acceptance criteria:

  • Detect no-result path filters that look like existing indexed directory prefixes.
  • Suggest path/** or the closest indexed prefix in human output and structured JSON metadata.
  • Keep the hint bounded and avoid filesystem crawling outside the index.
  • Add tests for exact file path, directory-like path, already-globbed path, and nonexistent path filters.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions