{"record":{"id":"13e7a6bb30586f62","repo":"coleam00/Archon","slug":"optionwithoutdryrun-requires-dry-run","errorCode":null,"errorMessage":"${optionWithoutDryRun} requires --dry-run.","messagePattern":"(.+?) requires --dry-run\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/cli/src/commands/workflow.ts","lineNumber":1685,"sourceCode":"  emitParseWarnings(workflowEntry?.parseWarnings, workflow.name);\n  emitDeprecationNotice(workflow);\n\n  if (isContinuation && options.modelAssignments && options.modelAssignments.length > 0) {\n    throw new Error(\n      '--resume and --model are mutually exclusive. A resumed run keeps its original model bindings.'\n    );\n  }\n\n  const dryRunOnlyOptions = [\n    ['--stubs', options.stubsPath !== undefined],\n    ['--stubs-init', options.stubsInitPath !== undefined],\n    ['--default-stubs', options.defaultStubs === true],\n    ['--exec-code', options.execCode === true],\n    ['--pause-at-gates', options.pauseAtGates === true],\n  ] as const;\n  const optionWithoutDryRun = dryRunOnlyOptions.find(([, present]) => present)?.[0];\n  if (!options.dryRun && optionWithoutDryRun) {\n    throw new Error(`${optionWithoutDryRun} requires --dry-run.`);\n  }\n\n  if (options.dryRun) {\n    const incompatible = [\n      ['--branch', options.branchName !== undefined],\n      ['--from/--from-branch', options.fromBranch !== undefined],\n      ['--base', options.baseBranch !== undefined],\n      ['--no-worktree', options.noWorktree === true],\n      ['--folder', options.folder === true],\n      ['--container', options.container === true],\n      ['--resume', options.resume === true],\n      ['--detach', options.detach === true],\n    ] as const;\n    const incompatibleFlag = incompatible.find(([, present]) => present)?.[0];\n    if (incompatibleFlag) {\n      throw new Error(`--dry-run cannot be combined with ${incompatibleFlag}.`);\n    }\n    if (options.stubsInitPath !== undefined && options.stubsPath !== undefined) {","sourceCodeStart":1667,"sourceCodeEnd":1703,"githubUrl":"https://github.com/coleam00/Archon/blob/0773b9745896ef0612e709c80845a0f7db315b19/packages/cli/src/commands/workflow.ts#L1667-L1703","documentation":"Several flags (--stubs, --default-stubs, --exec-code, --pause-at-gates) only make sense in dry-run simulation mode. The CLI throws when any is supplied without `--dry-run`, preventing flags that would otherwise be silently ignored in a real run.","triggerScenarios":"`archon workflow run wf --stubs stubs.yaml` without `--dry-run`; same for --default-stubs, --exec-code, or --pause-at-gates passed alone.","commonSituations":"Testing a workflow with stubs but forgetting the --dry-run flag; a wrapper script passing stub options in real-run mode.","solutions":["Add --dry-run to the invocation","Or remove the dry-run-only flags if you actually intended a real run"],"exampleFix":"// before\narchon workflow run wf --stubs stubs.yaml\n// after\narchon workflow run wf --dry-run --stubs stubs.yaml","handlingStrategy":"validation","validationCode":"const dryRunOnly = ['--stubs','--default-stubs','--exec-code','--pause-at-gates'];\nif (!args.includes('--dry-run') && args.some(a => dryRunOnly.some(f => a.startsWith(f)))) {\n  throw new Error('These flags require --dry-run: ' + dryRunOnly.join(', '));\n}","typeGuard":null,"tryCatchPattern":"try {\n  await runWorkflow(args);\n} catch (e) {\n  if (/requires --dry-run\\./.test(String(e.message))) {\n    return runWorkflow(['--dry-run', ...args]);\n  }\n  throw e;\n}","preventionTips":["Always pair stub/exec-code/pause-at-gates flags with --dry-run in scripts","Lint wrapper scripts for dry-run-only flags","Keep simulation invocations in dedicated script paths"],"tags":["cli","flags","dry-run","validation"],"backgroundTag":"flag-requires-flag","analyzedSha":"0773b9745896ef0612e709c80845a0f7db315b19","analyzedAt":"2026-09-01T02:28:07.064Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}