Repository navigation
Backlog
Labels
agent-readyMaintainer-approved spec: an agent may take it. Only maintainers set this; never in a templateagent-taskWritten with the agent-task form; not approval for agents (that is agent-ready)agent-workingAn agent has claimed this issue (the claim comment names the branch)
Description
切片
把「这个 PR 能不能合」从人的记忆变成脚本判断:新增 .github/scripts/merge-gate.mjs,对任一 PR 输出四道门的 pass/fail 与退出码,供「谁负责合入」这件事有据可依。
输入
- 只读 GitHub REST:
/pulls/{n}、/commits/{head}/check-runs、/issues/{n}/comments、/issues/{n}(labels)。 - check 名单以常量写在脚本里,不动态读 workflow 文件。
产出
.github/scripts/merge-gate.mjs、.github/scripts/merge-gate.test.mjs(pure node,无第三方依赖,风格对齐risk-gate.mjs)。- CLI:
node .github/scripts/merge-gate.mjs --pr <N> [--json] [--self-test]。
四道门(任一条 fail → exit 1)
- head 与状态:
state=open、draft=false、mergeable=true、base 为 main;打印 40 位 head sha。 - 检查全绿且同 head:名单内 check 全部
completed|success;必须存在名字恰为FlyBot required checks的汇总门;in_progress / failure / cancelled / 缺失一律 fail 并列出缺哪几个。名单 =tests.yml现有 7 个 suite job + 汇总门,一字不改。 - 两份证据且都绑当前 head:PR 评论里同时存在 ①含当前 40 位 head sha 且含字面量
本证据不构成验收通过的 QA 证据;②含当前 head sha 且含字面量Lead 评审记录的评审。head 一变两份自动失效。 - 风险闸:无
risk:T*→ fail;risk:T3→ 额外要求risk-approved:t3标签,否则 fail 并打印「需人工批准」;risk:T0/T1过;risk:T2过但标needs user ok(脚本只报,不做该判断)。
验收标准
--self-test用内置 fixture(无网络)覆盖四组:全绿通过 / 缺汇总门 / QA 证据绑旧 head / T3 无批准;node --test .github/scripts/merge-gate.test.mjs本地绿。- 对真实 PR track: fail the run when the upstream suite or container smoke did not pass #3400、docs: DEV_PIPELINE state machine + UI surface map #3398、Add silent-revert and audit-merges report-only gates #3397 各跑一次
--pr(只读),三次输出原文与 exit code 贴回,供评审比对。 - 不改
tests.yml,不改任何 check 名,不动 vendor 树runtime/ds-bot-upstream/**。
涉及目录
.github/scripts/(新增两文件);不涉及其他目录。
风险
按 .github/agent/risk-rules.json,.github/** 命中 T3 paths,本切片预计判 T3,需人工批准。该规则是否该放宽(.github/scripts/** 降到 T2)是第 5 阶段的独立裁决,不在本切片内改。
纪律
- 分支
dev/3401-merge-gate,从 main 拉。 - 只用
Related #N/Refs #N,禁止 Fixes / Closes / Resolves。 - 结论绑 exact head SHA;本地绿与 CI 绿分开报;不声称 parity 或验收通过。
Related #3393
Metadata
Metadata
Assignees
Labels
agent-readyMaintainer-approved spec: an agent may take it. Only maintainers set this; never in a templateagent-taskWritten with the agent-task form; not approval for agents (that is agent-ready)agent-workingAn agent has claimed this issue (the claim comment names the branch)
Activity
Birfy commentedon Nov 26, 2026
认领(单一写人:FlyBot Lead;开发:Runtime Dev)
dev/3401-merge-gate,从main 34a80ca5a1acf9d7da821664002fa1e9dba2b215拉。Related #3393;只新增.github/scripts/merge-gate.mjs+merge-gate.test.mjs,不动tests.yml/ check 名 / vendor 树。risk:T3(.github/**命中 T3 paths),由risk-gate.mjs --pr在 PR 开出后打出,不手打;T3 需人工批准。Related #3393