{"record":{"id":"9d08751fb32698c0","repo":"affaan-m/ECC","slug":"unsupported-install-target-scope-scope","errorCode":null,"errorMessage":"Unsupported install target scope: ${scope}","messagePattern":"Unsupported install target scope: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"scripts/lib/install-targets/helpers.js","lineNumber":59,"sourceCode":"  }\n\n  return false;\n}\n\nfunction resolveBaseRoot(scope, input = {}) {\n  if (scope === 'home') {\n    return input.homeDir || os.homedir();\n  }\n\n  if (scope === 'project') {\n    const projectRoot = input.projectRoot || input.repoRoot;\n    if (!projectRoot) {\n      throw new Error('projectRoot or repoRoot is required for project install targets');\n    }\n    return projectRoot;\n  }\n\n  throw new Error(`Unsupported install target scope: ${scope}`);\n}\n\nfunction buildValidationIssue(severity, code, message, extra = {}) {\n  return {\n    severity,\n    code,\n    message,\n    ...extra,\n  };\n}\n\nfunction listRelativeFiles(dirPath, prefix = '') {\n  if (!fs.existsSync(dirPath)) {\n    return [];\n  }\n\n  const entries = fs.readdirSync(dirPath, { withFileTypes: true }).sort((left, right) => (\n    left.name.localeCompare(right.name)","sourceCodeStart":41,"sourceCodeEnd":77,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/scripts/lib/install-targets/helpers.js#L41-L77","documentation":"resolveBaseRoot only understands the scopes 'home' and 'project'; any other scope string reaches the final throw. This is a guard against typo'd or newly invented scope values reaching the target adapters before they are supported.","triggerScenarios":"baseRoot(scope, input) called with a scope other than 'home' or 'project' — e.g. 'global', 'workspace', a typo like 'projec', or a custom scope introduced by a third-party adapter.","commonSituations":"Adding a new install-target scope in a fork without extending resolveBaseRoot; misconfiguring a module's target scope in the manifest; a typo in a custom script calling the helper directly.","solutions":["Check the scope value passed to the install target — it must be exactly 'home' or 'project'","Fix the typo or wrong scope string in the caller or module manifest","If you need a new scope, extend resolveBaseRoot in scripts/lib/install-targets/helpers.js to handle it"],"exampleFix":"// before\nconst root = baseRoot('global', input);\n// after\nconst root = baseRoot('home', input);","handlingStrategy":"validation","validationCode":"const ALLOWED_SCOPES = ['home', 'project'];\nif (!ALLOWED_SCOPES.includes(scope)) {\n  throw new Error(`scope must be one of ${ALLOWED_SCOPES.join(', ')}, got: ${scope}`);\n}","typeGuard":"function isValidScope(scope) {\n  return scope === 'home' || scope === 'project';\n}","tryCatchPattern":"try {\n  const root = baseRoot(scope, input);\n} catch (e) {\n  if (/Unsupported install target scope/.test(e.message)) {\n    // map or correct the scope before retrying\n  } else throw e;\n}","preventionTips":["Use the exact scope literals 'home' and 'project'; define them as constants","Centralize scope selection in one module instead of scattering string literals","When adding a new scope, update resolveBaseRoot and its tests together"],"tags":["install-target","invalid-enum-value","config"],"backgroundTag":"invalid-enum-value","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"}