From 01717854f5e973701aa97fa6b4b781a831846245 Mon Sep 17 00:00:00 2001 From: Colby Mchenry Date: Fri, 12 Jun 2026 00:30:56 -0500 Subject: [PATCH] fix(cli): codegraph node accepts Windows backslash paths in file mode (#822) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The file-vs-symbol heuristic only matched '/' — `codegraph node src\auth\session.ts` on Windows fell through to symbol mode and found nothing. Both separators now route to file mode, normalized to forward slashes (the form the index stores). Symbols never contain either separator in any indexed language. Validated: macOS smoke (explore/node symbol/node file/unindexed refusal) + Linux Docker (same smoke + full suite, 1428 passed). Windows VM validation queued — the Parallels guest is currently unreachable (control commands are Pro-gated; needs a manual start). Co-authored-by: Claude Opus 4.8 --- src/bin/codegraph.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/bin/codegraph.ts b/src/bin/codegraph.ts index b6a3262..1dbbca2 100644 --- a/src/bin/codegraph.ts +++ b/src/bin/codegraph.ts @@ -968,12 +968,15 @@ program // A name with a path separator is a file read; otherwise a symbol // (use --file for basename-only file reads or to pin an overload). + // Both separators: Windows users type src\auth\session.ts. Symbols + // never contain either ('/' isn't an identifier char anywhere we + // index; C++ scope is '::', JS members '.'). const args: Record = {}; if (options.file) { args.file = options.file; if (name && name !== options.file) args.symbol = name; - } else if (name.includes('/')) { - args.file = name; + } else if (name.includes('/') || name.includes('\\')) { + args.file = name.replace(/\\/g, '/'); } else { args.symbol = name; args.includeCode = true;