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
2 changes: 1 addition & 1 deletion .github/agents/github-foreman.agent.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ This phase is iterative. It runs automatically and loops until Foreman judges th
2. **Wait for review completion** β€” Sleep **5 minutes** (`Start-Sleep -Seconds 300`), then poll in **2-minute** cycles (`Start-Sleep -Seconds 120`). Use `github/pull_request_read` with `method: "get_reviews"` on each PR until the Code Review Agent's review shows `status: completed` on all PRs.

3. **Collect and judge comments** β€” Use `github/pull_request_read` with `method: "get_review_comments"` on each PR. Internally bucket all comments by severity β€” this summary is for Foreman's judgment only, not presented to the human yet:
- **Blocking** β€” security issues, logic errors, incorrect behaviour
- **Blocking** β€” security issues, logic errors, incorrect behavior
- **Suggestions** β€” style, naming, refactoring opportunities
- **Informational** β€” questions, observations, minor notes

Expand Down
101 changes: 49 additions & 52 deletions .github/agents/references/foreman-workflows.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ graph TB
F["πŸ—οΈ GitHub Foreman<br/>(coordinator)"]
WR["πŸ” Wave Reviewer<br/>(subagent, read-only)"]
DW["πŸ“ Docs Writer<br/>(subagent)"]
QA["πŸ§ͺ QA Enforcer<br/>(subagent, terminal)"]
GD["βš™οΈ go-developer<br/>(existing)"]
PR_AGENT["✨ prettify<br/>(existing)"]
end
Expand All @@ -25,13 +24,14 @@ graph TB
CA1["☁️ Coding Agent<br/>Session A"]
CA2["☁️ Coding Agent<br/>Session B"]
CRA["πŸ“‹ Code Review Agent"]
CI["πŸ”§ CI<br/>(go build/vet/test)"]
end

subgraph "GitHub Repository"
IS["πŸ“‚ Issues &<br/>Milestones"]
PR1["PR #1<br/>copilot/issue-X"]
PR2["PR #2<br/>copilot/issue-Y"]
CI["copilot-instructions.md"]
INST[".github/copilot-instructions.md"]
end

%% Human interacts only with Foreman and PRs
Expand All @@ -40,40 +40,41 @@ graph TB
H -->|"approve"| PR2

%% Foreman reads issues
F -->|"MCP: list_issues,<br/>issue_read"| IS
F -->|"github/list_issues,<br/>github/issue_read"| IS

%% Foreman dispatches to cloud coding agents
F -->|"MCP: assign_copilot_to_issue<br/>(base_branch, model)"| CA1
F -->|"MCP: assign_copilot_to_issue"| CA2
F -->|"github/assign_copilot_to_issue<br/>(base_branch, model)"| CA1
F -->|"github/assign_copilot_to_issue"| CA2

%% Cloud agents create PRs
CA1 -->|"creates + pushes"| PR1
CA2 -->|"creates + pushes"| PR2

%% Cloud agents read repo instructions
CA1 -.->|"reads"| CI
CA2 -.->|"reads"| CI
CA1 -.->|"reads"| INST
CA2 -.->|"reads"| INST

%% Foreman triggers code review
F -->|"MCP: request_copilot_review"| CRA
F -->|"github/request_copilot_review"| CRA
CRA -->|"review comments"| PR1
CRA -->|"review comments"| PR2
CRA -.->|"reads review guidance"| CI
CRA -.->|"reads review guidance"| INST
Comment on lines 57 to +61
Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

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

