diff --git a/.gitea/workflows/pr-check.yml b/.gitea/workflows/pr-check.yml index ac2300f..3bf1d23 100644 --- a/.gitea/workflows/pr-check.yml +++ b/.gitea/workflows/pr-check.yml @@ -1,8 +1,10 @@ -# 前端类型检查 + 单元测试(每次 push master 触发) -name: Push Check +# 前端类型检查 + 单元测试(push master/feat/* 或向 master 发 PR 时触发) +name: Push & PR Check on: push: + branches: [master, 'feat/**'] + pull_request: branches: [master] jobs: diff --git a/AGENTS.md b/AGENTS.md index cd03478..8ebfe26 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -166,9 +166,27 @@ docs/templates/ 炼境接入包模板草案(设计层) ## Git 工作流 -见 `docs/ai-context/git-workflow.md`(分支策略 + Conventional Commits + Rules-Applied trailer + PR 规范)。 +见 `docs/ai-context/git-workflow.md`(Conventional Commits + Rules-Applied trailer + PR 规范)。 **commit 必须符合 Conventional Commits**(lefthook 强制),炼境据此采集飞轮数据。 +### 炼境自身的分支策略 + +> `git-workflow.md` 是分发给被管理子项目的接入包模板(dev→main 双分支)。 +> 炼境自身使用以下策略,不套用子项目模板。 + +| 任务复杂度 | 分支策略 | +|-----------|---------| +| S(简单增删改) | 直接 push `master`,不开分支 | +| M(中等逻辑) | 开 `feat/` 分支,完成后 PR → `master` | +| L(复杂系统) | 开 `feat/` 分支,必须走 PR + CI 验证 | + +**分支命名**:直接对应蓝图模块 ID,如 `feat/manage-multi-view`、`feat/flywheel-intelligence`。 + +**为什么 M/L 要开分支**: +- PR body 是 agent 自验报告的归宿,飞轮从中采集结构化数据(PR 事件比 push 事件包含更多意图信息) +- feat/* 分支触发 PR CI,是 agent 自验链条的最后一环(本地 typecheck → PR CI → 人终验) +- 炼境推荐子项目走 PR 工作流,自身也应遵守同一套规范 + ## agent 按钮与验证路径 > 完整体系设计见 `docs/ai-context/agent-button-system.md`。