# Quality Gate Configuration
# Version: 1.0.0
# Story: 2.10 - Quality Gate Manager
#
# This configuration controls the behavior of the 3-layer Quality Gate system.
# Layers execute sequentially with fail-fast behavior.

version: "1.0"

# Layer 1: Pre-commit checks (fast, local)
layer1:
  enabled: true
  failFast: true  # Stop pipeline on first failure
  checks:
    lint:
      enabled: true
      command: "npm run lint"
      failOn: "error"  # error | warning
      timeout: 60000   # 1 minute
    test:
      enabled: true
      command: "npm test"
      timeout: 300000  # 5 minutes
      coverage:
        enabled: true
        minimum: 80
    typecheck:
      enabled: true
      command: "npm run typecheck"
      timeout: 120000  # 2 minutes

# Layer 2: PR Automation (external tools)
layer2:
  enabled: true
  coderabbit:
    enabled: true
    # Cross-platform CodeRabbit CLI invocation (Issue #731).
    # Runtime resolves the command from cli_path + platform detection:
    #   - macOS/Linux: run cli_path directly from project root.
    #   - Windows: wrap with 'wsl bash -c' and rewrite project paths to /mnt/<drive>/...
    # Set installation_mode explicitly ('wsl' | 'native') to override platform detection.
    # Set command: "<raw shell string>" to bypass detection entirely (back-compat).
    cli_path: ~/.local/bin/coderabbit
    platform_notes:
      macos_linux: "Run binary directly from project root (PATH or cli_path)."
      windows: "Wrap with 'wsl bash -c' and use /mnt/<drive>/... project paths."
    timeout: 900000  # 15 minutes
    blockOn:
      - CRITICAL
    warnOn:
      - HIGH
    documentOn:
      - MEDIUM
    ignoreOn:
      - LOW
  quinn:
    enabled: true
    autoReview: true
    agentPath: ".claude/commands/AIOX/agents/qa.md"
    severity:
      block: ["CRITICAL"]
      warn: ["HIGH", "MEDIUM"]

# Layer 3: Human Review (manual)
layer3:
  enabled: true
  requireSignoff: true
  assignmentStrategy: "auto"  # auto | manual | round-robin
  defaultReviewer: "@architect"
  checklist:
    enabled: true
    template: "strategic-review-checklist"
    minItems: 5
  signoff:
    required: true
    expiry: 86400000  # 24 hours in ms

# Report settings
reports:
  location: ".aiox/qa-reports"
  format: "json"  # json | yaml | markdown
  retention: 30   # days to keep reports
  includeMetrics: true

# Status persistence
status:
  location: ".aiox/qa-status.json"
  updateOnChange: true

# Verbose output settings
verbose:
  enabled: false
  showCommands: true
  showOutput: true
  showTimings: true
