# Multi-Agent Configuration
#
# Top-level key MUST be `ma:`. resolve-profile.js merges this under the
# `ma` namespace, and profile-rules.js reads `ma.parallel_stories` /
# `ma.max_parallel_stories`.

ma:
  enabled: true
  max_parallel_review_layers: 3 # Always 3: blind, edge-case, acceptance
  max_parallel_research: 3 # Max concurrent research agents per batch
  max_parallel_analysis: 5 # Max concurrent codebase analysis agents
  # session_story_limit lives under autopilot.* — single source of truth.

  # Intra-epic parallel story execution.
  #
  # parallel_stories: true enables the dispatch-layer.js building blocks
  # (planBatch, resolve-dag.js, merge-shards.js, agent-adapter.js). The
  # state machine emits stories one at a time; the autopilot logs a
  # clear notice at session start when this flag is set so behavior is
  # unambiguous. Intra-epic parallel emission is planned for a future
  # minor release.
  #
  # max_parallel_stories: cap on concurrent sub-agents per layer.
  # min_epic_duration_for_parallel_sec: skip parallelism for epics whose
  #   estimated wall-clock is below this threshold (saves dispatch overhead).
  # max_consecutive_conflicts: disable parallelism for the rest of the
  #   session once N consecutive merge conflicts occur.
  # effective_parallel_floor: never drop below this mid-session even
  #   after failure-driven concurrency reduction.
  parallel_stories: false
  max_parallel_stories: 2
  min_epic_duration_for_parallel_sec: 300
  baseline_story_duration_sec: 180
  max_consecutive_conflicts: 2
  effective_parallel_floor: 1

  # Experimental: parallel_stories dispatch on Gemini CLI.
  #
  # Gemini CLI has a subagent primitive (invoke_subagent) but its
  # worktree-scoped variant is tracked upstream
  # (github.com/google-gemini/gemini-cli#22967). Real-world parallelism
  # reports serialization + quota throttling. Sprintpilot detects Gemini
  # CLI via GEMINI_CLI=1 (env, HIGH confidence) or parent process `gemini`
  # (MEDIUM); supports_parallel stays false by default.
  #
  # Flip to true PER PROJECT to opt into the experimental path. The
  # workflow logs an "experimental parallel" warning once per session
  # when this is true AND host=gemini-cli.
  experimental_parallel_on_gemini: false

  # Cross-epic parallelism (experimental). Off by default on every
  # profile, including large. Enabling requires:
  #   1. Both epics carry `independent: true` in dependencies.yaml.
  #   2. preflight-merge.js reports no conflicts between them.
  #   3. max_parallel_epics is fixed at 2 — no tuning knob.
  # A single cross-epic merge conflict in a session disables parallel_epics
  # for the rest of the session.
  parallel_epics: false
