feat: expert review loop — replace self-review with full adversarial review + fix loop#785
Conversation
…gs workflow
Three changes:
1. Rename review.agent.md → expert-review.md to avoid dots in
tool names (CAPI rejects dots in ^[a-zA-Z0-9_-]{1,128}$).
2. Update agent-fix to dispatch expert-review instead of doing a
lightweight self-review. The full 3-model adversarial review
now runs on every agent-fix PR.
3. Add fix-review-findings.md workflow — reads expert review findings,
fixes them, runs tests, and re-dispatches expert-review. Loops
up to 3 rounds until zero issues are found.
Flow: agent-fix creates PR → dispatches expert-review → expert-review
posts findings → fix-review-findings reads findings, pushes fixes,
re-dispatches expert-review → repeat until clean.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Expert Code Review — PR #785Methodology: 3 independent reviewers with adversarial consensus, plus targeted follow-up verification for disputed findings. Findings
Discarded Findings (1/3 — failed consensus, not in top-3 for follow-up)
CI Status
Test Coverage AssessmentThis PR modifies only gh-aw workflow files ( SummaryThe rename from
|
There was a problem hiding this comment.
🔴 3 critical findings posted inline. See full review summary in the comment below.
Generated by Expert Code Review (auto) for issue #785 · ● 18.1M
| roles: [admin, maintainer, write] | ||
|
|
||
| permissions: | ||
| contents: read |
There was a problem hiding this comment.
🔴 CRITICAL — contents: read prevents git push (3/3 reviewers)
Steps 3–5 instruct the agent to edit files, commit, and git push to the PR branch. But permissions only grant contents: read. The compiled lock file confirms this on the agent job. Without contents: write, every git push fails with HTTP 403 — the entire fix-and-push workflow is non-functional.
Fix: Change to contents: write. If CI triggering is needed, also add github-token-for-extra-empty-commit: with a PAT/App token (per gh-aw guidelines, GITHUB_TOKEN pushes don't trigger CI).
| description: "Reads expert review findings on a PR, fixes them, runs tests, and re-dispatches the expert review. Loops until zero issues." | ||
|
|
||
| on: | ||
| workflow_dispatch: |
There was a problem hiding this comment.
🔴 CRITICAL — No PR checkout for workflow_dispatch (3/3 reviewers after follow-up)
The compiled lock file's checkout-pr step has if: github.event.pull_request || github.event.issue.pull_request — neither is true for workflow_dispatch. The agent operates on the default branch (main) instead of the PR's head branch. Fixes would land on the wrong branch or fail entirely.
Compare with review-on-open.agent.lock.yml which adds a separate "Checkout target PR (for workflow_dispatch)" step using Checkout-GhAwPr.ps1.
Fix: Add a pre-agent-steps: block to the frontmatter (or an explicit checkout step in the agent instructions) that runs Checkout-GhAwPr.ps1 when github.event_name == 'workflow_dispatch', then recompile.
| @@ -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. | |||
There was a problem hiding this comment.
🔴 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 noop — no 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.
Summary
Replaces the lightweight self-review in agent-fix with the full expert review pipeline, and adds an automated fix loop.
Changes
Rename
review.agent.md→expert-review.md— removes dots from the workflow name, fixing the CAPI 400 tool name validation errorUpdate agent-fix — drops the inline 3-sub-agent self-review (Steps 6-7), replaces with dispatching
expert-reviewalongside CI workflowsNew
fix-review-findings.mdworkflow — reads expert review findings on a PR, fixes each one, runs tests, and re-dispatches expert-review. Loops up to 3 rounds until zero issues found.Flow
graph LR A[agent-fix] -->|creates PR| B[expert-review] B -->|posts findings| C[fix-review-findings] C -->|pushes fixes| B C -->|round 3 or zero findings| D[Done ✅] A -->|dispatches| E[verify-build] A -->|dispatches| F[integration-tests]