Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 73 additions & 0 deletions .github/ISSUE_TEMPLATE/bug.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Bug 上报(reproduce 流水线)
description: 提交一个 bug——打 bug 标签即进 reproduce 阶段(免签):env-gate + 哨兵自证 + 三值判定(W3-C1 .github#218,ADR-0064)
labels: [bug]
body:
Comment on lines +1 to +4

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remediation recommended

2. Issue form not ci-validated 🐞 Bug ⚙ Maintainability

bug.yml is added under .github/ISSUE_TEMPLATE/, but the gate workflow’s YAML parsing step only
loads governance/**/*.yaml and standards/**/*.yaml, so syntax errors in issue templates can
merge undetected. This increases the chance of silently breaking org-wide bug reporting UX after
future edits.
Agent Prompt
## Issue description
The repo’s `gate.yml` validates YAML by parsing only `governance/**/*.yaml` and `standards/**/*.yaml`. The newly added GitHub Issue Form (`.github/ISSUE_TEMPLATE/bug.yml`) is outside those globs, so a malformed edit to this file would not be caught by CI and would ship to the org default templates.

## Issue Context
This PR introduces a new issue form that is intended to be machine-parsed and org-inherited, so catching YAML syntax regressions in CI is particularly valuable.

## Fix Focus Areas
- .github/workflows/gate.yml[52-65]
- .github/ISSUE_TEMPLATE/bug.yml[1-73]

## Suggested fix
Extend the YAML parse step in `.github/workflows/gate.yml` to also include `.github/ISSUE_TEMPLATE/**/*.yml` (and/or `.yaml`). For example, add:
- `glob.glob(".github/ISSUE_TEMPLATE/**/*.yml", recursive=True)`
- `glob.glob(".github/ISSUE_TEMPLATE/**/*.yaml", recursive=True)`
so the same `yaml.safe_load` pass validates issue-template YAML syntax.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

- 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/翻转)→ 换新环境重试一次,仍不可判定转人裁。
Comment on lines +8 to +12
同指纹(仓+症状签名+关键栈 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 标记断言语义"
Comment on lines +70 to +73
Comment on lines +72 to +73
50 changes: 49 additions & 1 deletion governance/transitions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,22 @@ version: 1
# schema:
# from_state = 转移前状态(当前 issue 无 state:* 标签时视为 ir-draft)
# event = label:state:<name> | 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)、
# author_association(OWNER|MEMBER|COLLABORATOR|CONTRIBUTOR|NONE)、
# 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]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

1. Unprovisioned new state labels 🐞 Bug ☼ Reliability

The PR introduces new states (bug/reproduced/fixed) that imply new labels (state:bug,
state:reproduced, state:fixed), but these labels are not in governance/expected-state.json, so
governance/apply.sh won’t create them across repos. Any automation that tries to add these labels
via the GitHub API will fail when the label doesn’t exist, blocking bug-flow state transitions.
Agent Prompt
## Issue description
This PR adds new state-machine states (`bug`, `reproduced`, `fixed`) and transitions that assume corresponding GitHub labels (`state:bug`, `state:reproduced`, `state:fixed`) exist. However, label provisioning is driven by `governance/expected-state.json` (applied by `governance/apply.sh`), and these new `state:*` labels are not registered there.

As a result, when automation (conductor/bugflow) tries to set these state labels via the GitHub Issues Labels API, it can error (404) if the label is missing, preventing the issue from entering the intended state.

## Issue Context
- `governance/apply.sh` only creates/patches labels listed in `governance/expected-state.json#labels.items`.
- `governance/expected-state.json` currently lists the existing `state:*` labels but not `state:bug`, `state:reproduced`, `state:fixed`.

## Fix Focus Areas
- governance/expected-state.json[35-98]
- governance/apply.sh[158-177]
- governance/transitions.yaml[23-23]

## Suggested fix
1. Add three new label entries to `governance/expected-state.json` under `labels.items`:
   - `state:bug`
   - `state:reproduced`
   - `state:fixed`
   Each should include a color + description consistent with the governance label scheme.
2. (Optional but recommended) If you intend bug-flow to roll out across repos, ensure the rollout plan includes running `governance/apply.sh` after merge so repos get the new labels before automation starts writing them.
3. If you intentionally do not want these to be governance labels yet, then the executor (bugflow) must create missing labels before attempting to set them, and failures must fail-closed with clear audit output.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


transitions:
- id: T1 # 主通路:owner/agent 打签署标签 → 进 spec 阶段(BEH-01)。
Expand Down Expand Up @@ -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
Comment on lines +74 to +76
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']"