In the interaction graph, tool labels are partially migrated to the github/* style (e.g., github/request_copilot_review), but the earlier edges still use the old MCP: prefix for list_issues/issue_read and assign_copilot_to_issue. This leaves the diagram inconsistent and contradicts the PR description’s claim that tool labels were updated where applicable; consider updating those remaining edge labels to github/list_issues, github/issue_read, and github/assign_copilot_to_issue for consistency.

This issue also appears on line 147 of the same file.

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in commit 62361a0 β€” updated the remaining MCP: edge labels to github/list_issues, github/issue_read, and github/assign_copilot_to_issue for consistency with the rest of the diagram.


%% CI runs automatically on every push
PR1 -->|"triggers"| CI
PR2 -->|"triggers"| CI
CI -->|"check results"| PR1
CI -->|"check results"| PR2

%% Foreman runs local subagents
F -->|"runSubagent"| WR
F -->|"runSubagent"| DW
F -->|"runSubagent"| QA

%% Wave Reviewer reads PRs
WR -->|"MCP: pull_request_read"| PR1
WR -->|"MCP: pull_request_read"| PR2
WR -->|"github/pull_request_read"| PR1
WR -->|"github/pull_request_read"| PR2
WR -->|"consistency report"| F

%% QA Enforcer runs tests locally
QA -->|"go test / build / vet"| QA
QA -->|"test results"| F

%% Docs Writer updates docs
DW -->|"edits README,<br/>AGENTS.md"| DW
DW -->|"doc report"| F
Expand All @@ -94,8 +95,8 @@ sequenceDiagram
participant CodingAgent as ☁️ Coding Agent (Cloud)
participant PRs as πŸ“„ Pull Requests
participant CodeReview as πŸ“‹ Code Review Agent
participant CI as πŸ”§ CI (GitHub Actions)
participant WaveReview as πŸ” Wave Reviewer
participant QA as πŸ§ͺ QA Enforcer
participant Docs as πŸ“ Docs Writer

Note over Human,Foreman: ═══ PHASE 1: PLAN ═══
Expand Down Expand Up @@ -128,56 +129,52 @@ sequenceDiagram
CodingAgent->>PRs: PR #B created (draft)
Foreman-->>Human: "All PRs are in. Starting reviews."

Note over Human,Docs: ═══ PHASE 3: REVIEW (automatic) ═══
Note over Foreman,PRs: ═══ PHASE 3: CODE REVIEW LOOP (automatic) ═══
loop Until no actionable comments remain
Foreman->>PRs: Mark PRs ready for review
Foreman->>CodeReview: Request review (fallback if ruleset doesn't trigger)
CodeReview-->>PRs: Review comments
Foreman->>Foreman: Sleep 5 min, poll until reviews complete
Foreman->>PRs: Collect + judge review comments
alt Actionable comments found
Foreman->>PRs: Post @copilot <fix description>
Foreman->>Foreman: Sleep 3 min, poll for new commits
else No actionable comments
Note over Foreman: Exit review loop β†’ Phase 4
end
end

par Automated reviews
Foreman->>CodeReview: Request review on PR #A
Foreman->>CodeReview: Request review on PR #B
Note over Foreman,CI: ═══ PHASE 4: CI GATE (automatic) ═══
CI->>PRs: go build / go vet / go test (Linux/Windows/macOS)
loop Poll every 2min until checks complete
Foreman->>PRs: github/pull_request_read (method: "get_checks")
alt All green
Note over Foreman: Proceed to Phase 5
else Any red
Foreman->>PRs: Post @copilot <failure summary + fix request>
Foreman->>Foreman: Sleep 3 min, poll for new commits
Note over Foreman: Loop back to Phase 3
end
end
CodeReview-->>PRs: Review comments

par Local subagent checks
Note over Foreman,Docs: ═══ PHASE 5: DOCS & CONSISTENCY ═══
par Post-review checks
Foreman->>WaveReview: Check cross-PR consistency
Foreman->>QA: Run go build / test / vet + CLI smoke tests
Foreman->>Docs: Verify docs are updated
end

WaveReview-->>Foreman: Consistency findings
QA-->>Foreman: Build + test + CLI results
Docs-->>Foreman: Doc completeness report

Foreman->>PRs: Collect Code Review Agent comments
PRs-->>Foreman: Review comments by severity

Note over Human,Foreman: ═══ PHASE 4: HUMAN GATE ═══
Foreman-->>Human: Wave summary:<br/>βœ… Code review: clean<br/>βœ… Cross-PR: consistent<br/>βœ… Tests: passing<br/>⚠️ README: missing 1 entry
Note over Human,Foreman: ═══ PHASE 6: HUMAN GATE ═══
Foreman-->>Human: Wave summary:<br/>βœ… Code review: clean<br/>βœ… CI: passing<br/>βœ… Cross-PR: consistent<br/>βœ… Docs: updated

Human->>Foreman: "Fix the README"
Foreman->>PRs: Post @copilot fix comment

Note over Foreman,QA: ═══ PHASE 4b: FIX LOOP (automatic) ═══
Foreman->>Foreman: Sleep 3 minutes
loop Poll every 2min for new commits
Foreman->>PRs: Check for new commits
alt New commits found
Foreman->>QA: Re-run QA Enforcer
QA-->>Foreman: Updated results
Foreman->>PRs: Re-collect review comments
else Still waiting
Foreman->>Foreman: Sleep 2 minutes
end
end
Foreman-->>Human: Fix status:<br/>βœ… Fix applied, QA passing

Note over Human,PRs: ═══ PHASE 5: MERGE ═══
Human->>Foreman: "LGTM β€” merge them"

Note over Human,PRs: ═══ PHASE 7: ADVANCE ═══
Foreman->>PRs: gh pr merge --squash --delete-branch (PR #A)
PRs-->>Foreman: βœ… Merged, branch deleted
Foreman->>PRs: gh pr merge --squash --delete-branch (PR #B)
PRs-->>Foreman: βœ… Merged, branch deleted

Note over Human,Foreman: ═══ PHASE 6: ADVANCE ═══
Human->>Foreman: "Wave complete β€” next"
Foreman->>Foreman: Update state, find next wave
Foreman-->>Human: "Next wave: issues #C, #D..."
```
Expand Down