{"record":{"id":"1af973e49bd626b0","repo":"affaan-m/ECC","slug":"memory-read-incomplete","errorCode":"MEMORY_READ_INCOMPLETE","errorMessage":"Memory lookup is incomplete. Inspect the authorized vault before retrying.","messagePattern":"Memory lookup is incomplete\\. Inspect the authorized vault before retrying\\.","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"scripts/memory-mcp.mjs","lineNumber":216,"sourceCode":"\nfunction textResult(payload) {\n  const text = JSON.stringify(payload, null, 2);\n  if (Buffer.byteLength(text, 'utf8') > MAX_RESPONSE_BYTES) {\n    throw new JsonRpcError(-32001, 'Memory tool response exceeds the bounded output limit.');\n  }\n  return {\n    content: [{\n      type: 'text',\n      text,\n    }],\n  };\n}\n\nfunction toolFailure(code, error) {\n  if (code === 'MEMORY_READ_FAILED' && error?.code === 'ECC_MEMORY_INCOMPLETE') {\n    return {\n      ...textResult({ error: {\n        code: 'MEMORY_READ_INCOMPLETE',\n        message: 'Memory lookup is incomplete. Inspect the authorized vault before retrying.',\n      } }),\n      isError: true,\n    };\n  }\n  const suspectedSecret = error instanceof Error\n    && error.message.toLowerCase().includes('suspected secret');\n  const message = suspectedSecret\n    ? 'Memory operation rejected a suspected secret.'\n    : {\n      MEMORY_WRITE_REJECTED: 'Memory write was rejected by validation.',\n      MEMORY_SEARCH_FAILED: 'Memory search failed validation.',\n      MEMORY_READ_FAILED: 'Memory could not be read. It may be missing, not visible, or invalid.',\n      MEMORY_DOCTOR_FAILED: 'Memory doctor could not inspect the authorized vault.',\n    }[code] || 'Memory operation failed.';\n  return {\n    ...textResult({\n      error: {","sourceCodeStart":198,"sourceCodeEnd":234,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/scripts/memory-mcp.mjs#L198-L234","documentation":"toolFailure maps internal memory-read exceptions to a client-facing result. When the underlying error carries code ECC_MEMORY_INCOMPLETE, the read partially failed (e.g. some vault files unreadable), so the server returns a structured MEMORY_READ_INCOMPLETE error result (isError: true) telling the caller the lookup is not trustworthy and to inspect the authorized vault before retrying.","triggerScenarios":"A memory_read operation where one or more vault files/entries could not be read or parsed, causing the reader to surface ECC_MEMORY_INCOMPLETE, which toolFailure rewrites into MEMORY_READ_INCOMPLETE.","commonSituations":"Vault directory partially synced (cloud sync in progress); permission changes making some memory files unreadable; corrupted or partially written memory file; symlinked/external paths outside the authorized vault root.","solutions":["Manually inspect the authorized memory vault for unreadable, corrupted, or partially-written files and repair or remove them","Check file permissions on vault entries and restore read access","Pause/complete any sync process writing to the vault, then retry memory_read","Re-run memory_save for entries that are missing or damaged to rebuild them"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"const res = await readMemory();\nif (res.isError && res.error?.code === 'MEMORY_READ_INCOMPLETE') {\n  // treat all returned entries as possibly stale; fall back to manual vault inspection\n}","preventionTips":["Keep the vault directory fully local or ensure sync is quiescent before reads","Audit vault file permissions after user/group changes","Periodically re-save critical memories to keep the vault internally consistent"],"tags":["memory","partial-failure","vault"],"backgroundTag":"memory-read-incomplete","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"}