Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions docs/ADRs/0002-initial-fullsend-design.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,17 +142,17 @@ It **does not** read the **issue comment thread** for intake decisions—no scan
3. **Testing loop (iterative)** — Run the **existing test suite** in the **PR sandbox**. Incorporate **triage-provided tests** if present; if none, **author tests** consistent with the framework. Repeat **implement → test** until **local/CI-equivalent tests pass** in the sandbox used for iteration.
4. **Open or update PR** — Link issue; describe changes.
5. **GitHub checks loop** — After push, **required checks** run on GitHub. On failure, the **implementation agent** **fetches logs**, fixes, pushes; repeat until **all required checks pass** (or until policy caps retries — implementation detail).
6. **Handoff to Review** — When checks are green: add **`ready-for-review`**. (**`ready-to-implement`** was already removed when this run **started**.) The **implementation agent** then **waits** until **Review** outcome.
6. **Handoff to Review** — When checks are green, the PR creation or push triggers review dispatch automatically via `pull_request_target` events. The **implementation agent** does not apply labels for handoff. (**`ready-to-implement`** was already removed when this run **started**.) The **implementation agent** then **waits** until **Review** outcome.

### Review

**Entry:** The **`ready-for-review`** label was **applied** (or **`/review`** or **PR synchronize** per re-review policy)—**before** the run strips **`ready-for-review`**.
**Entry:** A `pull_request_target` event fired (PR opened, pushed, or marked ready for review), the **`ready-for-review`** label was **applied** manually, or **`/review`** was invoked—**before** the run strips **`ready-for-review`**.

**Triggers (Review — **review agent** + coordinator):**

1. **`ready-for-review`** label **added** to the issue (or linked PR—policy per repo).
2. **`/review`** in a comment.
3. **PR synchronize** (push to the PR branch)—**re-review** per policy below.
1. **`pull_request_target`** event — PR **opened**, **synchronize** (push to the PR branch), or **ready_for_review** (draft → ready). This is the primary trigger.
2. **`ready-for-review`** label **added** to the issue (or linked PR—policy per repo). Available for manual dispatch.
3. **`/review`** in a comment.

**When a review run starts** (initial review, **`/review`**, or **push-triggered re-review**): **remove** **`ready-for-review`** **and** **`ready-for-merge`**. A new round **supersedes** any prior merge verdict until the coordinator finishes this round—otherwise **`ready-for-merge`** could describe an **old** head after the author **pushed** new commits, which is **unsafe** for bots and humans. Reviewers evaluate the **current** PR head; the coordinator applies outcomes using the algorithm below. (**`requires-manual-review`** is **not** removed here by default—humans may still need to resolve an earlier split verdict unless **repo policy** clears it when enqueueing a new round.)

