Repository navigation
Description
Summary
Cortex runs about 9000 tests on Linux and only 20 hand-picked test files on Windows. A one-off measurement of the full suite on Windows found 194 failing tests (188 failed, 6 errors) against 0 on the Linux control and 3 on macOS. This issue tracks the Windows debt as a sequence of root causes; the verified product defects and the bash question have their own issues.
Evidence
Measured on 2026-10-10 at main 18bd25b, SQLite backend, Python 3.12, dependencies from uv.lock, the process-leak guard active, no -x. Two identical runs gave the identical set of failing ids.
- Run 1: https://github.com/cdeust/Cortex/actions/runs/38008915302, run 2: https://github.com/cdeust/Cortex/actions/runs/38011318496, diagnostics: https://github.com/cdeust/Cortex/actions/runs/38012683041.
- Totals: ubuntu 9197 passed, 0 failed; macos 9194 passed, 3 failed; windows 8933 passed, 194 failing, 78 more skips than the control. The Windows full suite takes about 32 minutes against about 5 for Linux.
- By directory: tests_py/scripts 104, benchmarks 40, hooks 23, infrastructure 16, handlers 6, core 2, shared 2, invariants 1.
Failure classes (mutually exclusive, they sum to 194):
- 50 tests: the
empty_envfixture oftests_py/scripts/test_launcher_platform_coverage.py(line 92) returnsScripts/pythonwithout.exe. Once fixed, uv's cross-platform resolution runs on Windows for the first time and may expose more. - 42 tests: bare
bashresolves to the WSL launcher (tracked in its own issue). - 16 tests: default text encoding is cp1252; 4 of them are a product defect in
auto_recall(tracked in its own issue), 12 are tests that callread_text()without an encoding or compare mojibake. - 13 tests:
benchmarks/lib/machine_load_snapshot.py:54calls the POSIX-onlyos.getloadavg. - 21 tests assume a POSIX path or branch:
/a.pyis not absolute on Windows (test_preemptive_context 9),os.getppidpatched while_window_claude_pidtakes the Windows branch (session_registry.py:210-212, test_session_registry 5; PR fix(session-registry): resolve the window's claude.exe on Windows and probe liveness without os.kill (#665) #678 made its own tests platform aware but not this file),~/stateunder USERPROFILE,is_supported()false sodispatchtakes the spool branch (test_capture_dispatch), a path regex overtmp_path(test_validate_memory 4). - 4 tests use a POSIX primitive without a platform guard (
os.O_NOFOLLOW,multiprocessing.get_context("fork"),select.selecton a pipe). - 2 tests:
tests_py/_hermetic_hook_env.py:91sets HOME only, andPath.home()reads USERPROFILE on Windows. - 23 tests, suspected CRLF translation of fixtures written with
write_text(test_migrate_decision_blocks 9, test_wiki_rebucket_file_docs 9, test_wiki_bulk_migrate 5); inferred from the code, not run. - 23 tests not isolated (first error lines recorded): installer rerun fixtures 6, file priming aliases 6 (heat 0.5 against 0.6: a symlinked project alias is scoped differently, possibly a product defect in the ADR-1086 scoping), mcp client spawn 2, a mocked
Path.resolve2, a TTL on a coarse Windows clock 1,test_capture_drain1 (tracked in its own issue), and 5 singles.
Expected
Fix the classes in this order, one pull request each, re-measuring on Windows after each one with the scratch workflow used for the measurement: 1 (50 tests), then 3 (the product defect first), 2, 4, 8, then 5, 6 and 7 together, then class 9 one by one. After the first four steps 73 ids remain, after 5 to 7 about 20. The required Windows job then grows one directory at a time (not straight to the full suite), and the per-system skip counts (Windows 78, macOS 6 more than the control) are pinned in CI so that a new platform skip is a visible decision.
Activity
fix(hooks): write hook and launcher output as UTF-8 through one share…
fix(windows): CI runs the plugin hook commands without bash on PATH; …
test(windows): return the executable from the empty launcher environm…
test(windows): return the executable from the empty launcher environm…
fix(bench): machine-load snapshot reports no load average where os.ge…
cdeust commentedon Nov 4, 2026
Tranche classe 4 proposée dans #861 (commit d0f0ab9) :
os.getloadavgest Unix-only, l'AttributeErrorsous Windows échappait auexcept OSErrordebenchmarks/lib/machine_load_snapshot.py. Le test qui échouait avant (os sansgetloadavg) passe maintenant. Sous Linux,tests_py/benchmarksdonne 386 passés et 12 ignorés. Rien n'a tourné sous Windows.Tranches restantes, dans l'ordre de l'issue : classe 3 (encodage cp1252, 12 tests ; le défaut produit
auto_recalla sa propre issue), classe 8 (CRLF, 23 tests), classes 5 à 7 ensemble, puis la classe 9 une par une. Les classes 1 et 2 sont déjà fusionnées : #824 pour la classe 1, #738 pour la classe 2.Generated by Claude Code