Skip to content

Redirect unsupported search scans to find - #5016

Merged
Widthdom merged 3 commits into
mainfrom
fix-issue4906
Jul 31, 2026
Merged

Redirect unsupported search scans to find#5016
Widthdom merged 3 commits into
mainfrom
fix-issue4906

Conversation

@Widthdom

Copy link
Copy Markdown
Owner

Summary

  • Replace the generic search --regex / search --all removal hint with a shell-safe, display-only cdidx find alternative when the invocation maps exactly.
  • Return typed JSON recovery fields (argv, POSIX sh, PowerShell, blockers, non-equivalent options, and explicit non-execution markers).
  • Reject lossy or invalid alternatives, including incompatible output modes, consumed option-shaped values, byte-budget overflow, invalid snippet limits, and oversized queries.

Root cause

search intentionally preserves indexed-query semantics and does not support scan-only flags, but its usage error did not translate compatible invocations to the scan-oriented find command or explain why a safe translation was impossible.

Impact

Users and automation receive an actionable alternative without changing search semantics or executing another command. Requests that cannot be represented exactly return a reason and no alternative command.

Validation

  • dotnet restore CodeIndex.sln
  • dotnet build CodeIndex.sln -c Release -p:UseSharedCompilation=false --no-restore (0 warnings, 0 errors)
  • dotnet build CodeIndex.sln -c Debug -p:UseSharedCompilation=false --no-restore (0 warnings, 0 errors)
  • Issue-focused tests: 10 passed on net8.0 and 10 passed on net9.0
  • Full net8.0 suite: 11,036 passed, 0 failed, 7 skipped
  • Full net9.0 suite: 10,561 passed, 1 unrelated load-sensitive MCP test failed, 420 skipped; the isolated rerun passed
  • Changelog fragment validation passed
  • CLI smoke tests covered human, JSON, shell-sensitive and option-shaped queries, structured count output, unmappable requests, and JSON byte limits
  • cdidx status --check --json: index/workspace/HEAD matched with no failed checks
  • Codex adversarial review: two rounds completed; all five P2 findings were addressed

Documentation and changelog

  • Updated the English and Japanese sections in README.md, DEVELOPER_GUIDE.md, and TESTING_GUIDE.md.
  • Added changelog.d/unreleased/4906.fixed.md.

Follow-up

None.

Fixes #4906

@Widthdom
Widthdom marked this pull request as ready for review July 31, 2026 15:56
@Widthdom
Widthdom merged commit 9417993 into main Jul 31, 2026
12 checks passed
@Widthdom
Widthdom deleted the fix-issue4906 branch July 31, 2026 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Redirect unsupported search scan options to find

1 participant