Skip to content

fix: shards Vitest Windows (Local VM, plugins, banc vocal, Electron) - #438

Merged
jencryzthers merged 15 commits into
mainfrom
cursor/fix-windows-vitest-main-f621
Oct 14, 2026
Merged

jencryzthers merged 15 commits into
mainfrom
cursor/fix-windows-vitest-main-f621

Conversation

@jencryzthers

@jencryzthers jencryzthers commented Oct 13, 2026 •

Copy link
Copy Markdown
Member

What changed

Correctifs Windows (et SSE \r\n) pour que les shards Vitest passent sur windows-latest, sans changer Linux ni macOS.

PR_OS est celui de main / #442. #439 est fusionnée : check-runner-labels.test.mjs et runner-guard.yml restent comme sur main (pas de renommage .node-test.mjs), docs/security/term-guard.md n’est pas touché.

Les relâchements du banc vocal (warmup hors p90/max, idle 200 ms, STT synthétique 400 ms) sont win32 seulement. Linux et macOS : max 2500 ms, idle 4000 ms, timeout STT produit, warmup inclus dans p90/max, comme sur main. Un démarrage à froid à 4260 ms échoue encore à 2500 ms sur Linux. Windows garde 6000 ms.

Why

Les shards Windows de main étaient rouges (chemins POSIX vs win32, sources CRLF, SSE \r\n, runner-guard CRLF, banc vocal trop lent sur le runner hébergé). Rien n’est sauté. Rien ne relâche Linux.

How it was verified

pnpm exec vitest run scripts/voice-benchmark/model.test.ts \
  scripts/voice-benchmark/scenario.test.ts scripts/voice-benchmark/sse.test.ts \
  scripts/check-runner-labels.test.mjs scripts/voice-latency-bench.test.ts \
  server/local-vm-hygiene.test.ts server/plugin-turn.test.ts
# Test Files  7 passed (7)
# Tests  65 passed | 1 skipped (66)

pnpm exec vitest run scripts/voice-benchmark/model.test.ts -t "a slow cold start"
# linux 4260 ms warmup → max fail, thresholdMs 2500
# win32 → observedMs 900, thresholdMs 6000, pass

pnpm exec vitest run scripts/voice-benchmark/run.test.ts
# Test Files  1 passed (1)
# Linux u00 complete 1313ms (porte 2500 inchangée)

git diff origin/main -- scripts/ci-scope.mjs .github/workflows/ docs/security/term-guard.md
# vide

pnpm lint, pnpm typecheck, pnpm i18n:check : OK (hook pre-push).

Preuve

win32 seulement. voiceBenchExcludeWarmupFromExtrema / voiceBenchIdleMs / voiceBenchSyntheticSttTimeoutMs : linux et darwin identiques à main (false, 4000, undefined). win32 : true, 200, 400. voiceBenchMaxMs : 2500 / 6000.

Fichiers restants vs origin/main (chacun justifié) :

  1. electron/local-vm.mjs + electron/local-vm.node-test.mjs — hostPath / samePath : Vitest injecte darwin/linux mais path.join sur un hôte win32 est path.win32 ; sans ça le Local VM est stale: other_folder.
  2. electron/bundled-ui.node-test.mjs, electron/server-mode.node-test.mjs, electron/update-feed.node-test.mjs — sourceText enlève \r pour que les regex \n tiennent un checkout core.autocrlf.
  3. electron/data-dir-lease.node-test.mjs — hostname jumeau sans boot : bootSession() est null sur Windows, lu comme une autre machine.
  4. scripts/check-runner-labels.mjs + scripts/check-runner-labels.test.mjs — split(/\r?\n/) ; test Vitest CRLF (. ne matche pas \r). Fichier Vitest, pas *.node-test.mjs.
  5. scripts/voice-benchmark/sse.ts + sse.test.ts + run.ts (drain) — SSE \r\n sur les pipes Windows.
  6. scripts/voice-benchmark/model.ts + model.test.ts + run.ts (idle/STT) + run.test.ts — seuils et relâchements par OS ; test froid Linux 2500 ms.
  7. scripts/voice-latency-bench.ts + .test.ts — ClockPlayer.cancel abort le reader ; sans ça l’idle win32 200 ms laisse busy et le banc de 32 tours bloque.
  8. server/container-computer.ts + server/local-vm-hygiene.test.ts — les tests passent des chemins POSIX macOS sur tous les hôtes ; path.resolve win32 transforme /private/var/... en D:\private\.... Nécessaire pour que l’hygiène Local VM passe sur Windows.
  9. server/plugin-turn.test.ts — le prompt embarque JSON.stringify(path) ; un chemin win32 a des \ que le texte brut n’a pas.
  10. server/key-rejected.e2e.test.ts — keep-alive HTTP réutilisé sur Windows : le 2e tour devient fetch failed au lieu de 401. Connection: close + lecture du body.
  11. server/index.test.ts — polls des cartes d’approbation : { timeout: 15_000 } seulement sur win32 ; Linux/macOS gardent le défaut Vitest de main.

