Skip to content

fix(LifeosUpgrade): m-005 detect can never match on a case-sensitive filesystem#1547

Open
m8ryx wants to merge 1 commit into
danielmiessler:mainfrom
m8ryx:fix/m005-memory-gitignore-case
Open

fix(LifeosUpgrade): m-005 detect can never match on a case-sensitive filesystem#1547
m8ryx wants to merge 1 commit into
danielmiessler:mainfrom
m8ryx:fix/m005-memory-gitignore-case

Conversation

@m8ryx

@m8ryx m8ryx commented Jul 19, 2026

Copy link
Copy Markdown

LifeosUpgrade.ts m-005 detects whether LIFEOS/MEMORY/ is gitignored, but tests a mixed-case pattern:

// Already-applied if any LIFEOS/MEMORY/ subpath is gitignored. The current
// policy gitignores LEARNING/, OBSERVABILITY/, STATE/, etc. selectively;
// Phase G may broaden this. For now, we detect "any LIFEOS/MEMORY/ rule" as
// applied.
return /^LifeOS\/MEMORY\//m.test(content);

The three comment lines directly above the regex say LIFEOS/MEMORY/, the migration's own name field says Phase G — LIFEOS/MEMORY/ in .gitignore, and the installed tree uses LIFEOS/. Only the pattern disagrees.

On a case-sensitive filesystem the check can therefore never match, so a correctly configured install reports m-005 as MISSING permanently — and re-reports it on every --diagnose run, with no edit to .gitignore able to satisfy it.

Reproduce

On Linux, with the standard rule present in .gitignore:

$ grep -n '^LIFEOS/MEMORY/' ~/.claude/.gitignore
265:LIFEOS/MEMORY/

$ bun LIFEOS/TOOLS/LifeosUpgrade.ts --diagnose
  ...
  ✗ MISSING  m-005  Phase G — LIFEOS/MEMORY/ in .gitignore

Measured against the same file:

lines matching ^LifeOS/MEMORY/   0
lines matching ^LIFEOS/MEMORY/   1

macOS hides this: HFS+ and APFS are case-insensitive by default, so the pattern matches there and the migration reports APPLIED.

Fix

One line — align the pattern with the directory the project actually uses:

-      return /^LifeOS\/MEMORY\//m.test(content);
+      return /^LIFEOS\/MEMORY\//m.test(content);

No behaviour change on macOS, where both forms already match. Detection-only code path; apply() is untouched.

Related casing fixes: #1273, #1259, #1175.

…an never match

The m-005 check tests /^LifeOS\/MEMORY\//m against .gitignore, but the tree
uses LIFEOS/MEMORY/ — as do the migration's own name field and the three
comment lines directly above the regex. On a case-sensitive filesystem the
check can never pass, so a correctly configured install reports m-005 as
MISSING permanently.

Reproduce on Linux with LIFEOS/MEMORY/ present in .gitignore:
  bun LIFEOS/TOOLS/LifeosUpgrade.ts --diagnose   ->  m-005 MISSING

macOS hides this because HFS+/APFS are case-insensitive by default.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant