feat(governance): bug form+transitions bug 流状态(W3-C1 .github#218,ADR-0064) - #243
Conversation
|
Warning Review limit reached
Next review available in: 10 minutes Limit details: You’ve used all 10 included reviews currently available. Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?Wait for the limit to reset, then comment An organization admin can change what happens after included review limits in Billing. How do review limits work?CodeRabbit enforces per-developer PR review limits within each organization. For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Comment |
PR Summary by QodoAdd bug issue form and bug-flow state transitions (ADR-0064)
AI Description
Diagram
High-Level Assessment
Files changed (2)
|
There was a problem hiding this comment.
Pull request overview
Adds an organization-wide bug issue form and governance state transitions for the W3-C1 bug workflow.
Changes:
- Adds structured bug-report fields with
buglabeling. - Adds
bug,reproduced, andfixedstates with transitions B1–B5.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Summary and final findings |
|---|---|
.github/ISSUE_TEMPLATE/bug.yml |
Defines the structured bug form. Findings: moderate (3 votes) — no workflow dispatch path in target repositories; moderate (2 votes) — optional reproduction command can leave issues stuck; critical (1 vote) — user-controlled commands can expose the App token. |
governance/transitions.yaml |
Extends the state machine with bug-flow states and transitions. Findings: moderate (3 votes) — required state labels are not provisioned; moderate (2 votes) — from_state: reproduced is not enforceable with the event shape, also affecting lines 80 and 86. |
Suppressed comments (3)
governance/transitions.yaml:82
- B4 has the same state-label ordering problem: adding
state:doneleavesstate:fixedpresent, so conductor aborts before matching this transition; removingstate:fixedfirst makes the label event a no-op and bypasses thefixedprecondition. Close the issue through an operation that atomically validates and swaps the state instead of relying on thisissues.labeledevent.
- id: B4 # 终态关单:fixed → done(owner/agent 置 state:done 后关单)
from_state: fixed
event: label:state:done
governance/transitions.yaml:89
- B5 cannot provide the claimed manual/flow precondition check with
label:state:needs-human: adding it whilestate:bugremains triggers conductor's multiple-state abort, while removingstate:bugfirst makes the event an unmatched no-op. Route this escalation through an operation that validatesbugand performs the state swap atomically, or define a command event with an explicit source state.
- id: B5 # 三值判定之【不可判定】兜底:环境错/超时/翻转,换新环境重试一次仍
# 不可判定 → label:inconclusive + state:needs-human(转人裁)
from_state: bug
event: label:state:needs-human
governance/transitions.yaml:23
- The IFACE-03 contract still declares the state universe as only the ten feature states in
specs/IR-0001/spec.md:120. This state list now makes that interface documentation stale: consumers and reviewers have no documented schema for the three new states. Update the contract, or explicitly version/extend it, in the same change.
states: [ir-draft, ir-signed, spec, redteam, wave-planned, ready, in-progress, quarantine, needs-human, done, bug, reproduced, fixed]
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| Bug 流铁律:**复现前置,签署点后移**(宪法 §3)——区别于 Feature 流的签署前置, | ||
| 本表单提交即触发机器复现,无签署门。判定协议 = SWT-bench F→P 扩展,三值: | ||
| `reproduced`(base 上稳定 fail,若有 fix 候选则其上 pass)→ 产 failing repro test 待 owner 签; | ||
| `cannot-reproduce`(base 上 pass)→ **不关单**,保留人裁; | ||
| `inconclusive`(环境错/超时 30min/翻转)→ 换新环境重试一次,仍不可判定转人裁。 |
| id: repro_cmd | ||
| attributes: | ||
| label: 机器复现用例(可选) | ||
| description: "单行命令或测试引用(如 pytest tests/test_x.py::test_y);多步用例先落脚本文件后在此引用。用例需输出 REPRO_OUTCOME: pass|fail 标记断言语义" |
| label: 机器复现用例(可选) | ||
| description: "单行命令或测试引用(如 pytest tests/test_x.py::test_y);多步用例先落脚本文件后在此引用。用例需输出 REPRO_OUTCOME: pass|fail 标记断言语义" |
| # 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] |
| - id: B3 # 修复合入:owner/agent 置 state:fixed(fix PR 的合并事实回写 bug 单) | ||
| from_state: reproduced | ||
| event: label:state:fixed |
Code Review by Qodo
1. Unprovisioned new state labels
|
| # 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] |
There was a problem hiding this comment.
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
| name: Bug 上报(reproduce 流水线) | ||
| description: 提交一个 bug——打 bug 标签即进 reproduce 阶段(免签):env-gate + 哨兵自证 + 三值判定(W3-C1 .github#218,ADR-0064) | ||
| labels: [bug] | ||
| body: |
There was a problem hiding this comment.
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
动机
Bug 流入口(宪法 §3:复现前置、签署点后移):结构化 bug 上报 form(打
bug标签即进 reproduce 阶段——免签,区别于 Feature 流的签署前置)+ 状态机表增补 bug 流状态转移。与 CI-Workflows PR(Cloudbird-Software/CI-Workflows#58,pipeline/bugflow)配套:form 字段标题与bugflow.py字段常量逐字对齐(跨仓机器解析契约)。变更清单
.github/ISSUE_TEMPLATE/bug.yml:bug form(repo/版本/症状签名/关键栈/复现步骤/期望/实际/环境指纹/机器复现用例;labels: [bug])。org 级默认模板——各仓缺省继承本表单governance/transitions.yaml:states 追加bug/reproduced/fixed;只 append 新转移 B1-B5(T1-T4 逐字未动):B1 ir-draft --label:bug--> bug(免签入口);B2 bug --label:reproduced--> reproduced;B3 reproduced --label:state:fixed--> fixed;B4 fixed --label:state:done--> done;B5 bug --label:state:needs-human--> needs-human。cannot-reproduce 不产生状态转移(保留人裁,ADR-0064 决策 4)——表头注释注明AC 映射(卡 .github#218)
duplicate-fingerprint实录 .github#242测试方法
风险与回滚
Card: #218
ADR: ADR-0064(archive 仓 adr/ADR-0064-bug-pipeline-env-gate-tri-verdict.md)
配套: Cloudbird-Software/CI-Workflows#58