# Adaptive Process Scaling — base defaults for all non-legacy profiles.
# Per-profile YAML files override only the keys they want to change.
# See docs/adaptive-process-scaling.md and docs/implementation-plan.md.

name: _base
version_pinned: null

autopilot:
  implementation_flow: full        # full | quick
  # Proactive handoff threshold. Lowered from 5 → 3 because context rot
  # (late-session instruction decay) caused the LLM to skip late-step
  # actions in longer single-session runs. Keeping sessions short enough
  # that every step 10 CRITICAL action fits comfortably inside the prompt
  # budget is cheaper than paying for skipped cleanup actions.
  session_story_limit: 3
  retrospective_mode: auto
  phase_timings: true              # M0, PR 2 — enabled by default (legacy overrides to false)
  coalesce_state_writes: true      # M3, PR 6 — batch non-critical writes, flush at story boundary
  conditional_boot_work: true      # M4, PR 7 — skip health-check + branch reconciliation on a clean repo
  cache_shared_reads: true         # M5, PR 8 — memoize sprint-status / git-status / decision-log reads per loop iteration
  # 2.0.2 — original dependency-inference knob. Pre-v2.3.0 this triggered
  # an LLM-driven inference pass once after bmad-sprint-planning and wrote
  # `_Sprintpilot/sprints/dependencies.yaml`. v2.3.0 replaces that flow:
  #   - The plan now lives at `_bmad-output/implementation-artifacts/sprint-plan.yaml`.
  #   - Inference is opt-in via /sprintpilot-plan-sprint, NOT automatic.
  #   - Greenfield runs (no plan, no --stories/--epic) execute stories in
  #     sprint-status order — same as today's resolveNextStoryKey path.
  # Default flipped to false; users who relied on the old behavior should
  # set `autopilot.auto_plan_on_start: true` (see below).
  auto_infer_dependencies: false

  # v2.3.0 — when true, cmdStart emits an `invoke_skill` action for
  # /sprintpilot-plan-sprint on first run if no sprint-plan.yaml exists.
  # Default `false`: missing plan → fall back to sprint-status order
  # (existing behavior). Once a plan exists, staleness is detected and
  # re-derive runs automatically regardless of this knob — flipping back
  # to false is a one-shot opt-out for net-new projects only.
  auto_plan_on_start: false

  # 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, full profiles behave exactly as before. This is a sanctioned,
  # opt-in relaxation of the RED-first rule (see AGENTS.md); the installer
  # prompts whether to enable it. A pre-story gate (fast-lane-gate.js)
  # decides fast|full deterministically and defaults to `full` on any
  # uncertainty; a fast-laned story that fails tests or hits high severity
  # bounces back to the full cycle and is remembered for the rest of the
  # sprint.
  # NOTE: glob lists are comma-separated STRINGS, not YAML sequences —
  # resolve-profile.js ships a narrow YAML parser (no array support) into the
  # user's project, so `allow_globs: "a,b"` is the portable representation.
  # flatToProfile splits them into arrays.
  fast_lane:
    enabled: false                 # master switch (installer prompts)
    max_ac: 3                      # more Acceptance Criteria than this → never fast-lane
    # A story only *infers* fast when every path it declares is allow-listed.
    allow_globs: "docs/**,**/*.md"
    # Any declared path matching a deny glob forces full — beats an explicit
    # fast tag (hard safety for auth / migrations / secrets / infra).
    deny_globs: "**/auth/**,**/migrations/**,**/*secret*,**/*secret*/**"
    require_story_tag: false       # true = only stories tagged `fast_lane: true` / `risk: low` fast-lane

git:
  granularity: story               # story | epic
  worktree:
    enabled: true
  squash_on_merge: false

ma:
  parallel_stories: false
  max_parallel_stories: 2
  # PR 11 intra-epic parallelism safety rails. Honored by dispatch-layer.js
  # when a host declares parallel support (see agent-adapter.js).
  min_epic_duration_for_parallel_sec: 300
  baseline_story_duration_sec: 180
  max_consecutive_conflicts: 2
  effective_parallel_floor: 1
  parallel_epics: false
  # PR 3: state_sharding semantics — auto = shard when parallelism is active,
  # always = shard unconditionally (for forcing the code path in tests),
  # never = write authoritative files directly (pre-PR behavior, rollback).
  state_sharding: auto
