Skip to content

fix: normalize Windows path keys in harness generation - #667

Open
rudycelekli wants to merge 1 commit into
cursor:mainfrom
rudycelekli:fix/windows-harness-tree-paths-20261016
Open

rudycelekli wants to merge 1 commit into
cursor:mainfrom
rudycelekli:fix/windows-harness-tree-paths-20261016

Conversation

@rudycelekli

@rudycelekli rudycelekli commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

The harness generator indexes copied files using native path.relative() results, then looks them up using slash-separated skill paths. Windows relative paths contain backslashes, causing rendering to crash at files.get(path).bytes. Native disk keys would also disagree with generated keys during --check.

Normalize keys to POSIX separators at both boundaries while keeping filesystem paths native. Add a regression that runs the full production check with native and actual path.win32 relative-path semantics, and run it in CI.

Validation: both regression cases pass; the unchanged generator passes the native case and fails the Windows-separator case. Separate production write runs generated 139 files each, with all filenames, bytes and executable flags matching the committed tree. Tests ran on macOS; this verifies Windows path semantics, not a native Windows filesystem.


Note

Low Risk
Scoped to the harness generator script and CI; no runtime product or security-sensitive paths.

Overview
Fixes harness generation and --check on Windows by normalizing file map keys to forward slashes after path.relative(), so lookups like skills/.../SKILL.md match even when the OS returns backslash paths.

Adds scripts/generate-pstack-harness-trees.test.mjs, which runs the real generator’s --check in a VM and stubs node:path with win32.relative / win32.sep to lock in that behavior. CI (validate-plugins.yml) now runs this test with node --experimental-vm-modules.

Reviewed by Cursor Bugbot for commit 733e486. Bugbot is set up for automated code reviews on this repo. Configure here.

@rudycelekli
rudycelekli force-pushed the fix/windows-harness-tree-paths-20261016 branch from e56550c to 733e486 Compare October 24, 2026 02:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant