## Design: Unified Pipeline Architecture

Section 4 of 4 — main.py CLI Changes + Testing Strategy

main.py new flags

    # Current usage:
    python main.py "Build a todo app"

    # New optional flags:
    python main.py "Build a todo app" --pipeline ai-feature
    python main.py "Fix the login bug" --pipeline ai-fix
    python main.py --list-pipelines  # show available pipelines/

    # Default (no --pipeline flag):
    # uses pipelines/ai-feature.yaml if it exists,
    # else falls back to built-in feature pipeline

Testing strategy
Step 1 tests: Merge orchestrators
All 52 existing tests must still pass.
Add tests: BugFix stages available in stage registry
Step 2 tests: Pipeline YAML loading
Test: load ai-feature.yaml, run 1 mock stage
Test: fallback to built-in when no YAML
Step 3 tests: Watcher queues + pools
Test: parallel_issues=2 runs 2 concurrent
Test: LLM pool semaphore limits calls
Step 4 tests: --once mode
Test: watcher --once exits after 1 issue
Full file change summary
Deleted
bug_fix_orchestrator.py
doc_orchestrator.py
build_feature.py
fix_issue.py
Modified
orchestrator.py (absorb classes)
watcher.py (queues + pools + --once)
repos.yaml (add parallel_issues)
config.yaml (add llm.pools)
main.py (add --pipeline flag)
.github/workflows/*.yml
Created
pipelines/ai-feature.yaml
pipelines/ai-fix.yaml
pipelines/ai-docs.yaml
llm_pool.py (LLMPoolManager)
tests/test_watcher_queues.py
tests/test_llm_pool.py
Backwards compatibility: All new config fields are optional with defaults (parallel_issues defaults to 1, pools default to 5 or 1 for ollama). Existing repos.yaml and config.yaml work without changes.