{"record":{"id":"a6bf75f181315d91","repo":"affaan-m/ECC","slug":"ecc-memory-incomplete","errorCode":"ECC_MEMORY_INCOMPLETE","errorMessage":"Memory lookup is incomplete. Inspect the authorized vault before retrying.","messagePattern":"Memory lookup is incomplete\\. Inspect the authorized vault before retrying\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scripts/lib/memory-vault.js","lineNumber":475,"sourceCode":"  const skippedSymlinks = [];\n  let invalidFileCount = 0;\n  let skippedSymlinkCount = 0;\n  let visitedCount = 0;\n  let scannedBytes = 0;\n  let truncated = false;\n\n  for (const scope of scopes) {\n    if (visitedCount >= MAX_FILES || scannedBytes >= MAX_SCAN_BYTES) {\n      truncated = true;\n      break;\n    }\n    const root = assertMemoryRootSafe(roots, scope);\n    let walked;\n    try {\n      walked = walkMemoryRoot(root, MAX_FILES - visitedCount);\n    } catch {\n      // Directory open/read/close failures cannot establish a complete lookup.\n      throw incompleteMemoryLookupError();\n    }\n    visitedCount += walked.visitedCount;\n    truncated = truncated || walked.truncated;\n    skippedSymlinkCount += walked.skippedSymlinkCount;\n    for (const skippedPath of walked.skippedSymlinks) {\n      if (skippedSymlinks.length >= MAX_DIAGNOSTICS) break;\n      skippedSymlinks.push(vaultRelativePath(scope, root, skippedPath));\n    }\n\n    for (const filePath of walked.paths) {\n      if (scannedBytes >= MAX_SCAN_BYTES) {\n        truncated = true;\n        break;\n      }\n      try {\n        const source = readRegularTextFile(filePath, {\n          label: 'memory document',\n          maxBytes: MAX_DOCUMENT_BYTES,","sourceCodeStart":457,"sourceCodeEnd":493,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/scripts/lib/memory-vault.js#L457-L493","documentation":"readMemoryFiles in scripts/lib/memory-vault.js walks each authorized vault scope root with walkMemoryRoot to build a complete index of memory documents. If the walk itself throws (a directory could not be opened, read, or closed), the library cannot prove the lookup saw every file, so it throws ECC_MEMORY_INCOMPLETE instead of returning silently partial results.","triggerScenarios":"readMemoryFiles (via searchMemories/loaded) calls walkMemoryRoot(root, budget) and the walk throws — e.g. EACCES/EIO opening or reading a subdirectory of the vault root, or a scope root disappearing between assertMemoryRootSafe and the walk.","commonSituations":"Vault directory permissions changed (chmod/chown, restrictive umask); an OS-level I/O error on a networked or encrypted home directory; another process deleting a scope directory mid-lookup; running as a different user than the vault owner.","solutions":["Fix filesystem access to the vault directory: check permissions with ls -la on ~/.claude (or the configured roots) and restore read/execute for your user.","Retry the lookup — transient EIO from a network/encrypted filesystem often resolves on a second attempt.","Verify the configured vault roots exist and are real directories; recreate a missing scope directory.","Check for processes deleting/moving vault directories concurrently and pause them during lookups."],"exampleFix":"// before: vault subdir unreadable -> ECC_MEMORY_INCOMPLETE\n// drwx------ someuser staff memory/ but process runs as other user\nsudo chown -R $(whoami) ~/.claude/ecc/memory\n\n// after: lookup completes\nconst loaded = readMemoryFiles({ scopes: ['project'] });","handlingStrategy":"try-catch","validationCode":"const fs = require('fs');\nfunction vaultIsReadable(root) {\n  try { fs.accessSync(root, fs.constants.R_OK | fs.constants.X_OK); return true; }\n  catch { return false; }\n}","typeGuard":"function canWalk(dir) {\n  try { return fs.statSync(dir).isDirectory() && fs.accessSync(dir, fs.constants.R_OK) === undefined; }\n  catch { return false; }\n}","tryCatchPattern":"try {\n  const results = searchMemories(query, { scopes: ['project'] });\n} catch (e) {\n  if (e.code === 'ECC_MEMORY_INCOMPLETE') {\n    console.error('Vault unreadable; check permissions on the memory root, then retry.');\n  } else throw e;\n}","preventionTips":["Keep the vault root and subdirectories owned and readable by the user running ECC.","Avoid storing the memory vault on flaky network/encrypted mounts.","Don't delete or move vault directories while lookups are running."],"tags":["filesystem","permissions","io-error"],"backgroundTag":"file-read-failed","analyzedSha":"8321021c54d670126ce3b2969d5deb880b4b0c2a","analyzedAt":"2026-09-16T10:08:13.343Z","contentChangedAt":"2026-09-16T10:08:13.343Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}