project:
  name: service-maintenance
  root: .
  task_file: .nightshift/tasks.md
  artifact_dir: .nightshift

safety:
  require_clean_worktree: false
  scoped_paths:
    - src
    - tests
    - docs
    - pyproject.toml
    - README.md
  allowed_commands:
    - python -m pytest -q
  forbidden_commands:
    - rm -rf
    - git push
    - curl | bash

experiment:
  label: long-running-junior-senior
  prompt_variant: qwen25-junior-qwen3-senior-v1

agents:
  planner:
    backend: ollama
    model: qwen2.5-coder:14b
    temperature: 0.2
    system_prompt: .nightshift/agents/planner.md

  architect:
    backend: ollama
    model: qwen2.5-coder:14b
    temperature: 0.2
    system_prompt: .nightshift/agents/architect.md

  junior:
    backend: ollama
    model: qwen2.5-coder:14b
    temperature: 0.1
    system_prompt: .nightshift/agents/junior.md

  senior:
    backend: ollama
    model: qwen3-coder:30b
    temperature: 0.1
    system_prompt: .nightshift/agents/senior.md

  reviewer:
    backend: ollama
    model: qwen2.5-coder:14b
    temperature: 0.1
    system_prompt: .nightshift/agents/reviewer.md

  debugger:
    backend: ollama
    model: qwen2.5-coder:14b
    role: debugger
    temperature: 0.1
    system_prompt: .nightshift/agents/debugger.md

pipeline:
  max_task_retries: 4
  continue_on_task_failure: false
  stages:
    - id: plan
      type: agent
      agent: planner
      output: plan.md

    - id: architecture
      type: agent
      agent: architect
      output: architecture.md

    - id: context
      type: repo_context
      output: context-pack.md

    - id: implement_junior
      type: file_writer
      agent_pool:
        - junior
        - senior
      output: proposed.patch

    - id: normalize_junior
      type: patch_normalizer
      output: normalized.patch

    - id: validate_junior
      type: patch_validator
      output: patch-validation.md
      max_files: 16
      max_lines: 1400
      max_delete_ratio: 0.70
      on_fail: implement_senior

    - id: apply_junior
      type: patch_apply
      mode: apply
      output: patch-apply-output.txt
      on_fail: implement_senior

    - id: test_junior
      type: command
      commands:
        - python -m pytest -q
      output: test-output.txt
      shell: true
      timeout_seconds: 45
      on_fail: implement_senior

    - id: review_junior
      type: agent_review
      agent: reviewer
      output: review.md
      on_fail: implement_senior

    - id: implement_senior
      type: file_writer
      agent: senior
      output: senior-proposed.patch

    - id: normalize_senior
      type: patch_normalizer
      output: senior-normalized.patch

    - id: validate_senior
      type: patch_validator
      output: senior-patch-validation.md
      max_files: 20
      max_lines: 1800
      max_delete_ratio: 0.70
      on_fail: implement_senior

    - id: apply_senior
      type: patch_apply
      mode: apply
      output: senior-patch-apply-output.txt
      on_fail: implement_senior

    - id: test_senior
      type: command
      commands:
        - python -m pytest -q
      output: senior-test-output.txt
      shell: true
      timeout_seconds: 60
      on_fail: implement_senior

    - id: review_senior
      type: agent_review
      agent: reviewer
      output: senior-review.md
      on_fail: implement_senior

    - id: summarize
      type: summarize
      output: final-notes.md
