{"record":{"id":"d065e14b812560a6","repo":"coleam00/Archon","slug":"stubs-init-cannot-be-combined-with-stubs","errorCode":null,"errorMessage":"--stubs-init cannot be combined with --stubs.","messagePattern":"--stubs-init cannot be combined with --stubs\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/cli/src/commands/workflow.ts","lineNumber":1704,"sourceCode":"  }\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) {\n      throw new Error('--stubs-init cannot be combined with --stubs.');\n    }\n    if (options.stubsInitPath !== undefined && options.defaultStubs) {\n      throw new Error('--stubs-init cannot be combined with --default-stubs.');\n    }\n\n    // The IDENTICAL invocation gate a real run passes through below (#2610): parse\n    // `--input name=value`, validate against the declared `inputs:` contract, and fail\n    // with the same errors (undeclared key, missing required) before any trace output.\n    // Only the supplied entries travel; the simulator derives declared defaults itself,\n    // mirroring the executor's `defaultRunInputs` merge at run start.\n    const dryRunInputs = resolveTopLevelInputs(\n      workflow,\n      options.inputs ? parseInputAssignments(options.inputs) : undefined\n    );\n\n    // Relative stub paths resolve from `--cwd`, as the CLI reference states. They are the\n    // operator's dry-run inputs, not part of the workflow's source, so `--workflow-source`\n    // must not silently move where they are read from or written to.","sourceCodeStart":1686,"sourceCodeEnd":1722,"githubUrl":"https://github.com/coleam00/Archon/blob/0773b9745896ef0612e709c80845a0f7db315b19/packages/cli/src/commands/workflow.ts#L1686-L1722","documentation":"`--stubs-init` (generate an initial stub file) and `--stubs` (use an existing stub file) are alternative stub modes for a dry-run and cannot both be supplied. The check sits inside the --dry-run validation block.","triggerScenarios":"`archon workflow run wf --dry-run --stubs-init path --stubs other.yaml`; both options.stubsInitPath and options.stubsPath defined.","commonSituations":"Building on a script that seeds stubs with --stubs-init and later switching to a checked-in stubs file via --stubs without removing the other flag.","solutions":["Keep --stubs to reuse an existing stub file, dropping --stubs-init","Or keep --stubs-init to generate fresh stubs, dropping --stubs"],"exampleFix":"// before\narchon workflow run wf --dry-run --stubs-init stubs.yaml --stubs stubs.yaml\n// after\narchon workflow run wf --dry-run --stubs stubs.yaml","handlingStrategy":"validation","validationCode":"if (args.includes('--stubs-init') && args.includes('--stubs')) {\n  throw new Error('--stubs-init and --stubs are mutually exclusive');\n}","typeGuard":null,"tryCatchPattern":"try {\n  await runWorkflow(args);\n} catch (e) {\n  if (/--stubs-init cannot be combined/.test(String(e.message))) {\n    return runWorkflow(args.filter(a => a !== '--stubs-init'));\n  }\n  throw e;\n}","preventionTips":["Pick one stub mode per invocation: generate (--stubs-init) or reuse (--stubs)","Keep stub-arg assembly in one helper so conflicting flags can't both be appended"],"tags":["cli","flags","stubs","mutually-exclusive"],"backgroundTag":"mutually-exclusive-flags","analyzedSha":"0773b9745896ef0612e709c80845a0f7db315b19","analyzedAt":"2026-09-01T02:28:07.064Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}