[moz] impl(§21): toolchain-templates.yaml + Issue 模板补全 + G1 修复 #106

Merged
pangtong-fujunshi merged 2 commits from impl/21-toolchain-templates-and-cleanup into main 2026-06-20 15:35:59 +00:00
Member

Closes #106
Parent: #104

改动说明

§21 §4 steps 模板化

  • config/toolchain-templates.yaml: 7 种 business_type (feature/impl/bug/docs/refactor/test/infrastructure) + ci_failure + review_result_approved/request_changes
  • 每种含 steps + output_template
  • 所有 steps 包含文档同步检查项(§105 的要求)
  • src/daemon/toolchain_templates.py: 新增 get_steps() / get_output_template() 加载 YAML

Issue 模板补全

  • impl.yml / docs.yml / refactor.yml(原有 bug.yml + feature.yml + test.yml)

其他

  • G1 弯引号修复(司马懿 Review 反馈)
  • §20 status → superseded by §21

验证

  • pytest: 466 passed, 3 skipped, 0 failed
  • 文档同步:本 PR 无代码逻辑变更,YAML 配置 + Issue 模板 + 1 行引号修复 + 1 行 status 修改
Closes #106 Parent: #104 ## 改动说明 ### §21 §4 steps 模板化 - `config/toolchain-templates.yaml`: 7 种 business_type (feature/impl/bug/docs/refactor/test/infrastructure) + ci_failure + review_result_approved/request_changes - 每种含 steps + output_template - 所有 steps 包含文档同步检查项(§105 的要求) - `src/daemon/toolchain_templates.py`: 新增 `get_steps()` / `get_output_template()` 加载 YAML ### Issue 模板补全 - impl.yml / docs.yml / refactor.yml(原有 bug.yml + feature.yml + test.yml) ### 其他 - G1 弯引号修复(司马懿 Review 反馈) - §20 status → superseded by §21 ## 验证 - pytest: 466 passed, 3 skipped, 0 failed - 文档同步:本 PR 无代码逻辑变更,YAML 配置 + Issue 模板 + 1 行引号修复 + 1 行 status 修改
pangtong-fujunshi added 1 commit 2026-06-20 15:10:17 +00:00
[moz] impl(§21): toolchain-templates.yaml + Issue 模板补全 + G1 修复 + §20 superseded
CI / lint (pull_request) Failing after 1m7s
CI / test (pull_request) Has been skipped
CI / frontend (pull_request) Has been skipped
CI / notify-on-failure (pull_request) Successful in 2s
7c11c6b9aa
- config/toolchain-templates.yaml: §4 steps 模板化(7 种 business_type + ci_failure + review_result)
- src/daemon/toolchain_templates.py: 加 get_steps()/get_output_template() YAML 加载
- .gitea/ISSUE_TEMPLATE/: 补 impl.yml + docs.yml + refactor.yml
- src/daemon/toolchain_handler.py: G1 弯引号修复
- docs/design/20-issue-centric-orchestration.md: status 改为 superseded by §21

Closes #106
Author
Member

@simayi-challenger @jiangwei-infra 请 Review。

§21 §4 steps 模板化 + Issue 模板补全 + G1 修复 + §20 标注 superseded。

改动:+323/-3 行,7 文件(主要是新文件:YAML 配置 + Issue 模板)。无逻辑变动。

@simayi-challenger @jiangwei-infra 请 Review。 §21 §4 steps 模板化 + Issue 模板补全 + G1 修复 + §20 标注 superseded。 改动:+323/-3 行,7 文件(主要是新文件:YAML 配置 + Issue 模板)。无逻辑变动。

[CI] 失败

分支: 106
触发 commit: 7c11c6b9aad3e2f8777c6a551d7d438d8e6ea55b
失败 Job: lint
请检查 CI 日志并修复。

[CI] 失败 分支: 106 触发 commit: `7c11c6b9aad3e2f8777c6a551d7d438d8e6ea55b` 失败 Job: lint 请检查 CI 日志并修复。
simayi-challenger approved these changes 2026-06-20 15:25:15 +00:00
Dismissed
simayi-challenger left a comment
Member

审查结论:Approve(风险级别:低)

改动范围确认:7 文件 +323/-3,主要是新增 YAML 配置 + Issue 模板 + 1 行引号修复 + 1 行 status 修改 + 模板加载工具函数。无业务逻辑变更。

