Windows: tryExec probes binaries with `command -v`, so every binary check false-negatives (DetectEnv reports bun/git absent; LinkUser silently skips git init)

オープン 初心者向け
#3,023 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 5 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
78/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
bun, typescript

調査の方向性

skills/LifeOS/Tools/InstallEngine.ts、特に tryExec、detectTool、detectHarness、initLocalRepo から始め、続いて提供されている detectTool のプローブを Windows で実行します。POSIX 専用のバイナリ検出をプラットフォーム非依存の検索に置き換え、バージョン取得コマンドは維持したまま、DetectEnv、harness の検出、LinkUser によるリポジトリの初期化を確認します。完了条件は、Windows でインストール済みの git、bun、harness のバイナリが検出され、Git が利用可能な場合に git init が実行され、既存、Windows 以外の環境での動作が引き続き機能することです。

索引モデルが issue の本文から書いたものです。

説明

Version

LifeOS 8.761.0 · attestation: unattested (could not extract v8.761.0: tar (child): Cannot connect to C: resolve failed

gzip: stdin: unexpected end of file
tar: Child returned status 128
tar: Error is not recoverable: exiting now)

What is broken

On Windows every binary-presence probe in the install tools returns a false negative, because tryExec hands its argument to execSync with no shell override: Node then spawns %ComSpec% (cmd.exe), where command -v is not a command, so the call throws and the helper returns null. Three call sites read that as "the binary is not installed". detectTool backs the bun and git fields of DetectEnv and the environment block of Report.ts collect, both of which report the tools absent on a machine where they run normally. detectHarness's hasBin can never match a harness binary, so harness confidence is pinned at assumed even when the claude CLI is on PATH, and Setup step 1 asks the operator to confirm a harness the code could have proven. initLocalRepo takes its git-missing branch, so LinkUser skips git init on both the USER tree and the config root and records "reason": "git not found on PATH". That last one is the costly symptom: the boundary symlinks are established and the install reports success, so a Windows install silently ends up with no local history on the principal's personal tree, which is the thing that step exists to provide.

Where (file:line)

skills/LifeOS/Tools/InstallEngine.ts:85 (tryExec); call sites :113 detectTool, :137 detectHarness hasBin, :1070 initLocalRepo

Repro on a clean tree
# Windows 11, git-bash shell. git and bun are both installed and resolve on PATH.

git clone --depth 1 https://github.com/danielmiessler/LifeOS   # HEAD 94bd8f2
T="$PWD/LifeOS/LifeOS"

# p.ts calls the SHIPPED exported detectTool and prints no filesystem paths:
#   const root = process.argv[2];
#   const { detectTool } = await import(`${root}/Tools/InstallEngine.ts`);
#   for (const [bin, v] of [["git","git --version"], ["bun","bun --version"]])
#     console.log(bin, detectTool(bin, v).installed, !!Bun.which(bin));

bun p.ts "$T"
# Seen:     git: detectTool says installed=false | resolves on PATH=true
#           bun: detectTool says installed=false | resolves on PATH=true
# Expected: installed=true for both

# The same cause, observed through the shipped tools on a real install:

bun Tools/DetectEnv.ts
#   "bun": { "installed": false }     <- bun is running this very script
#   "git": { "installed": false }
#   "harness": { "name": "claude-code", "confidence": "assumed" }   <- claude IS on PATH

bun Tools/InstallAll.ts --yes --json
#   LinkUser "repo"       -> { "action": "skipped", "reason": "git not found on PATH" }
#            "configRepo" -> { "action": "skipped", "reason": "git not found on PATH" }
#   ...while `git --version` in the same shell prints git version 2.56.1.windows.1
Negative control

Probe: bun C:/lifeos-repro/probes/p-commandv.ts C:/lifeos-repro/upstream/LifeOS · exit 1 · captured 2026-11-29T01:31:58.967Z

Red looks like: RED: shipped detectTool reports a binary absent while it is installed and on PATH

git: detectTool says installed=false | resolves on PATH=true
bun: detectTool says installed=false | resolves on PATH=true
RED: shipped detectTool reports a binary absent while it is installed and on PATH
Suggested fix

Untested shape. Resolve binary presence with a runtime API rather than a POSIX shell builtin: Bun.which(name) is already used elsewhere in the payload (LIFEOS/TOOLS/lifeos.ts uses it for the claude lookup) and is platform-correct. detectTool could use it for the presence check and keep tryExec only for the version string, which is a real command on every platform. Alternatively branch tryExec on process.platform and use where instead of command -v on Windows. The guard at :1070 has a third option: drop the probe entirely and let git init fail, since initLocalRepo already handles a failed init and reports it.

Note that the POSIX assumption in tryExec is wider than these three call sites: detectOS also shells out to sw_vers, uname and cat /etc/os-release through the same helper, which is why the Windows branch there already special-cases ver.

Environment
  • OS: Windows (x64)
  • Harness: claude-code
  • bun: not found · git: not found
  • Doctor broken: identity-placeholders, ripgrep, imagemagick, ffmpeg, ytdlp, jq
主要言語
TypeScript
スター
20k
フォーク
2.5k
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

danielmiessler/LifeOS のほかの issue

danielmiessler/LifeOS の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。