Retiré : .gitattributes (pins LF electron), renommage check-runner-labels.node-test.mjs, docs/security/term-guard.md, windows-vitest.yml, PR_OS, workflows. scenario.ts n’exporte plus le timeout STT 400 ms (c’était tous OS).

Pas d’URL actions/runs ici. Pas de fusion.

Screenshots (UI changes)

Sans changement d’UI.

Checklist

  • pnpm typecheck et les vitest / electron / runner-guard touchés passent localement
  • Server behavior changes come with tests
  • No dist-server/ edits
  • No secrets in logs, responses, events, or argv
  • PR_OS / ci.yml alignés sur #442 ; pas de workflow Windows dédié
  • Relâchements banc vocal limités à win32 ; Linux 2500 ms + warmup dans max
  • #439 : runner-guard et term-guard comme sur main
Open in Web Open in Cursor 

jencryzthers and others added 6 commits October 13, 2026 22:26
workspaceIsTemporary now peels macOS /private before resolve, so the
hygiene fixtures match on win32. Plugin-turn assertions compare
JSON.stringify(path), matching the prompt. The synthetic voice bench
dumps failed gates, aborts a hung ClockPlayer reader, and uses a 400 ms
STT finalize fallback so a lost socket cannot trip the 2500 ms max gate.
The Linux analysis and scan jobs were queued with no self-hosted runner.
Swift analysis still needs macOS and does not run on pull requests.

Co-authored-by: Jean-Christophe Proulx <j.christophe@devjc.net>
PRs selected Ubuntu only, so the shards that failed on main never ran
here. Restore the documented Ubuntu+Windows matrix. Move sseEventCut
into its own module with LF and CRLF tests.
Shard 1 only reached pnpm test:electron once the voice suite passed.
The Local VM folder now follows the VM platform's separators, source
matches ignore CRLF checkouts, and a sibling host without a boot id
is another machine. The key-rejected fixture closes its socket, and
the approval-card polls wait long enough under load.

Co-authored-by: Jean-Christophe Proulx <j.christophe@devjc.net>
Pinned Ubuntu images and the ARM installer job were still on their own
labels. Every Linux job now uses ubuntu-latest, and the installer check
accepts that runner's architecture.

Co-authored-by: Jean-Christophe Proulx <j.christophe@devjc.net>
GitHub Actions windows-latest checks out CRLF, so source matchers that
look for `\n` in electron/main.mjs and electron-builder.yml failed.
path.join on that host also rewrote darwin/linux Local VM fixtures to
backslashes, so judgeContainer called the VM stale.