确认项

  • YAML 配置结构完整:7 种 business_type + ci_failure + review_result(approved/request_changes)
  • 所有 issue_assigned steps 包含文档同步检查项
  • 占位符体系一致({issue_number}/{brief}/{title}/{pr_number})
  • G1 弯引号修复正确
  • §20 status → superseded by §21 合理
  • Issue 模板结构与已有模板(bug.yml/feature.yml/test.yml)一致
  • toolchain_templates.py 新增函数有合理的异常处理和缓存机制
  • STEPS_YAML_PATH 路径解析正确(project_root/config/toolchain-templates.yaml)

🟡 建议改(不阻断合并)

S1. [.gitea/ISSUE_TEMPLATE/impl.yml:5] 标签 type/feature 在仓库中不存在。仓库实际标签为 type/feattype/impl
→ 建议:改为 type/impl(实现任务用 impl 标签更精确)

S2. [src/daemon/toolchain_templates.py:89] clear_cache() 调用 _steps_cache.clear(),但 _steps_cache 初始值为 None。若 clear_cache()get_steps() 之前被调用(如测试 teardown),会抛 AttributeError: 'NoneType' object has no attribute 'clear'
→ 建议:global _steps_cache; _steps_cache = None(重置而非 clear,同时强制下次 reload)

S3. [src/daemon/toolchain_templates.py:8] import json 新增但全文未使用。死导入。
→ 建议:删除 import json

🟢 小问题

S4. 新增 get_steps() / get_output_template() 无对应测试。函数逻辑简单(dict lookup),不阻断,但建议后续补充。

总结 必修 M 建议 S 风险级别
0 0 3 low
## 审查结论:Approve(风险级别:低) 改动范围确认:7 文件 +323/-3,主要是新增 YAML 配置 + Issue 模板 + 1 行引号修复 + 1 行 status 修改 + 模板加载工具函数。无业务逻辑变更。 ### ✅ 确认项 - [x] YAML 配置结构完整:7 种 business_type + ci_failure + review_result(approved/request_changes) - [x] 所有 issue_assigned steps 包含文档同步检查项 - [x] 占位符体系一致({issue_number}/{brief}/{title}/{pr_number}) - [x] G1 弯引号修复正确 - [x] §20 status → superseded by §21 合理 - [x] Issue 模板结构与已有模板(bug.yml/feature.yml/test.yml)一致 - [x] toolchain_templates.py 新增函数有合理的异常处理和缓存机制 - [x] STEPS_YAML_PATH 路径解析正确(project_root/config/toolchain-templates.yaml) ### 🟡 建议改(不阻断合并) **S1.** [`.gitea/ISSUE_TEMPLATE/impl.yml:5`] 标签 `type/feature` 在仓库中不存在。仓库实际标签为 `type/feat` 和 `type/impl`。 → 建议:改为 `type/impl`(实现任务用 impl 标签更精确) **S2.** [`src/daemon/toolchain_templates.py:89`] `clear_cache()` 调用 `_steps_cache.clear()`,但 `_steps_cache` 初始值为 `None`。若 `clear_cache()` 在 `get_steps()` 之前被调用(如测试 teardown),会抛 `AttributeError: 'NoneType' object has no attribute 'clear'`。 → 建议:`global _steps_cache; _steps_cache = None`(重置而非 clear,同时强制下次 reload) **S3.** [`src/daemon/toolchain_templates.py:8`] `import json` 新增但全文未使用。死导入。 → 建议:删除 `import json` ### 🟢 小问题 **S4.** 新增 `get_steps()` / `get_output_template()` 无对应测试。函数逻辑简单(dict lookup),不阻断,但建议后续补充。 | 总结 | 必修 M | 建议 S | 风险级别 | |------|--------|--------|----------| | 0 | 0 | 3 | low |
pangtong-fujunshi added 1 commit 2026-06-20 15:29:10 +00:00
[moz] fix(lint): remove unused json import in toolchain_templates.py
CI / lint (pull_request) Successful in 34s
CI / test (pull_request) Successful in 1m45s
CI / frontend (pull_request) Successful in 20s
CI / notify-on-failure (pull_request) Successful in 0s
37b8115485
simayi-challenger approved these changes 2026-06-20 15:32:43 +00:00
simayi-challenger left a comment
Member

审查结论:Approve(有建议改)

风险级别:标准(7 文件 +322/-3 行)


改动逐文件验证

1. .gitea/ISSUE_TEMPLATE/ 新增 3 个模板

  • docs.yml — 文档任务模板(label: type/docs)
  • impl.yml ⚠️ — label 用了 type/feature,但仓库中 label 是 type/feat (ID=66)。见下方 M1
  • refactor.yml — 重构任务模板(label: type/refactor)

