fix(#1615): normalize Windows backslash paths in workflow content
computePathPrefix returned a Windows-style path (with backslashes from path.join) into markdown @-references. Workflow file content on Windows ended up with mixed separators, breaking substring checks in install/install-runtime-artifacts tests on windows-latest CI only. Normalize resolvedTarget and homeDir to forward slashes inside computePathPrefix. The prefix is always substituted into markdown body text, which uses POSIX paths universally. Idempotent on POSIX. Also normalizes the two test assertions to forward-slash form so they pass on Windows. Adds a regression test for backslash-style input. Documents DEFECT.WINDOWS-PATH-LEAK-IN-MARKDOWN-CONTENT + RULESET.CONTENT-PATH-NORMALIZATION in CONTEXT.md so this anti-pattern stops recurring.
This commit is contained in:
@@ -1320,7 +1320,7 @@ describe('windsurf local install writes workflow slash commands (#1615)', () =>
|
||||
const workflowFile = path.join(workflowsDir, workflowEntry.name);
|
||||
const content = fs.readFileSync(workflowFile, 'utf8');
|
||||
assert.ok(
|
||||
content.includes(`${tmpDir}/.windsurf/gsd-core/commands/gsd/`),
|
||||
content.includes(`${tmpDir}/.windsurf/gsd-core/commands/gsd/`.replace(/\\/g, '/')),
|
||||
`${workflowEntry.name} must reference the installed canonical command body`,
|
||||
);
|
||||
assert.ok(
|
||||
|
||||
Reference in New Issue
Block a user