{"record":{"id":"feab1408a9050905","repo":"affaan-m/ECC","slug":"invalid-kimi-install-profile-profile","errorCode":null,"errorMessage":"Invalid Kimi install profile: ${profile}","messagePattern":"Invalid Kimi install profile: (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scripts/lib/multi-harness-setup.js","lineNumber":45,"sourceCode":"  const includesKimi = harnesses.includes('kimi');\n  if (!includesClaude && (input.claudeScope !== undefined || input.claudeHooks !== undefined)) {\n    throw new Error('Claude scope and hook options require Claude to be selected.');\n  }\n  if (!includesKimi && input.profile !== undefined) {\n    throw new Error('The managed install profile requires Kimi to be selected.');\n  }\n\n  const claudeScope = includesClaude ? (input.claudeScope || 'user') : undefined;\n  const claudeHooks = includesClaude ? (input.claudeHooks || 'standard') : undefined;\n  const profile = includesKimi ? (input.profile || 'core') : undefined;\n  if (claudeScope && !VALID_CLAUDE_SCOPES.has(claudeScope)) {\n    throw new Error(`Invalid Claude scope: ${claudeScope}`);\n  }\n  if (claudeHooks && !VALID_CLAUDE_HOOKS.has(claudeHooks)) {\n    throw new Error(`Invalid Claude hooks preference: ${claudeHooks}`);\n  }\n  if (profile && !VALID_PROFILES.has(profile)) {\n    throw new Error(`Invalid Kimi install profile: ${profile}`);\n  }\n\n  return {\n    harnesses,\n    ...(claudeHooks ? { claudeHooks } : {}),\n    ...(claudeScope ? { claudeScope } : {}),\n    dryRun: Boolean(input.dryRun),\n    json: Boolean(input.json),\n    ...(profile ? { profile } : {}),\n    yes: Boolean(input.yes),\n  };\n}\n\nfunction canonicalPath(filePath) {\n  return realpathNearestExisting(filePath);\n}\n\nfunction pathsMatch(left, right) {","sourceCodeStart":27,"sourceCodeEnd":63,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/scripts/lib/multi-harness-setup.js#L27-L63","documentation":"normalizeGuidedInstallRequest validates the resolved Kimi profile (defaulting to 'core' when Kimi is selected) against the VALID_PROFILES whitelist. An unrecognized profile name throws this error with the offending value interpolated. It is the Kimi-side enum check mirroring the Claude scope/hooks guards.","triggerScenarios":"Calling the guided install request API with input.profile set to a string not in VALID_PROFILES while 'kimi' is selected (e.g. profile: 'full' or 'everything' when only 'core' etc. are valid).","commonSituations":"Typo in scripts or docs; profile names renamed between library versions; copying profile names from another installer with different tiers.","solutions":["Use a profile listed in VALID_PROFILES in scripts/lib/multi-harness-setup.js (e.g. 'core')","Omit profile to use the 'core' default","Check the current version's docs for renamed profiles after upgrading"],"exampleFix":"// before\nrunSetup({ harnesses: ['kimi'], profile: 'complete' })\n// after\nrunSetup({ harnesses: ['kimi'], profile: 'core' })","handlingStrategy":"validation","validationCode":"const VALID_PROFILES = ['core'] // confirm against VALID_PROFILES in the library\nif (input.profile !== undefined && !VALID_PROFILES.includes(input.profile)) {\n  throw new Error(`profile must be one of: ${VALID_PROFILES.join(', ')}`)\n}","typeGuard":"const isValidProfile = (s) => typeof s === 'string' && ['core'].includes(s)","tryCatchPattern":"try {\n  return normalizeGuidedInstallRequest(input)\n} catch (err) {\n  if (err.message.startsWith('Invalid Kimi install profile:')) {\n    return normalizeGuidedInstallRequest({ ...input, profile: 'core' })\n  }\n  throw err\n}","preventionTips":["Only pass profile names sourced from the library's own valid set","Omit profile to accept the 'core' default","Re-validate profile config after library version bumps"],"tags":["validation","enum","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"}