Problem
When @evomap/evolver is installed globally via npm (e.g. npm install -g @evomap/evolver), the getRepoRoot() function walks upward from the package directory inside node_modules and stops at the first .git directory it finds. On macOS with Homebrew, this causes it to resolve to /opt/homebrew (Homebrew's own git repo) instead of the user's actual project workspace.
Impact
repoRoot → /opt/homebrew
workspaceRoot → /opt/homebrew
memoryDir → /opt/homebrew/memory (does not exist)
evolutionDir → /opt/homebrew/memory/evolution (does not exist)
The evolver scans wrong session logs and produces evolution proposals for the wrong codebase.
Workaround
Set EVOLVER_REPO_ROOT env var explicitly:
<<key>EVOLVER_REPO_ROOT</key>
<string>/Users/allenrong/.openclaw/workspace</string>
Suggested Fix
When the evolver binary is installed inside a node_modules directory (global or local), detect this condition and either:
- Skip the
.git auto-discovery entirely and require explicit EVOLVER_REPO_ROOT
- Add a
node_modules boundary in the upward walk so it never escapes the user's project
- Prefer
process.env.HOME or process.cwd() over git root when inside package manager directories
Environment
- OS: macOS 15.5 (arm64)
- Node: v26.0.0
- Evolver: v1.85.2
- Install method:
npm install -g @evomap/evolver
Verification
cd /opt/homebrew/lib/node_modules/@evomap/evolver && node -e "
const {getRepoRoot} = require('./src/gep/paths');
console.log(getRepoRoot()); // → /opt/homebrew ← wrong
"
Problem
When
@evomap/evolveris installed globally via npm (e.g.npm install -g @evomap/evolver), thegetRepoRoot()function walks upward from the package directory insidenode_modulesand stops at the first.gitdirectory it finds. On macOS with Homebrew, this causes it to resolve to/opt/homebrew(Homebrew's own git repo) instead of the user's actual project workspace.Impact
repoRoot→/opt/homebrewworkspaceRoot→/opt/homebrewmemoryDir→/opt/homebrew/memory(does not exist)evolutionDir→/opt/homebrew/memory/evolution(does not exist)The evolver scans wrong session logs and produces evolution proposals for the wrong codebase.
Workaround
Set
EVOLVER_REPO_ROOTenv var explicitly:Suggested Fix
When the evolver binary is installed inside a
node_modulesdirectory (global or local), detect this condition and either:.gitauto-discovery entirely and require explicitEVOLVER_REPO_ROOTnode_modulesboundary in the upward walk so it never escapes the user's projectprocess.env.HOMEorprocess.cwd()over git root when inside package manager directoriesEnvironment
npm install -g @evomap/evolverVerification