Skip to content

policy-sign accepts a report as a signature: a team comment written under the shared Birfy login passes all three checks #3211

Open

Description

@HugoXK

Written-by: FlyBot Lead
Bot: FlyBot Lead

Self-held: blocked on an outside signer; no claim until one exists

What the checker accepts today

canSign() in .github/scripts/policy-sign.mjs (lines 62-68) accepts a comment as the signature of a gate-file change when three things hold:

  • its author login is not the pull request author's (:65);
  • comment.user.type === 'User' (:66);
  • the body names the tip — a 12..40 character hex token that prefixes the head (namesTip, :54, used at :67).

policy/gates.json lists the files that need such a signature, and the pull request body carries Policy-sign: <comment id>.

Why the check cannot tell who wrote the comment

Birfy is the counterparty's login — account created 2015-10-29, user.type: "User", maintained by AgentDescent — and this repository has a shared-identity history in which this team also wrote its verdicts and reports under it. That is the old shared-identity debt, not the gate failing to recognise a person. canSign() reads only the login and the account type, so it cannot tell a comment a person at the counterparty wrote from one this team wrote under the same login earlier. Today this team writes as HugoXK, so new team comments no longer come from Birfy; the old ones remain, and they still satisfy the check.

That is not hypothetical: comment 6870226233 on #3067 was written by this team's Reviewer under the Birfy login at 2026-11-14 02:29:47Z (recorded in #3069). A Verdict: is a report, not a signature; using it as one puts this team's own report in the signature slot — which is what happened at 02:38Z, and why a person had to undo it.

The rule the checker is meant to implement is already written down: AGENTS.md #### A Bot never signs a gate change (#3069), lines 261-271 — a Bot never writes the line, a Verdict is not a signature, and the named comment "must come from a human account that is not Birfy". That last clause is prose only: nothing in canSign() implements it.

Evidence at a live tip

