fix: make health-check probes Windows-aware (.exe, .cmd, exec-bit, PATHEXT)#4
Open
zbolton36 wants to merge 1 commit into
Open
fix: make health-check probes Windows-aware (.exe, .cmd, exec-bit, PATHEXT)#4zbolton36 wants to merge 1 commit into
zbolton36 wants to merge 1 commit into
Conversation
…THEXT) On Windows the binary is ll-search.exe and the shims are .cmd, and Node statSync reports no POSIX exec bit for either. The doctor reported four false-positive failures (binary-exists, binary-runs, shims-exist, claude-version) even with everything installed and working. - health-check.mjs / quick.mjs: probe ll-search.exe on win32. - quick.mjs: probe .cmd shims and skip the stat.mode & 0o111 exec-bit test on win32 (binary + shims). - health-check.mjs safeExec: shell:true on win32 so execFileSync honors PATHEXT and resolves claude.cmd / node shims. - tests: add win32-mocked coverage for the binary and shim checks.
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.
Fixes #3.
Problem
On Windows,
/learning-loop:doctorreports four hard failures even when the binary, shims, and Claude Code are all installed and working. All four are false positives in the health-check probes (POSIX assumptions), not real install problems. The runtime path is unaffected:lib/binary.mjsalready resolvesll-search.exe, so semantic search and indexing work while the checker reports the binary missing.Verified before the fix that
bin/ll-search.exe versionreturns1.33.0,vault-search.mjs searchreturns ranked results, the.cmdshims exist, andclaude --versionworks in the shell, while doctor still showedbinary-exists,binary-runs,shims-exist, andclaude-versionas FAIL.Changes
.exeon the binary path (health-check.mjs,quick.mjscheckBinaryExists): the binary isll-search.exeon Windows. Drivesbinary-existsandbinary-runs..cmdon the shim path (quick.mjscheckShimsExist):install-shims.mjswritesll-watch.cmd/ll-search.cmd. Drivesshims-exist.stat.mode & 0o111is always 0 for.exe/.cmdunder NodestatSync, so existence is the correct signal there.shell: trueon win32 insafeExec:execFileSyncdoes not honor PATHEXT, so bareclaude/nodemiss their.cmdshims and read as "not found". Drivesclaude-version(and the misleading Linuxinstall.shfix it suggested).All win32 behavior is guarded behind
process.platform === 'win32', so POSIX behavior is byte-for-byte unchanged.Tests
Added three
win32-mocked cases totests/health-check.test.mjs(mockprocess.platformso the branches run on the POSIX CI runner):.exebinary OK,.cmdshims OK, and extensionless-only shims FAIL on win32. The existingskipOnWindowsexec-bit tests are untouched.Local checks
npx prettier --checkon changed files: clean.npx eslint .: 0 errors (only pre-existing unused-disable warnings, including one onmain).node --test tests/health-check.test.mjs: 87 pass, 0 fail (3skipOnWindows, 3 new win32 cases pass).Result on a real Windows box: doctor goes from
19 pass / 1 warn / 4 failto23 pass / 1 warn / 0 fail(remaining warn is the legitimatelocal-bin-on-path).Possibly related (not addressed here)
The session-start hook injects
PLUGIN_DATA=...\data\learning-loop-inline, butresolve-paths.mjs/download-binary.mjsresolve...\data\learning-loop-learning-loop-marketplace. Bothbin/dirs end up populated, so it is not breaking, butdownload-binary.mjsreporting "already installed" in one root while the checker probes the other is confusing. Flagging in case it points at a path-derivation inconsistency; happy to look if you want it in scope.