test(windows): add red regressions for platform-specific failures#639
Open
Flipper1994 wants to merge 3 commits into
Open
test(windows): add red regressions for platform-specific failures#639Flipper1994 wants to merge 3 commits into
Flipper1994 wants to merge 3 commits into
Conversation
Adds Windows-only red tests and analysis for native Windows failures found during a Windows red-test campaign. This change contains no production fixes. - windows_non_ascii_repo_path_preserves_definitions (integration): byte-identical TypeScript fixtures indexed under non-ASCII parent paths (Latin-1 accents, Cyrillic, CJK, Greek) extract zero definitions and only File/Folder nodes (5 nodes / 4 edges) versus the ASCII baseline (12 nodes / 20 edges / 5 definitions). The pipeline source readers open files with fopen() on a UTF-8 path, which the Windows CRT interprets in the active ANSI code page; directory discovery already uses the wide API, so files are listed but never parsed. - windows_cli_non_ascii_repo_path_is_honored (integration): the documented `cli index_repository` entrypoint rejects a non-ASCII repo_path because main() does not read the wide command line, so argv arrives in the ANSI code page. Both reproduce at the product surface (real MCP process, real stdio, real SQLite DB), are deterministic, and pass on Linux/macOS. A PowerShell runner builds the binary and runs the suite; standard-library Python only. See tests/windows/RED_TEST_ANALYSIS.md for environment, commands, ruled-out seed areas, and suspected fix locations. Signed-off-by: Flipper <jacobphilipp@ymail.com>
…cker Extends the Windows red-test suite with two more reproduced, Windows-specific failures. No production fixes. - windows_hook_augment_emits_context (integration, DeusData#618): the PreToolUse Grep/Glob augmenter `hook-augment` emits empty stdout for every payload on Windows. src/cli/hook_augment.c gates on POSIX-style absolute paths (cwd[0] == '/' and the walk-up loop's dir[0] == '/'), which a Windows drive-letter cwd never satisfies, so the graph augmentation never fires. A control search_graph confirms the symbol is indexed. - windows_ui_picker_reaches_all_drives (integration, DeusData#548): the UI directory picker's GET /api/browse?path=/ returns no entries and never enumerates logical drives, so drives other than the system drive (D:\, E:\) cannot be selected. handle_browse in src/ui/http_server.c uses opendir without a GetLogicalDriveStrings root case. Needs a UI build (cbm-with-ui) and >1 drive; otherwise it reports a precondition (exit 2). Also records additional ruled-out seed areas (get_code_snippet sanitizes non-UTF-8 to U+FFFD DeusData#530.3; stdio handshake/flush works DeusData#513/DeusData#530.1/DeusData#635; mapped subst-drive indexing keeps the DB DeusData#227/DeusData#367) and cross-platform items left out of this Windows-only PR (DeusData#530.2 nested gitignore, DeusData#530.5 .git/info/exclude, DeusData#530.4 libgit2 build, DeusData#581 memory soak). Signed-off-by: Flipper <jacobphilipp@ymail.com>
Reference the Windows umbrella issue DeusData#394 in the analysis so every open Windows-relevant issue is accounted for: its open children (DeusData#227/DeusData#367, the mapped/SMB-drive class) are in the ruled-out table and its other children are already fixed upstream. No test or production change. Signed-off-by: Flipper <jacobphilipp@ymail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds Windows-only red tests and analysis for native Windows failures found during
a Windows red-test campaign. This PR intentionally contains no production
fixes — the tests are regression guards for follow-up maintainer fixes.
All tests reproduce at the product surface (a real
codebase-memory-mcp.exeprocess, real JSON-RPC stdio / CLI / HTTP UI, real SQLite DB), are deterministic,
use only the Python standard library, and pass on Linux/macOS.
Red test classes
(The wider campaign ran smoke/integration/unit/invariant attempts across
PowerShell 5.1,
cmd.exe, Git Bash, direct Win32, Pythonsubprocess, andPython stdio; seed areas that behave correctly on Windows are listed as
"ruled out" in the analysis rather than shipped as tests.)
windows_non_ascii_repo_path_preserves_definitions(#636, #357)Byte-identical TypeScript fixtures under non-ASCII parent paths (Latin-1 accents,
Cyrillic, CJK, Greek) extract zero definitions and only
File/Foldernodes(5/4) versus the ASCII baseline (12/20/5). The pipeline source readers
(
read_file()inpass_definitions.c,pass_calls.c,pass_parallel.c,pass_semantic.c, …)fopen()a UTF-8 path, which the Windows CRT reads in theANSI code page; discovery already uses the wide API, so files are listed but never
parsed.
windows_cli_non_ascii_repo_path_is_honored(#423, #20)The
cli index_repositoryentrypoint rejects a non-ASCIIrepo_path("repo_path is required") because
main()does not read the wide command line.windows_hook_augment_emits_context(#618)codebase-memory-mcp hook-augment(the PreToolUse Grep/Glob augmenter) emitsempty stdout for every payload on Windows.
src/cli/hook_augment.cgates onPOSIX-style absolute paths (
cwd[0] == '/'and the walk-up loop'sdir[0] == '/'), which a Windows drive-lettercwdnever satisfies. A controlsearch_graphconfirms the symbol is indexed.windows_ui_picker_reaches_all_drives(#548)The UI directory picker's
GET /api/browse?path=/returns no entries and neverenumerates logical drives, so drives other than the system drive (
D:\,E:\)cannot be selected.
handle_browseinsrc/ui/http_server.cusesopendirwithout a
GetLogicalDriveStringsroot case. Needs a UI build (cbm-with-ui)and >1 drive; otherwise it reports a precondition (exit 2).
Related issues
Closes none. Reproduces or expands: #636, #357, #423, #20, #618, #548, #530.
Ruled out as green on Windows (documented in the analysis, no test shipped):
#513/#530.1/#635 (stdio handshake/flush), #422/#348 (search_code via
Select-String), #274 (ignore files), #371/#137 (detect_changes), #627
(query_graph), #272 (shell metachars), #511/#530.3 (non-UTF-8 → U+FFFD),
#331 (root containment), #185/#406 (process exit), #227/#367 (mapped subst
drive). Out of scope as cross-platform: #571, #530.2, #530.4, #530.5.
Windows environments tested
cmd.exe, Git Bash (MSYS2), direct Win32,Python
subprocess.Popen, Python stdio JSON-RPC transport, embedded HTTP UIC:/D:/E:and asubstmappeddrive; ASCII, Latin-1, Cyrillic, CJK, Greek segments; spaces,
&,(),[],#,%,!, apostrophe; mixed slash/backslash; lower-case drive lettersb075f05; production + UI builds viamake -f Makefile.cbmHow to run
Each test exits
0(green),1(red / Windows failure reproduced), or2(precondition not met). Full environment, commands, ruled-out seed areas, and
suspected fix locations are in
tests/windows/RED_TEST_ANALYSIS.md.Expected maintainer action
Use these failing tests as regression guards while fixing the Windows path and
platform handling in follow-up PRs (route per-pass file reads through
cbm_utf8_to_wide+_wfopen; read the wide command line inmain(); acceptdrive-letter paths in
hook_augment.c; enumerate logical drives inhandle_browse).🤖 Generated with Claude Code