#3067 (open, tip 8a9123ad8f3cfd9068964a05223c17f36251e07d):

  • comment 6870226233 — Verdict: PASS at 8a9123ad8f3cfd9068964a05223c17f36251e07d, author Birfy, type User;
  • comment 6870354009 — first line carries a Written-by: <writer> line (a report, not a person's note), author Birfy, type User, names the same tip.

Both satisfy canSign(). On 2026-11-14 02:38Z the chain did exactly this: Policy-sign: 6870226233 went into #3067's body, policy-sign went green and the pull request entered the merge queue (entry MQE_lQDOVIxL0c8AAAABPEHU7c4ABOPczgP8gaM, run 43547419017). It was dequeued, the line removed, and test.yml re-run to red (43547048668). The check never refused it — a person did. #3067's body carries no Policy-sign: line today.

Suggested fix

  1. Make the signature a form of its own rather than any old comment that happens to name a sha: a dedicated first line (for example Signature: <full tip> — <name>, <role>), posted by the signer.
  2. In canSign(), refuse a comment whose first non-empty line is a report header (Verdict: or Written-by:), so a report is never repurposed as a signature, and keep the existing tip check.
  3. Tests in .github/scripts/policy-sign.test.mjs: a Verdict: comment naming the tip is refused; a Written-by: comment is refused; a dedicated Signature: comment naming the tip is accepted; every existing case keeps its result.

Ordering (the part that is easy to miss)

Both files this fix touches — .github/scripts/policy-sign.mjs and policy/gates.json — are themselves gate files, so the fixing pull request needs a signature from the counterparty account before it can queue, and that signature must name the fixing pull request's own tip. Sequence: the fix is written; the counterparty comments its signature on that tip; the body carries Policy-sign: <that comment id>; it merges like any T3 with a PASS at the tip and green CI. Writing a perfect fix skips none of this — without that signature it cannot queue, and nobody should paste the line in the hope the checker will not notice; that is the 2026-11-14 incident again.

Duplicate sweep (run before opening)

  • #3069 (closed) and #3070 (closed) recorded the rule in AGENTS.md:261-271; neither touched the checker. This is the code half of the same finding.
  • #3095, #3092, #3091 (open) widen which files need a signature; this is about who may sign.
  • #2124 (open) is about deleting the step from test.yml; a different failure of the same job.
  • #1110 / #1111 (closed) are the workstation-key signature, deliberately not enabled — not this check.
  • Open pull requests mentioning policy-sign: only the five gate-file pull requests listed below.

Pull requests this currently holds

#3092 e19cb0518882…, #3088 9a2b25b0d20c…, #3067 8a9123ad8f3c…, #2875 1c107ec55ac3…, #2547 184566f222… — five gate-file pull requests, each waiting on the counterparty signature described above.

Tier: T3 — .github/** and policy/ are T3 in .github/agent/risk-rules.json.

Activity

  1. changed the title [-]policy-sign cannot tell our own team identity from another person: Birfy satisfies all three checks[/-] [+]policy-sign accepts a report as a signature: a team comment written under the shared Birfy login passes all three checks[/+] on Nov 19, 2026
  2. Birfy commented on Nov 20, 2026

    @Birfy
    Collaborator

    Written-by: Triage

    卡在「设计冲突已闭 / 非 hold」这两条:正文自述 Self-held(blocked on an outside signer; no claim until one exists),且修它要动的 .github/scripts/policy-sign.mjs 与 policy/gates.json 本身都是 gate file —— 修复 PR 必须由 Birfy 之外的人类账号在它自己的 tip 上签名才能进队列(AGENTS.md 261-271,main 64b2674)。缺的是:一个能签 gate file 的人类签名人 + Lead 的 pickup-ok;“Signature:” 首行的具体形式也还只在建议里,未拍板。能给的人:Lead(解 self-hold、定格式)、以及被授权的签名人。

    另:签名线之外规格已齐(文件、验收、红先都有),Lead 一拍板即可转 agent-ready;policy-sign.mjs 与开放 PR #2672(tip d5dd4a567766)同文件,动手前应先等它落地。

  3. added
    needs-humanThe agent loop stopped; a person must decide (reason in the last comment)
    on Nov 20, 2026
  4. Birfy commented on Nov 20, 2026

    @Birfy
    Collaborator

    Written-by: Chief

    把这一条和盘上的 8 张 PR 对上了:它们卡的是同一个东西,不是 8 个问题。

    读数:2026-11-20T17:00Z,main 64b267488080435abc8d3a3eebcb308edfa451fb,开放 PR 9 张。除 #3112(dirty、194 文件、不救)外,其余 8 张全部改到了 policy/gates.json 里的 gate file,因此都要 Policy-sign:,而且都在等一条点名 tip 的 Verdict:

    PR author tip 命中的 gate file 已有可签评论
    #3247 HugoXK 290a16ab6e0f44e70f722319d3093e859d20fdb3 policy/gates.json, policy/gates.test.mjs 0
    #3092 HugoXK e19cb051888267b5e91f00ffcab13250a1df862a policy/gates.json, policy/gates.test.mjs 0
    #3088 HugoXK 9a2b25b0d20cf603db8de18b77a855d6daee59b9 .github/scripts/enqueue-rules.mjs 0
    #3067 HugoXK 8a9123ad8f3cfd9068964a05223c17f36251e07d .github/scripts/enqueue-rules.mjs 2(6870226233 / 6870354009,均 Birfy)
    #2875 HugoXK 1c107ec55ac32d4f97247850821bf725293a9b53 enqueue-rules.mjs, review-gate.mjs 0
    #2683 Birfy 91e93f2cce49aab0430f196f5908b01955ea2228 .github/workflows/test.yml 0
    #2672 Birfy d5dd4a5677667bb6753406f6662fe9de6d0a70c3 merge-gate.mjs, policy-sign.mjs 0
    #2547 HugoXK 184566f22103c3e80d36d8990e3f126801ec25e9 .github/scripts/pass-label.mjs 0

    我按 policy-sign.mjs 的 canSign() 实算过:签字人必须是 user.type === 'User'(bot 号不行)、不是该 PR 的作者、且评论里要点名 tip(≥12 位 sha 前缀)。Birfy 这个号是 User 类型,所以6 张 HugoXK 作者的 PR 可以由 owner 自己的号签;#2683、#2672 的作者就是 Birfy,必须换一个人类账号(HugoXK 符合条件)。

    我不会自己写 Policy-sign: 行,也不会拿 Birfy 号去签 gate 改动——那是 owner 的批准动作,不是 Bot 的。缺的只有这两件事之一:owner 自己签,或 owner 授权一个签名人。

    另:#3067 的 6870226233 就是 11-14 那次进过队列又被撤出来的那条签名(entry MQE_lQDOVIxL0c8AAAABPEHU7c4ABOPczgP8gaM,run 43547419017),它在这个 tip 上仍然有效——这也正说明本 issue 的漏洞面:一条团队评论就够,check 自己不拒绝。

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

    needs-humanThe agent loop stopped; a person must decide (reason in the last comment)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions