fix(ci): resolve cross-platform test failures

- Sanity check script (check-codex-global-state.sh) now falls back to
  grep -E when ripgrep is not available, fixing the codex-hooks sync
  test on all CI platforms. Patterns converted to POSIX ERE for
  portability.
- Unicode safety test accepts both / and \ path separators so the
  executable-file assertion passes on Windows.
- Gacha test sets PYTHONUTF8=1 so Python uses UTF-8 stdout encoding on
  Windows instead of cp1252, preventing UnicodeEncodeError on box-drawing
  characters.
- Quoted-hook-path test skipped on Windows where NTFS disallows
  double-quote characters in filenames.
This commit is contained in:
Affaan Mustafa
2026-03-31 01:38:00 -04:00
parent e68233cd5d
commit d728312b58
4 changed files with 25 additions and 12 deletions

View File

@@ -66,7 +66,11 @@ function makeHermeticCodexEnv(homeDir, codexDir, extraEnv = {}) {
let passed = 0;
let failed = 0;
if (
// Windows NTFS does not allow double-quote characters in file paths,
// so the quoted-path shell-injection test is only meaningful on Unix.
if (os.platform() === 'win32') {
console.log(' - install-global-git-hooks.sh quoted paths (skipped on Windows)');
} else if (
test('install-global-git-hooks.sh handles quoted hook paths without shell injection', () => {
const homeDir = createTempDir('codex-hooks-home-');
const weirdHooksDir = path.join(homeDir, 'git-hooks "quoted"');