Environment
- Axolotl project size: 2.2 GB, 34,327 files
frontend/node_modules: 817 MB
frontend/release: 785 MB
frontend/jre: 127 MB (bundled JRE)
- Actual source code: ~2 MB
Steps to Reproduce
NODE_OPTIONS="--max-old-space-size=8192" engram init --with-skills
Root Cause
File: engramx/dist/chunk-IIFAAYDO.js:1203-1244
The extractDirectory function has no maximum depth limit on recursive walk():
function walk(dir) {
// ...
if (visitedDirs.has(realDir)) return;
visitedDirs.add(realDir);
const entries = readdirSync(dir, { withFileTypes: true });
for (const entry of entries) {
if (entry.isDirectory()) {
// Hardcoded exclusions only — no .engramignore support
if (entry.name.startsWith(".") ||
entry.name === "node_modules" || ...) {
continue;
}
walk(fullPath); // ← RECURSIVE, NO DEPTH LIMIT
}
}
}
Problems:
- NO maximum depth — crashes on deep directory trees
realpathSync failure = silent termination of entire walk
visitedDirs Set grows unbounded — symlinks to distinct dirs cause memory leak
- No
.engramignore support — users can't exclude node_modules, release, jre
Stack Trace Evidence
InterpreterEntryTrampoline (repeats) ← call stack overflow from unbounded recursion
Suggested Fixes
- Add
MAX_DEPTH constant with limit check in walk()
- Wrap
readdirSync in try-catch
- Add
.engramignore file support
Workaround
Not available — even 8GB heap limit is insufficient due to call stack overflow.
Environment
frontend/node_modules: 817 MBfrontend/release: 785 MBfrontend/jre: 127 MB (bundled JRE)Steps to Reproduce
NODE_OPTIONS="--max-old-space-size=8192" engram init --with-skillsRoot Cause
File:
engramx/dist/chunk-IIFAAYDO.js:1203-1244The
extractDirectoryfunction has no maximum depth limit on recursivewalk():Problems:
realpathSyncfailure = silent termination of entire walkvisitedDirsSet grows unbounded — symlinks to distinct dirs cause memory leak.engramignoresupport — users can't excludenode_modules,release,jreStack Trace Evidence
Suggested Fixes
MAX_DEPTHconstant with limit check inwalk()readdirSyncin try-catch.engramignorefile supportWorkaround
Not available — even 8GB heap limit is insufficient due to call stack overflow.