{"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":null,"httpStatus":null,"severity":"error","filePath":"scripts/lib/harness-capabilities.js","lineNumber":337,"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":319,"sourceCodeEnd":355,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/scripts/lib/harness-capabilities.js#L319-L355","documentation":"normalizeHarnessSelection treats 'all' and '*' as wildcards that select every guided harness, and rejects combining a wildcard with explicit harness tokens since that is ambiguous (explicit tokens would be redundant or contradictory). The error message states the constraint directly.","triggerScenarios":"Calling the installer with a selection like 'all,claude-code', '*,cursor', or an array ['all', 'codex'] — any mix of wildcard and explicit tokens.","commonSituations":"Users trying to say 'all of these plus that one extra'; CI templates where a default 'all' is concatenated with a user-specified list; shell scripts appending flags and ending up with '--harnesses all,codex'.","solutions":["Use just 'all' (or '*') when you want every guided harness.","List only the explicit harnesses you need, without the wildcard.","In scripts, choose one mode: either expand 'all' yourself or pass an explicit list, not both.","Sanitize combined inputs before calling the installer by de-duplicating: if 'all' is present, drop explicit tokens."],"exampleFix":"// before\nnormalizeHarnessSelection('all,codex'); // throws\n\n// after\nconst tokens = String(input).split(',').map(t => t.trim()).filter(Boolean);\nconst sel = tokens.includes('all') || tokens.includes('*') ? 'all' : tokens.join(',');\nnormalizeHarnessSelection(sel);","handlingStrategy":"validation","validationCode":"const tokens = String(selection || '').split(',').map(t => t.trim()).filter(Boolean);\nconst hasAll = tokens.some(t => ['all', '*'].includes(t.toLowerCase()));\nif (hasAll && tokens.length > 1) {\n  throw new Error('Pass either \"all\" or an explicit harness list, not both');\n}","typeGuard":null,"tryCatchPattern":"try {\n  const ids = normalizeHarnessSelection(selection);\n} catch (e) {\n  if (/all\\/\\* harness selection cannot be combined/.test(e.message)) {\n    console.error('Use \"all\" alone, or list explicit harnesses without the wildcard.');\n    process.exitCode = 2;\n    return;\n  }\n  throw e;\n}","preventionTips":["Normalize selections before invoking: if a wildcard is present, drop explicit tokens.","Avoid building harness lists by naive string concatenation in scripts/CI.","Document in the installer help that 'all'/'*' is exclusive of other values."],"tags":["cli","validation","conflicting-options","installer"],"backgroundTag":"mutually-exclusive-options","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"}