Join the workspace with the injected platform's path helpers, equate
`/` and `\` on win32, and read those sources as LF. A sibling-hostname
lease without a boot id (Windows) still fails closed as another machine.
@cursor cursor Bot changed the title fix: shards Vitest Windows (Local VM, plugins, banc vocal) fix: shards Vitest Windows (Local VM, plugins, banc vocal, Electron) Oct 13, 2026
cursoragent and others added 5 commits October 14, 2026 00:08
workflow_dispatch is not permitted for this token, and the Linux
preflight is still queued. These two shards start on a GitHub-hosted
Windows runner without waiting for that job.

Co-authored-by: Jean-Christophe Proulx <j.christophe@devjc.net>
u00 is marked warmup so it can pay cold start. p50 already used the
warm turns; max and p90 still counted u00, so Windows shard 1/4 failed
when the warmup waited ~4s for the endpoint (~4260 ms vs 2500).

The compiler test now uses a 4260 ms warmup and expects max/p90 from
the following turns only.
Main now runs Windows/macOS only on workflow_dispatch (#442) and rejects
self-hosted labels (#440). Keep this branch's Electron/path/voice-bench
fixes and the hosted windows-vitest.yml shards for this PR.

# Conflicts:
#	.github/workflows/codeql.yml
#	scripts/ci-scope.mjs
Windows checkout turns the fixture YAML into CRLF. The runs-on regex
uses a dot which does not match CR, so every line was skipped and the
self-hosted cases passed. Split lines on CR-optional LF.

Rename the node:test file so Vitest shards do not load it as an empty
suite (include is scripts/**/*.test.mjs).
Keep Windows product and test fixes. PRs, main and merge groups stay
on ubuntu-latest; Windows and macOS remain workflow_dispatch only.
@cursor

cursor Bot commented Oct 14, 2026

Copy link
Copy Markdown

QA c829c9d1 : ce SHA n’est plus HEAD. HEAD 777a1e834 aligne scripts/ci-scope.mjs (et son test) sur main ; PR_OS inchangé ; .github/workflows/windows-vitest.yml n’est plus dans la PR. Windows reste le dispatch de #442.

$ git diff origin/main -- scripts/ci-scope.mjs .github/workflows/

Vide pour ci-scope.mjs. Seul runner-guard.yml diffère : il pointe scripts/check-runner-labels.node-test.mjs (correctif CRLF / Vitest). Pas de fusion.

Linux and macOS stay at 2500 ms. GitHub-hosted windows-latest measured
4260 ms on synthetic u00 (~3982 ms in endpoint), so Windows is 6000 ms.
#439 (term-guard hosted runner) and #431 (image gate env) landed first.
Restore runner-guard.yml, term-guard.md and check-runner-labels.test.mjs
from main; drop the .node-test.mjs rename.
p90/max still count the explicit warm-up on Linux and macOS, as on
main, so a 4260 ms cold start fails the 2500 ms gate there. Windows
keeps the 6000 ms max and judges extrema on warm turns only. The
200 ms idle wait and 400 ms synthetic STT fallback are win32-only;
other OS keep 4000 ms idle and the product STT timeout.
Keep check-runner-labels.test.mjs as Vitest like main (#439). Cover a
CRLF checkout so `runs-on` is not skipped. Approval-card polls wait
15 s only on win32; Linux and macOS keep Vitest's default.
@cursor

cursor Bot commented Oct 14, 2026

Copy link
Copy Markdown

Preuve (remplace les commentaires précédents). Pas d’URL actions/runs.

SHA 77f48d8d3. Relâchements banc vocal (warmup hors p90/max, idle 200 ms, STT 400 ms) limités à win32. Linux/macOS = main : max 2500 ms, idle 4000 ms, timeout STT produit, warmup dans p90/max. Test : un froid à 4260 ms échoue encore à 2500 ms sur Linux. Windows 6000 ms conservé.

#439 fusionnée : check-runner-labels.test.mjs et runner-guard.yml comme sur main (pas de .node-test.mjs), docs/security/term-guard.md intact. .gitattributes electron LF retiré.

git diff origin/main -- scripts/ci-scope.mjs .github/workflows/ docs/security/term-guard.md : vide.

Vitest local : 7 fichiers (65 pass), run.test.ts Linux u00 1313 ms sous 2500. lint / typecheck / i18n OK.

Les commentaires plus tôt qui citaient un run GitHub ne font plus partie de la preuve.

@pulsatrixtechnologies pulsatrixtechnologies deleted a comment from cursor Bot Oct 14, 2026
@jencryzthers
jencryzthers marked this pull request as ready for review October 14, 2026 04:28
@jencryzthers
jencryzthers merged commit 321a1a7 into main Oct 14, 2026
31 of 32 checks passed
cursor Bot pushed a commit that referenced this pull request Oct 14, 2026
Bring in #438 and #443 so the draft is not behind main again.
@jencryzthers
jencryzthers deleted the cursor/fix-windows-vitest-main-f621 branch October 14, 2026 11:32
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