Expand Down
2 changes: 1 addition & 1 deletion docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ ADR 0002: [Building block 7](ADRs/0002-initial-fullsend-design.md#7-test-artifac

### 8. code agent runtime

Implements changes, runs local/CI-equivalent tests, handles check failures, and advances handoff to **Review** (`ready-for-review`).
Implements changes, runs local/CI-equivalent tests, handles check failures, and opens or updates a PR. Review dispatch is triggered automatically by `pull_request_target` events.
ADR 0002: [Building block 8](ADRs/0002-initial-fullsend-design.md#8-implementation-agent-runtime).

### 9. PR sandbox / CI mirror
Expand Down
16 changes: 8 additions & 8 deletions docs/guides/user/bugfix-workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ When someone files a bug, fullsend's agent pipeline processes it through three s
Each stage is triggered by labels and can be restarted with slash commands. The pipeline uses GitHub's native primitives (issues, PRs, labels, branch protection) as its coordination layer — there is no central orchestrator. See [ADR 0002](../../ADRs/0002-initial-fullsend-design.md) for the full design.

```
Issue filed → Triage → ready-to-code → Code Agent → ready-for-review → Review → ready-for-merge → Merge
│ ↑ │
│ └── changes requested (planned) ┘
Issue filed → Triage → ready-to-code → Code Agent → PR opened → Review → ready-for-merge → Merge
│ ↑
│ └── changes requested (planned)
├── duplicate → closed
├── not-ready → waiting for info
└── not-reproducible → human intervention
Expand Down Expand Up @@ -44,7 +44,7 @@ These labels track where an issue is in the pipeline:
| `not-ready` | Missing information | Triage comment explains what's needed; add a comment or edit the issue body to fix |
| `not-reproducible` | Bug couldn't be reproduced in the sandbox | Human intervention required; triage comment documents what was tried |
| `ready-to-code` | Triage passed | Code agent picks it up |
| `ready-for-review` | PR with passing CI ready for review | Review agents evaluate the PR |
| `ready-for-review` | PR ready for review (manual trigger) | Review agents evaluate the PR |
| `ready-for-merge` | All reviewers unanimously approved | PR can be merged per governance policy |
| `requires-manual-review` | Reviewers disagreed or flagged security concerns | Human must decide |

Expand All @@ -68,7 +68,7 @@ When the code agent opens a PR:
- The PR description summarizes what was changed and why.
- The code agent has already run the test suite in its sandbox and iterated until tests pass.
- After pushing, GitHub's required checks run. If checks fail, the code agent fetches logs, fixes the issue, and pushes again (up to a configurable retry cap).
- Once checks are green, the PR is labeled `ready-for-review` and the review agents take over.
- Once checks are green, the review agents take over automatically (triggered by the PR creation or push event).

### Reviewing agent output

Expand Down Expand Up @@ -117,11 +117,11 @@ The code agent:
3. **Tests iteratively.** Runs the test suite, incorporates triage-provided tests if present, writes new tests if needed. Iterates until tests pass.
4. **Opens a PR.** Links the issue, describes the changes.
5. **Handles CI failures.** Fetches failing check logs, fixes issues, pushes again. Repeats until all required checks pass (up to a configurable cap, default defined in `config.yaml` as `defaults.max_implementation_retries`).
6. **Hands off to review.** Labels `ready-for-review`.
6. **Hands off to review.** The PR creation or push triggers review dispatch automatically via `pull_request_target`.

### Stage 3: Review

**Triggered by:** `ready-for-review` label, `/review` command, or push to the PR branch.
**Triggered by:** `pull_request_target` events (PR opened, push to PR branch, or marked ready for review), `/review` command, or `ready-for-review` label.

The review swarm:

Expand All @@ -141,7 +141,7 @@ Once the PR is merged (by human, merge queue, or automation per org governance),

### Stopping automation

- Remove the triggering label. Without `ready-to-code` or `ready-for-review`, the next stage won't fire.
- Remove the triggering label (`ready-to-code`) to prevent the next stage from starting. Note: review is triggered automatically by PR events (`pull_request_target`), so closing the PR is the way to stop review dispatch.
- Close the issue. Agents don't act on closed issues (except `/triage` which explicitly reopens).

### Restarting a stage
Expand Down
9 changes: 1 addition & 8 deletions internal/scaffold/fullsend-repo/scripts/post-code.sh
Original file line number Diff line number Diff line change
Expand Up @@ -161,19 +161,12 @@ git push --force-with-lease -u origin -- "${BRANCH}" 2>&1
# ---------------------------------------------------------------------------
export GH_TOKEN="${PUSH_TOKEN}"

PR_LABEL="ready-for-review"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ready-for-review label creation (gh label create) was removed here. This means the label won't be pre-created with its description and color for repos that haven't seen a code agent run before the old version. Consider ensuring the label is created during repo scaffolding/installation instead. (Deferring to a follow-up is fine.)

gh label create "${PR_LABEL}" --repo "${REPO_FULL_NAME}" \
--description "Agent PR ready for human review" --color "0E8A16" \
--force 2>/dev/null || true

EXISTING_PR_NUM="$(gh pr list --repo "${REPO_FULL_NAME}" --head "${BRANCH}" \
--json number --jq '.[0].number' 2>/dev/null || true)"

if [ -n "${EXISTING_PR_NUM}" ]; then
EXISTING_PR_URL="$(gh pr list --repo "${REPO_FULL_NAME}" --head "${BRANCH}" \
--json url --jq '.[0].url' 2>/dev/null || true)"
gh pr edit "${EXISTING_PR_NUM}" --repo "${REPO_FULL_NAME}" \
--add-label "${PR_LABEL}" 2>/dev/null || true
echo "PR #${EXISTING_PR_NUM} already exists — branch updated with new commits"
echo "PR: ${EXISTING_PR_URL}"
echo "pr_url=${EXISTING_PR_URL}" >> "${GITHUB_OUTPUT:-/dev/null}"
Expand Down Expand Up @@ -237,7 +230,7 @@ PR_URL="$(gh pr create \
--base "${TARGET_BRANCH}" \
--title "${PR_TITLE}" \
--body "${PR_BODY}" \
--label "${PR_LABEL}" 2>&1)"
2>&1)"

echo "PR created: ${PR_URL}"
echo "pr_url=${PR_URL}" >> "${GITHUB_OUTPUT:-/dev/null}"
Loading