Skip to content

fix: normalize Windows paths to forward slashes#13

Merged
kehoej merged 1 commit intomainfrom
fix/windows-path-normalization
Apr 12, 2026
Merged

fix: normalize Windows paths to forward slashes#13
kehoej merged 1 commit intomainfrom
fix/windows-path-normalization

Conversation

@kehoej
Copy link
Copy Markdown
Owner

@kehoej kehoej commented Apr 12, 2026

Closes #8

Summary

  • Add filepath.ToSlash() in scanner.scanFile() so all file paths stored in the database use forward slashes regardless of OS
  • Add filepath.ToSlash() to 4 locations in the Python resolver where filepath.Join() produces resolved paths, matching the pattern already used by Go, TypeScript, Java, and Rust resolvers

Root Cause

On Windows, filepath.Rel() returns backslash-separated paths (core\orchestrator\live_runtime.py), which get stored directly in SQLite. All lookup commands (analyze, get_context, analyze-change) normalize user input to forward slashes before querying, causing exact-match lookups to always fail on Windows.

Test plan

  • make check (vet + lint + test) — all pass
  • go test -race on all affected packages — no races
  • End-to-end: built binary, indexed + analyzed contextception (Go), httpx (Python), zulip (Python monorepo)
  • Verified zero backslash paths in files and edges tables across all test repos

@kehoej kehoej merged commit 012e658 into main Apr 12, 2026
2 checks passed
@kehoej kehoej deleted the fix/windows-path-normalization branch April 12, 2026 22:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant