{"record":{"id":"758d148c93acb1cd","repo":"coleam00/Archon","slug":"stubs-init-cannot-be-combined-with-default-stu","errorCode":null,"errorMessage":"--stubs-init cannot be combined with --default-stubs.","messagePattern":"--stubs-init cannot be combined with --default-stubs\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/cli/src/commands/workflow.ts","lineNumber":1707,"sourceCode":"    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.\n    const stubsPath = options.stubsPath\n      ? isAbsolute(options.stubsPath)\n        ? options.stubsPath","sourceCodeStart":1689,"sourceCodeEnd":1725,"githubUrl":"https://github.com/coleam00/Archon/blob/0773b9745896ef0612e709c80845a0f7db315b19/packages/cli/src/commands/workflow.ts#L1689-L1725","documentation":"`--stubs-init` cannot be combined with `--default-stubs` (use built-in default stubs): both decide where dry-run stub values come from, so supplying both is ambiguous. Same validation block as the --stubs conflict.","triggerScenarios":"`archon workflow run wf --dry-run --stubs-init path --default-stubs`; options.stubsInitPath defined while options.defaultStubs is true.","commonSituations":"A wrapper that adds --default-stubs for convenience colliding with a script that also passes --stubs-init to materialize stubs.","solutions":["Drop --stubs-init if the built-in defaults suffice","Or drop --default-stubs if you want a generated stub file at --stubs-init's path"],"exampleFix":"// before\narchon workflow run wf --dry-run --stubs-init stubs.yaml --default-stubs\n// after\narchon workflow run wf --dry-run --stubs-init stubs.yaml","handlingStrategy":"validation","validationCode":"if (args.includes('--stubs-init') && args.includes('--default-stubs')) {\n  throw new Error('--stubs-init and --default-stubs are mutually exclusive');\n}","typeGuard":null,"tryCatchPattern":"try {\n  await runWorkflow(args);\n} catch (e) {\n  if (/--stubs-init cannot be combined with --default-stubs/.test(String(e.message))) {\n    return runWorkflow(args.filter(a => a !== '--default-stubs'));\n  }\n  throw e;\n}","preventionTips":["Decide a single stub source per dry-run: file, generated file, or defaults","Avoid stacking convenience flags in wrappers"],"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"}