open-code-review icon indicating copy to clipboard operation
open-code-review copied to clipboard

ocr scan --path silently selects nothing when the selector case differs from the on-disk path

Open JasonBuildAI opened this issue 1 month ago • 0 comments

Impact

On Windows and macOS, ocr scan --path <path> silently reviews nothing when the selector's casing differs from the on-disk spelling, e.g. --path SRC for a directory named src. The filesystem resolves SRC (Explorer, cd SRC, git add SRC/... all work), but ocr scan prints "No files changed." and exits 0, so the run reports success while covering zero files. Every other user-facing path filter in OCR already ignores case (review --include/--exclude, secret-path blocking, the extension allowlist), which makes --path the lone exception and the silence the expensive part: nothing points at the selector.

OpenCodeReview Version

open-code-review v1.12.13 (357c3f0) windows/amd64
built at: 2026-10-11T12:28:59Z

Operating System

Windows (verified). macOS has the same case-insensitive default filesystem, so it should be affected the same way.

Installation Method

Built from source (make build).

LLM Provider

Not needed to reproduce: scan --preview only enumerates files, no model call happens.

Steps to Reproduce

  1. In a git repository containing src/keep.go, run ocr scan --preview --path src -> 1 file selected.
  2. Run ocr scan --preview --path SRC -> "No files changed.", exit code 0.
  3. The same happens for file selectors: ocr scan --preview --path src/KEEP.GO -> "No files changed."

On Windows Test-Path SRC\keep.go returns True, so the path the user named unambiguously exists.

Expected Behavior

--path SRC selects src/keep.go, exactly as --path src does; matching should ignore case like OCR's other path filters.

Actual Behavior

The selector matches nothing, the scan exits 0 with "No files changed.", and the user has no indication that the casing is why.

Logs / Error Output

> ocr scan --preview --path SRC
No files changed.
> $LASTEXITCODE
0

> ocr scan --preview --path src/KEEP.GO
No files changed.
> $LASTEXITCODE
0

> ocr scan --preview --path src
Preview: 6 file(s) changed  |  +10  -0
...

Additional Context

Root cause: internal/scan/provider.go filterByPaths compares each selector against git ls-files output with == / strings.HasPrefix, byte-for-byte.

Related: #1597 / #1598 fixed the same silent-empty-selector family for . and Windows backslash spellings; the case dimension of the same comparison stayed behind.

AI disclosure: this issue was filed with AI assistance at my request, under my direction and review.

JasonBuildAI avatar Oct 11 '26 13:10 JasonBuildAI