Windows: MemoryHealthCheck reports installed memory hooks as unregistered (installer backslash-escapes the config root)

Đang mở Phù hợp với người mới
#3,020 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 5 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
72/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
bash, bun, typescript

Hướng nghiên cứu

Bắt đầu với skills/LifeOS/Tools/InstallEngine.ts và kiểm tra rewriteHomeRoot, shellQuoteRoot cùng rewriteHookRoots, sau đó so sánh đầu ra của chúng với hookCommandScript trong LIFEOS/TOOLS/LifeosUpgrade.ts. Xác minh rằng các thư mục gốc trên Windows được chuẩn hóa thành dấu gạch chéo và các hook hiện có được trỏ lại khi cập nhật. Dùng bộ kiểm tra trong issue và MemoryHealthCheck.ts để xác nhận rằng các lệnh được phân tích và được báo cáo là đã đăng ký; xử lý riêng vấn đề trích xuất Report.ts attest và phát hiện PATH.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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, MemoryHealthCheck reports MemoryTurnStart, MemoryReviewFire and MemoryHealthGate as "not registered in any settings layer" even though the installer registered them and they run. The installer's rewriteHookRoots → shellQuoteRoot (unquoted position) backslash-escapes every backslash in a Windows config root, so each hook command is written with doubled backslashes: <DRIVE>:\\<HOMEDIR>\\.claude/hooks/<name>.hook.ts. Bash runs that correctly, but hookCommandScript in LIFEOS/TOOLS/LifeosUpgrade.ts treats any backslash as making a command opaque and returns null, so every installer-written hook is invisible to the registration check (and to anything else that attests hooks through that parser). The four memory-write bugs on the same install are already covered by #2568 (closed, fix pending release) and are not refiled here. Separately, Report.ts attest cannot extract the release on Windows: tar reads the drive letter in the archive path as a remote host ("Cannot connect to C: resolve failed"), and collect reports bun and git as "not found" although both are on PATH.

Where (file:line)

skills/LifeOS/Tools/InstallEngine.ts:1322

Repro on a clean tree
1. Install LifeOS 8.761.0 on Windows 11 x64 under Claude Code (Git Bash, bun 1.4.5), default config root (`.claude` in the user profile).
2. Open `settings.json` in the config root: every LifeOS hook command is the config root with doubled backslashes, then `/hooks/<name>.hook.ts`.
3. Run `MemoryHealthCheck.ts`: it warns `settings-hook-absent` for all three memory hooks.
4. Probe (captured below): render `$HOME/.claude/hooks/MemoryTurnStart.hook.ts` through the installer's own `rewriteHookRoots` with the Windows config root, run the result with `bash -c` (exit 0: the hook works), then pass the same string to `hookCommandScript`, which returns `null`. The probe exits 1.
5. Workaround that turns the check green: rewrite each command's root to forward slashes (`<DRIVE>:/<HOMEDIR>/.claude/hooks/...`). Git Bash runs it identically and `hookCommandScript` returns the script path.
Negative control

Probe: bun C:~/AppData/Local/Temp/claude/978c4f609d2e0d95/745f923b-81b5-41a9-a4f1-42748d93b935/scratchpad/probe/hookroot-probe.ts · exit 1 · captured 2026-11-28T20:10:35.661Z

Red looks like: hookCommandScript -> null

installer-rendered command: C:\\Users\\<user>\\.claude/hooks/MemoryTurnStart.hook.ts
runs under bash: exit 0
hookCommandScript -> null
Suggested fix

Smallest fix, at the producer: on win32, convert the config root to forward slashes before shellQuoteRoot quotes it (in rewriteHomeRoot), e.g. const r = process.platform === "win32" ? root.split(sep).join("/") : root. A drive path with forward slashes is valid for Git Bash, cmd and PowerShell, contains no backslash, and hookCommandScript parses it. POSIX output is unchanged. repointHookRoots could apply the same normalisation so existing Windows installs heal on the next update. Relaxing hookCommandScript's backslash rule instead is not recommended; it exists for quote-boundary safety.

Environment
  • OS: Windows (x64)
  • Harness: claude-code
  • bun: not found · git: not found
  • Doctor broken: codex, interceptor, cloudflare, imagemagick, ffmpeg, ytdlp, fabric
Ngôn ngữ chính
TypeScript
Star
20k
Fork
2.5k
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của danielmiessler/LifeOS

Tất cả issue của danielmiessler/LifeOS

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.