{"record":{"id":"aacc7f63fa4ecee5","repo":"affaan-m/ECC","slug":"ecc-memory-harness-must-identify-this-mcp-server-w","errorCode":null,"errorMessage":"ECC_MEMORY_HARNESS must identify this MCP server with a lowercase harness slug.","messagePattern":"ECC_MEMORY_HARNESS must identify this MCP server with a lowercase harness slug\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scripts/memory-mcp.mjs","lineNumber":169,"sourceCode":"  }\n}\n\nfunction isRecord(value) {\n  return value !== null && typeof value === 'object' && !Array.isArray(value);\n}\n\nfunction isValidRequestId(value) {\n  return (\n    (typeof value === 'string' && value.length > 0 && value.length <= 128)\n    || (typeof value === 'number' && Number.isSafeInteger(value))\n  );\n}\n\nfunction resolveServiceSecurity(options = {}) {\n  const env = isRecord(options.env) ? options.env : process.env;\n  const harness = options.harness ?? env.ECC_MEMORY_HARNESS;\n  if (typeof harness !== 'string' || !SLUG_REGEXP.test(harness)) {\n    throw new Error(\n      'ECC_MEMORY_HARNESS must identify this MCP server with a lowercase harness slug.'\n    );\n  }\n  return Object.freeze({\n    harness,\n    allowUserScope: options.allowUserScope ?? env.ECC_MEMORY_ALLOW_USER_SCOPE === '1',\n  });\n}\n\nfunction assertScopesAuthorized(scopes, security) {\n  const requestedScopes = scopes || DEFAULT_RECALL_SCOPES;\n  if (!security.allowUserScope && requestedScopes.includes('user')) {\n    throw new JsonRpcError(\n      -32602,\n      'The user memory scope is disabled for this MCP server.'\n    );\n  }\n  return requestedScopes;","sourceCodeStart":151,"sourceCodeEnd":187,"githubUrl":"https://github.com/affaan-m/ECC/blob/06c5e118c4d3e6c3b7f9445f973a2194c82de193/scripts/memory-mcp.mjs#L151-L187","documentation":"resolveServiceSecurity requires ECC_MEMORY_HARNESS (or an explicit harness option) to be a lowercase slug identifying the calling MCP client; it must match SLUG_REGEXP so per-harness namespacing stays safe. Missing, uppercase, or malformed values all fail here.","triggerScenarios":"Triggered when memory-mcp.mjs rejects the current invocation: ECC_MEMORY_HARNESS must identify this MCP server with a lowercase harness slug.","commonSituations":"Occurs while running scripts/memory-mcp.mjs with invalid arguments, missing flags, or a failing external dependency; the guard at scripts/memory-mcp.mjs:169 aborts the command with this message.","solutions":["Review the constraint in the error message, correct the input accordingly, and re-run."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"06c5e118c4d3e6c3b7f9445f973a2194c82de193","analyzedAt":"2026-08-18T11:27:13.915Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}