Personal_AI_Infrastructure icon indicating copy to clipboard operation
Personal_AI_Infrastructure copied to clipboard

v6.0.0 Linux: LifeOS vs LIFEOS case mismatch crash-loops Pulse on case-sensitive filesystems (+ stray dir side effect)

Open badosanjos opened this issue 5 months ago • 5 comments

Summary

PULSE/Observability/observability.ts hardcodes the runtime dir as ~/.claude/LifeOS (mixed case) while DeployCore deploys the runtime to ALL-CAPS ~/.claude/LIFEOS. On case-sensitive filesystems (Linux) Pulse crash-loops with ENOENT on first start — and as a side effect the crash loop mkdir's a stray REAL ~/.claude/LifeOS/ directory (it captures PULSE/state/pulse.pid), which then shadows any later symlink fix.

On macOS (default case-insensitive APFS) both paths resolve to the same dir, which is why this only bites Linux.

Environment

Ubuntu 24.04, LifeOS v6.0.0, Pulse via manage.sh install (systemd user unit).

Repro

  1. Fresh install on Linux, Setup toolchain, manage.sh install.
  2. Unit enters activating (auto-restart); pulse-stderr.log shows repeated {"msg":"Pulse crashed","error":"ENOENT: No such file or directory"}.
  3. ls ~/.claude/ now shows BOTH LIFEOS/ and a stray LifeOS/ real dir created by the crash loop.

Workaround (verified)

Stop the unit, remove the stray dir, ln -s ~/.claude/LIFEOS ~/.claude/LifeOS, start → Pulse boots clean (all modules load, port 31337 binds).

Fix suggestion

Use the same constant the deployer uses (LIFEOS, or a shared resolve helper — DeployComponents.resolveLifeosDir already tolerates both). Happy to send a small PR.

badosanjos avatar Jul 03 '26 04:07 badosanjos

Confirming this on Debian, and adding two more mixed-case sources that #1397 doesn't cover (it fixes PULSE/Observability/observability.ts only):

LIFEOS/TOOLS/PangramScore.ts line 30 — env fallback uses the mixed-case path:

const RUNS_PATH = join(
  process.env.LIFEOS_DIR || `${process.env.HOME}/.claude/LifeOS`,
  "MEMORY", "OBSERVABILITY", "pangram-runs.jsonl",
);

(Note this compounds with the literal-$HOME env issue: when LIFEOS_DIR arrives unexpanded or unset, this fallback actively creates the mixed-case twin.)

LIFEOS/TOOLS/DASchedule.ts lines 17–18 — pure hardcode, no env override at all:

const LIFEOS_DIR = join(HOME, ".claude", "LifeOS")
const TASKS_DIR = join(LIFEOS_DIR, "PULSE", "state", "da")

So v6's own task scheduler reads/writes ~/.claude/LifeOS/ on Linux while the runtime deploys to ~/.claude/LIFEOS/ — scheduled tasks land in a tree nothing else reads.

Observed effect on a case-sensitive FS after setup + a few sessions: a twin ~/.claude/LifeOS/ containing MEMORY/OBSERVABILITY/success-claim-gate.jsonl, MEMORY/OBSERVABILITY/permission-decisions.jsonl, MEMORY/STATE/permission-cache.json, and USER/CACHE/freshness.json. On macOS both spellings resolve to one directory, so this is invisible there.

This is the same class as v5's #1146 (resolved as "ALL_CAPS consistently") recurring in the new tree — a repo-wide grep for \.claude/LifeOS plus a CI lint on path casing would catch the whole class at once.

rpriven avatar Jul 03 '26 16:07 rpriven

Found a deeper consequence of this same LifeOS↔LIFEOS duality: even with the symlink workaround in place, the string-compared allowlists in MutationTier.ts/MemoryWriter.ts still miss (path.resolve doesn't resolve symlinks), so every Tier-A memory write is rejected with ETIER_MISMATCH. Filed separately with a tested canonicalize() patch: #1410

badosanjos avatar Jul 03 '26 20:07 badosanjos

Closing as verified fixed in the shipped tree: LifeOS/install/LIFEOS/PULSE/Observability/observability.ts on main (and on the v6.0.5 tag) now derives all paths from all-caps LIFEOS (e.g. L58 join(HOME, ".claude", "LIFEOS"), L145, L1629) — no remaining mixed-case .claude/LifeOS references, so the crash-loop and the stray-dir side effect on case-sensitive filesystems are resolved. Verified against file contents, not just the changelog. Thanks!

rpriven avatar Jul 07 '26 17:07 rpriven

FWIW, verified against file contents on main today (not just the changelog): LifeOS/install/LIFEOS/PULSE/Observability/observability.ts now derives all paths from all-caps LIFEOS (e.g. L58 join(HOME, ".claude", "LIFEOS"), L145, L1629), with no remaining mixed-case .claude/LifeOS references — same on the v6.0.5 tag. So the crash-loop and stray-dir side effect on case-sensitive filesystems look genuinely resolved in the shipped tree. @badosanjos probably safe to confirm on your install and close.

rpriven avatar Jul 07 '26 17:07 rpriven

This one's fixed — Pulse's Observability module now resolves the runtime dir as all-caps LIFEOS everywhere (shipped since 6.0.2, and 6.0.5 carried a full case sweep of the payload). We also added a case-portability gate to the release pipeline so mixed-case paths can't ship again. Thanks for the crisp repro, including the stray-dir side effect.

danielmiessler avatar Jul 07 '26 18:07 danielmiessler