#2267·LifeOS

Installer links `LIFEOS/USER` but never `LIFEOS/MEMORY`, so the boundary guard refuses every Cortex write on a fresh install

Author: ktalonsCreated Sep 30, 2026Updated Sep 30, 2026

Version

LifeOS 7.40.4 / Cortex v8.3.0 (upstream main at 5e2f2e8)

What is broken

SystemUserBoundary.md says ~/.claude/LIFEOS/MEMORY is a symlink into ~/.config/LIFEOS/USER/MEMORY, and assertInsideUserData() enforces that. It refuses any personal write whose realpath lands outside ~/.config/LIFEOS/USER. The installer only builds half of that contract. setupUserSeparation() links LIFEOS/USER and nothing else. The copy step skips MEMORY, and the validator checks only USER. On a fresh install LIFEOS/MEMORY doesn't exist until the first hook runs mkdirSync(..., { recursive: true }) under it, which creates a real directory inside the system tree. From then on MemorySystem.add and the Pulse proposal writer return EWRITE_FAILED for every memory write. The only visible symptom is MemoryHealthCheck reporting "Latest reviewer run is failed". Nothing names the cause, so proposals and ideas are dropped silently until someone traces the guard.

Where (file:line)

  • Linker, USER only: LifeOS/Tools/InstallEngine.ts:573 (setupUserSeparation, also shipped as skills/LifeOS/Tools/InstallEngine.ts). Copy skip: :347 (SKIP_DIRS includes "MEMORY"). Validator, USER only: :654-662.
  • Guard (reader): LIFEOS/TOOLS/lib/ForeignDataCheck.ts:239, called at LIFEOS/TOOLS/MemorySystem.ts:841 and LIFEOS/PULSE/lib/memory-proposals.ts:245.
  • Writer that creates the real dir: e.g. hooks/AgentInvocation.hook.ts:155 (OBS_DIR = paiPath('MEMORY','OBSERVABILITY'), :108). There are about a dozen similar mkdirSync sites across the hooks.
  • Contract: LIFEOS/DOCUMENTATION/SystemUserBoundary.md:57.

Repro on a clean tree

bash
git clone https://github.com/danielmiessler/PAI && cd PAI
cat > probe.ts <<'EOF'
import { mkdirSync, lstatSync } from "node:fs";
import { join } from "node:path";
import { setupUserSeparation } from "./LifeOS/Tools/InstallEngine";
import { assertInsideUserData } from "./LifeOS/install/LIFEOS/TOOLS/lib/ForeignDataCheck";
const H = process.env.HOME!, root = join(H, ".claude"), cfg = join(H, ".config", "LIFEOS");
mkdirSync(join(root, "LIFEOS"), { recursive: true });
console.log("install:", setupUserSeparation(root, cfg).action);
const kind = (p: string) => { const s = lstatSync(p, { throwIfNoEntry: false }); return !s ? "absent" : s.isSymbolicLink() ? "symlink" : "real dir"; };
console.log("LIFEOS/USER   :", kind(join(root, "LIFEOS/USER")));
console.log("LIFEOS/MEMORY :", kind(join(root, "LIFEOS/MEMORY")));
mkdirSync(join(root, "LIFEOS/MEMORY/OBSERVABILITY"), { recursive: true }); // what the hooks do
console.log("after hook    :", kind(join(root, "LIFEOS/MEMORY")));
console.log("guard(MEMORY) :", assertInsideUserData(join(root, "LIFEOS/MEMORY/OBSERVABILITY/pending-proposals.jsonl")).ok ? "ok" : "REFUSED");
console.log("guard(USER)   :", assertInsideUserData(join(root, "LIFEOS/USER/x.md")).ok ? "ok" : "REFUSED");
EOF
HOME="$(mktemp -d)" bun probe.ts   # throwaway HOME; touches nothing real

Negative control

On unpatched 7.40.4 (5e2f2e8), the installer's own setupUserSeparation against an empty home prints:

install: scaffolded-linked
LIFEOS/USER   : symlink
LIFEOS/MEMORY : absent
after hook    : real dir
guard(MEMORY) : REFUSED
guard(USER)   : ok

With the same code and the same home, adding only symlink ~/.config/LIFEOS/USER/MEMORY → ~/.claude/LIFEOS/MEMORY before the hook write makes guard(MEMORY) print ok. So the missing link alone decides the outcome.

On a real install this ran for 10 days before anyone noticed. The reviewer failed on every run with EWRITE_FAILED and 8 proposals were lost. Health reported only "Latest reviewer run is failed".

Suggested fix

Untested as a patch; the shape:

  1. In setupUserSeparation (or a sibling setupMemorySeparation called right after it), link LIFEOS/MEMORY → <configDir>/USER/MEMORY using the same branches USER already has:
    • a correct link is a no-op;
    • a dangling link is repaired;
    • an existing real directory is merged into the data home, then renamed aside rather than deleted, then linked;
    • a fresh install gets mkdir plus the link.
  2. Extend the validator at :654 to check MEMORY as well as USER.
  3. Add a critical finding to MemoryHealthCheck.ts that calls assertInsideUserData() on a probe path under LIFEOS/MEMORY. Existing installs that already have a real directory there would then see the cause at session start, not just "reviewer run failed". I run this locally. It goes critical on a real directory and passes on the linked layout, both verified against a throwaway HOME.

For existing installs, the migration has a race to know about. Hooks recreate LIFEOS/MEMORY/... between the mv and the ln -s. Merge whatever landed in that window rather than overwriting it.

Before submitting

  • I searched open and closed issues for this defect. gh issue list --state all found nothing for "MEMORY symlink", "EWRITE_FAILED", "assertInsideUserData" or "LIFEOS/MEMORY" on 2026-09-30.
  • The repro runs against a clean tree of the version above, not against my modified install.
  • I removed personal data from the pasted output.