{"record":{"id":"bce964a1bad8f6ef","repo":"affaan-m/ECC","slug":"choose-at-least-one-guided-harness-claude-codex","errorCode":null,"errorMessage":"Choose at least one guided harness: Claude, Codex, or Kimi.","messagePattern":"Choose at least one guided harness: Claude, Codex, or Kimi\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scripts/lib/multi-harness-setup.js","lineNumber":23,"sourceCode":"const os = require('os');\nconst path = require('path');\n\nconst { assertSafeInstallOperation } = require('./install/apply');\nconst { assertWithinTrustedRoot, realpathNearestExisting } = require('./path-safety');\n\nconst VALID_CLAUDE_SCOPES = new Set(['user', 'project', 'local']);\nconst VALID_CLAUDE_HOOKS = new Set(['off', 'minimal', 'standard', 'strict']);\nconst VALID_PROFILES = new Set(['minimal', 'core', 'developer', 'security', 'research', 'full']);\n\nfunction catalogHelpers() {\n  return require('./harness-capabilities');\n}\n\nfunction normalizeGuidedInstallRequest(input = {}) {\n  const { normalizeHarnessSelection } = catalogHelpers();\n  const harnesses = normalizeHarnessSelection(input.harnesses || []);\n  if (harnesses.length === 0) {\n    throw new Error('Choose at least one guided harness: Claude, Codex, or Kimi.');\n  }\n\n  const includesClaude = harnesses.includes('claude');\n  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)) {","sourceCodeStart":5,"sourceCodeEnd":41,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/scripts/lib/multi-harness-setup.js#L5-L41","documentation":"normalizeGuidedInstallRequest validates the guided multi-harness install request. It normalizes the harnesses selection, and if the resulting list is empty it throws this error — a guided install must target at least one of the supported harnesses (Claude, Codex, Kimi).","triggerScenarios":"Invoking the guided setup/request path with harnesses omitted, an empty array, or a list whose entries all fail normalization (invalid names dropped) — e.g. input.harnesses = [] or input.harnesses = ['cursor'] (unsupported in guided mode).","commonSituations":"CLI invocation missing the harness flag; config file with a misspelled harness name that normalizes away; interactive flow where the user unchecked every option before submitting.","solutions":["Pass at least one supported harness, e.g. harnesses: ['claude'].","Check spelling of harness names (claude, codex, kimi) — invalid entries are normalized away.","If running the CLI, add the required harness flag/option to the command.","Re-run the interactive flow and select at least one harness before confirming."],"exampleFix":"// before\nrequest({ harnesses: [] });\n// after\nrequest({ harnesses: ['claude', 'codex'] });","handlingStrategy":"validation","validationCode":"const SUPPORTED = ['claude', 'codex', 'kimi'];\nconst harnesses = (input.harnesses || []).filter(h => SUPPORTED.includes(h));\nif (harnesses.length === 0) throw new Error('Select at least one of: claude, codex, kimi.');","typeGuard":"const hasValidHarnessSelection = (input) => Array.isArray(input.harnesses) && input.harnesses.some(h => ['claude','codex','kimi'].includes(h));","tryCatchPattern":"try {\n  normalizeGuidedInstallRequest(input);\n} catch (err) {\n  if (err.message.includes('Choose at least one guided harness')) {\n    // prompt the user again or default to ['claude']\n  } else throw err;\n}","preventionTips":["Always pass a non-empty harnesses array to guided install requests.","Validate harness names against the supported list before submitting.","In interactive flows, require at least one selection before submit.","Keep harness names lowercase and exact (claude, codex, kimi)."],"tags":["validation","configuration","setup","cli"],"backgroundTag":"empty-required-field","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"}