Personal_AI_Infrastructure icon indicating copy to clipboard operation
Personal_AI_Infrastructure copied to clipboard

Windows: MutationTier.getTier() classifies every path as Tier D — all Tier-B memory writes fail ETIER_MISMATCH

Open umair-a11y opened this issue 4 months ago • 1 comments

Summary

On Windows, every call to MemorySystem.add() with type idea or knowledge fails with ETIER_MISMATCH. Root cause is two POSIX-only assumptions in LIFEOS/TOOLS/MutationTier.ts.

Root cause

  1. Absolute-path guard (getTier):

    if (!absolutePath.startsWith("/")) return "D";
    

    Windows absolute paths are C:\..., so every path on the platform short-circuits to Tier D ("untouchable") and the defense-in-depth check in add() rejects the write.

  2. Tier-B prefix table builds prefixes with a hardcoded forward slash:

    pathResolve(CLAUDE_ROOT, "LIFEOS/MEMORY/KNOWLEDGE") + "/",
    

    pathResolve emits backslashes on Windows, so even past bug 1 the abs.startsWith(prefix) comparison fails on the mixed separator.

Fix (verified)

import { resolve as pathResolve, isAbsolute, sep } from "node:path";
// guard:
if (!isAbsolute(absolutePath)) return "D";
// prefixes:
pathResolve(CLAUDE_ROOT, "LIFEOS/MEMORY/KNOWLEDGE") + sep,
pathResolve(CLAUDE_ROOT, "LIFEOS/MEMORY/IDEAS") + sep,

After the patch, bun MutationTier.ts test passes 21/21 (all Tier-D untouchable defaults intact: settings.json, .env, hooks/*, CLAUDE.md, system prompt), and a 335-note bulk load through MemorySystem.add() completed with a full tier-b audit trail.

Impact

Silent on a fresh install: the autonomic reviewer's Tier-B dispatches all fail, so ideas/knowledge never persist on Windows. Proposals still work (queue writes skip the tier check), which masks the breakage.

Environment

Windows 11 (10.0.26200), Bun, LifeOS 7.28.3. Found during a Memora→Cortex bulk migration (first sustained Tier-B write volume on this platform). Related Windows-path class: #1729, #1730.

umair-a11y avatar Aug 03 '26 09:08 umair-a11y

Good catch, @umair-a11y — on Windows, MutationTier was classifying every path as Tier D. Fixed in source (now uses isAbsolute() and sep, in MutationTier.ts), ships next release. Closing since the public repo is generated from that source.

danielmiessler avatar Aug 06 '26 05:08 danielmiessler