From 5ecc8eb7a6881264805878f83daea5171509cc6a Mon Sep 17 00:00:00 2001 From: randypanding Date: Sat, 22 Aug 2026 03:04:05 +0800 Subject: [PATCH] =?UTF-8?q?feat(governance):=20bug=20form+transitions=20bu?= =?UTF-8?q?g=20=E6=B5=81=E7=8A=B6=E6=80=81=EF=BC=88W3-C1=20.github#218?= =?UTF-8?q?=EF=BC=8CADR-0064=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/ISSUE_TEMPLATE/bug.yml | 73 ++++++++++++++++++++++++++++++++++ governance/transitions.yaml | 50 ++++++++++++++++++++++- 2 files changed, 122 insertions(+), 1 deletion(-) create mode 100644 .github/ISSUE_TEMPLATE/bug.yml diff --git a/.github/ISSUE_TEMPLATE/bug.yml b/.github/ISSUE_TEMPLATE/bug.yml new file mode 100644 index 0000000..f8d51d3 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug.yml @@ -0,0 +1,73 @@ +name: Bug 上报(reproduce 流水线) +description: 提交一个 bug——打 bug 标签即进 reproduce 阶段(免签):env-gate + 哨兵自证 + 三值判定(W3-C1 .github#218,ADR-0064) +labels: [bug] +body: + - type: markdown + attributes: + value: | + Bug 流铁律:**复现前置,签署点后移**(宪法 §3)——区别于 Feature 流的签署前置, + 本表单提交即触发机器复现,无签署门。判定协议 = SWT-bench F→P 扩展,三值: + `reproduced`(base 上稳定 fail,若有 fix 候选则其上 pass)→ 产 failing repro test 待 owner 签; + `cannot-reproduce`(base 上 pass)→ **不关单**,保留人裁; + `inconclusive`(环境错/超时 30min/翻转)→ 换新环境重试一次,仍不可判定转人裁。 + 同指纹(仓+症状签名+关键栈 sha256)二次上报自动绕过重复 reproduce。 + 注意:**字段标题是机器解析契约**——与 CI-Workflows 仓 `pipeline/bugflow/bugflow.py` + 的字段常量逐字对齐,改任一侧须两仓同步并引用 ADR-0064。 + - type: input + id: repo + attributes: + label: 受影响的仓(owner/name) + description: 如 Cloudbird-Software/CI-Workflows + validations: + required: true + - type: input + id: version + attributes: + label: 版本 / commit + description: 出问题时所在版本号或 commit SHA + validations: + required: true + - type: textarea + id: symptom + attributes: + label: 症状签名(一句话 + 关键报错) + description: 一句话症状 + 最关键的报错文本——与仓、关键栈一起参与同指纹去重(sha256) + validations: + required: true + - type: textarea + id: stack + attributes: + label: 关键栈(可选) + description: 栈顶关键帧(去路径/随机量后的稳定部分)——提高指纹区分度 + - type: textarea + id: steps + attributes: + label: 复现步骤 + description: 逐步操作;能写成命令/测试的尽量写进"机器复现用例" + validations: + required: true + - type: textarea + id: expected + attributes: + label: 期望结果 + validations: + required: true + - type: textarea + id: actual + attributes: + label: 实际结果 + validations: + required: true + - type: textarea + id: env + attributes: + label: 环境指纹(可选) + description: 已知则填——与复现环境对账,不匹配判"不可判定"而非"证伪"(ADR-0064 决策 2) + placeholder: | + image: sha256:…(基础镜像 digest) + lockfile:requirements.txt: sha256:…(依赖 lockfile hash) + - type: input + id: repro_cmd + attributes: + label: 机器复现用例(可选) + description: "单行命令或测试引用(如 pytest tests/test_x.py::test_y);多步用例先落脚本文件后在此引用。用例需输出 REPRO_OUTCOME: pass|fail 标记断言语义" diff --git a/governance/transitions.yaml b/governance/transitions.yaml index 9aa13af..fea8c39 100644 --- a/governance/transitions.yaml +++ b/governance/transitions.yaml @@ -5,6 +5,8 @@ version: 1 # schema: # from_state = 转移前状态(当前 issue 无 state:* 标签时视为 ir-draft) # event = label:state: | comment:/start | comment:/claim | comment:/retry +# | label:<非state判定标签>(W3-C1 Bug 流扩展:label:bug/label:reproduced +# ——判定标签驱动的转移,见 B1/B2 注) # to_state = 转移后状态(conductor 以 App 身份换标签:移除 from、置上 to) # action = invoke:spec-author | claim | noop(W0 全集) # guard = 布尔表达式;变量白名单:sender_role(owner|agent|none)、 @@ -12,7 +14,13 @@ version: 1 # label_set(当前标签名集合) # 未列出的 (from_state, event) 组合 = 禁止转移(conductor no-op;重复投递/ # 跳态/反向天然被 from_state 匹配拒绝——幂等键 {issue, from, to} 的落盘形态)。 -states: [ir-draft, ir-signed, spec, redteam, wave-planned, ready, in-progress, quarantine, needs-human, done] +# W3-C1(ADR-0064):append bug 流状态 bug/reproduced/fixed 与转移 B1-B5。 +# Bug 流与 Feature 流的差异:入口免签(bug 标签即 reproduce 阶段)、 +# 判定标签(reproduced/cannot-reproduce/inconclusive)是事实标签而非状态—— +# cannot-reproduce 不产生状态转移(保留人裁,ADR-0064 决策 4); +# bugflow 的状态写序=先移旧态再置新态(防双 state 并存窗口触发 +# conductor 多状态 abort)。 +states: [ir-draft, ir-signed, spec, redteam, wave-planned, ready, in-progress, quarantine, needs-human, done, bug, reproduced, fixed] transitions: - id: T1 # 主通路:owner/agent 打签署标签 → 进 spec 阶段(BEH-01)。 @@ -42,3 +50,43 @@ transitions: to_state: ready action: noop guard: "sender_role in ['owner', 'agent']" + # ---------- Bug 流(W3-C1 .github#218 / ADR-0064,宪法 §3)---------- + # 执行者:CI-Workflows pipeline/bugflow(bug-reproduce.yml 以 App 身份写标签)。 + # conductor 对 label:bug/label:reproduced 等非 state 标签事件静默 no-op—— + # B1/B2 是状态机声明(唯一转移定义源原则:bug 流的合法转移也必须落表), + # 由 bugflow 执行转移本体;B5 的人工/流水线双路径均满足 from_state 幂等。 + - id: B1 # Bug 流入口(免签——区别于 Feature 流签署前置):bug form 落 bug + # 标签 → 进 reproduce 阶段(state:bug)。无 state 标签按约定视为 ir-draft。 + from_state: ir-draft + event: label:bug + to_state: bug + action: noop + guard: "'bug' in label_set" + - id: B2 # 三值判定之【复现】:base 稳定 fail(+fix 候选 pass)→ reproduced + # 标签 + state:reproduced;reproduced 后产 failing repro test 待 owner 签 + # (锁定 ADR-0061 → 修复 → 关卡 → 合并)。证伪(label:cannot-reproduce) + # 不在此列:不转移状态、不关单——保留人裁。 + from_state: bug + event: label:reproduced + to_state: reproduced + action: noop + guard: "sender_role in ['owner', 'agent']" + - id: B3 # 修复合入:owner/agent 置 state:fixed(fix PR 的合并事实回写 bug 单) + from_state: reproduced + event: label:state:fixed + to_state: fixed + action: noop + guard: "sender_role in ['owner', 'agent']" + - id: B4 # 终态关单:fixed → done(owner/agent 置 state:done 后关单) + from_state: fixed + event: label:state:done + to_state: done + action: noop + guard: "sender_role in ['owner', 'agent']" + - id: B5 # 三值判定之【不可判定】兜底:环境错/超时/翻转,换新环境重试一次仍 + # 不可判定 → label:inconclusive + state:needs-human(转人裁) + from_state: bug + event: label:state:needs-human + to_state: needs-human + action: noop + guard: "sender_role in ['owner', 'agent']"