feat: Gitea 协作规范落地 — 标题前缀+Label+模板+L2注入
CI / lint (pull_request) Successful in 7s
CI / test (pull_request) Successful in 30s
CI / notify-on-failure (pull_request) Successful in 0s

This commit is contained in:
cfdaily
2026-06-14 11:51:57 +08:00
parent 1c939bfa27
commit a89a70a983
10 changed files with 223 additions and 15 deletions
+84 -9
View File
@@ -245,11 +245,14 @@ pm2 show sanguo-act-runner # 详情
|------|------|
| `feat` | 新功能 |
| `fix` | Bug 修复 |
| `impl` | 按设计文档实现 |
| `refactor` | 重构(不改行为) |
| `test` | 测试相关 |
| `docs` | 文档 |
| `chore` | 构建/工具/配置 |
sanguo 组织所有仓库统一使用此 commit 规范。
---
## §4. 问题管理
@@ -266,15 +269,19 @@ pm2 show sanguo-act-runner # 详情
### 4.2 Issue 标签体系
| 标签 | 颜色 | 说明 |
|------|------|------|
| `bug` | 红 | 功能异常 |
| `feature` | 蓝 | 新功能需求 |
| `improvement` | 绿 | 改进优化 |
| `security` | 橙 | 安全相关 |
| `risk:high/standard/low` | 分级色 | 风险级别(见 §6.1 判定规则) |
| `priority:high/medium/low` | 黄/灰 | 优先级 |
| `blocked` | | 阻塞中 |
| 标签 | 颜色 | 色值 | 说明 |
|------|------|------|------|
| `type/bug` | 红 | #ee0701 | Bug 修复 |
| `type/feat` | 蓝 | #84b6eb | 新功能 |
| `type/impl` | 浅蓝 | #c5def5 | 按设计实现 |
| `type/docs` | 黄 | #fbca04 | 文档 |
| `type/test` | 绿 | #0e8a16 | 测试 |
| `type/ci` | 紫 | #d4c5f9 | CI/CD |
| `type/refactor` | | #ff6f00 | 重构 |
| `priority/P0` | 深红 | #b60205 | 紧急 |
| `priority/P1` | 红 | #d93f0b | 高 |
| `priority/P2` | 黄 | #fbca04 | 中 |
| `priority/P3` | 浅蓝 | #c5def5 | 低 |
### 4.3 需求/问题 Review 前置
@@ -296,6 +303,29 @@ Open → In Progress → Review → Closed
└──── Reopened ←───────────────────┘
```
### 4.5 标题规范
所有 Issue 和 PR 标题**必须**包含项目代号前缀,让人类一眼识别项目+类型:
**Issue**: `[代号] type: 简述`
**PR**: `[代号] type(scope): 简述`
项目代号:
| 仓库 | 代号 |
|------|------|
| sanguo_moziplus_v2 | moz |
| sanguo_quant_live | quant |
| sanguo_vnpy | vnpy |
示例:
- `[moz] bug: Mail API 500 when comment_type invalid`
- `[moz] impl(daemon): 知识注入 L2 引擎层 — WikiGuideSection`
- `[quant] feat: 趋势跟踪策略骨架`
此规范通过 L2 引擎层 `GiteaConventionSection`priority=55)自动注入所有 Agent prompt。
完整规范文档:L3 Skill `gitea-conventions`
---
## §5. CI/CD 管道设计
@@ -3297,3 +3327,48 @@ async def _handle_issue_comment(payload):
|------|------|------|
| 2026-06-09 | v1.0 | 初版:E2E 真实场景暴露问题 → 四层改造方案 + @mention 通知 + Mail type 改造 |
---
## §26. Gitea 协作规范落地
> **状态**: ✅ 已完成
> **日期**: 2026-06-14
> **PR**: 本次改动随 PR 提交
### 26.1 动机
团队三个仓库(moziplus_v2 / quant_live / vnpy)缺少统一的 Issue/PR 模板、Label 体系和标题规范。人类从标题无法一眼分辨是哪个项目什么类型的问题。
### 26.2 落地内容
| 层级 | 内容 | 说明 |
|------|------|------|
| L3 | `gitea-conventions` Skill | 完整规范文档(标题/分支/commit/label |
| L2 | `GiteaConventionSection`priority=55 | 注入所有 handlertask/toolchain/mail),自动提醒 Agent 遵循标题格式 |
| L1 | TOOLS.md 追加代号表 | Agent 静态可见的速查 |
| Gitea 模板 | 3 仓库 × 4 文件 | bug.yml / feature.yml / test.yml / PULL_REQUEST_TEMPLATE.md |
| Gitea Labels | 3 仓库 × 11 个 | type × 7 + priority × 4 |
### 26.3 四层注入路径
```
L1 TOOLS.md(静态,Agent workspace
→ 代号表 + 格式速查
L2 GiteaConventionSection(动态,每次 spawn 注入)
→ "创建 Issue/PR 时标题必须带 [代号] 前缀"
L3 gitea-conventions Skill(被动,extraDirs 自动发现)
→ 完整规范:标题/分支/commit/label/模板
```
### 26.4 代码改动
| 文件 | 改动 |
|------|------|
| `prompt_composer.py` | 新增 `GiteaConventionSection`priority=55 |
| `task_handler.py` | `get_sections()` 注册 `GiteaConventionSection()` |
| `toolchain_handler.py` | `get_sections()` 注册 `GiteaConventionSection()` |
| `mail_handler.py` | `get_sections()` 注册 `GiteaConventionSection()` |
| `db.py` | `COMMENT_TYPES``action_report`(修 API 500 bug |