Skip to content
This repository was archived by the owner on May 24, 2026. It is now read-only.
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
53 changes: 38 additions & 15 deletions .github/workflows/agent-fix.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

58 changes: 18 additions & 40 deletions .github/workflows/agent-fix.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ safe-outputs:
max: 3
target: "*"
dispatch-workflow:
workflows: [polypilot-integration, verify-build]
workflows: [polypilot-integration, verify-build, expert-review]
max: 3

timeout-minutes: 90
Expand All @@ -65,9 +65,8 @@ You are an autonomous agent that takes a GitHub issue and delivers a fully teste
3. **Implement the fix** — make targeted changes
4. **Run tests** — verify nothing is broken
5. **Create a PR** — with the fix and test coverage
6. **Self-review** — do a multi-model adversarial review of your own changes
7. **Fix review findings** — iterate until clean
8. **Run integration tests** — dispatch end-to-end verification
6. **Dispatch expert review + CI** — 3-model adversarial review + cross-platform builds + integration tests
7. **Post summary** — comment on the issue with results

## Step 0: Triage the Issue (Go/No-Go Gate)

Expand Down Expand Up @@ -169,42 +168,20 @@ Then create the PR via `create_pull_request` with:
- Title: `fix: <description> (fixes #${{ github.event.issue.number || inputs.issue_number }})`
- Body: description of what was changed and why, linking to the issue

## Step 6: Self-Review
## Step 6: Dispatch Expert Review and Integration Tests

Launch 3 parallel sub-agents to review your own changes:

```
task(agent_type: "general-purpose", model: "claude-opus-4.6", mode: "background",
description: "Reviewer 1", prompt: "<diff + review instructions>")
task(agent_type: "general-purpose", model: "claude-sonnet-4.6", mode: "background",
description: "Reviewer 2", prompt: "<same>")
task(agent_type: "general-purpose", model: "gpt-5.3-codex", mode: "background",
description: "Reviewer 3", prompt: "<same>")
```

Each reviewer should check for: regressions, security issues, bugs, race conditions, missing edge cases. Wait for all 3 to complete.

Apply adversarial consensus:
- 3/3 agree → include finding
- 2/3 agree → include
- 1/3 only → discard

## Step 7: Fix Review Findings

For each finding from the self-review:
1. Make the fix
2. Run tests again
3. Commit with descriptive message

Repeat Steps 6-7 up to **3 times** (max 3 review rounds).

## Step 8: Dispatch Integration Tests

After all fixes are committed, dispatch the integration test workflows.
After all fixes are committed, dispatch the expert code review and integration test workflows.

**Important:** Use the exact branch name from the PR. If you named your branch `fix/issue-N`, the safe-outputs job will use that name without modification (because `preserve-branch-name: true` is set). If you're unsure, use `get_pull_request` to read the PR and get the `headRefName` field.

```
dispatch_workflow({
"workflow": "expert-review",
"inputs": {
"pr_number": "<PR number>"
}
})

dispatch_workflow({
"workflow": "verify-build",
"inputs": {
Expand All @@ -223,21 +200,22 @@ dispatch_workflow({
})
```

## Step 9: Post Summary
The expert review runs a 3-model adversarial code review (Opus + Sonnet + GPT) on the PR and posts findings as review comments. If it finds issues, the **fix-review-findings** workflow will automatically pick them up, push fixes, and re-dispatch the expert review — looping until zero issues are found.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔴 CRITICAL — Broken loop: no automated trigger from expert-review to fix-review-findings (3/3 reviewers)

This line claims "the fix-review-findings workflow will automatically pick them up", but there is no automated trigger path. expert-review's safe-outputs (defined in shared/review-shared.md) include only add-comment, create-pull-request-review-comment, submit-pull-request-review, and noopno dispatch-workflow. Meanwhile, fix-review-findings only triggers on workflow_dispatch. The loop in the flow diagram (expert-review → fix-review-findings → expert-review) is completely unwired.

Fix: Either (a) add dispatch-workflow: { workflows: [fix-review-findings], max: 1 } to shared/review-shared.md's safe-outputs and recompile, or (b) reword this to clarify manual dispatch is required.


## Step 7: Post Summary

Post an `add_comment` on issue #${{ github.event.issue.number || inputs.issue_number }} with:
- What was changed and why
- Link to the PR
- Test results (unit tests passed/failed count)
- Review summary (findings found and fixed)
- Integration test dispatch status
- Expert review dispatch status
- **For visual changes:** note that screenshots are available in the integration test CI artifacts (link to the workflow run)

## Rules

1. **Fix only the reported issue.** Don't fix unrelated problems.
2. **Always run tests** before creating the PR.
3. **Never modify `.github/` files** — protected-files will reject it.
4. **Max 3 review rounds.** After 3 rounds, post remaining findings as PR comments.
5. **Never force-push.** Only add commits on top.
6. **One commit per logical change.** Keep git history clean.
4. **Never force-push.** Only add commits on top.
5. **One commit per logical change.** Keep git history clean.
Loading
Loading