{"record":{"id":"ad9364d94c93b820","repo":"affaan-m/ECC","slug":"unknown-guided-harness-selection-token","errorCode":null,"errorMessage":"Unknown guided harness selection: ${token}","messagePattern":"Unknown guided harness selection: (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scripts/lib/harness-capabilities.js","lineNumber":338,"sourceCode":"  const allTokens = tokens.filter(token => ['all', '*'].includes(normalizeLookupToken(token)));\n  const explicitTokens = tokens.filter(token => !['all', '*'].includes(normalizeLookupToken(token)));\n  if (allTokens.length > 0 && explicitTokens.length > 0) {\n    throw new Error('The all/* harness selection cannot be combined with other selections');\n  }\n  if (allTokens.length > 0) {\n    return GUIDED_HARNESS_IDS.slice();\n  }\n\n  const selected = new Set();\n  for (const token of tokens) {\n    const normalizedToken = normalizeLookupToken(token);\n    const menuIndex = /^\\d+$/.test(normalizedToken) ? Number(normalizedToken) - 1 : -1;\n    const harness = menuIndex >= 0\n      ? listGuidedHarnesses()[menuIndex] || null\n      : getHarnessCapability(token);\n\n    if (!harness) {\n      throw new Error(`Unknown guided harness selection: ${token}`);\n    }\n    if (!harness.guidedReady) {\n      throw new Error(`${harness.label} is an advanced harness and is not guided-ready`);\n    }\n    selected.add(harness.id);\n  }\n\n  if (selected.size === 0) {\n    throw new Error('At least one guided harness must be selected');\n  }\n\n  return GUIDED_HARNESS_IDS.filter(id => selected.has(id));\n}\n\nmodule.exports = {\n  GUIDED_HARNESS_IDS,\n  HARNESS_CAPABILITIES,\n  getHarnessCapability,","sourceCodeStart":320,"sourceCodeEnd":356,"githubUrl":"https://github.com/affaan-m/ECC/blob/01e15490f04e29cfefe3896951f43db46994d8ee/scripts/lib/harness-capabilities.js#L320-L356","documentation":"Thrown by normalizeHarnessSelection() when a token cannot be resolved to any harness via getHarnessCapability or numeric menu index. The token is echoed verbatim so the user can see what failed.","triggerScenarios":"For each token, getHarnessCapability(token) returns null and it is not a numeric menu index that maps into listGuidedHarnesses(). Happens with typos like 'claud', unregistered harnesses like 'copilot', or tokens with stray punctuation.","commonSituations":"Typo in harness id on CLI; user assumes a harness exists (e.g. 'copilot', 'aider') that ECC does not ship; outdated docs reference a renamed harness; token has invisible whitespace or unicode dash.","solutions":["List valid harnesses: console.log(require('./harness-capabilities').listHarnessCapabilities().map(h => h.id)).","Correct the typo (e.g. 'claud' -> 'claude'); remember aliases like 'claude-code' are accepted.","Use a numeric menu index from listGuidedHarnesses() (1-based).","Strip stray whitespace and unicode look-alikes from the token."],"exampleFix":"// before\nnormalizeHarnessSelection('claud,codex');\n\n// after\nnormalizeHarnessSelection('claude,codex');","handlingStrategy":"validation","validationCode":"const { listHarnessCapabilities } = require('./harness-capabilities');\nconst known = new Set(listHarnessCapabilities().flatMap(h => [h.id, h.label, ...h.aliases]));\nfunction isKnownToken(token) {\n  return known.has(token) || /^\\d+$/.test(String(token).trim());\n}\nif (!tokens.every(isKnownToken)) {\n  throw new Error(`Unknown harness token. Valid: ${[...known].join(', ')}`);\n}","typeGuard":"function isHarnessToken(v) {\n  if (typeof v !== 'string') return false;\n  const t = v.trim().toLowerCase();\n  return t === 'all' || t === '*' || /^\\d+$/.test(t)\n    || listHarnessCapabilities().some(h =>\n      [h.id, h.label, ...h.aliases].map(s => s.toLowerCase()).includes(t));\n}","tryCatchPattern":"try {\n  return normalizeHarnessSelection(sel);\n} catch (err) {\n  if (/Unknown guided harness/.test(err.message)) {\n    throw new Error(`${err.message}. Valid guided: claude, codex, kimi`);\n  }\n  throw err;\n}","preventionTips":["Surface the guided harness list in CLI --help.","Tab-complete harness ids in the interactive prompt.","Reject unknown tokens at the CLI boundary before forwarding."],"tags":["validation","harness","input"],"backgroundTag":null,"analyzedSha":"01e15490f04e29cfefe3896951f43db46994d8ee","analyzedAt":"2026-08-13T00:31:08.655Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}