{
  "$schema": "./bosun.schema.json",
  "projectName": "my-project",
  "primaryAgent": "codex-sdk",

  "_comment_workflowFirst": "Set to true to run everything as workflows (task lifecycle, PR management, etc.)",
  "workflowFirst": false,
  "_comment_worktreeRecoveryCooldown": "Minutes to keep a task blocked after a non-retryable worktree failure before Bosun automatically returns it to todo.",
  "workflowWorktreeRecoveryCooldownMin": 15,
  "_comment_worktreeBootstrap": "Optional managed-worktree bootstrap policy. Commands are per detected stack and can be overridden per repo.",
  "worktreeBootstrap": {
    "enabled": true,
    "linkSharedPaths": true,
    "commandTimeoutMs": 600000,
    "setupScript": "node tools/install-git-hooks.mjs",
    "commandsByStack": {
      "node": ["npm install"],
      "python": ["poetry install --no-interaction"],
      "dotnet": ["dotnet restore"]
    },
    "sharedPathsByStack": {
      "node": ["node_modules"],
      "php": ["vendor"]
    }
  },
  "_comment_prAutomation": "High-risk PR automation stays Bosun-created-only unless you explicitly trust specific authors. Bosun also auto-trusts the currently connected GitHub OAuth login.",
  "prAutomation": {
    "attachMode": "all",
    "trustedAuthors": ["your-github-login"],
    "allowTrustedFixes": false,
    "allowTrustedMerges": false,
    "assistiveActions": {
      "installOnSetup": false
    }
  },
  "gates": {
    "prs": {
      "repoVisibility": "unknown",
      "automationPreference": "runtime-first",
      "githubActionsBudget": "ask-user"
    },
    "checks": {
      "mode": "required-only",
      "requiredPatterns": ["ci", "test", "build"],
      "optionalPatterns": ["lint-optional", "preview"],
      "ignorePatterns": ["dependabot"],
      "requireAnyRequiredCheck": true,
      "treatPendingRequiredAsBlocking": true,
      "treatNeutralAsPass": false
    },
    "execution": {
      "sandboxMode": "workspace-write",
      "containerIsolationEnabled": false,
      "containerRuntime": "auto",
      "networkAccess": "default"
    },
    "worktrees": {
      "requireBootstrap": true,
      "requireReadiness": true,
      "enforcePushHook": true
    },
    "runtime": {
      "enforceBacklog": true,
      "agentTriggerControl": true
    }
  },
  "workflows": [
    {
      "type": "continuation-loop",
      "enabled": false,
      "taskId": "TASK-123",
      "maxTurns": 8,
      "terminalStates": ["done", "cancelled"],
      "stuckThresholdMs": 300000,
      "onStuck": "retry"
    }
  ],
  "kanban": {
    "backend": "internal"
  },
  "internalExecutor": {
    "mode": "internal"
  },
  "workflows": {
    "code-review": {
      "type": "sequential",
      "stages": ["implement", "test", "review"]
    },
    "parallel-search": {
      "type": "fanout",
      "stages": [
        { "name": "search-codex", "sdk": "codex" },
        { "name": "search-claude", "sdk": "claude" },
        { "name": "search-copilot", "sdk": "copilot" }
      ]
    }
  },
  "auth": {
    "copilot": {
      "sources": ["env", "cli"],
      "fallbackToInteractive": false
    },
    "claude": {
      "sources": ["env", "cli"],
      "fallbackToInteractive": false
    },
    "codex": {
      "sources": ["config"],
      "fallbackToInteractive": true
    }
  },
  "interactiveShellEnabled": false,
  "executors": [
    {
      "name": "codex-default",
      "executor": "CODEX",
      "variant": "DEFAULT",
      "weight": 100,
      "role": "primary"
    }
  ],
  "failover": {
    "strategy": "weighted-random",
    "maxRetries": 3,
    "cooldownMinutes": 5,
    "disableOnConsecutiveFailures": 3
  },
  "distribution": "primary-only",
  "repositories": [
    {
      "name": "my-project",
      "slug": "org/my-project",
      "primary": true
    }
  ],
  "agentPrompts": {
    "orchestrator": ".bosun/agents/orchestrator.md",
    "planner": ".bosun/agents/task-planner.md",
    "monitorMonitor": ".bosun/agents/monitor-monitor.md",
    "taskExecutor": ".bosun/agents/task-executor.md",
    "taskExecutorRetry": ".bosun/agents/task-executor-retry.md",
    "taskExecutorContinueHasCommits": ".bosun/agents/task-executor-continue-has-commits.md",
    "taskExecutorContinueHasEdits": ".bosun/agents/task-executor-continue-has-edits.md",
    "taskExecutorContinueNoProgress": ".bosun/agents/task-executor-continue-no-progress.md",
    "reviewer": ".bosun/agents/reviewer.md",
    "conflictResolver": ".bosun/agents/conflict-resolver.md",
    "sdkConflictResolver": ".bosun/agents/sdk-conflict-resolver.md",
    "mergeStrategy": ".bosun/agents/merge-strategy.md",
    "mergeStrategyFix": ".bosun/agents/merge-strategy-fix.md",
    "mergeStrategyReAttempt": ".bosun/agents/merge-strategy-reattempt.md",
    "autofixFix": ".bosun/agents/autofix-fix.md",
    "autofixFallback": ".bosun/agents/autofix-fallback.md",
    "autofixLoop": ".bosun/agents/autofix-loop.md",
    "monitorCrashFix": ".bosun/agents/monitor-crash-fix.md",
    "monitorRestartLoopFix": ".bosun/agents/monitor-restart-loop-fix.md"
  },
  "markdownSafety": {
    "enabled": true,
    "auditLogPath": ".bosun/logs/markdown-safety-audit.jsonl",
    "allowlist": [
      {
        "path": "AGENTS.md",
        "context": "documentation",
        "reason": "Trusted documentation examples that discuss hostile prompt patterns"
      }
    ]
  },
  "hookProfiles": {
    "enabled": true,
    "profile": "strict",
    "targets": ["codex", "claude", "copilot"],
    "overwriteExisting": false
  },
  "complexityRouting": {
    "enabled": true,
    "models": {
      "CODEX": {
        "low": {
          "model": "gpt-5.1-codex-mini",
          "variant": "GPT51_CODEX_MINI",
          "reasoningEffort": "low"
        },
        "medium": {
          "model": "gpt-5.2-codex",
          "variant": "DEFAULT",
          "reasoningEffort": "medium"
        },
        "high": {
          "model": "gpt-5.1-codex-max",
          "variant": "GPT51_CODEX_MAX",
          "reasoningEffort": "high"
        }
      },
      "COPILOT": {
        "low": {
          "model": "haiku-4.5",
          "variant": "CLAUDE_HAIKU_4_5",
          "reasoningEffort": "low"
        },
        "medium": {
          "model": "sonnet-4.5",
          "variant": "CLAUDE_SONNET_4_5",
          "reasoningEffort": "medium"
        },
        "high": {
          "model": "opus-4.6",
          "variant": "CLAUDE_OPUS_4_6",
          "reasoningEffort": "high"
        }
      }
    }
  }
}
