v6.0.0 Linux: MutationTier/MemoryWriter allowlists compare path strings — LifeOS↔LIFEOS duality rejects every Tier-A memory write (ETIER_MISMATCH), symlink workaround insufficient
Summary
Sibling of #1391 / #1278, one layer deeper. LIFEOS/TOOLS/MemoryTypes.ts builds storage paths with pathJoin(CLAUDE_ROOT, "LifeOS") (mixed case) while MutationTier.ts and MemoryWriter.ts build their allowlists with "LIFEOS/..." (all caps). The allowlists match on path strings, so on case-sensitive filesystems every Tier-A hot-layer write is rejected:
ETIER_MISMATCH: Type 'memory' declares tier A, but resolved path
~/.claude/LifeOS/USER/PRINCIPAL/PRINCIPAL_MEMORY.md classifies as tier D.
and after the tier layer, MemoryWriter.validatePath() fails the same way (EINVAL_PATH: Path not in allowlist).
Crucially, the #1391 symlink workaround does not help here: LifeOS → LIFEOS fixes file I/O, but path.resolve() does not resolve symlinks, so the string comparison still misses. On macOS (case-insensitive APFS) both bugs are invisible.
Net effect on Linux: the autonomic memory loop runs, the reviewer extracts items, and every memory write is refused — combined with the template bug (filed separately) the memory subsystem is fully inert on Linux installs.
Environment
Ubuntu 24.04, LifeOS v6.0.0, ~/.claude/LifeOS → ~/.claude/LIFEOS symlink in place per #1391.
Repro
bun LIFEOS/TOOLS/MemoryReviewer.ts test → E2E dispatch failure with ETIER_MISMATCH (above).
Fix suggestion (verified locally)
Canonicalize (symlink-resolve) both the allowlist constants and the classify/validate input. For not-yet-existing files, realpath the deepest existing ancestor and re-attach the tail:
function canonicalize(absolutePath: string): string {
let head = absolutePath, tail = "";
while (head !== "/" && !existsSync(head)) {
tail = tail ? pathJoin(basename(head), tail) : basename(head);
head = dirname(head);
}
try {
const real = realpathSync(head);
return tail ? pathJoin(real, tail) : real;
} catch { return absolutePath; }
}
Applied in MutationTier.ts (allowlists + getTier) and MemoryWriter.ts (ALLOWED_FILES + validatePath). Side benefit: a symlink planted inside an allowlisted dir can no longer smuggle a write to its real target, which strengthens the classifier's default-deny posture. All five memory smoke suites pass after the patch (MutationTier 24/24 incl. three new symlink-spelling regression cases).
Longer term: one exported constant (or shared resolve helper, cf. DeployComponents.resolveLifeosDir mentioned in #1391) for the LifeOS dir would remove the dual spelling at the source. Happy to send a PR.
Independently confirmed on Debian 13 (the #1391 symlink-workaround box — so this is exactly the "symlink insufficient" case): the autonomic reviewer extracted 3 items and all 3 were rejected:
ETIER_MISMATCH: Type 'memory' declares tier A, but resolved path
/home/e/.claude/LifeOS/USER/PRINCIPAL/PRINCIPAL_MEMORY.md classifies as tier D.
This is a registry/classifier disagreement — fix one or the other.
One additional root-cause data point for the fix: the disagreement is literally hardcoded one file apart —
MemoryTypes.ts:37(the registry):const LIFEOS_DIR = pathJoin(CLAUDE_ROOT, "LifeOS")— mixed case, and unlike sibling tools it doesn't honorprocess.env.LIFEOS_DIRMutationTier.ts:47+(the classifier): allowlists built frompathResolve(CLAUDE_ROOT, "LIFEOS/...")— all caps
So alongside the canonicalize() belt (which hardens every comparison), the one-line suspender is aligning MemoryTypes.ts:37 to LIFEOS + env: verified locally — after that change the same reviewer run dispatches 5/5 writes successfully, entries landing in PRINCIPAL_MEMORY.md and MEMORY/KNOWLEDGE/ under the correct tree.
Same class as PangramScore.ts:30 / DASchedule.ts:17 noted on #1391 — the repo-wide \.claude/LifeOS grep + CI casing lint would catch all of these at once.
Fixed at the root you pointed to: the LifeOS/LIFEOS dual spelling is gone — MemoryTypes now builds the same all-caps path the MutationTier and MemoryWriter allowlists use (shipped in 6.0.5), and a case-portability gate in the release pipeline keeps it that way. Your realpath-canonicalization suggestion is a good defense-in-depth idea we may still take separately. Seriously thorough report — the 'symlink workaround doesn't help because path.resolve doesn't follow symlinks' detail saved real debugging time.