From 1c2162310950dc648025be7824c50fb522daa99e Mon Sep 17 00:00:00 2001 From: fullsend-code Date: Thu, 23 Apr 2026 20:44:42 +0000 Subject: [PATCH 1/2] fix: remove ready-for-review label from post-code.sh MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The code agent's PR creation flow fired two events that both matched dispatch-review: pull_request_target:opened from gh pr create, and issues:labeled from the subsequent gh pr edit --add-label. This caused a redundant workflow dispatch that wasted compute and a GitHub App token. Remove the ready-for-review label addition from post-code.sh entirely: - Remove PR_LABEL variable and gh label create call - Remove gh pr edit --add-label for existing PRs - Remove --label flag from gh pr create for new PRs The pull_request_target:opened event already triggers dispatch-review for automated PR creation. The ready-for-review label remains available for manual /review triggers by humans. Note: make lint could not run (pre-commit network error in sandbox). Go tests could not run (go not available in sandbox). The change is a shell script deletion only — no Go code was modified. Closes #391 --- internal/scaffold/fullsend-repo/scripts/post-code.sh | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/internal/scaffold/fullsend-repo/scripts/post-code.sh b/internal/scaffold/fullsend-repo/scripts/post-code.sh index 7c470fc5d7..a8a4e99825 100755 --- a/internal/scaffold/fullsend-repo/scripts/post-code.sh +++ b/internal/scaffold/fullsend-repo/scripts/post-code.sh @@ -161,19 +161,12 @@ git push --force-with-lease -u origin -- "${BRANCH}" 2>&1 # --------------------------------------------------------------------------- export GH_TOKEN="${PUSH_TOKEN}" -PR_LABEL="ready-for-review" -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}" @@ -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}" From e9a2c64423ba275f14ab93f592e29d0166f59605 Mon Sep 17 00:00:00 2001 From: Ralph Bean Date: Thu, 30 Apr 2026 12:54:41 -0400 Subject: [PATCH 2/2] docs: update references to reflect pull_request_target-based review dispatch The code agent no longer applies the ready-for-review label. Review dispatch is now triggered by pull_request_target events (PR opened, synchronize, ready_for_review) rather than explicit labeling. Update bugfix-workflow.md, ADR 0002, and architecture.md to reflect this. Co-Authored-By: Claude Opus 4.6 --- docs/ADRs/0002-initial-fullsend-design.md | 10 +++++----- docs/architecture.md | 2 +- docs/guides/user/bugfix-workflow.md | 16 ++++++++-------- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/docs/ADRs/0002-initial-fullsend-design.md b/docs/ADRs/0002-initial-fullsend-design.md index 4b90f43a5a..9b4225931b 100644 --- a/docs/ADRs/0002-initial-fullsend-design.md +++ b/docs/ADRs/0002-initial-fullsend-design.md @@ -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.) diff --git a/docs/architecture.md b/docs/architecture.md index 91226ba424..600ca84a93 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -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 diff --git a/docs/guides/user/bugfix-workflow.md b/docs/guides/user/bugfix-workflow.md index eeecf77b4c..9421cc9138 100644 --- a/docs/guides/user/bugfix-workflow.md +++ b/docs/guides/user/bugfix-workflow.md @@ -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 @@ -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 | @@ -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 @@ -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: @@ -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