镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
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
@deanrie

deanrie commented Oct 29, 2026

Copy link
Copy Markdown

Hey @rudycelekli, this one still applies: scripts/generate-pstack-harness-trees.mjs on main (23ab063) keys both maps with relative(...) as returned by node:path, so on Windows the generated-tree keys carry backslashes and --check compares them against the POSIX keys of the rendered files. The only conflict on the branch is .github/workflows/validate-plugins.yml: #977 added the pstack test step at the same spot where this PR adds the "Test harness tree path portability" step. The generator and test hunks apply as they are, so it is a rebase of that one workflow block, with your step going after the existing node --test pstack/skills/*/scripts/test/*.test.ts line.

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.

2 participants