{"record":{"id":"189065ef98737c3a","repo":"affaan-m/ECC","slug":"non-interactive-and-json-mutations-require-yes","errorCode":null,"errorMessage":"Non-interactive and JSON mutations require --yes.","messagePattern":"Non-interactive and JSON mutations require --yes\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scripts/install-guided.js","lineNumber":199,"sourceCode":"  if (options.allHarnesses) return normalizeHarnessSelection(['all']);\n  if (options.harnesses.length === 0) return [];\n  return normalizeHarnessSelection(options.harnesses);\n}\n\nfunction validateExecutionMode(options, interactive) {\n  const harnesses = selectedHarnessIds(options);\n  if (!interactive && harnesses.length === 0) {\n    throw new Error('Non-interactive guided install requires at least one --harness.');\n  }\n  const requiresExplicit = !interactive || options.json;\n  if (requiresExplicit && harnesses.includes('claude') && (!options.claudeScope || !options.claudeHooks)) {\n    throw new Error('Claude requires explicit --claude-scope and --claude-hooks choices in this mode.');\n  }\n  if (requiresExplicit && harnesses.includes('kimi') && !options.profile) {\n    throw new Error('Kimi requires an explicit --profile choice in this mode.');\n  }\n  if ((!interactive || options.json) && !options.yes && !options.dryRun) {\n    throw new Error('Non-interactive and JSON mutations require --yes.');\n  }\n}\n\nfunction printPlan(plan, output) {\n  output.write('\\nECC guided install preview\\n\\n');\n  output.write('Harness       Channel           Destination\\n');\n  for (const entry of plan.harnesses) {\n    const harness = getHarnessCapability(entry.id);\n    output.write(`${harness.label.padEnd(13)} ${entry.channel.padEnd(17)} ${harness.destination}\\n`);\n  }\n  if (plan.request.harnesses.includes('kimi')) {\n    output.write('\\nKimi note: ECC hooks are not configured; model, provider, and authentication settings are unchanged.\\n');\n  }\n  if (plan.request.harnesses.includes('claude') && plan.request.claudeHooks && plan.request.claudeHooks !== 'off') {\n    output.write(\n      `\\nClaude hook profile '${plan.request.claudeHooks}' enables automation that can:\\n`\n      + `${formatHookCapabilityDisclosure()}\\n`\n      + \"Choose '--claude-hooks off' to install without automatic hook behavior.\\n\"","sourceCodeStart":181,"sourceCodeEnd":217,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/scripts/install-guided.js#L181-L217","documentation":"validateExecutionMode() requires explicit confirmation for any run that can mutate files without a human prompt. When the run is non-interactive or uses --json, mutations are only allowed with --yes (or harmlessly previewed with --dry-run). Without confirmation the script refuses to proceed.","triggerScenarios":"Running with non-interactive stdin or --json, with options.yes false and options.dryRun false, after harness selection passes.","commonSituations":"CI pipelines that forget --yes; JSON-mode tooling that parses a plan then applies it without --yes; users testing non-interactively expecting a dry-run by default.","solutions":["Add --yes to acknowledge the mutations, e.g. at the end of the command.","Add --dry-run instead if you only want a preview of what would be installed.","Run the command interactively (TTY) if you want prompts instead of --yes."],"exampleFix":"// before\nnode scripts/install-guided.js --harness claude --claude-scope project --claude-hooks standard\n// after\nnode scripts/install-guided.js --harness claude --claude-scope project --claude-hooks standard --yes","handlingStrategy":"validation","validationCode":"if ((!isInteractive || jsonMode) && !yes && !dryRun) { throw new Error('Pass --yes (or --dry-run) for non-interactive/JSON runs'); }","typeGuard":null,"tryCatchPattern":"try { main(); } catch (e) { if (/require --yes/.test(e.message)) { console.error('Append --yes to apply changes, or --dry-run to preview'); process.exit(2); } throw e; }","preventionTips":["Default scripted invocations to --dry-run first, then --yes once reviewed.","Never add --yes blindly in shared CI templates without a review step.","Run interactively when you want confirmation prompts instead of flags."],"tags":["cli","non-interactive","confirmation"],"backgroundTag":"missing-required-flag","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"}