mirror of
https://github.com/DeusData/codebase-memory-mcp.git
synced 2026-10-25 06:33:13 +08:00
Three path-canonicalization sites routed UTF-8 paths through the ANSI CRT (_access + _fullpath): the repo_path canonicalization in handle_index_repository, project-name derivation in fqn.c, and resolve_canonical_path (the containment check). ANSI decoding is locale-dependent by construction — on a CJK system codepage (the reporter runs Big5) the UTF-8 bytes of a CJK repo path re-decode into different characters, corrupting canonicalization while our CI (en-US codepage) sails through: that is why the existing non-ASCII guards stayed green while v0.9.0 crashed in the field. New cbm_canonical_path: realpath on POSIX (unchanged behavior); on Windows a wide GetFileAttributesW existence check + GetFullPathNameW, never touching the ANSI codepage. resolve_canonical_path now also requires existence on Windows, aligning it with the POSIX realpath semantics it mirrors. Guard: the Windows non-ASCII CLI guard gains the reporter's exact shape — Traditional-Chinese directory (雷達測試), flag-form --repo-path + --mode fast, real supervised spawn. Honest caveat: CI cannot switch the system codepage, so the guard validates the mechanics under en-US; the locale-specific corruption is fixed by construction (no ANSI path decoding remains on these sites). Closes #973 Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>