-
Notifications
You must be signed in to change notification settings - Fork 9
Description
Summary
ctx currently has several assumptions that break on Windows:
-
Path boundary validation —
ValidateBoundaryuses case-sensitive path comparison, but on Windows, VS Code lowercases drive letters (e.g.c:\) whilefilepath.EvalSymlinksreturns uppercase (C:\). This causes false boundary violations. -
Project slug generation —
ProjectSluguses OS-native path separators and includes Windows drive prefixes (C:) in slugs, producing platform-dependent identifiers instead of consistent forward-slash paths. -
Session path parsing — The recall parser uses
filepath.Separatorandfilepath.Joinfor session paths, but these are always stored with forward slashes regardless of OS. -
Journal source links —
InjectSourceLinkandGenerateZensicalTomlemit backslash paths on Windows, breaking Markdown links and navigation items. -
Feed generation — Uses literal
\nand.mdstrings instead of theconfig.NewlineLFandconfig.ExtMarkdownconstants. -
Test portability — 50+ tests fail on Windows due to:
- Missing
USERPROFILEenv var (os.UserHomeDirreadsUSERPROFILEon Windows, notHOME) - Missing
APPDATAenv var (XDG fallback readsAPPDATAon Windows) t.Setenv("TZ", "UTC")has no effect on Windows (time.Localis not re-read from env)- Hardcoded Unix paths in test assertions
- Unix-specific test patterns:
/bin/shshebang,0755permissions,:PATH separator,/tmp/paths
- Missing
Proposed Fix
- Case-insensitive path comparison on Windows for boundary validation
- Platform-independent slug generation with
filepath.ToSlashand drive prefix stripping - Forward-slash-only session path operations
- Normalized forward slashes in generated links and nav items
- Use existing platform constants for newlines and extensions
- Cross-platform test helpers:
setLocalUTC,USERPROFILE/APPDATAenv setup, conditional permission skips, platform-aware PATH separators and binary extensions