From c9d2a25b73c3fc66c0f464a1ec0e0eb1cf53de65 Mon Sep 17 00:00:00 2001 From: Colby McHenry Date: Fri, 22 May 2026 14:12:40 -0500 Subject: [PATCH] docs: validate Windows PRs via Parallels+SSH; gitignore .parallels Document the Mac-host -> Parallels Windows 11 SSH workflow for validating Windows-specific behavior, the win32-gated test convention (it.runIf), and guest toolchain quirks (PATH refresh, Windows-local clone, VC++ ARM64 redist). Co-Authored-By: Claude Opus 4.7 (1M context) --- .gitignore | 3 +++ CLAUDE.md | 20 ++++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/.gitignore b/.gitignore index 435882b..f7aa9d6 100644 --- a/.gitignore +++ b/.gitignore @@ -40,6 +40,9 @@ npm-debug.log* # Local Claude settings .claude/settings.local.json +# Parallels Windows VM SSH/connection config (local machine, see CLAUDE.md) +.parallels + # CodeGraph data directories (in test projects) .codegraph/ diff --git a/CLAUDE.md b/CLAUDE.md index d5222f3..be63c67 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -101,6 +101,26 @@ Tests live in `__tests__/` and mirror the module they cover. Notable ones beyond Tests create temp dirs with `fs.mkdtempSync` and clean up in `afterEach`. They write real files and exercise real SQLite — there is no DB mocking. +### Windows-gated tests + +Behavior that differs by platform (path resolution, drive letters, `SENSITIVE_PATHS`, `%APPDATA%` config dirs, CRLF) must be gated, not assumed. Use `it.runIf(process.platform === 'win32')(...)` for Windows-only assertions and `it.runIf(process.platform !== 'win32')(...)` for POSIX-only ones — e.g. `/etc` is sensitive on POSIX but resolves to `C:\etc` (non-existent) on Windows, so an ungated `/etc` assertion fails on Windows. Validate the Windows side for real (see below); don't merge a Windows-gated test you haven't seen run. + +## Windows validation (Parallels + SSH) + +For any Windows-specific PR, bug, or implementation, validate it on the real Windows VM rather than guessing. Connection details live in the gitignored **`.parallels`** file at the repo root (VM name, guest IP, SSH user/key). `prlctl exec` needs Parallels Pro and is unavailable, so SSH is the bridge. + +- Connect / run from the Mac host: `ssh @ "..."`. For multi-line work, pipe PowerShell over stdin and **refresh PATH from the registry** first (sshd's session has a stale PATH after winget installs): + ``` + ssh colby@10.211.55.3 "powershell -NoProfile -ExecutionPolicy Bypass -Command -" <<'PS' + $env:Path = [Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [Environment]::GetEnvironmentVariable("Path","User") + Set-Location C:\dev\codegraph + PS + ``` +- Clone fresh into a **Windows-local** path (`C:\dev\codegraph`) and `npm ci` there — never run npm against the shared Mac repo, since `esbuild`/`rollup` ship platform-specific binaries. +- Guest toolchain (winget): Node LTS, Git, and the **VC++ ARM64 redistributable** (required by `@rollup/rollup-win32-arm64-msvc`, which vitest pulls in). +- Fetch a contributor PR head straight from their fork to dodge `pull//head` lag: `git fetch ` then `git checkout -f FETCH_HEAD`. +- Known pre-existing Windows failure: `security.test.ts > Session marker symlink resistance > does not follow a pre-planted symlink` (symlink creation needs privileges on Windows). Unrelated to current work; don't let it mask new regressions. + ## Releases Released to npm and mirrored as [GitHub Releases](https://github.com/colbymchenry/codegraph/releases). `CHANGELOG.md` is the source of truth; GitHub Release notes are extracted from it.