Files
Andrey Kumanyaev 1d4c9d981a Normalize the remaining store-path prefix filters and guard them on Windows
Indexed paths are repoPrefix + '/' + the rest in the indexing machine's
native separators, so a stored path on Windows reads `repo/dir\file.cs`.
Slash-only prefix logic applied to that shape sees the whole repo as one
directory: every `analyze path_prefix`, guard rule, doc filter and trigram
scope silently matches nothing below the repo root.

Three such filters were normalized when graphpath landed; the audit that
found them named "the remaining members" but only covered the reference
implementations in graph.go. Thirty-five were left raw. This finishes the
sweep through a single graphpath.HasPrefix helper, which also absorbs the
`prefix != ""` guard every call site repeated.

The helper deliberately keeps raw string-prefix semantics rather than
becoming segment-aware: `internal/mcp` matched `internal/mcpx` before and
still does. Making it segment-aware would quietly change what every
path_prefix argument returns, which is a different change from this one.

Left alone on purpose:
  - `external::` / `external-call::` node sentinels, which are not paths
  - comparisons against `repoPrefix + "/"`, where the separator after the
    repo prefix is '/' by the storage invariant

Both of the earlier Windows fixes shipped with tests that cannot fail on
the runners that execute them: on POSIX a backslash is an ordinary filename
byte, so filepath.Clean and ToSlash leave the fixtures untouched and the
assertions pass with or without the production code. The build-windows job
already exists for exactly this class of platform-divergent semantics, so
the separator tests now run there — the only place they can go red.

Also simplifies the import-adjacency canonicality guard: `cleaned != path`
was redundant ahead of the normalized comparison, since equal normalized
forms already imply the two spellings differ only in separators.
2026-08-11 19:22:04 +02:00
..