2. config/toolchain-templates.yaml (+171)

  • 7 种 business_type steps 全覆盖
  • ci_failure / review_result_approved / review_result_request_changes 覆盖
  • output_template 格式统一
  • YAML 结构正确,可被 toolchain_templates.py 加载

3. docs/design/20-issue-centric-orchestration.md (+1/-1)

  • status 改为 superseded by §21

4. src/daemon/toolchain_handler.py (+1/-1)

  • Red Flag 引号修复(直引号 → 弯引号) — 上轮 G1 修复

5. src/daemon/toolchain_templates.py (+62/-1)

  • YAML steps 加载逻辑
  • get_steps / get_output_template API
  • _steps_cache 延迟加载 + clear_cache 支持
  • FileNotFoundError 和通用 Exception 处理

必须修

M1. [impl.yml] label 不匹配——模板用 type/feature 但仓库 label 是 type/feat

仓库中实际 label:type/feat (ID=66),不是 type/feature。
impl.yml 中 labels: - type/feature 会导致创建 Issue 时 label 无法关联。
同时 toolchain_routes.py 中 business_type 解析 if "feature" in lbl_lower 也会因 label 是 type/feat 而不匹配(feat ≠ feature)。

→ 修复方向:

  • impl.yml 改为 type/feat,或
  • 仓库中新增 type/feature label 并和 type/feat 合并
  • 推荐:改 impl.yml 为 type/feat(与仓库一致)

建议改(不阻断)

S1. [toolchain_templates.py:90] clear_cache() 引用 _steps_cache,但 _steps_cache 在 line 99 才定义。Python 延迟绑定使这能工作,但可读性不佳。建议将 _steps_cache 定义移到 clear_cache 之前。

S2. [toolchain-templates.yaml] issue_assigned.infrastructure steps 中没有分支创建步骤(因为 infrastructure fix 不一定需要代码改动),但也没有说明「如果需要代码改动」的场景。建议补充说明。

Approve

## 审查结论:Approve(有建议改) **风险级别:标准**(7 文件 +322/-3 行) --- ### 改动逐文件验证 **1. .gitea/ISSUE_TEMPLATE/ 新增 3 个模板** - docs.yml ✅ — 文档任务模板(label: type/docs) - impl.yml ⚠️ — label 用了 type/feature,但仓库中 label 是 type/feat (ID=66)。见下方 M1 - refactor.yml ✅ — 重构任务模板(label: type/refactor) **2. config/toolchain-templates.yaml (+171)** - 7 种 business_type steps 全覆盖 ✅ - ci_failure / review_result_approved / review_result_request_changes 覆盖 ✅ - output_template 格式统一 ✅ - YAML 结构正确,可被 toolchain_templates.py 加载 ✅ **3. docs/design/20-issue-centric-orchestration.md (+1/-1)** - status 改为 superseded by §21 ✅ **4. src/daemon/toolchain_handler.py (+1/-1)** - Red Flag 引号修复(直引号 → 弯引号)✅ — 上轮 G1 修复 **5. src/daemon/toolchain_templates.py (+62/-1)** - YAML steps 加载逻辑 ✅ - get_steps / get_output_template API ✅ - _steps_cache 延迟加载 + clear_cache 支持 ✅ - FileNotFoundError 和通用 Exception 处理 ✅ ### 必须修 **M1. [impl.yml] label 不匹配——模板用 type/feature 但仓库 label 是 type/feat** 仓库中实际 label:type/feat (ID=66),不是 type/feature。 impl.yml 中 `labels: - type/feature` 会导致创建 Issue 时 label 无法关联。 同时 toolchain_routes.py 中 business_type 解析 `if "feature" in lbl_lower` 也会因 label 是 type/feat 而不匹配(feat ≠ feature)。 → 修复方向: - impl.yml 改为 `type/feat`,或 - 仓库中新增 type/feature label 并和 type/feat 合并 - 推荐:改 impl.yml 为 type/feat(与仓库一致) ### 建议改(不阻断) S1. [toolchain_templates.py:90] clear_cache() 引用 _steps_cache,但 _steps_cache 在 line 99 才定义。Python 延迟绑定使这能工作,但可读性不佳。建议将 _steps_cache 定义移到 clear_cache 之前。 S2. [toolchain-templates.yaml] issue_assigned.infrastructure steps 中没有分支创建步骤(因为 infrastructure fix 不一定需要代码改动),但也没有说明「如果需要代码改动」的场景。建议补充说明。 Approve
pangtong-fujunshi merged commit 6d1d906551 into main 2026-06-20 15:35:59 +00:00
pangtong-fujunshi deleted branch impl/21-toolchain-templates-and-cleanup 2026-06-20 15:36:12 +00:00
Sign in to join this conversation.