{"record":{"id":"c8bf8f65eff3ee8c","repo":"coleam00/Archon","slug":"branch-and-no-worktree-are-mutually-exclusive","errorCode":null,"errorMessage":"--branch and --no-worktree are mutually exclusive.\n  --branch creates an isolated worktree (safe).\n  --no-worktree runs directly in your repo (no isolation).\nUse one or the other.","messagePattern":"--branch and --no-worktree are mutually exclusive\\.\n  --branch creates an isolated worktree \\(safe\\)\\.\n  --no-worktree runs directly in your repo \\(no isolation\\)\\.\nUse one or the other\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/cli/src/commands/workflow.ts","lineNumber":1821,"sourceCode":"      // Same filter `checkFixture` applies: a stub an `all_done` join tolerated\n      // never blocked anything, so naming it as a cause of this failure points\n      // the reader at the wrong node (#2869).\n      const blockingMissingStubs = result.missingStubs.filter(\n        nodeId => !result.toleratedMissingStubs.includes(nodeId)\n      );\n      throw new Error(\n        blockingMissingStubs.length > 0\n          ? `Dry-run failed; missing stubs: ${blockingMissingStubs.join(', ')}`\n          : 'Dry-run failed. See the trace for details.'\n      );\n    }\n    return;\n  }\n\n  // Validate mutually exclusive flags (defensive — cli.ts checks these for UX, but\n  // workflowRunCommand is the authoritative boundary for programmatic callers)\n  if (options.branchName !== undefined && options.noWorktree) {\n    throw new Error(\n      '--branch and --no-worktree are mutually exclusive.\\n' +\n        '  --branch creates an isolated worktree (safe).\\n' +\n        '  --no-worktree runs directly in your repo (no isolation).\\n' +\n        'Use one or the other.'\n    );\n  }\n  if (options.noWorktree && options.fromBranch !== undefined) {\n    throw new Error(\n      '--from/--from-branch has no effect with --no-worktree.\\n' +\n        'Remove --from or drop --no-worktree.'\n    );\n  }\n  if (options.noWorktree && options.baseBranch !== undefined) {\n    throw new Error(\n      '--base has no effect with --no-worktree.\\n' + 'Remove --base or drop --no-worktree.'\n    );\n  }\n  if (options.resume && options.branchName !== undefined) {","sourceCodeStart":1803,"sourceCodeEnd":1839,"githubUrl":"https://github.com/coleam00/Archon/blob/0773b9745896ef0612e709c80845a0f7db315b19/packages/cli/src/commands/workflow.ts#L1803-L1839","documentation":"Authoritative programmatic guard (cli.ts also checks for UX): `--branch` creates an isolated git worktree while `--no-worktree` runs directly in the repo; the two isolation choices contradict, so the invocation is rejected at workflowRunCommand.","triggerScenarios":"Calling `archon workflow run wf --branch x --no-worktree` or workflowRunCommand with both options.branchName and options.noWorktree set.","commonSituations":"A wrapper that always passes --branch combined with a config/script that sets --no-worktree for speed.","solutions":["Keep --branch (isolated worktree, safe) and remove --no-worktree","Or keep --no-worktree and remove --branch"],"exampleFix":"// before\narchon workflow run wf --branch feature/x --no-worktree\n// after\narchon workflow run wf --branch feature/x","handlingStrategy":"validation","validationCode":"if (args.includes('--branch') && args.includes('--no-worktree')) {\n  throw new Error('--branch and --no-worktree are mutually exclusive');\n}","typeGuard":null,"tryCatchPattern":"try {\n  await runWorkflow(args);\n} catch (e) {\n  if (/--branch and --no-worktree/.test(String(e.message))) {\n    return runWorkflow(args.filter(a => a !== '--no-worktree'));\n  }\n  throw e;\n}","preventionTips":["Default to --branch (isolated) and reserve --no-worktree for explicit speed runs","Centralize isolation-flag selection in one place in wrapper scripts"],"tags":["cli","flags","worktree","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"}