{"record":{"id":"f7e07b377a2dc468","repo":"affaan-m/ECC","slug":"no-memory-root-is-configured-for-scope-scope","errorCode":null,"errorMessage":"No memory root is configured for scope \"${scope}\".","messagePattern":"No memory root is configured for scope \"(.+?)\"\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scripts/lib/memory-vault.js","lineNumber":103,"sourceCode":"        : projectRoot,\n      user: env.ECC_MEMORY_USER_ROOT\n        ? realpathNearestExisting(userVault)\n        : homeDir,\n    }),\n    enumerable: false,\n    configurable: false,\n    writable: false,\n  });\n  return Object.freeze(roots);\n}\n\nfunction assertMemoryRootSafe(roots, scope) {\n  if (!roots || typeof roots !== 'object' || Array.isArray(roots)) {\n    throw new Error('Memory roots must include a trusted boundary policy.');\n  }\n  const root = roots[scope];\n  if (typeof root !== 'string' || root.length === 0) {\n    throw new Error(`No memory root is configured for scope \"${scope}\".`);\n  }\n  const boundary = roots[VAULT_ROOT_BOUNDARIES]?.[scope];\n  if (typeof boundary !== 'string' || boundary.length === 0) {\n    throw new Error(`No trusted boundary policy is configured for memory scope \"${scope}\".`);\n  }\n  assertWithinTrustedRoot(root, boundary, 'access memory through a symlink');\n  if (fs.existsSync(root) && fs.lstatSync(root).isSymbolicLink()) {\n    throw new Error(`Refusing to access memory through symlink root: ${root}`);\n  }\n  return root;\n}\n\nfunction assertMemoryDirectorySafe(directory, root) {\n  assertWithinTrustedRoot(directory, root, 'access memory directory');\n  if (fs.existsSync(directory) && fs.lstatSync(directory).isSymbolicLink()) {\n    throw new Error(`Refusing to access memory through symlink directory: ${directory}`);\n  }\n  return directory;","sourceCodeStart":85,"sourceCodeEnd":121,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/scripts/lib/memory-vault.js#L85-L121","documentation":"assertMemoryRootSafe throws when the roots object has no non-empty string root for the requested scope (project, team, or user). It fires when the corresponding env vars (ECC_MEMORY_PROJECT_ROOT etc.) and defaults yield nothing — the faulting input is the missing scope entry.","triggerScenarios":"Thrown at scripts/lib/memory-vault.js:103 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set the scope's root via ECC_MEMORY_PROJECT_ROOT / ECC_MEMORY_USER_ROOT or ensure homeDir/projectRoot defaults resolve.","Check which scope string was passed — typos yield unknown scopes with no root.","Initialize memory roots before calling read/save operations."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}