{"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":"Error","httpStatus":null,"severity":"error","filePath":"scripts/install-guided.js","lineNumber":107,"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":89,"sourceCodeEnd":125,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/scripts/install-guided.js#L89-L125","documentation":"parseArgs() in the guided install script enforces that the --all-harnesses shortcut cannot be combined with explicit --harness selections. The two options describe the harness set in incompatible ways (all vs. a subset), so the script rejects the combination rather than guessing intent. This is a fail-fast CLI contract check that runs immediately after argument collection.","triggerScenarios":"Invoking `node scripts/install-guided.js --all-harnesses --harness claude` (or any --harness repeat) such that options.allHarnesses is truthy while options.harnesses has length > 0 when parseArgs returns.","commonSituations":"Shell scripts that append --all-harnesses to a base command that already lists harnesses; users copying an 'install everything' snippet and adding a specific harness; CI templates parameterized with a harness list that collides with an --all-harnesses default.","solutions":["Remove --all-harnesses if you want specific harnesses, keeping only the --harness flags.","Remove all --harness flags if you actually want every harness installed.","If the intent is conditional in a wrapper script, branch: use either --all-harnesses or the explicit list, never both."],"exampleFix":"// before\nnode scripts/install-guided.js --all-harnesses --harness claude --harness codex\n// after\nnode scripts/install-guided.js --harness claude --harness codex","handlingStrategy":"validation","validationCode":"if (allHarnesses && harnessList.length > 0) { throw new Error('Use either --all-harnesses or --harness, not both'); }","typeGuard":"const hasConflict = (opts) => Boolean(opts.allHarnesses) && Array.isArray(opts.harnesses) && opts.harnesses.length > 0;","tryCatchPattern":null,"preventionTips":["Pick one selection style per command: explicit list or --all-harnesses.","In wrapper scripts, build the flag array conditionally, never concatenating both.","Validate the assembled command line before executing the installer."],"tags":["cli","argument-validation"],"backgroundTag":"mutually-exclusive-flags","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"}