{"record":{"id":"7053211ff8b28b32","repo":"affaan-m/ECC","slug":"all-harnesses-and-harness-are-mutually-exclusi","errorCode":null,"errorMessage":"--all-harnesses and --harness are mutually exclusive.","messagePattern":"--all-harnesses and --harness are mutually exclusive\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"scripts/install-guided.js","lineNumber":106,"sourceCode":"        ? { ...options, harnesses: [...options.harnesses, value] }\n        : { ...options, [key]: value };\n      index += 1;\n    } else if (argument === '--all-harnesses') {\n      options = { ...options, allHarnesses: true };\n    } else if (argument === '--yes' || argument === '-y') {\n      options = { ...options, yes: true };\n    } else if (argument === '--dry-run') {\n      options = { ...options, dryRun: true };\n    } else if (argument === '--json') {\n      options = { ...options, json: true };\n    } else if (argument === '--help' || argument === '-h') {\n      options = { ...options, help: true };\n    } else {\n      throw new Error('Unknown argument. Run guided install with --help to see valid options.');\n    }\n  }\n  if (options.allHarnesses && options.harnesses.length > 0) {\n    throw new Error('--all-harnesses and --harness are mutually exclusive.');\n  }\n  return options;\n}\n\nfunction choicesText(values) {\n  return values.join('|');\n}\n\nasync function askChoice(terminal, output, prompt, values, defaultValue) {\n  output.write(`\\n${prompt}\\n`);\n  values.forEach((value, index) => output.write(`  ${index + 1}. ${value}\\n`));\n  while (true) {\n    const question = defaultValue\n      ? `Choose [Recommended: ${defaultValue}] (one option only): `\n      : 'Choose one option: ';\n    const answer = (await terminal.question(question)).trim().toLowerCase();\n    if (!answer && defaultValue) return defaultValue;\n    const numeric = /^\\d+$/.test(answer) ? values[Number(answer) - 1] : undefined;","sourceCodeStart":88,"sourceCodeEnd":124,"githubUrl":"https://github.com/affaan-m/ECC/blob/01e15490f04e29cfefe3896951f43db46994d8ee/scripts/install-guided.js#L88-L124","documentation":"install-guided.js treats --all-harnesses and individual --harness selections as mutually exclusive. If both are present on the command line, it throws rather than trying to merge the two intents.","triggerScenarios":"Running node scripts/install-guided.js --all-harnesses --harness claude, or a wrapper that always adds --all-harnesses while also forwarding user-selected harnesses.","commonSituations":"A CI template that sets --all-harnesses globally and a user override adding --harness; or copy-pasting a base command and appending a specific harness.","solutions":["Use only --all-harnesses, or only one or more --harness flags","Remove --all-harnesses from your wrapper when a specific harness is requested","If you want a subset, drop --all-harnesses and list each harness explicitly"],"exampleFix":"// before\nnode scripts/install-guided.js --all-harnesses --harness claude --yes\n// after\nnode scripts/install-guided.js --harness claude --yes","handlingStrategy":"validation","validationCode":"const hasAll = argv.includes('--all-harnesses');\nconst harnessCount = argv.filter(a => a === '--harness').length;\nif (hasAll && harnessCount > 0) {\n  throw new Error('Use --all-harnesses OR --harness, not both');\n}","typeGuard":"function isExclusiveHarnessSelection(argv) {\n  const all = argv.includes('--all-harnesses');\n  const specific = argv.filter(a => a === '--harness').length;\n  return !(all && specific > 0);\n}","tryCatchPattern":"try { parseInstallGuidedArgs(argv); }\ncatch (err) {\n  if (/mutually exclusive/.test(err.message)) {\n    console.error(err.message);\n    process.exit(2);\n  }\n  throw err;\n}","preventionTips":["Decide upfront between all-harnesses and explicit selection","Audit base CI templates that always add --all-harnesses","Document the chosen mode in the wrapper script"],"tags":["cli","argument-validation","install-guided"],"backgroundTag":null,"analyzedSha":"01e15490f04e29cfefe3896951f43db46994d8ee","analyzedAt":"2026-08-13T00:31:08.655Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}