fix: support native Windows project state paths - #17
Open
Linxiushen wants to merge 1 commit into
Open
Linxiushen wants to merge 1 commit into
Linxiushen wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Project initialization and catalog registration fail on Windows because
gitRoot()returns a native path, whileprojectId()splits only on/. For a repository such asC:\work\sample-skill, the resulting state path contains<home>\projects\C:\work\sample-skill-<hash>\runs, and directory creation fails withENOENT.What changed
Use
path.basename()for the project name, preserving the existing fallback and full-root hash. Add real Git/SQLite tests for state persistence after reopening, isolation between same-named repositories, and catalog registration.Reproduction
On Windows, with the new regression file added to the upstream base:
pnpm exec tsc -p tsconfig.json node --disable-warning=ExperimentalWarning --test dist/test/project-paths.test.jsAll three tests fail at directory creation on the baseline and pass with this change. The tests use temporary native paths, including spaces, without filesystem or database mocks.
Validation and results
pnpm testpasses 34/34, including the normal build; 7/7 representative POSIX project IDs exactly match the original implementation.git diff --check, gitleaks directory/history scans, dependency audit and registry-signature checks pass.Effect and limits
Windows project state can now be created and reopened. The hash still distinguishes repositories with the same directory name, and existing POSIX IDs retain their format. Linux validation used the supported Node 22 line; hosted CI uses Node 24. The complete suite's existing POSIX shell fixtures were run on Linux, while the new storage regressions were also run natively on Windows.
Review checklist
git diff --check.