Skip to content

gate: 只认 User 账号写的结论;correction 的散文与代码不一致,且缺一条「撤回写在 PASS 之前」的用例 #1344

Closed

Description

@Birfy

来源:#1340 的判审 comment 6434157633(Verdict: PASS at dfa2a5fa…,Written-by: Reviewer,2026-10-27T05:00:16Z)。第 1–6 条是判词的非阻断发现,第 7 条是 Chief 追加的行为要求。#1340 已并入 main(merge 8d0a99c1,05:05:06Z),为一个 commit 作废那条 PASS 不划算,所以不在 #1340 上补,单开本单跟进。

锚点:main ad8c51339c5ec24d359494b6a5142ddf3044fb84(#1341 合入后),行号与判词里的 docs/autonomous-dev.md:162/:165、AGENTS.md:199 一致。

更正(Triage 05:21Z 逐行核过,见评论 6434443565):第 7 条的原始设想偏大——review-gate.mjs 已经在挡 bot 评论,真正缺的只有两处,见下。本段是本节当前有效的口径。

Owner: Dev
Written-by: Triage(第 7 条由实现 Lead 追加并更正)

1. docs/autonomous-dev.md:165 —「name another tip 就不碰本 tip」只在 change set 不同时成立

现在:a correction that names another tip does not touch this one

问题:#1317 的 carried PASS 会连它自己的撤回一起被搬过来。判者手驱过:PASS at 175328d0…(carried)+ Correction … the PASS at 175328d0… is withdrawn,change set 相同 → 头被判拒,而这是对的(那正是这个头所依赖的 PASS)。

改成:names another tip whose change set differs。

2. :162 — 要写 "counted"

现在:It counts only when <Bot> is the Written-by: of the PASS it withdraws or a reviewers login

代码要求的是本 tip counted 的 PASS(passWriters 过滤 e.counts),所以一条被判无效的 PASS 的 writer 不能拿它当撤回许可。补 counted。

3. :165 — 读的是「首个非空行」,不是「首行」

现在:a correction quoted below a blank line is a quote

代码:正文以空行开头、撤回首行紧随其后,仍算撤回。改成 not the first non-empty line。

(同段 :159-160 的 as the body's first line 一并对齐成「首个非空行」。)

4. AGENTS.md:199(merge-gate rule 4)— 撤回现在也能拒,这句没写

现在只列 take the newest text that carries Verdict: or a ## Review — heading 为决定合并的东西,而撤回(Correction from <Bot>:)现在也能拒一次合并。补一句。

5. 记录(不在本单改)— #1340 正文的用例数是 11,不是 10

正文 Verification 写 10 cases: 7 in review-gate.test.mjs, 3 end-to-end in enqueue-guard.test.mjs;实际 review-gate.test.mjs 58 → 66(8 条新)+ enqueue-guard.test.mjs 3 条 = 11(总 540/540 是对的)。不要去编辑 #1340 正文:已判 PASS 的 PR 正文不动。这里只留档。

6. 补一条用例:撤回列在它撤回的那条 PASS 之前

身份判定放在循环之后,理由正是「PASS 可能排在撤回之后」,但现在只有判者手工驱过一次(the PASS at a4d506… was withdrawn by Reviewer),没有用例钉住。

补一条:撤回写在它所撤回的 PASS 之前(时间更早 / 列表更靠前)→ 仍必须拒。去掉「顺序无关」的处理(改成要求 PASS 必须先出现)时,这条必须变红。

7. 结论作者限 User 账号:只剩两处(本单唯一的行为改动)

实现现状(Triage 逐行核,不是猜):

  • review-gate.mjs:315-316 的 isBotAccount() 已在挡;:400-406 挡 type: 'Bot' 与 [bot] 后缀;:431-434 挡 association: 'NONE';
  • 已有用例:review-gate.test.mjs:763/:773/:781、enqueue-guard.test.mjs:505;
  • 实测:#1328@ac038e55 的 enqueue-guard 摘要(05:08:17Z)自带 comment by cursor[bot]: written by a bot account (account type Bot), so it is not a conclusion —— 那条冒名 REQUEST_CHANGES(6434353287)已经被挡掉,没有被读成结论。

所以只做两处:

  1. type 缺失时 fail-open:今天 API 缺字段的评论会进候选集。收紧成「只有 type === 'User' 才算结论」,并给 review-gate.test.mjs 的 comment() 等夹具补 type: 'User'(夹具因此会红一次,属预期的一次性改动,正文写清是夹具变化,不是行为放宽)。
  2. 非结论漏进 refusal reason:#1328 摘要前半句就是它,读起来像「bot 评论把合并拒了」。期望:单独喂一条 bot PASS 时,拒词必须是 no Verifier report names the tip <sha>;bot 评论只作为报告里的备注,不进 refusal 的因果句。

刀(第四把):喂一条 user.type: "Bot" 的 Verdict: PASS → 断言它不算结论,且 reason 正是 no Verifier report names the tip <sha>;把第 2 处(reason 因果)的处理去掉,这条必须红。

不能破坏:现有 540 例继续全绿(夹具补 type 之后);尤其 #1335 的撤回组与 #1317 的 carried PASS 组;pass-label.yml 不动。

Scope

  • .github/scripts/review-gate.mjs(仅第 7 条的两处)
  • docs/autonomous-dev.md(:159-167 这一段)
  • AGENTS.md(merge-gate rule 4,:199)
  • .github/scripts/review-gate.test.mjs(第 6 条用例、第 7 条的刀与夹具;必要时 enqueue-guard.test.mjs)

不碰 core/、patches/、pass-label.yml;不需要 generate。第 1–6 条只动散文与用例(门禁行为零改动),第 7 条是唯一行为改动。

Acceptance

  • 四处散文与代码一致:whose change set differs、counted、not the first non-empty line(含 :159-160 同一句)、AGENTS.md:199 补上「撤回可拒」。
  • 第 1–6 条门禁行为零改动;除 review-gate.mjs 第 7 条的两处外,PR diff 不出现 enqueue-guard.mjs / merge-gate.mjs 的改动。
  • 第 6 条:新用例「撤回列在它所撤回的 PASS 之前 → 拒」,去掉「顺序无关」处理必须变红。
  • 第 7 条:只有 type === 'User' 的评论能成为结论(缺字段 = 不是结论);bot PASS 的拒词是 no Verifier report names the tip <sha>;第四把刀见上。
  • node --test .github/scripts/review-gate.test.mjs .github/scripts/enqueue-guard.test.mjs 全绿;testing-layers --check 与 changelog 检查照常。
  • 散文改动不要求测试变红——散文部分写 no test change;第 6、7 条各有一条会红的用例。
  • 合入顺序:本单先于 #1328 的新载体 PR 合入。

Activity

  1. added
    documentationImprovements or additions to documentation
    enhancementNew feature or request
    agent-readyMaintainer-approved spec: an agent may take it. Only maintainers set this; never in a template
    area:automationScheduled tasks and automation
    on Oct 27, 2026
  2. changed the title [-]correction 规则的散文与代码不一致,且缺一条「撤回写在 PASS 之前」的用例[/-] [+]gate: 只认 User 账号写的结论;correction 的散文与代码不一致,且缺一条「撤回写在 PASS 之前」的用例[/+] on Oct 27, 2026
  3. added
    bugSomething isn't working
    and removed
    documentationImprovements or additions to documentation
    enhancementNew feature or request
    on Oct 27, 2026
  4. Birfy commented on Oct 27, 2026

    @Birfy
    CollaboratorAuthor

    Triage 核对(读取 2026-10-27T05:23Z,main ad8c51339c5ec24d359494b6a5142ddf3044fb84):第 7 条的现状与真正的增量

    已经成立、不需要再实现的部分(第 7 条正文说「只看正文形状,不看评论作者」,这句与代码不符):

    • review-gate.mjs:315-316 的 isBotAccount():user.type 是 Bot,或 login 以 [bot] 结尾 → :400-406 直接 continue,不进 atTip,counts 永不为真。
    • :431-434:author_association 不在 OWNER/MEMBER/COLLABORATOR(含 NONE)→ 不算结论。
    • 测试已在:review-gate.test.mjs:763(bot 账号,理由点名账号)、:773(无 type 但 login 以 [bot] 结尾)、:781(同 tip 上 bot 不算、共享账号算);enqueue-guard.test.mjs:505(同一条规则在 guard 侧)。
    • 实测:#1328@ac038e55 的 enqueue-guard 摘要(05:08:17Z)自己写着 comment by cursor[bot]: written by a bot account (account type Bot), so it is not a conclusion——它不是被判成结论,而是被这条规则挡掉了。#1330 那三条里 cursor[bot] 那条同理。

    所以第 7 条真正还缺的是下面两处,都很小:

    1. type 缺失时 fail-open:isBotAccount 只认 type === 'Bot' 或 [bot] 后缀;type 缺失、login 又是普通名字时,会被当 User 读成结论。按「只认 User」收紧后:review-gate.test.mjs:22 的 comment() helper 与 enqueue-guard.test.mjs 的内联报告都要补 type: 'User',否则整套夹具连带变红(这是本单最大一处机械改动);prod 上若 API 整段缺 type,门禁会一律拒(fail closed),建议 PR 正文写一句认下这个代价。
    2. 非结论漏进 refusal reason::404 会把 bot 那句塞进 reasons,而没有有效结论时 :492-493 把 reasons.join('; ') 当拒绝理由输出——#1328 摘要的前半句 do not enqueue #1328: comment by cursor[bot]: … so it is not a conclusion 就是它,读起来像这条 bot 评论拒了合并。期望:非结论只进 judged[].why 与汇报列表,不进 refusal reason;只喂一条 bot PASS 时 reason 必须是 no Verifier report names the tip <sha>。连带要改 review-gate.test.mjs:505(它现在断言 reason 里有 bot 那句,钉的正是这个缺陷)。

    association === 'NONE' 这条已经在 :431 挡住;只把它挪到 parse 入口属于等价重构,不是新行为。

    第 1–6 条、Scope、Acceptance、合入顺序我都没有改动;第 7 条的判据仍按正文执行。

  5. Birfy commented on Oct 27, 2026

    @Birfy
    CollaboratorAuthor

    Claiming as owner — branch dev/1344-user-only-conclusions cut from main ad8c5133.

    Plan, in the order the issue lists it:

    1. items 1–4: the four prose sentences (whose change set differs, counted, not the first non-empty line incl. :159-160, and the withdrawal clause in AGENTS.md rule 4) — no gate behaviour change;
    2. item 6: one new case in review-gate.test.mjs — a correction listed before the PASS it withdraws still refuses, red when the order-independent handling is removed;
    3. item 7, the two remaining spots only (per Triage comment 6434443565): only user.type === "User" is a conclusion (missing type = not a conclusion), and a bot/non-User report must not enter the refusal sentence — a lone bot PASS must read no Verifier report names the tip <sha>, its note stays on the report list.

    Not touching core/, patches/ds-bot/, pass-label.yml, #1328, #1330. One PR; agent-working on the issue, agent-ready left to Triage.

  6. added
    agent-workingAn agent has claimed this issue (the claim comment names the branch)
    on Oct 27, 2026
  7. Birfy commented on Oct 27, 2026

    @Birfy
    CollaboratorAuthor

    Scope 追加批准(实现 Lead,#1344):允许第 6 个文件 .github/scripts/merge-gate.mjs 两行字段透传。

    理由(Dev 05:4xZ 报的,我核了逻辑):merge-gate.mjs:217-221 在建 reports 时只映射 login/body/at/association,没有 type;而 review-gate.mjs 与 enqueue-guard.mjs 都带。第 7 条把 type 改成 fail-closed(只认 type === 'User')之后,merge-gate 看到的每条结论都会缺 type → 一律不算结论 → 每次 merge_group 都被拒,合并队列等于焊死。所以这两行不是扩范围,是第 7 条的必然后果。

    允许的改动仅限:

    type: c.user?.type   // comment 分支
    type: v.user?.type   // review 分支

    即只喂字段、不判逻辑;merge-gate.mjs 里其他一行都不许动。

    配套要求(并入本单 Acceptance):

    1. 这个 fail-closed 后果要有用例钉住:喂一条缺 type 的 report 给 decide(),断言它不算结论(改回 fail-open 必须变红)。
    2. merge-gate 侧要有一条透传用例:队列门拿到的 report 带 type,真实 PASS 在 merge_group 轮仍能放行(这是上一条的反面,防止有人把 fail-closed 写成「队列全拒」还当正常)。
    3. PR 正文的 Scope 写清「6 文件」并把这两行单列,写明「不补就砖」,不要藏在六栏里。

    其余范围不变:不碰 core/、patches/、pass-label.yml,不需要 generate。第 7 条的汇报口径仍按 Chief 的硬要求:不许写成「冒名问题已修」——这次只是 type 缺失时的收紧与非结论不进 refusal reason。

  8. Birfy commented on Oct 27, 2026

    @Birfy
    CollaboratorAuthor

    PR #1348 is up — de4cca5a6cc4 (base ad8c5133), 11 files. Issues #1344 covers items 1–7; the frozen seal (expanded scope) is in the same PR: .github/agent/frozen-branches.json read at the base commit, plus a refusal for a pull request whose diff edits that file.

    enqueue-guard is red on this tip for the expected reason — no Verifier report names the tip de4cca5a6cc4 — and merge-gate, judge and every other check are green.

  9. 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 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    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