chore(ci): add hardened trusted-bot auto-merge tier#7
Merged
Conversation
Re-introduces ai-agent-auto-merge as Tier 2, but with a trust model qualitatively different from the version dropped in #6: - Keys off `pull_request.user.login` (immutable original author) instead of `github.actor` (whoever triggered the workflow run, spoofable on re-runs). - Requires bot identity AND branch prefix AND not-draft. A human pushing a branch named `claude/foo` from their own account no longer satisfies the condition because they aren't `claude-code[bot]`. - App token threaded through the same approval/merge sequence the other tiers use; no GITHUB_TOKEN identity for the merge action. This is the "trusted-bot fast lane" referenced in qyl#186 — established bot identities with verified intent get an auto-approve + auto-merge, which is necessary while CodeRabbit isn't installed on every framework repo and the per-PR claude-review action is unreliable. Once those gaps close, this tier can be dropped again in favor of pure reviewer-driven merges. Tier numbering: dependabot stays 1a, renovate stays 1b, trusted-bot is the new Tier 2, CodeRabbit becomes Tier 3, Owner becomes Tier 4. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Re-introduces
ai-agent-auto-mergeas Tier 2 in the reusable workflow, but with a trust model qualitatively different from the version dropped in #6.Why
The original lane used
github.actor+ branch prefix. A human pushing a branch namedclaude/foofrom their own account satisfied that condition — that's why dropping it was the right call at the time.The version this PR adds requires all three of:
pull_request.user.loginmatches a known bot identity (copilot[bot],jules[bot], orclaude-code[bot]) — immutable original author, not spoofable on re-runscopilot/,jules/,claude/) — intent signalThat's a trusted-bot pattern (same trust shape as Tier 1a/1b for Dependabot/Renovate), not a rubber-stamp.
Why now (and why not later)
coderabbit-auto-merge(Tier 3) and per-PRclaude-reviewactions are the proper independent-reviewer approach. But today:ANcpLua.NET.Sdk,Roslyn.Utilities,Analyzers,Agentsclaude-reviewaction class (also affecting/ultrareview)So agent-authored fix PRs would currently sit forever waiting for a review that never lands. This trusted-bot tier provides a pragmatic fast lane while those gaps close.
When CodeRabbit is everywhere AND the Anthropic action is reliable, this tier can be dropped again — it's intentionally additive, not load-bearing for any other tier.
Diff shape
Coordinated PRs
This unblocks four thin-caller drafts that consume the reusable:
And qyl#186 which converts qyl from standalone to thin-caller (drops its own ai-agent block now that the reusable carries the hardened version).
Test plan
claude/*branch authored by a non-bot user, confirm Tier 2 does NOT matchclaude-code[bot]-authoredclaude/*PR matches Tier 2 and auto-merges