ci(gam): install governed auto-merge (IGV-D-028) - #139
Conversation
Template sha256 c5a25074d341525ac4b3c1980eb571d8e1074e50e807f6844bad0b14508a6c2f. Inert until WAVE_AGENT_* secrets are visible and AUTONOMY_ENABLED=1. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
Skipping PR review because a bot author is detected. If you want to trigger CodeAnt AI, comment |
Reviewer's GuideAdds the public-repository GAM workflow, implementing App-controlled, fail-closed gate evaluation and head-SHA-pinned merge or merge-queue enqueue behavior with explicit audit comments and kill-switch controls. Sequence diagram for governed autonomous pull request mergesequenceDiagram
participant Event as GitHub event
participant GAM as GAM workflow
participant App as wave-av-agent App
participant GitHub as GitHub API
participant Queue as Merge queue
Event->>GAM: Trigger on label, synchronize, reopen, check_suite, or dispatch
GAM->>GAM: Read AUTONOMY_ENABLED first
alt Kill-switch disabled
GAM-->>Event: No-op
else Enabled
GAM->>GitHub: Resolve open PR and read PR facts
GAM->>App: Mint installation token
App-->>GAM: App token
GAM->>GitHub: Verify gates and required checks
alt Gate fails
GAM->>GitHub: Comment reason and optionally remove label
else All gates pass
alt Base has merge queue
GAM->>GitHub: enqueuePullRequest(expectedHeadOid)
GitHub->>Queue: Enqueue pinned head SHA
GAM->>GitHub: Comment enqueued result
else Direct merge
GAM->>GitHub: gh pr merge --merge --match-head-commit
GAM->>GitHub: Comment merged result
end
end
end
Flow diagram for fail-closed GAM gate evaluationflowchart TD
A[Workflow triggered] --> B{AUTONOMY_ENABLED == 1?}
B -- No --> C[No-op]
B -- Yes --> D[Resolve open PR]
D --> E[Mint wave-av-agent App token]
E --> F{App token available and identity verified?}
F -- No --> G[Comment deferred; merge nothing]
F -- Yes --> H[Read PR facts and branch rules]
H --> I{All objective gates pass?}
I -- No --> J[Comment reason; defer or remove label]
I -- Yes --> K{Merge queue enabled?}
K -- Yes --> L[enqueuePullRequest pinned to HEAD SHA]
K -- No --> M[Merge with --merge and --match-head-commit]
L --> N[Comment audit result]
M --> N
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
| Filename | Overview |
|---|---|
| .github/workflows/auto-merge.yml | Adds the governed auto-merge workflow and improves label attribution and reviewer counting, but the existing reviewer-identity finding remains only partially addressed. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Workflow event] --> B{Autonomy enabled?}
B -- No --> Z[No operation]
B -- Yes --> C[Resolve candidate PR]
C --> D[Mint wave-av-agent token]
D --> E[Read PR and label timeline]
E --> F{Labeler, author, base, and paths valid?}
F -- No --> R[Defer or refuse with comment]
F -- Yes --> G{Required checks and merge state valid?}
G -- No --> R
G -- Yes --> H{Threads resolved and reviewer floor met?}
H -- No --> R
H -- Yes --> I{Merge queue enabled?}
I -- Yes --> J[Enqueue at expected head SHA]
I -- No --> K[Merge with matching head commit]
Reviews (3): Last reviewed commit: "ci(gam): install public governed auto-me..." | Re-trigger Greptile
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — This PR adds a substantial GitHub Actions merge authority that can mint write-capable App tokens and autonomously land pull requests once enabled. The workflow is outside the author’s ownership domain, and an unresolved security concern remains about unbound reviewer identities, so its authorization and merge gates require human review. Not approved because:
Review your spending limits in Billing settings. You can add or adjust custom eligibility rules. Learn more. |
Template sha256 c921bfa8caee7483f5fb4ccaef3b4a5ba20b6b1ff79bfef35cfe4f281290aa97. Inert until WAVE_AGENT_* secrets are visible and AUTONOMY_ENABLED=1. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Template sha256 21ce6e77f5dee00807b4c2f8ed35278b3c7b9da9bbc0418e15ba92e5dea81062. Inert until WAVE_AGENT_* secrets are visible and AUTONOMY_ENABLED=1. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
Three heads, three Greptile rounds; every finding and what changed (IGV-D-028 template, claude-workstation):
For the merger: this PR is inert until the org secrets |
Install Governed Autonomous Merge (GAM) — public-repo edition
IGV-D-028 (claude-workstation#4825): the operator is no longer the merge gate on public repos.
This PR installs
.github/workflows/auto-merge.ymlfromgovernance/templates/public-auto-merge.yml(template sha256
c5a25074d341525a) intowave-av/sdk, opened by thewave-av-agentApp.What it does once armed
The workflow performs the merge, acting as the App, iff every objective gate passes:
autonomy:auto-mergepresent, applied by someone with write/maintain/admin (checked server-side);wave-av-agentApp (or a login in the repo variableGAM_AUTHOR_ALLOWLIST);mergeStateStatus == CLEAN, 0 unresolved review threads;GAM_MIN_REVIEWERS(default 2) distinct LLM reviewers finished non-failing on the head SHA.On a merge-queue-governed base it ENQUEUES via GraphQL pinned to the head SHA; otherwise it merges
with
--merge --match-head-commit. Never--squash, never--admin, never a checkout of PR-head code.Every failed gate leaves a comment saying why; nothing is silent.
Inert until enabled (fail-closed)
WAVE_AGENT_APP_ID+WAVE_AGENT_PRIVATE_KEYvisible to this repo (org-level, public visibility).AUTONOMY_ENABLED=1— the kill-switch, read first at the job level.0disarms instantly.Until both hold the workflow bills zero minutes and merges nothing.
Why this PR is merged by a person
A workflow cannot merge the PR that creates it. This install PR is one of the last operator merges
on this repo; every later PR authored by the App and labelled
autonomy:auto-mergelands through theworkflow. Design, measurements and receipts:
governance/docs/IGV-D-028-public-merge-path.mdin claude-workstation.
🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by Sourcery
Install the fail-closed Governed Autonomous Merge workflow for public-repository pull requests.
New Features:
Enhancements:
CI: