Skip to content

bug(build): forward-slash paths on Windows cause 0 files parsed and graph stored in CWD #287

@carlos-alm

Description

@carlos-alm

Found during dogfooding v2.6.32-dev.4f08082

Severity: Medium
Command: codegraph build H:/Vscode/codegraph/.claude/worktrees/swift-jumping-quill

Reproduction

cd /tmp/test-dir
npx codegraph build H:/Vscode/codegraph/.claude/worktrees/swift-jumping-quill --verbose

Expected behavior

Build should find and parse 164 files from the target directory, storing graph.db at H:/Vscode/codegraph/.claude/worktrees/swift-jumping-quill/.codegraph/graph.db.

Actual behavior

Build finds 0 files, creates an empty graph.db in the CWD (/tmp/test-dir/.codegraph/graph.db), and reports "No changes detected. Graph is up to date."

Using backslash paths (H:\Vscode\...) works correctly — finds 164 files and stores in the right location.

Root cause

The native engine's file discovery likely doesn't normalize forward-slash POSIX-style paths to Windows paths. When the build dir is passed with forward slashes, path resolution fails silently, causing the build to fall back to CWD or an empty directory.

Suggested fix

Normalize the dir argument in buildGraph() (or in the native engine's file collector) to use path.resolve() before passing to the Rust engine. This would handle both / and \ on Windows.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdogfoodFound during dogfooding

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions