Skip to content

feat(gate): agent 分支 PR 须 agent-approved label 才放行——draft 口头约定升级为机制 - #189

Merged
2233admin merged 1 commit into
mainfrom
fix/agent-merge-gate
Aug 4, 2026
Merged

feat(gate): agent 分支 PR 须 agent-approved label 才放行——draft 口头约定升级为机制#189
2233admin merged 1 commit into
mainfrom
fix/agent-merge-gate

Conversation

@2233admin

Copy link
Copy Markdown
Owner

干什么

pr-gate.yml 新增 agent-gate job:head 分支匹配 grok/** / agent/** / codex/** 的 PR,必须带 agent-approved label(人点的)检查才绿;非 agent 分支直接通过。label 已建(agent-approved,绿色)。

为什么

#174 试点(PR #187)确认:本仓合并惯例是「绿灯即合」,而 agent PR 不误合的唯一防线是「记得开 draft」——口头约定,零机制。编排放量后这是必然事故点。本 job 把人审动作物化成 label,配合 branch protection required check(本 PR 合并后由维护者启用)形成真闸。

配套(合并后一步)

branch protection on main:required checks = change-risk + agent-gate + ci.yml 四个 job,enforce_admins 开。ci.yml pull_request 无 path 过滤,所有 PR 都会产生这些 check,不会有 docs-only PR 卡死问题。

验证

Refs #184

@gemini-code-assist

Copy link
Copy Markdown

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@repowise-bot

repowise-bot Bot commented Aug 4, 2026

Copy link
Copy Markdown

🔒 Repowise is not analyzing this repository

The PR bot is free on public repositories. This one is private, which needs a Pro plan.

See plans · Manage this repository

@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 941cacb5-6547-4560-8632-2a68122e6154

📥 Commits

Reviewing files that changed from the base of the PR and between 9f21592 and c37fb30.

📒 Files selected for processing (1)
  • .github/workflows/pr-gate.yml

📝 Walkthrough

Summary by CodeRabbit

  • Chores
    • Updated pull request validation for automated development branches.
    • Pull requests from designated agent branches now require an agent-approved label to pass checks.
    • Pull requests from other branches continue through validation without this additional requirement.

Walkthrough

The pull request workflow adds an agent-gate job. It requires the agent-approved label for pull requests from grok/*, agent/*, or codex/* branches. Other branches skip this check.

Changes

Agent branch gating

Layer / File(s) Summary
Agent approval workflow check
.github/workflows/pr-gate.yml
The agent-gate job skips non-agent branches, checks pull request labels for agent-approved, and fails agent branches when the label is absent.

Estimated code review effort: 2 (Simple) | ~10 minutes

Poem

A rabbit checks the branch at night,
“agent-approved” must shine bright.
Agent paths wait; other paths go,
Labels make the workflow flow.
Hop, hop, the gate says yes!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the new agent branch label gate and identifies the required agent-approved label.
Description check ✅ Passed The description explains the agent-gate behavior, purpose, trigger events, verification limits, and planned branch protection configuration.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown

Code Intel change risk

Score Percentile Level
12/100 4th (vs last 49 commits) 🟢 low

Top signals

  • Diff shape: 1 file(s), +30/-0 (max file share 1.0)
  • Test asymmetry: source changed, tests touched
  • Bug-magnet: 0 fix commit(s) in touched files (180d)
  • Churn: 1 commit(s) touching these files (90d)

revspec: origin/main..HEAD · threshold: percentile >= 90 blocks unless labeled risk-accepted · code-intel change risk

@2233admin
2233admin merged commit d469861 into main Aug 4, 2026
8 checks passed
@2233admin
2233admin deleted the fix/agent-merge-gate branch August 4, 2026 17:57
@2233admin 2233admin mentioned this pull request Aug 5, 2026
2233admin added a commit that referenced this pull request Aug 5, 2026
版本位五处同步(Cargo.toml、Cargo.lock、cli-head-parity 夹具的 old+new 两份 stdout、
toolchain-versions.v1.json 的 declaredIn 绑定),和 v0.7.0-beta.5 (#164) 完全同一组文件。

CHANGELOG 补上一批漏账:beta.5 之后的 13 个 commit 里只有 4 个进过 `[Unreleased]`。
本次补写 6 条正文条目(锚点验证闸 #151、扫描面具名排除闸门 #152、文档语言首选项 #155、
测试不对称信号认 tests.rs 约定 #170、sentrux shim lite 门与权威 baseline 分居 #182、
测试临时目录按进程归属 #175)与 3 条 Notes(#179 变异测试补测、#189 agent-approved
label 门、#156 OpenSpec 记录核实),`[Unreleased]` 收敛为 `[0.7.0-beta.6] — 2026-08-05`。
漏账本身是 #174 想解的那条单行道税的现症,不是本次新引入的。

发布前证据(本机,非 CI):

- `cargo test -p code-intel --locked`:3432 passed / 0 failed,55 个测试二进制。
  首轮 `-j` 默认并行撞本机 `rustc-LLVM ERROR: out of memory`(宿主 commit 贴顶,
  与 #123 bug 1 同因),`-j 2` 复跑全绿——是环境限制不是代码红灯。
- `cli_head_parity` 3/3、`toolchain_versions` 5/5:版本绑定判据全绿。
- `tests/test_repository_layout.py` 5/5、`tests/test_skill_package.py` 18/18。
- 权威 self-scan(release 构建,`run execute --doctor-require-repowise false`):
  exitCode 0,9 个节点全 pass,anchors 4596 verified / 0 approximate / 0 dropped,
  `failures.process` 与 `failures.domain` 皆空。

不含任何行为变更:本次 diff 只有版本字符串与 CHANGELOG。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant