[bug] Windows: memory writes and statusline fail on a fresh install (POSIX-only path…

オープン
#2,774 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

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

  • #2802 @isihussain による — マージされずにクローズ

評価

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

調査の方向性

Start with TOOLS/lib/Boundary.ts, TOOLS/MemoryWriter.ts, STATUSLINE/Admission.ts, and STATUSLINE/State.ts; trace the seven Windows path and permission failures described in the issue. Run the listed memory health check and pipe session JSON into LIFEOS_StatusLine.sh on Windows to reproduce them. Done means the health check has no critical findings, ledger verification succeeds, and the statusline renders every row.

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

説明

What happened

On Windows every memory write is refused and the statusline crashes on every render, because several tools assume POSIX paths and permission bits

Summary

Environment

  • LifeOS 8.761.0, Windows 11, Bun 1.4.4 (Windows x64)
  • Claude Code 2.1.303, hooks run through Git Bash
  • The user-data folder is a directory junction from the install tree into the config tree

Summary

On Windows, every memory write is refused and the statusline crashes on every render. Both come from code that assumes / separators, a / filesystem root, or POSIX permission bits. Seven defects, each hidden behind the previous one.

Memory (health check reports "Latest reviewer run is failed")

  1. TOOLS/lib/Boundary.ts, confinedPath: an absolute walk starts at sep, so the first component it stats is a backslash followed by the drive letter, which never exists (ENOENT). Every absolute path is refused, including the real file inside the user-data repo. Relative paths pass. Error: EWRITE_FAILED: memory write refused at the system/user boundary ... does not resolve inside the USER_DATA repo. Fix: start from parse(p).root and join with cur.endsWith(sep).

  2. TOOLS/lib/Boundary.ts, atomicWrite: invariant((fstatSync(fd).mode & 0o777) === mode) always fails, because Windows reports 0o666 whatever mode was requested.

  3. TOOLS/MemoryWriter.ts, snapshotBeforeWrite: absPath.split("/").pop() returns the whole Windows path, which trips the invariant snapshot target ... must sit directly in ... memory-snapshots.

  4. TOOLS/MemoryWriter.ts: the invariant snapshot dir ... is wider than 0700 fails for the same reason as (2).

  5. TOOLS/MemoryWriter.ts (4 sites): abs.replace(CLAUDE_ROOT + "/", "") leaves the full drive-letter path as the ledger row's file key. CortexLedger.ts verify then reports entries-drift on files the writer itself just wrote.

Statusline (prints nothing)

  1. STATUSLINE/Admission.ts (3 sites): startsWith(this.directory + "/render-") throws INVARIANT VIOLATION: render lock must be scoped to inflight. Fix: use sep.

  2. STATUSLINE/State.ts, expandRoot: converts a drive-letter install root to the MSYS form (slash, drive letter, slash). Bun on Windows cannot open that form, so every read under state.root returns null. Visible effect: blank STATE row and no doctor line. Fix: keep the native path when process.platform === "win32".

Smaller items found on the way

  • TOOLS/MergeSettings.ts with a relative --output settings.json fails with EEXIST: file already exists, mkdir '.'. An absolute output path works.
  • TOOLS/Inference.ts line 483: spawnSync("id", ["-un"]).stdout.trim() throws when the USER variable is unset and id is not on PATH (PowerShell).
  • TOOLS/ParkedReplay.ts replays only EDRIFT items, so writes parked with EWRITE_FAILED are never replayed after the cause is fixed.
  • The header's flag emoji draws as two letters, because Windows fonts have no flag glyphs.

Repro

  1. Fresh install on Windows 11; let one session end so the memory reviewer fires.
  2. Run bun LIFEOS/TOOLS/MemoryHealthCheck.ts: overall is critical.
  3. Pipe any session JSON into LIFEOS/LIFEOS_StatusLine.sh: invariant violation.

Verification of the fixes

  • confinedPath: 12 accept and refuse cases pass, including .. escapes through the junction and targets in the system tree.
  • After all seven: the health check has 0 critical findings, CortexLedger.ts verify is OK, a reviewer run wrote entries unaided, and the statusline renders every row.

The patches are small, about 25 changed lines in four files. Happy to open a PR.

Details

  • Kind: bug
  • LifeOS version: 8.761.0

Filed with the LifeOS /feedback command. The reporter approved this exact text before it was sent; paths, secrets and personal details were stripped locally.

主要言語
TypeScript
スター
19.9k
フォーク
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 を短くまとめたダイジェスト。