{"record":{"id":"1a42aecfad6d74fb","repo":"affaan-m/ECC","slug":"the-all-harness-selection-cannot-be-combined-wit","errorCode":null,"errorMessage":"The all/* harness selection cannot be combined with other selections","messagePattern":"The all/\\* harness selection cannot be combined with other selections","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scripts/lib/harness-capabilities.js","lineNumber":323,"sourceCode":"}\n\nfunction tokenizeSelection(selection) {\n  const values = Array.isArray(selection) ? selection : [selection];\n  return values.flatMap(value => (\n    typeof value === 'string' ? value.split(',') : []\n  )).map(value => value.trim()).filter(Boolean);\n}\n\nfunction normalizeHarnessSelection(selection) {\n  const tokens = tokenizeSelection(selection);\n  if (tokens.length === 0 || tokens.every(token => normalizeLookupToken(token) === 'none')) {\n    throw new Error('At least one guided harness must be selected');\n  }\n\n  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`);","sourceCodeStart":305,"sourceCodeEnd":341,"githubUrl":"https://github.com/affaan-m/ECC/blob/01e15490f04e29cfefe3896951f43db46994d8ee/scripts/lib/harness-capabilities.js#L305-L341","documentation":"Thrown by normalizeHarnessSelection() when the input contains both an 'all' (or '*') token and at least one explicit harness token. The selector is mutually exclusive: 'all' already means every guided harness, so combining is ambiguous and rejected.","triggerScenarios":"normalizeHarnessSelection receives tokens like ['all', 'claude'], ['*', 'codex'], or 'all,claude'. allTokens.length > 0 AND explicitTokens.length > 0 at harness-capabilities.js:322.","commonSituations":"User typed --harness all,claude thinking it would add to the set; config file lists 'all' alongside specific ids; a CLI default of 'all' was concatenated with a user-provided explicit selection.","solutions":["Use either 'all'/'*' on its own OR a comma-separated explicit list, not both.","If you wanted 'all plus extras' just use 'all' (it already returns every guided harness).","Inspect the caller: ensure CLI default and user flag are not both appended to the token list."],"exampleFix":"// before\nnormalizeHarnessSelection('all,claude,codex');\n\n// after\nnormalizeHarnessSelection('all');\n// or\nnormalizeHarnessSelection('claude,codex');","handlingStrategy":"validation","validationCode":"function isExclusiveSelection(sel) {\n  const tokens = (Array.isArray(sel) ? sel : String(sel || '').split(','))\n    .map(t => t.trim().toLowerCase()).filter(Boolean);\n  const hasAll = tokens.some(t => t === 'all' || t === '*');\n  const hasExplicit = tokens.some(t => t !== 'all' && t !== '*');\n  return !(hasAll && hasExplicit);\n}\nif (!isExclusiveSelection(sel)) throw new Error('Pass either \"all\" or explicit ids');","typeGuard":null,"tryCatchPattern":"try {\n  return normalizeHarnessSelection(sel);\n} catch (err) {\n  if (/cannot be combined/.test(err.message)) {\n    // pick 'all' as the safer superset\n    return normalizeHarnessSelection('all');\n  }\n  throw err;\n}","preventionTips":["Document the mutual exclusivity in the CLI --help text.","In config loaders, reject 'all' alongside explicit ids before forwarding.","Add a unit test that 'all,claude' throws."],"tags":["validation","harness","input"],"backgroundTag":null,"analyzedSha":"01e15490f04e29cfefe3896951f43db46994d8ee","analyzedAt":"2026-08-13T00:31:08.655Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}