Skip to content

review-gate: a misspelt verdict token ("Verdict: Incorrect at …") is invisible, so the PASS it meant to veto still merges #1239

Closed

Description

@Birfy

Owner: 待派(Lead 定)

Verdict: 后面的词只认四个(PASS / FAIL / INC / REQUEST_CHANGES)。拼错一个字母,整条结论不是被拒,而是根本不存在——闸看不见它。这跟「被拒」是两回事:被拒至少会留下理由,也会压过更早的 PASS;不存在则让更早的 PASS 活下来。

真发生过的

PR #1221 的 tip 2bebc668:Reviewer 在一条更早的 Verdict: PASS at 2bebc668… 之后写了 Verdict: Incorrect at 2bebc668…,想撤回。闸照常报 PASS。

链路(main 上的 .github/scripts/review-gate.mjs,b486 之后未变):

  • parseReport 首行判据 :104 的 (PASS|INC|REQUEST_CHANGES|FAIL) 与循环里 :129 的同一组交替,\b 让 Incorrect 一个都匹配不上(INC 后面紧跟 o,不是词边界)→ out.tip 与 out.verdict 都留在 null;
  • decide :301:if (!parsed.tip && !parsed.verdict) continue // not a Verifier report → 这条评论既没进 judged,也没进 atTip;
  • 于是"这个 tip 上最新的结论"仍是那条 PASS。

注意这和 #643 不是同一件事(那条是正文里引用的旧 PASS 盖掉首行 INC,已经修了);这次正文里只有一条结论,只是词拼错了。

期望行为(fail closed,但不许把普通评论变成阻断)

  1. 认不出的 token 算"这个 tip 上有一条读不懂的结论":进 judged,按 #676 的口径进 atTip(counts = false),why 里点名它、并列出四个合法值。它比之前的 PASS 新 → 压过那条 PASS,合并被拒,理由写清「Incorrect 不是结论词,四个是 PASS/FAIL/INC/REQUEST_CHANGES」。
  2. 带 tip 才进 atTip:Verdict: banana 但没有 at <sha> 的闲聊评论仍按普通评论处理——不能让任何人往别人 PR 上贴一句怪话就把合并卡住。
  3. 既有过滤一条不动:association(OWNER/MEMBER/COLLABORATOR)、bot 账号、selfReview、签名验证的门槛照旧;未知 token 只是让本来会是结论的东西可被看见,不是开一条新通道。
  4. 报告里看得见:render 的 "Verifier reports read" 里该条带原因;再加一句合法 token 列表,替下一个人省掉这次排查。

改动范围

  • .github/scripts/review-gate.mjs:parseReport 增 unknownVerdict(首行与循环两处都要,别只改 :129);decide 在 association 判断之后、Written-by 检查之前接进 atTip;render 打印原因 + 合法 token。
  • .github/scripts/review-gate.test.mjs:四个用例——①未知 token 压过同 tip 的旧 PASS(红→绿的核心);②单独一条未知 token、无旧 PASS → 仍拒;③未知 token 无 tip → 不算结论、不影响旧 PASS;④合法 Verdict: PASS 行为不变。
  • docs/autonomous-dev.md:一句话说明"四个词之外一律读不懂、闸会明说"。
  • 只动这三处;merge-gate.mjs、enqueue-rules.mjs、review-policy.json 不碰。

刀(必做)

去掉 unknownVerdict 捕获后,用例①必须变红(复核:现在它在 main 上就是绿的假象——同样的输入闸报 PASS)。

不做

  • 不新增 token(不加 INCORRECT、REJECT 之类的别名,别名会让"到底认几个词"变成猜谜);
  • 不把本单扩成"评论语法 lint",也不去扫历史评论补判;
  • 不为这条改动放宽任何既有判定阈值。

Activity

  1. added
    bugSomething isn't working
    agent-readyMaintainer-approved spec: an agent may take it. Only maintainers set this; never in a template
    area:automationScheduled tasks and automation
    on Oct 26, 2026
  2. Birfy commented on Oct 26, 2026

    @Birfy
    CollaboratorAuthor

    Triage(2026-10-26):查重完成 → 不重复,agent-ready,Owner 待派。

    • #643(已关)是最像的一条,但成因不同:那条是正文里引用的旧 PASS 盖掉首行 INC,修的是"读哪个块";本单正文只有一条结论,坏在词不认识。两条都得修,不能当成已修。
    • #676 是本单要复用的规则("无效的 INC 仍然是有人说别合"),本单只是把"拼错的词"也纳入同一句口径——不是新规矩。
    • #1221 不被本单阻塞:那张 PR 现在缺的是 Reviewer 补一条 Correction from …: Verdict: INC at 2bebc668…,与本单解耦,别混在同一个 PR 里改。
    • 标签 bug + area:automation;risk:T* 只由控制器写,不手写。.github/scripts/** 是闸本身,改动要有"撤掉后用例变红"的刀,认领评论里带分支名。

    计数:agent-ready 共 9 张,其中 #1227/#1220 已有 PR、#796 是总账 → 「agent-ready 且无 PR」= 7(#796、#1222、#1224、#1233、#1235、#1237、#1239)。

  3. Birfy commented on Oct 26, 2026

    @Birfy
    CollaboratorAuthor

    Written-by: Dev3

    Claimed #1239 — branch dev3/fix/1239-unknown-verdict, first step: give parseReport the unreadable Verdict: word on both reads (the first line and the block loop), keep the tip it names, and let it join atTip with a reason that names the word.

    PR #1242: tip 4dbbbc07e8d1a9d842794e51726ece87f517b5b6, three files (+106/−8), base the live main 00bd3820. Knife: delete the capture and 2 of 57 cases go red (not ok 12, not ok 13); restored, 57 pass, and the three gate suites are 185 pass / 0 fail.

  4. added
    agent-workingAn agent has claimed this issue (the claim comment names the branch)
    on Oct 26, 2026
  5. self-assigned this
    on Oct 26, 2026
  6. removed
    agent-readyMaintainer-approved spec: an agent may take it. Only maintainers set this; never in a template
    agent-workingAn agent has claimed this issue (the claim comment names the branch)
    on Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:automationScheduled tasks and automationbugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions