Intake → Delivery Flow
The pipeline processes work items through a deterministic sequence of stages. Each stage has explicit entry conditions, a defined executor, and clear exit criteria. Labels on GitHub issues and PRs encode the current state — no external database required.
The State Machine
Stage 1: Intake
Work enters the pipeline as a GitHub issue. Issues can originate from bug reports, feature requests, or automated triage (e.g., Sentry alerts, user feedback channels).
Entry conditions
- Issue exists in the project backlog column
- Issue has no classification label yet (
agent,human, orneeds-info)
What happens
- PM agent detects the issue during its periodic dispatch cycle
- Issue is queued for research within concurrency limits
Stage 2: Research
A coding agent analyzes the issue to determine scope, complexity, and whether it can be automated. This runs in cloud mode — the agent reads the codebase but doesn't modify it.
Entry conditions
- Issue in backlog column
- No classification label present
- Under concurrency limit (default: 3 concurrent research agents)
What happens
- Agent reads issue details and searches the codebase for relevant files
- Analyzes complexity and scope
- Classifies:
agent(automatable),human(needs judgment), orneeds-info - Posts structured research comment to the issue
- Applies classification and scope labels
Exit criteria
Classification label applied. Research tracking label added.
Output labels
| Category | Labels |
|---|---|
| Classification | agent, human, needs-info |
| Scope | scope:ui-only, scope:backend-only, scope:fullstack |
| Complexity | complexity:trivial, complexity:moderate, complexity:complex |
Timeout
30 minutes. If no classification label after timeout, the session is flagged as zombie and cleaned up.
Stage 3: Build
A coding agent implements the fix in an isolated git worktree, runs tests, and opens a PR. This is the core execution stage — where code gets written.
Entry conditions
- Issue has
agentlabel (classified as automatable) - Research complete (tracking label present)
- Issue is open
- No PR already exists for this issue
- Under concurrency limit (default: 2 concurrent builds)
What happens
- Create git worktree — never modify the main clone
- Spawn coding agent in the worktree
- Agent implements the fix
- Runs lint, typecheck, and tests
- Creates PR with
Closes #Nin the body - Syncs labels from issue to PR
Exit criteria
PR exists for the issue.
Isolation model
~/project/ # Main clone — NEVER touched
~/project/worktrees/
└── issue-<num>/ # Isolated worktree per issue
├── branch: fix/issue-N # Dedicated branch
└── (full repo checkout) # Independent working treeStage 4: Review
Automated code review via a GitHub Action. The PM agent triggers this by adding a label — no coding agent is spawned for review.
Entry conditions
- PR exists
- No review label present
What happens
- PM agent adds the review-trigger label to the PR
- GitHub Action fires automatically
- Action reviews code and posts findings as PR comments
- Action adds review-complete label
Exit criteria
Review-complete label applied.
Stage 5: Fix Comments
A coding agent reads review comments, categorizes them, and implements fixes. This stage has a built-in circuit breaker.
Entry conditions
- PR has review-complete label
- No comments-fixed label
- No
agent-stucklabel - Fix attempts < 3 (circuit breaker threshold)
What happens
- Agent reads all review comments (inline and PR-level)
- Categorizes each:
must-fix,should-fix,nitpick - Implements fixes for must-fix and should-fix items
- Commits, pushes, and posts a summary comment
- Adds comments-fixed label
Circuit breaker
After 3 failed fix attempts, the pipeline adds agent-stuck and stops retrying. A human must triage. This prevents infinite loops and wasted compute.
Stage 6: E2E Test
Browser-based end-to-end testing using the PR's preview deployment.
Entry conditions
- Review complete and comments addressed
- No test result label present
- No
agent-stucklabel
What happens
- Agent retrieves the preview deployment URL
- Extracts test criteria from the PR description
- Uses browser automation to test the deployment
- Captures screenshots as evidence
- Posts results as a PR comment
- Adds pass or fail label
Stage 7: Deliver
The only mandatory human touchpoint. A human reviews the PR and merges it.
What happens
- Human reviews the PR (code, review comments, test results)
- Human approves and merges
- Labels sync from PR back to issue
- Issue auto-closes via
Closes #Nin the PR body
Auto-merge (optional)
For low-risk repositories, auto-merge can be enabled when all conditions are met: architecture review approved, QA approved or tests passing, CI green, no unresolved comments. This is opt-in per repository.
Concurrency Management
Each stage has configurable concurrency limits to prevent resource exhaustion:
| Stage | Default Limit | Rationale |
|---|---|---|
| Research | 3 | Cloud-based, low resource cost |
| Build | 2 | Local compute + git worktrees |
| Fix | 5 | Typically quick, small changes |
| E2E Test | 2 | Browser automation, one deployment at a time |
Label Sync
Labels automatically sync between issues and PRs at key transitions:
- PR created: issue labels → PR (scope, complexity, area)
- PR merged: PR labels → issue (completion status)
- Daily reconciliation: catch any drift
Pipeline-internal labels (stage tracking) do not sync — they belong to their respective object.