Skip to content

feat(governance): bug form+transitions bug 流状态(W3-C1 .github#218,ADR-0064) - #243

Merged
randypanding merged 1 commit into
mainfrom
w3c1-bug-entry
Aug 21, 2026
Merged

feat(governance): bug form+transitions bug 流状态(W3-C1 .github#218,ADR-0064)#243
randypanding merged 1 commit into
mainfrom
w3c1-bug-entry

Conversation

@randypanding

Copy link
Copy Markdown
Contributor

动机

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)——表头注释注明
  • 头部 schema 注释扩展 label:<非state判定标签> 事件形态(conductor 对其静默 no-op——B1/B2 为状态机声明,转移本体由 bug-reproduce 流水线以 App 身份执行,幂等由 from_state 匹配承担)

AC 映射(卡 .github#218)

  • AC-1 ✅:form 提交→bug 标签→B1 进 reproduce 阶段;e2e 实录 .github#236(form 结构正文)→ reproduced 标签 + state:reproduced(详见 CI-Workflows#58 PR body)
  • AC-2 ✅:cannot-reproduce 不在转移表(不转移状态、不关单——人裁);同指纹绕过标签 duplicate-fingerprint 实录 .github#242
  • AC-3 ✅:B5 = 不可判定重试耗尽 → needs-human(与现有 state:needs-human 状态复用)
  • AC-4:transitions 不涉及(CI-Workflows#58 sample-week 承载)

测试方法

风险与回滚

  • bug 流标签(bug/state:bug/reproduced/cannot-reproduce/inconclusive/fixed/duplicate-fingerprint)未注册 expected-state.json——drift-check §16 只对账"应有哪些"(单向),仓自有标签不判漂移;board 列与 expected-state 注册随 W5 投影/车队卡扩展(本卡 blastRadius 不含 expected-state.json)
  • 回滚=摘除 bug.yml + 回退 B1-B5(新增式,ADR-0064 回滚条款)

Card: #218
ADR: ADR-0064(archive 仓 adr/ADR-0064-bug-pipeline-env-gate-tri-verdict.md)
配套: Cloudbird-Software/CI-Workflows#58

Copilot AI lite review requested due to automatic review settings August 21, 2026 19:09
@coderabbitai

coderabbitai Bot commented Aug 21, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@randypanding, you've reached your PR review limit, so we couldn't start this review.

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.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

Wait for the limit to reset, then comment @coderabbitai review or push new commits to the PR.

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 configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 0ce2da13-18a3-4617-8000-8afa9a269c57

📥 Commits

Reviewing files that changed from the base of the PR and between 94a8d2f and 5ecc8eb.

📒 Files selected for processing (2)
  • .github/ISSUE_TEMPLATE/bug.yml
  • governance/transitions.yaml

Comment @coderabbitai help to get the list of available commands.

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Add bug issue form and bug-flow state transitions (ADR-0064)

✨ Enhancement ⚙️ Configuration changes 🕐 10-20 Minutes

Grey Divider

AI Description

• Add an org-level bug report issue form that auto-labels issues as bug.
• Extend governance state machine with bug-flow states and B1–B5 transitions.
• Document non-state “verdict labels” semantics to keep conductor behavior unchanged.
Diagram

graph TD
  U([Reporter]) --> F["Bug issue form (bug.yml)"] --> L["Issue labels"]
  L --> P["Bugflow pipeline (CI-Workflows)"] --> T[("transitions.yaml")] --> C["Conductor state machine"] --> S(["Issue state"])
  L --> D{"Label kind?"}
  D -->|"bug/reproduced"| P
  D -->|"state:*"| C

  subgraph Legend
    direction LR
    _start(["Actor/Start-End"]) ~~~ _proc["Process"] ~~~ _cfg[("Config")] ~~~ _dec{"Decision"}
  end
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Model verdicts as states (cannot-reproduce/inconclusive as state:*)
  • ➕ Single mechanism (state:*) for all transitions
  • ➕ Less ambiguity between “fact labels” and “state labels”
  • ➖ Contradicts ADR choice to keep cannot-reproduce as non-transition human verdict
  • ➖ Increases risk of accidental auto-close or unintended automation
2. Keep bug-flow transitions in CI-Workflows only (no governance table entries)
  • ➕ Fewer edits to core governance config
  • ➕ Faster iteration inside the automation repo
  • ➖ Breaks the “single source of truth” for legal transitions
  • ➖ Harder for humans to audit/understand allowed label-driven moves
3. Use a single generic issue template and parse free-form sections
  • ➕ Lower maintenance burden on strict field-title contracts
  • ➕ Less brittle to copy edits
  • ➖ Weaker machine-parse reliability for cross-repo automation
  • ➖ Higher chance of pipeline failures due to missing/renamed headings

Recommendation: Current approach is the best fit: a strict bug form provides a stable machine contract for CI-Workflows parsing, while transitions.yaml remains the canonical declaration of allowed bug-flow transitions. Keeping cannot-reproduce out of state transitions matches the stated human-judgment requirement and avoids unintended automation effects.

Files changed (2) +122 / -1

Enhancement (2) +122 / -1
bug.ymlAdd structured bug-report issue form with default 'bug' label +73/-0

Add structured bug-report issue form with default 'bug' label

• Introduces an org-level GitHub Issue Form for bug submissions, designed for machine parsing by the bugflow pipeline. Captures repo/version/symptom signature/stack/steps/expected vs actual/environment fingerprint and an optional repro command, and applies 'labels: [bug]' on submission.

.github/ISSUE_TEMPLATE/bug.yml

transitions.yamlAppend bug-flow states and B1–B5 label-driven transitions +49/-1

Append bug-flow states and B1–B5 label-driven transitions

• Extends the governance state list with 'bug', 'reproduced', and 'fixed', and appends transitions B1–B5 to model the bug workflow. Adds schema commentary clarifying that non-state verdict labels (e.g., 'bug', 'reproduced') are treated as events and that 'cannot-reproduce' intentionally does not trigger a state transition.

governance/transitions.yaml

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 bug labeling.
  • Adds bug, reproduced, and fixed states 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:done leaves state:fixed present, so conductor aborts before matching this transition; removing state:fixed first makes the label event a no-op and bypasses the fixed precondition. Close the issue through an operation that atomically validates and swaps the state instead of relying on this issues.labeled event.
  - 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 while state:bug remains triggers conductor's multiple-state abort, while removing state:bug first makes the event an unmatched no-op. Route this escalation through an operation that validates bug and 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.

Comment on lines +8 to +12
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 +70 to +73
id: repro_cmd
attributes:
label: 机器复现用例(可选)
description: "单行命令或测试引用(如 pytest tests/test_x.py::test_y);多步用例先落脚本文件后在此引用。用例需输出 REPRO_OUTCOME: pass|fail 标记断言语义"
Comment on lines +72 to +73
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]
Comment on lines +74 to +76
- id: B3 # 修复合入:owner/agent 置 state:fixed(fix PR 的合并事实回写 bug 单)
from_state: reproduced
event: label:state:fixed
@qodo-code-review

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (2) 📘 Rule violations (0) 📜 Skill insights (0)

Grey Divider


Action required

1. Unprovisioned new state labels 🐞 Bug ☼ Reliability
Description
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.
Code

governance/transitions.yaml[23]

+states: [ir-draft, ir-signed, spec, redteam, wave-planned, ready, in-progress, quarantine, needs-human, done, bug, reproduced, fixed]
Relevance

●● Moderate

The PR explicitly scopes label registration to a later rollout, but no close rejection precedent
confirms accepting this omission.

PR-#173
PR-#195

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The PR adds new states/transitions that will require new state:* labels. But label creation is
driven by expected-state.json (consumed by apply.sh), and that file currently does not include
the new labels, so they won’t be created/applied across repos. GitHub’s labels API returns 404 when
the label does not exist, so attempts to add missing labels will fail and block transitions.

governance/transitions.yaml[17-23]
governance/expected-state.json[35-98]
governance/apply.sh[158-177]
🌐 Documents that adding labels to an issue returns 404 Not Found when the label does not exist ("Response if the label does not exist").

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## 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



Remediation recommended

2. Issue form not CI-validated 🐞 Bug ⚙ Maintainability
Description
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.
Code

.github/ISSUE_TEMPLATE/bug.yml[R1-4]

+name: Bug 上报(reproduce 流水线)
+description: 提交一个 bug——打 bug 标签即进 reproduce 阶段(免签):env-gate + 哨兵自证 + 三值判定(W3-C1 .github#218,ADR-0064)
+labels: [bug]
+body:
Relevance

●●● Strong

Recent gate-validation findings are accepted, including workflow parsing robustness and
coverage-related omissions.

PR-#55
PR-#61
PR-#19

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The new template file is introduced by this PR, but the gate workflow’s YAML validation explicitly
only glob-loads governance/ and standards/ YAML files, leaving .github/ISSUE_TEMPLATE unchecked.

.github/ISSUE_TEMPLATE/bug.yml[1-73]
.github/workflows/gate.yml[52-65]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## 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


Grey Divider

Context sources
✅ Compliance rules (platform): 16 rules
✅ Web pages:
  +2 more
Review mode: ⚖️ Balanced: This changes a cross-repository issue-form parsing contract and governance state-machine transitions, with meaningful workflow and authorization/transition semantics that warrant a careful single-pass review.

Grey Divider

Tip of the day
💡 Did you know, you can tweak Display preferences with a live preview to see your comment before it ships

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

# 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

Comment on lines +1 to +4
name: Bug 上报(reproduce 流水线)
description: 提交一个 bug——打 bug 标签即进 reproduce 阶段(免签):env-gate + 哨兵自证 + 三值判定(W3-C1 .github#218,ADR-0064)
labels: [bug]
body:

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

@randypanding
randypanding merged commit f4164ec into main Aug 21, 2026
12 checks passed
@randypanding
randypanding deleted the w3c1-bug-entry branch August 21, 2026 19:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants