Pipeline V3 Architecture
Pipeline V3: Multi-agent orchestration for complex software projects
Pipeline V3 Architecture
Pipeline V3 is Reeve's multi-agent orchestration system for complex software development. It implements a PM (Project Manager) pattern where a coordinator agent orchestrates specialized agents through a structured workflow.
Overview
Pipeline V3 transforms natural language task descriptions into working software through:
- Automated PRD generation β Task β Product Requirements Document
- Parallel design review β Architecture, Security, QA review in parallel
- Contract-driven development β Shared API specs, DB schemas, types
- Task graph execution β Dependency-aware task scheduling
- Multi-agent implementation β Specialized agents for each domain
- Visual validation β Headless browser verification
Agent Roles
Pipeline V3 uses a team of specialized agents, each with a defined role and model tier:
| Agent | Role | Model | Focus |
|---|---|---|---|
| Architect | Design review, architecture decisions | Opus | High-level structure, scalability |
| Backend Dev | Backend implementation | Sonnet | API, database, business logic |
| Frontend Dev | Frontend implementation | Sonnet | UI components, state management |
| Security Expert | Security review | Sonnet | Auth, vulnerabilities, data protection |
| QA Engineer | Testing, validation | Sonnet | Test coverage, integration testing |
| UI/UX Reviewer | Visual review | Sonnet | Usability, accessibility, design |
| Performance Analyst | Performance checks | Haiku | Optimization, load testing |
Pipeline Phases
Phase 1: Planning
Task Description β Architect β PRD
β Task Graph
β Contract RegistryThe Architect agent:
- Analyzes the task description
- Generates a PRD with features, tech stack, acceptance criteria
- Creates a dependency graph of tasks
- Establishes contracts (API specs, DB schemas, shared types)
Phase 2: Design Review
PRD + Contracts β [Architect, Security, QA] β Review Results
(parallel)Three reviewers evaluate the design simultaneously:
- Architect: Validates technical decisions
- Security: Identifies security concerns
- QA: Ensures testability
Review verdicts:
APPROVEβ ProceedSUGGESTβ Proceed with recommendationsBLOCKERβ Stop and revise
Phase 3: Execution (Parallel)
Task Graph β Ready Tasks β [Backend/Frontend Devs] β Code
(truly parallel via asyncio)The PM orchestrates task execution with full parallelism:
- Identifies tasks with satisfied dependencies (
get_ready()) - Launches all ready tasks concurrently via
asyncio.gather - Bounds concurrency with a semaphore (default: 8 simultaneous tasks)
- Each agent call is an async subprocess (
asyncio.create_subprocess_exec) - Collects results, updates task graph status
- Writes progress to
.pipeline/progress.jsonafter each completion - Retries failed tasks (up to 2 attempts) before marking blocked
- Detects deadlocks (no ready tasks but graph incomplete) and fails gracefully
Phase 4: Validation
Completed Tasks β QA + UI/UX β Validation Results
β Visual Tests (browser)Validation includes:
- Build verification
- API endpoint testing
- Integration smoke tests
- Visual regression testing
Parallel Execution Model
Pipeline V3 is fully async. Every agent call, every phase, and every task runs as a non-blocking coroutine.
How It Works
Agent calls use asyncio.create_subprocess_exec to spawn Reeve agent sessions. The pipeline never blocks waiting for a single agent β multiple agents run simultaneously.
Design review runs all three reviewers (Architect, Security, QA) in parallel via asyncio.gather. Results are collected when all three finish.
Task execution uses a semaphore-bounded parallel loop:
sem = asyncio.Semaphore(max_concurrency) # default: 8
async def _run_one(task):
async with sem:
success = await self.execute_task(task)
self._write_progress(task.id, status, completed, total)
# All ready tasks launch in parallel
await asyncio.gather(*[_run_one(t) for t in ready_tasks])Tasks whose dependencies are satisfied run concurrently. When a task completes, newly unblocked tasks become ready and join the next parallel batch.
Progress Monitoring
The pipeline writes .pipeline/progress.json after each task completion:
{
"timestamp": "2025-07-13T14:30:00",
"completed": 5,
"total": 12,
"last_task": "backend-auth-api",
"last_status": "completed",
"phase": "EXECUTION"
}External tools (supervisors, heartbeats, dashboards) can poll this file for real-time pipeline status.
Failure Handling
- Retry: Failed tasks retry up to 2 times before being marked
BLOCKED - Deadlock detection: If no tasks are ready but the graph isn't complete, the pipeline detects the deadlock and fails with a clear error
- Graceful degradation: Progress logging never crashes the pipeline β write failures are silently caught
Contract Registry
The Contract Registry is the critical glue between agents. It stores:
API Contracts
registry.add_endpoint(
method="POST",
path="/api/users",
summary="Create a new user",
request_body={"type": "object", "properties": {...}},
response={"type": "object", "properties": {...}},
auth_required=True,
tags=["users"]
)Database Contracts
registry.add_table(
name="users",
columns={
"id": "UUID PRIMARY KEY",
"email": "VARCHAR(255) UNIQUE NOT NULL",
"created_at": "TIMESTAMP DEFAULT NOW()"
},
indexes=["email"]
)Environment Contracts
registry.set_backend_env("DATABASE_URL", "PostgreSQL connection string")
registry.set_frontend_env("NEXT_PUBLIC_API_URL", "Backend API base URL")Shared Types
registry.add_type("User", {
"properties": {
"id": {"type": "string"},
"email": {"type": "string"},
"name": {"type": "string"}
},
"required": ["id", "email"]
})The registry can export to:
- OpenAPI 3.0 spec
- SQL schema
- TypeScript interfaces
- JSON for persistence
Task Graph
Tasks are organized in a dependency graph:
βββββββββββββββββββ
β Backend Scaffold β
ββββββββββ¬βββββββββ
β
ββββββββββΌβββββββββ
β DB Schema β
ββββββββββ¬βββββββββ
β
βββββββββββββββββ΄ββββββββββββββββ
β β
βββββΌββββββββ βββββββββΌββββ
β Auth API β β User API β
βββββββββββββ βββββββββββββTask states:
PENDINGβ Waiting for dependenciesREADYβ Dependencies satisfied, can runRUNNINGβ Currently executingDONEβ Completed successfullyFAILEDβ Execution failedBLOCKEDβ Blocked by failed dependency
Usage Example
from src.pipeline.pm import PipelinePM
async def my_llm_caller(agent, prompt):
"""Adapter to your LLM client."""
return await your_llm.call(
model=agent.model,
system=agent.system_prompt,
prompt=prompt
)
# Create and run pipeline
pm = PipelinePM(
task="Build a todo list API with user auth and React frontend",
repo="/path/to/repo",
output_dir="./pipeline-output",
llm_caller=my_llm_caller
)
# Run full pipeline
state = await pm.run()
# Or run phases individually
await pm.create_prd()
await pm.create_task_graph()
reviews = await pm.design_review()
if no_blockers(reviews):
await pm.execute_all()
await pm.validate()Relationship to Coordinator Model
Pipeline V3 is an extension of the Coordinator Model:
| Role | In Pipeline V3 |
|---|---|
| Coordinator | PipelinePM class orchestrates |
| Sub-agents | Architect, Devs, Reviewers |
| Memory | Contract Registry persists state |
| Task delegation | Task Graph manages work |
The PM never writes code directlyβit coordinates the specialized agents who do.
Configuration
Pipeline V3 can be configured via:
{
"pipeline": {
"maxRetries": 2,
"parallelTasks": 3,
"models": {
"architect": "anthropic/claude-opus-4-5",
"developer": "anthropic/claude-sonnet-4",
"reviewer": "anthropic/claude-sonnet-4",
"performance": "anthropic/claude-haiku"
},
"validation": {
"runVisualTests": true,
"screenshotDir": "./pipeline-output/screenshots"
}
}
}Output Artifacts
After pipeline completion:
pipeline-output/
βββ prd.json # Product Requirements Document
βββ task-graph.json # Task dependency graph
βββ contracts/
β βββ api-spec.json # OpenAPI spec
β βββ schema.sql # Database schema
β βββ env-contract.json # Environment variables
β βββ types.ts # TypeScript interfaces
βββ logs/
β βββ pipeline.jsonl # Full execution log
βββ screenshots/ # Visual test capturesBest Practices
- Clear task descriptions β The better the input, the better the PRD
- Review contracts early β Most bugs come from mismatched contracts
- Check blocker reviews β Don't proceed past design review blockers
- Monitor the task graph β Watch for deadlocks or stuck tasks
- Validate visually β Automated visual tests catch UI regressions
CLI Tools
Pipeline V3 includes several command-line tools for different workflows:
| Tool | Use Case |
|---|---|
run-pipeline-v3.py | Main pipeline runner (spec β code) |
run-audit-v3.py | Pattern-based code audit + fix |
run-logic-audit-v3.py | Human-level feature verification |
pipeline-supervisor.sh | Auto-restart crashed pipelines |
See Pipeline V3 Tools Reference for detailed usage.
Quick Start
# Run a pipeline from spec
./bin/run-pipeline-v3.py --spec docs/design.md --repo ./my-app
# Audit codebase for issues
./bin/run-audit-v3.py --repo ./my-app --min-severity high
# Verify features match docs
./bin/run-logic-audit-v3.py --frontend ./frontend --backend ./backendPipeline V3.5: Multi-Repo Coordination
Pipeline V3.5 extends V3 with multi-repository awareness. If your project spans multiple repos (e.g. backend + frontend), V3.5 adds:
- Multi-repo support β
--repos backend:./api frontend:./web - Cross-repo contract registry β endpoints and tables track which repo defines them and who consumes them
- Task routing per repo β each task executes in the correct repo's working directory
- Cascading task generation β auto-generates client integration tasks when a backend endpoint has frontend consumers
- Cross-repo dependency tracking β frontend tasks wait for backend tasks they depend on
V3.5 is fully backward compatible β --repo and all single-repo workflows work exactly as before.
See Pipeline V3.5 β Multi-Repo Coordination for full documentation.
See Also
- Pipeline V3.5 β Multi-Repo Coordination β Cross-repo orchestration
- Pipeline V3 Tools Reference β CLI tool documentation
- Coordinator Model β Foundation philosophy
- Spawning Sub-Agents β Manual sub-agent patterns
- Multi-Agent Routing β Agent isolation and routing
- Role Enforcer Plugin β Three-tier enforcement (supersedes coordinator-enforcer)
- Coordinator Enforcer Plugin β Legacy single-tier enforcement