# Autopilot Configuration for Sprintpilot
# Controls /sprint-autopilot-on session behavior.

autopilot:
  # Adaptive Process Scaling profile.
  #
  #   nano   — toy / tutorial / learning project, solo, small codebase.
  #            Routes through bmad-quick-dev one-shot (PR 4+). Fastest.
  #   small  — MVP / internal tool / prototype, solo or 1–2 devs.
  #   medium — team product with real users. Default, recommended.
  #   large  — production system, compliance / uptime stakes. Full
  #            reconciliation, interactive retrospectives, tighter
  #            checkpoints, parallelism on by default.
  #   legacy — rollback to v1.0.5 behavior. No v2 optimizations active.
  #            Pinned by version_pinned in profiles/legacy.yaml so future
  #            changes cannot silently affect legacy users.
  #
  # Profile defaults live in _Sprintpilot/modules/autopilot/profiles/*.yaml.
  # Override specific knobs here or in git/ma config.yaml — user overrides
  # always win over profile defaults. See docs/adaptive-process-scaling.md.
  #
  # Missing key defaults to 'medium' (matches v1.0.5 behavior byte-for-byte).
  # Upgrading v1 installs don't need to set this; new installs get it from
  # the installer prompt or `sprintpilot install --profile <name>`.
  complexity_profile: medium

  # Maximum stories to FULLY IMPLEMENT in a single autopilot session.
  #
  # "Fully implement" means the complete per-story cycle:
  #   bmad-dev-story (RED → GREEN) + bmad-code-review + all patches applied
  #   + artifacts committed + (if git enabled) pushed & PR created.
  #
  # Creating a story file (bmad-create-story) without implementing it does
  # NOT count toward this limit. The counter only ticks up after step 7
  # ("Mark story done") completes successfully.
  #
  # When the Nth story's full cycle finishes, the autopilot writes state
  # and exits cleanly so the user can start a fresh session without hitting
  # context compaction mid-story.
  #
  # Set 0 to disable the limit and run until the sprint is complete.
  session_story_limit: 3

  # Retrospective handling at epic completion.
  #
  # - "auto" (default): autopilot generates a deterministic retrospective
  #   from sprint-status.yaml + decision-log.yaml, then continues with the
  #   next epic. Safe under every CLI including Gemini CLI — no external
  #   skill call, no persona simulation, single pass.
  # - "stop": autopilot pauses at epic completion so you can run
  #   /bmad-retrospective interactively. Re-run /sprint-autopilot-on to
  #   resume with the next epic.
  # - "skip": autopilot skips the retrospective entirely and continues.
  #   NOT RECOMMENDED — you lose the epic-level learning record.
  #
  # Background: the external bmad-retrospective skill can enter a
  # multi-persona discussion loop when driven by autopilot on some CLIs,
  # which exhausts the token/memory budget. That's why "auto" generates
  # the artifact inline instead of invoking the external skill.
  retrospective_mode: auto

  # v2.4.0 — Per-phase wall-clock budgets.
  #
  # The state machine timestamps phase entry (state.phase_started_at) and
  # halts cleanly with `reason: 'phase_timeout_exceeded'` when the active
  # phase has been running longer than its budget. Catches the "I started
  # a sprint, walked away, came back to a multi-hour DEV_GREEN hang" case
  # v2.3.x had no recourse for.
  #
  # Keys must match orchestrator phases (dev_red, dev_green, code_review,
  # patch_apply, patch_retest, nano_quick_dev, create_story,
  # check_readiness). Phases not in the map are unbudgeted.
  #
  # Defaults scale with complexity_profile:
  #   nano   — short (15min nano_quick_dev)
  #   small  — pragmatic (20min dev_green)
  #   medium — default (30min dev_green)
  #   large  — generous (60min dev_green)
  #   legacy — disabled (preserves v1.0.5 semantics byte-for-byte)
  #
  # Override examples (uncomment and customize):
  #   phase_timeout_minutes: null      # disable all timeouts
  #   phase_timeout_minutes: {}        # disable all timeouts
  #   phase_timeout_minutes:
  #     dev_green: 45                  # raise one budget
  #     dev_red: null                  # disable one phase
  #
  # The halts are deliberately user_prompts (recoverable) so the LLM can
  # be re-prompted with extra context; the next session continues from
  # the same phase. Leave the key unset to inherit profile defaults.

  # Quick-dev fast lane — per-story routing of LOW-RISK stories through
  # bmad-quick-dev (one-shot) under a FULL profile, while substantial
  # stories keep the mandatory 7-step BMad cycle.
  #
  # DEFAULT OFF. When disabled, small/medium/large/legacy profiles behave
  # exactly as before — no story is ever fast-laned. This is a sanctioned,
  # opt-in relaxation of the RED-first rule (see AGENTS.md); the installer
  # asks whether to enable it. A deterministic pre-story gate decides
  # fast|full and defaults to `full` on any uncertainty; a fast-laned story
  # that fails its tests or hits a high-severity finding bounces back to the
  # full cycle and is remembered for the rest of the sprint.
  #
  # Only `enabled` is prompted at install; the remaining knobs inherit the
  # profile defaults in profiles/_base.yaml. Uncomment to override. NOTE:
  # glob lists are comma-separated STRINGS (the portable representation for
  # Sprintpilot's narrow YAML reader), e.g. "docs/**,**/*.md".
  fast_lane:
    enabled: false
    # max_ac: 3                         # more Acceptance Criteria than this → never fast-lane
    # allow_globs: "docs/**,**/*.md"    # infer fast only when every declared path is allow-listed
    # deny_globs: "**/auth/**,**/migrations/**,**/*secret*,**/*secret*/**"  # any match forces full (hard safety)
    # require_story_tag: false          # true = only stories tagged `fast_lane: true` / `risk: low`
