@fitlab-ai/agent-infra 0.4.0 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -15
- package/README.zh-CN.md +23 -15
- package/lib/defaults.json +5 -9
- package/lib/init.js +1 -6
- package/lib/update.js +0 -55
- package/package.json +1 -1
- package/templates/.agents/QUICKSTART.md +17 -7
- package/templates/.agents/QUICKSTART.zh-CN.md +23 -13
- package/templates/.agents/README.md +33 -27
- package/templates/.agents/README.zh-CN.md +35 -29
- package/templates/.agents/skills/analyze-task/SKILL.md +1 -4
- package/templates/.agents/skills/analyze-task/SKILL.zh-CN.md +1 -3
- package/templates/.agents/skills/block-task/SKILL.md +1 -5
- package/templates/.agents/skills/block-task/SKILL.zh-CN.md +1 -4
- package/templates/.agents/skills/check-task/SKILL.md +1 -5
- package/templates/.agents/skills/check-task/SKILL.zh-CN.md +1 -3
- package/templates/.agents/skills/close-codescan/SKILL.md +1 -4
- package/templates/.agents/skills/close-codescan/SKILL.zh-CN.md +1 -3
- package/templates/.agents/skills/close-dependabot/SKILL.md +1 -4
- package/templates/.agents/skills/close-dependabot/SKILL.zh-CN.md +1 -3
- package/templates/.agents/skills/commit/SKILL.md +26 -198
- package/templates/.agents/skills/commit/SKILL.zh-CN.md +26 -197
- package/templates/.agents/skills/commit/reference/commit-message.md +60 -0
- package/templates/.agents/skills/commit/reference/commit-message.zh-CN.md +60 -0
- package/templates/.agents/skills/commit/reference/copyright-check.md +39 -0
- package/templates/.agents/skills/commit/reference/copyright-check.zh-CN.md +39 -0
- package/templates/.agents/skills/commit/reference/task-status-update.md +88 -0
- package/templates/.agents/skills/commit/reference/task-status-update.zh-CN.md +88 -0
- package/templates/.agents/skills/complete-task/SKILL.md +1 -6
- package/templates/.agents/skills/complete-task/SKILL.zh-CN.md +1 -4
- package/templates/.agents/skills/create-issue/SKILL.md +32 -251
- package/templates/.agents/skills/create-issue/SKILL.zh-CN.md +33 -252
- package/templates/.agents/skills/create-issue/reference/label-and-type.md +77 -0
- package/templates/.agents/skills/create-issue/reference/label-and-type.zh-CN.md +77 -0
- package/templates/.agents/skills/create-issue/reference/template-matching.md +45 -0
- package/templates/.agents/skills/create-issue/reference/template-matching.zh-CN.md +45 -0
- package/templates/.agents/skills/create-pr/SKILL.md +39 -221
- package/templates/.agents/skills/create-pr/SKILL.zh-CN.md +39 -220
- package/templates/.agents/skills/create-pr/reference/branch-strategy.md +29 -0
- package/templates/.agents/skills/create-pr/reference/branch-strategy.zh-CN.md +29 -0
- package/templates/.agents/skills/create-pr/reference/pr-body-template.md +86 -0
- package/templates/.agents/skills/create-pr/reference/pr-body-template.zh-CN.md +86 -0
- package/templates/.agents/skills/create-release-note/SKILL.md +10 -13
- package/templates/.agents/skills/create-release-note/SKILL.zh-CN.md +10 -12
- package/templates/.agents/skills/create-task/SKILL.md +2 -5
- package/templates/.agents/skills/create-task/SKILL.zh-CN.md +2 -4
- package/templates/.agents/skills/implement-task/SKILL.md +47 -176
- package/templates/.agents/skills/implement-task/SKILL.zh-CN.md +43 -170
- package/templates/.agents/skills/implement-task/reference/implementation-rules.md +58 -0
- package/templates/.agents/skills/implement-task/reference/implementation-rules.zh-CN.md +58 -0
- package/templates/.agents/skills/implement-task/reference/report-template.md +63 -0
- package/templates/.agents/skills/implement-task/reference/report-template.zh-CN.md +63 -0
- package/templates/.agents/skills/import-codescan/SKILL.md +1 -4
- package/templates/.agents/skills/import-codescan/SKILL.zh-CN.md +1 -3
- package/templates/.agents/skills/import-dependabot/SKILL.md +1 -4
- package/templates/.agents/skills/import-dependabot/SKILL.zh-CN.md +1 -3
- package/templates/.agents/skills/import-issue/SKILL.md +2 -3
- package/templates/.agents/skills/import-issue/SKILL.zh-CN.md +2 -3
- package/templates/.agents/skills/init-labels/SKILL.md +1 -4
- package/templates/.agents/skills/init-labels/SKILL.zh-CN.md +1 -4
- package/templates/.agents/skills/init-milestones/SKILL.md +1 -3
- package/templates/.agents/skills/init-milestones/SKILL.zh-CN.md +1 -3
- package/templates/.agents/skills/plan-task/SKILL.md +1 -5
- package/templates/.agents/skills/plan-task/SKILL.zh-CN.md +1 -3
- package/templates/.agents/skills/refine-task/SKILL.md +40 -162
- package/templates/.agents/skills/refine-task/SKILL.zh-CN.md +38 -158
- package/templates/.agents/skills/refine-task/reference/fix-workflow.md +76 -0
- package/templates/.agents/skills/refine-task/reference/fix-workflow.zh-CN.md +76 -0
- package/templates/.agents/skills/refine-task/reference/report-template.md +38 -0
- package/templates/.agents/skills/refine-task/reference/report-template.zh-CN.md +38 -0
- package/templates/.agents/skills/refine-title/SKILL.md +1 -4
- package/templates/.agents/skills/refine-title/SKILL.zh-CN.md +1 -3
- package/templates/.agents/skills/release/SKILL.md +10 -12
- package/templates/.agents/skills/release/SKILL.zh-CN.md +10 -11
- package/templates/.agents/skills/review-task/SKILL.md +37 -239
- package/templates/.agents/skills/review-task/SKILL.zh-CN.md +37 -238
- package/templates/.agents/skills/review-task/reference/output-templates.md +72 -0
- package/templates/.agents/skills/review-task/reference/output-templates.zh-CN.md +72 -0
- package/templates/.agents/skills/review-task/reference/report-template.md +63 -0
- package/templates/.agents/skills/review-task/reference/report-template.zh-CN.md +63 -0
- package/templates/.agents/skills/review-task/reference/review-criteria.md +24 -0
- package/templates/.agents/skills/review-task/reference/review-criteria.zh-CN.md +24 -0
- package/templates/.agents/skills/sync-issue/SKILL.md +34 -490
- package/templates/.agents/skills/sync-issue/SKILL.zh-CN.md +34 -489
- package/templates/.agents/skills/sync-issue/reference/comment-publish.md +84 -0
- package/templates/.agents/skills/sync-issue/reference/comment-publish.zh-CN.md +84 -0
- package/templates/.agents/skills/sync-issue/reference/label-sync.md +62 -0
- package/templates/.agents/skills/sync-issue/reference/label-sync.zh-CN.md +62 -0
- package/templates/.agents/skills/sync-issue/reference/milestone-sync.md +37 -0
- package/templates/.agents/skills/sync-issue/reference/milestone-sync.zh-CN.md +37 -0
- package/templates/.agents/skills/sync-pr/SKILL.md +37 -284
- package/templates/.agents/skills/sync-pr/SKILL.zh-CN.md +41 -288
- package/templates/.agents/skills/sync-pr/reference/comment-publish.md +82 -0
- package/templates/.agents/skills/sync-pr/reference/comment-publish.zh-CN.md +82 -0
- package/templates/.agents/skills/sync-pr/reference/delivery-detection.md +54 -0
- package/templates/.agents/skills/sync-pr/reference/delivery-detection.zh-CN.md +54 -0
- package/templates/.agents/skills/test/SKILL.md +1 -3
- package/templates/.agents/skills/test/SKILL.zh-CN.md +1 -3
- package/templates/.agents/skills/test-integration/SKILL.md +1 -4
- package/templates/.agents/skills/test-integration/SKILL.zh-CN.md +1 -3
- package/templates/.agents/skills/update-agent-infra/SKILL.md +2 -6
- package/templates/.agents/skills/update-agent-infra/SKILL.zh-CN.md +2 -4
- package/templates/.agents/skills/update-agent-infra/scripts/sync-templates.js +45 -55
- package/templates/.agents/skills/upgrade-dependency/SKILL.md +1 -4
- package/templates/.agents/skills/upgrade-dependency/SKILL.zh-CN.md +1 -3
- package/templates/.claude/commands/analyze-task.md +1 -1
- package/templates/.claude/commands/analyze-task.zh-CN.md +1 -1
- package/templates/.claude/commands/block-task.md +2 -1
- package/templates/.claude/commands/block-task.zh-CN.md +2 -1
- package/templates/.claude/commands/check-task.md +2 -1
- package/templates/.claude/commands/check-task.zh-CN.md +2 -1
- package/templates/.claude/commands/close-codescan.md +2 -1
- package/templates/.claude/commands/close-codescan.zh-CN.md +2 -1
- package/templates/.claude/commands/close-dependabot.md +2 -1
- package/templates/.claude/commands/close-dependabot.zh-CN.md +2 -1
- package/templates/.claude/commands/commit.md +1 -1
- package/templates/.claude/commands/commit.zh-CN.md +1 -1
- package/templates/.claude/commands/complete-task.md +1 -1
- package/templates/.claude/commands/complete-task.zh-CN.md +1 -1
- package/templates/.claude/commands/create-issue.md +1 -1
- package/templates/.claude/commands/create-issue.zh-CN.md +1 -1
- package/templates/.claude/commands/create-pr.md +2 -2
- package/templates/.claude/commands/create-pr.zh-CN.md +2 -2
- package/templates/.claude/commands/create-release-note.md +2 -1
- package/templates/.claude/commands/create-release-note.zh-CN.md +2 -1
- package/templates/.claude/commands/create-task.md +1 -1
- package/templates/.claude/commands/create-task.zh-CN.md +1 -1
- package/templates/.claude/commands/implement-task.md +1 -1
- package/templates/.claude/commands/implement-task.zh-CN.md +1 -1
- package/templates/.claude/commands/import-codescan.md +1 -0
- package/templates/.claude/commands/import-codescan.zh-CN.md +2 -1
- package/templates/.claude/commands/import-dependabot.md +1 -0
- package/templates/.claude/commands/import-dependabot.zh-CN.md +2 -1
- package/templates/.claude/commands/import-issue.md +1 -1
- package/templates/.claude/commands/import-issue.zh-CN.md +1 -1
- package/templates/.claude/commands/init-labels.md +1 -0
- package/templates/.claude/commands/init-labels.zh-CN.md +2 -1
- package/templates/.claude/commands/init-milestones.md +2 -1
- package/templates/.claude/commands/init-milestones.zh-CN.md +2 -1
- package/templates/.claude/commands/plan-task.md +1 -1
- package/templates/.claude/commands/plan-task.zh-CN.md +1 -1
- package/templates/.claude/commands/refine-task.zh-CN.md +1 -1
- package/templates/.claude/commands/refine-title.md +2 -1
- package/templates/.claude/commands/refine-title.zh-CN.md +2 -1
- package/templates/.claude/commands/release.md +2 -1
- package/templates/.claude/commands/release.zh-CN.md +2 -1
- package/templates/.claude/commands/review-task.md +1 -1
- package/templates/.claude/commands/review-task.zh-CN.md +1 -1
- package/templates/.claude/commands/sync-issue.md +1 -1
- package/templates/.claude/commands/sync-issue.zh-CN.md +1 -1
- package/templates/.claude/commands/sync-pr.md +2 -2
- package/templates/.claude/commands/sync-pr.zh-CN.md +2 -2
- package/templates/.claude/commands/test-integration.md +2 -1
- package/templates/.claude/commands/test-integration.zh-CN.md +2 -1
- package/templates/.claude/commands/test.md +1 -1
- package/templates/.claude/commands/test.zh-CN.md +1 -1
- package/templates/.claude/commands/update-agent-infra.md +2 -1
- package/templates/.claude/commands/update-agent-infra.zh-CN.md +2 -1
- package/templates/.claude/commands/upgrade-dependency.md +2 -1
- package/templates/.claude/commands/upgrade-dependency.zh-CN.md +2 -1
- package/templates/.gemini/commands/_project_/analyze-task.toml +1 -1
- package/templates/.gemini/commands/_project_/analyze-task.zh-CN.toml +1 -1
- package/templates/.gemini/commands/_project_/block-task.toml +1 -1
- package/templates/.gemini/commands/_project_/block-task.zh-CN.toml +1 -1
- package/templates/.gemini/commands/_project_/check-task.toml +1 -1
- package/templates/.gemini/commands/_project_/check-task.zh-CN.toml +1 -1
- package/templates/.gemini/commands/_project_/close-codescan.toml +1 -1
- package/templates/.gemini/commands/_project_/close-codescan.zh-CN.toml +1 -1
- package/templates/.gemini/commands/_project_/close-dependabot.toml +1 -1
- package/templates/.gemini/commands/_project_/close-dependabot.zh-CN.toml +1 -1
- package/templates/.gemini/commands/_project_/commit.toml +1 -1
- package/templates/.gemini/commands/_project_/commit.zh-CN.toml +1 -1
- package/templates/.gemini/commands/_project_/complete-task.toml +1 -1
- package/templates/.gemini/commands/_project_/complete-task.zh-CN.toml +1 -1
- package/templates/.gemini/commands/_project_/create-issue.zh-CN.toml +1 -1
- package/templates/.gemini/commands/_project_/create-pr.toml +1 -1
- package/templates/.gemini/commands/_project_/create-pr.zh-CN.toml +1 -1
- package/templates/.gemini/commands/_project_/create-release-note.toml +1 -1
- package/templates/.gemini/commands/_project_/create-release-note.zh-CN.toml +1 -1
- package/templates/.gemini/commands/_project_/create-task.toml +1 -1
- package/templates/.gemini/commands/_project_/create-task.zh-CN.toml +1 -1
- package/templates/.gemini/commands/_project_/implement-task.toml +1 -1
- package/templates/.gemini/commands/_project_/implement-task.zh-CN.toml +1 -1
- package/templates/.gemini/commands/_project_/import-codescan.zh-CN.toml +1 -1
- package/templates/.gemini/commands/_project_/import-dependabot.zh-CN.toml +1 -1
- package/templates/.gemini/commands/_project_/import-issue.toml +1 -1
- package/templates/.gemini/commands/_project_/import-issue.zh-CN.toml +1 -1
- package/templates/.gemini/commands/_project_/init-labels.zh-CN.toml +1 -1
- package/templates/.gemini/commands/_project_/init-milestones.toml +1 -1
- package/templates/.gemini/commands/_project_/init-milestones.zh-CN.toml +1 -1
- package/templates/.gemini/commands/_project_/plan-task.toml +1 -1
- package/templates/.gemini/commands/_project_/plan-task.zh-CN.toml +1 -1
- package/templates/.gemini/commands/_project_/refine-task.zh-CN.toml +1 -1
- package/templates/.gemini/commands/_project_/refine-title.toml +1 -1
- package/templates/.gemini/commands/_project_/refine-title.zh-CN.toml +1 -1
- package/templates/.gemini/commands/_project_/release.toml +1 -1
- package/templates/.gemini/commands/_project_/release.zh-CN.toml +1 -1
- package/templates/.gemini/commands/_project_/review-task.toml +1 -1
- package/templates/.gemini/commands/_project_/review-task.zh-CN.toml +1 -1
- package/templates/.gemini/commands/_project_/sync-issue.toml +1 -1
- package/templates/.gemini/commands/_project_/sync-issue.zh-CN.toml +1 -1
- package/templates/.gemini/commands/_project_/sync-pr.toml +2 -2
- package/templates/.gemini/commands/_project_/sync-pr.zh-CN.toml +2 -2
- package/templates/.gemini/commands/_project_/test-integration.toml +1 -1
- package/templates/.gemini/commands/_project_/test-integration.zh-CN.toml +1 -1
- package/templates/.gemini/commands/_project_/test.toml +1 -1
- package/templates/.gemini/commands/_project_/test.zh-CN.toml +1 -1
- package/templates/.gemini/commands/_project_/update-agent-infra.toml +1 -1
- package/templates/.gemini/commands/_project_/update-agent-infra.zh-CN.toml +1 -1
- package/templates/.gemini/commands/_project_/upgrade-dependency.toml +1 -1
- package/templates/.gemini/commands/_project_/upgrade-dependency.zh-CN.toml +1 -1
- package/templates/.github/hooks/check-version-format.sh +29 -0
- package/templates/.github/hooks/pre-commit +8 -0
- package/templates/.opencode/commands/analyze-task.md +1 -1
- package/templates/.opencode/commands/analyze-task.zh-CN.md +1 -1
- package/templates/.opencode/commands/block-task.md +1 -1
- package/templates/.opencode/commands/block-task.zh-CN.md +1 -1
- package/templates/.opencode/commands/check-task.md +1 -1
- package/templates/.opencode/commands/check-task.zh-CN.md +1 -1
- package/templates/.opencode/commands/close-codescan.md +1 -1
- package/templates/.opencode/commands/close-codescan.zh-CN.md +1 -1
- package/templates/.opencode/commands/close-dependabot.md +1 -1
- package/templates/.opencode/commands/close-dependabot.zh-CN.md +1 -1
- package/templates/.opencode/commands/commit.md +1 -1
- package/templates/.opencode/commands/commit.zh-CN.md +1 -1
- package/templates/.opencode/commands/complete-task.md +1 -1
- package/templates/.opencode/commands/complete-task.zh-CN.md +1 -1
- package/templates/.opencode/commands/create-issue.zh-CN.md +1 -1
- package/templates/.opencode/commands/create-pr.md +1 -1
- package/templates/.opencode/commands/create-pr.zh-CN.md +1 -1
- package/templates/.opencode/commands/create-release-note.md +1 -1
- package/templates/.opencode/commands/create-release-note.zh-CN.md +1 -1
- package/templates/.opencode/commands/create-task.md +1 -1
- package/templates/.opencode/commands/create-task.zh-CN.md +1 -1
- package/templates/.opencode/commands/implement-task.md +1 -1
- package/templates/.opencode/commands/implement-task.zh-CN.md +1 -1
- package/templates/.opencode/commands/import-codescan.zh-CN.md +1 -1
- package/templates/.opencode/commands/import-dependabot.zh-CN.md +1 -1
- package/templates/.opencode/commands/import-issue.md +1 -1
- package/templates/.opencode/commands/import-issue.zh-CN.md +1 -1
- package/templates/.opencode/commands/init-labels.zh-CN.md +1 -1
- package/templates/.opencode/commands/init-milestones.md +1 -1
- package/templates/.opencode/commands/init-milestones.zh-CN.md +1 -1
- package/templates/.opencode/commands/plan-task.md +1 -1
- package/templates/.opencode/commands/plan-task.zh-CN.md +1 -1
- package/templates/.opencode/commands/refine-task.zh-CN.md +1 -1
- package/templates/.opencode/commands/refine-title.md +1 -1
- package/templates/.opencode/commands/refine-title.zh-CN.md +1 -1
- package/templates/.opencode/commands/release.md +1 -1
- package/templates/.opencode/commands/release.zh-CN.md +1 -1
- package/templates/.opencode/commands/review-task.md +1 -1
- package/templates/.opencode/commands/review-task.zh-CN.md +1 -1
- package/templates/.opencode/commands/sync-issue.md +1 -1
- package/templates/.opencode/commands/sync-issue.zh-CN.md +1 -1
- package/templates/.opencode/commands/sync-pr.md +2 -2
- package/templates/.opencode/commands/sync-pr.zh-CN.md +2 -2
- package/templates/.opencode/commands/test-integration.md +1 -1
- package/templates/.opencode/commands/test-integration.zh-CN.md +1 -1
- package/templates/.opencode/commands/test.md +1 -1
- package/templates/.opencode/commands/test.zh-CN.md +1 -1
- package/templates/.opencode/commands/update-agent-infra.md +1 -1
- package/templates/.opencode/commands/update-agent-infra.zh-CN.md +1 -1
- package/templates/.opencode/commands/upgrade-dependency.md +1 -1
- package/templates/.opencode/commands/upgrade-dependency.zh-CN.md +1 -1
- package/templates/.claude/CLAUDE.md +0 -176
- package/templates/.claude/CLAUDE.zh-CN.md +0 -176
- package/templates/.claude/project-rules.md +0 -65
- package/templates/.claude/project-rules.zh-CN.md +0 -65
- package/templates/.codex/README.md +0 -38
- package/templates/.codex/README.zh-CN.md +0 -37
- package/templates/.opencode/COMMAND_STYLE_GUIDE.md +0 -232
- package/templates/.opencode/COMMAND_STYLE_GUIDE.zh-CN.md +0 -232
- package/templates/.opencode/README.md +0 -76
- package/templates/.opencode/README.zh-CN.md +0 -77
- package/templates/AGENTS.md +0 -104
- package/templates/AGENTS.zh-CN.md +0 -104
|
@@ -1,296 +1,63 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: sync-pr
|
|
3
|
-
description:
|
|
4
|
-
将任务处理进度同步到对应的 Pull Request,包含 PR 元数据同步和单条幂等审查摘要。
|
|
5
|
-
当用户要求同步进度到 PR 时触发。参数:task-id。
|
|
3
|
+
description: "将任务进度同步到 Pull Request"
|
|
6
4
|
---
|
|
7
5
|
|
|
8
6
|
# 同步进度到 PR
|
|
9
7
|
|
|
10
|
-
|
|
8
|
+
同步 PR 元数据,并维护一条面向 reviewer 的摘要评论。
|
|
11
9
|
|
|
12
10
|
## 执行流程
|
|
13
11
|
|
|
14
|
-
### 1.
|
|
12
|
+
### 1. 解析参数
|
|
15
13
|
|
|
16
|
-
|
|
17
|
-
- `.agents/workspace/active/{task-id}/task.md`
|
|
18
|
-
- `.agents/workspace/completed/{task-id}/task.md`
|
|
19
|
-
- `.agents/workspace/blocked/{task-id}/task.md`
|
|
20
|
-
|
|
21
|
-
注意:`{task-id}` 格式为 `TASK-{yyyyMMdd-HHmmss}`,例如 `TASK-20260306-143022`
|
|
22
|
-
|
|
23
|
-
### 2. 读取任务信息
|
|
24
|
-
|
|
25
|
-
从 task.md 中提取:
|
|
26
|
-
- `pr_number`(必需,如果缺失则提示用户)
|
|
27
|
-
- `type`
|
|
28
|
-
- `issue_number`(如适用)
|
|
29
|
-
- `current_step`
|
|
30
|
-
- 任务标题、描述、状态
|
|
31
|
-
- `created_at`、`updated_at`、`last_synced_to_pr_at`(如存在)
|
|
32
|
-
|
|
33
|
-
### 3. 读取上下文文件
|
|
34
|
-
|
|
35
|
-
检查并读取(如存在):
|
|
36
|
-
- 最高轮次的 `plan.md` / `plan-r{N}.md` - 技术方案
|
|
37
|
-
- `implementation.md`、`implementation-r{N}.md` - 实现报告
|
|
38
|
-
- `review.md`、`review-r{N}.md` - 审查报告
|
|
39
|
-
- `refinement.md`、`refinement-r{N}.md` - 修复报告
|
|
40
|
-
- 最高轮次的 `analysis.md` / `analysis-r{N}.md` - 需求分析(仅作为 `in:` label 的回退输入)
|
|
41
|
-
|
|
42
|
-
### 4. 获取仓库坐标并检查 label 体系是否已初始化
|
|
43
|
-
|
|
44
|
-
先获取仓库坐标,供后续 milestone 查询和评论同步复用:
|
|
45
|
-
|
|
46
|
-
```bash
|
|
47
|
-
repo="$(gh repo view --json nameWithOwner --jq '.nameWithOwner')"
|
|
48
|
-
owner="${repo%%/*}"
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
执行:
|
|
52
|
-
|
|
53
|
-
```bash
|
|
54
|
-
gh label list --search "type:" --limit 1 --json name --jq 'length'
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
判断规则:
|
|
58
|
-
- 返回 `0` -> 标准 label 体系缺失。先执行 `init-labels` 技能,然后重新执行本步骤
|
|
59
|
-
- 返回非 `0` -> 继续后续 PR 元数据同步
|
|
60
|
-
|
|
61
|
-
### 5. 同步 type label
|
|
62
|
-
|
|
63
|
-
根据 task.md 的 `type` 字段按下表映射:
|
|
64
|
-
|
|
65
|
-
| task.md type | GitHub label |
|
|
66
|
-
|---|---|
|
|
67
|
-
| bug、bugfix | `type: bug` |
|
|
68
|
-
| feature | `type: feature` |
|
|
69
|
-
| enhancement | `type: enhancement` |
|
|
70
|
-
| refactor、refactoring | `type: enhancement` |
|
|
71
|
-
| documentation | `type: documentation` |
|
|
72
|
-
| dependency-upgrade | `type: dependency-upgrade` |
|
|
73
|
-
| task | `type: task` |
|
|
74
|
-
| 其他 | 跳过 |
|
|
75
|
-
|
|
76
|
-
如果映射到具体 label,执行:
|
|
77
|
-
|
|
78
|
-
```bash
|
|
79
|
-
gh pr edit {pr-number} --add-label "{type-label}"
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
未映射到标准 type label 时跳过,不创建新 label。
|
|
83
|
-
|
|
84
|
-
### 6. 同步 in: label
|
|
85
|
-
|
|
86
|
-
从实现报告(优先)或分析报告中提取受影响模块:
|
|
87
|
-
- 优先读取 `implementation.md` 与 `implementation-r{N}.md` 中 `## 修改文件` / `## 新建文件` 的文件路径
|
|
88
|
-
- 如果实现报告不存在,则回退到分析报告中的受影响文件列表
|
|
89
|
-
|
|
90
|
-
对每个文件路径:
|
|
91
|
-
1. 取第一级目录作为模块名 `{module}`
|
|
92
|
-
2. 去重
|
|
93
|
-
3. 检查仓库中是否存在对应 label:
|
|
94
|
-
|
|
95
|
-
```bash
|
|
96
|
-
gh label list --search "in: {module}" --limit 10 --json name --jq '.[].name'
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
4. 只有存在精确匹配的 `in: {module}` label 时才执行:
|
|
100
|
-
|
|
101
|
-
```bash
|
|
102
|
-
gh pr edit {pr-number} --add-label "in: {module}"
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
5. 只添加,不移除现有的 `in:` labels
|
|
106
|
-
|
|
107
|
-
### 7. 同步 Milestone
|
|
108
|
-
|
|
109
|
-
根据 PR 当前状态、任务显式配置和分支策略,为 PR 关联线里程碑。
|
|
110
|
-
|
|
111
|
-
**a) 检查 PR 是否已有 Milestone**
|
|
112
|
-
|
|
113
|
-
执行:
|
|
114
|
-
|
|
115
|
-
```bash
|
|
116
|
-
gh pr view {pr-number} --json milestone --jq '.milestone.title // empty'
|
|
117
|
-
```
|
|
118
|
-
|
|
119
|
-
如果返回非空,保留现有里程碑并记录 `Milestone: {existing} (preserved)`,跳过后续里程碑同步。
|
|
120
|
-
|
|
121
|
-
**b) 检查 task.md 是否显式指定 milestone**
|
|
122
|
-
|
|
123
|
-
如果 task.md frontmatter 中存在非空 `milestone` 字段,优先使用该值作为目标里程碑。
|
|
124
|
-
|
|
125
|
-
**c) 推断目标线里程碑**
|
|
126
|
-
|
|
127
|
-
当 task.md 未显式指定 `milestone` 时,按以下顺序推断:
|
|
128
|
-
|
|
129
|
-
1. 检测当前分支:
|
|
130
|
-
|
|
131
|
-
```bash
|
|
132
|
-
git branch --show-current
|
|
133
|
-
```
|
|
134
|
-
|
|
135
|
-
- 如果分支名匹配 `{major}.{minor}.x`,目标里程碑为同名线里程碑 `{major}.{minor}.x`
|
|
136
|
-
|
|
137
|
-
2. 如果当前分支是 `main` 或 `master`,检测现有版本分支:
|
|
14
|
+
同时接受 `task-id` 和 PR number。对于 PR number,使用下面的命令反查任务:
|
|
138
15
|
|
|
139
16
|
```bash
|
|
140
|
-
|
|
17
|
+
grep -rl "^pr_number: {pr-number}$" \
|
|
18
|
+
.agents/workspace/active/ \
|
|
19
|
+
.agents/workspace/blocked/ \
|
|
20
|
+
.agents/workspace/completed/ \
|
|
21
|
+
2>/dev/null | head -1
|
|
141
22
|
```
|
|
142
23
|
|
|
143
|
-
|
|
144
|
-
- 如果不存在版本分支,则读取最新 tag:
|
|
24
|
+
如果没有匹配任务,输出 `No task found associated with PR #{pr-number}`。
|
|
145
25
|
|
|
146
|
-
|
|
147
|
-
git tag --list 'v*' --sort=-v:refname | head -1
|
|
148
|
-
```
|
|
149
|
-
|
|
150
|
-
- 当最新 tag 存在且可解析为 `X.Y.Z` 时,目标里程碑为 `X.Y.x`
|
|
151
|
-
|
|
152
|
-
3. 如果以上规则都无法得出结果,回退到 `General Backlog`
|
|
153
|
-
|
|
154
|
-
**d) 查找并设置里程碑**
|
|
155
|
-
|
|
156
|
-
执行:
|
|
157
|
-
|
|
158
|
-
```bash
|
|
159
|
-
gh api "repos/$repo/milestones" --paginate \
|
|
160
|
-
--jq '.[] | select(.title=="{target}") | .title' | head -1
|
|
161
|
-
```
|
|
162
|
-
|
|
163
|
-
- 如果目标里程碑不存在,则降级到查找 `General Backlog`
|
|
164
|
-
- 如果 `General Backlog` 也不存在,则记录 `Milestone: skipped (not found)` 并跳过关联
|
|
165
|
-
- 一旦找到目标标题,执行:
|
|
166
|
-
|
|
167
|
-
```bash
|
|
168
|
-
gh pr edit {pr-number} --milestone "{milestone-title}"
|
|
169
|
-
```
|
|
170
|
-
|
|
171
|
-
### 8. 同步 Development 关联
|
|
172
|
-
|
|
173
|
-
如果 task.md 包含 `issue_number`,确保 PR body 关联当前 Issue。
|
|
174
|
-
|
|
175
|
-
1. 读取 PR body:
|
|
176
|
-
|
|
177
|
-
```bash
|
|
178
|
-
gh pr view {pr-number} --json body --jq '.body // ""'
|
|
179
|
-
```
|
|
180
|
-
|
|
181
|
-
2. 检查 body 是否已经包含以下任一关键词:
|
|
182
|
-
- `Closes #{issue-number}`
|
|
183
|
-
- `Fixes #{issue-number}`
|
|
184
|
-
- `Resolves #{issue-number}`
|
|
185
|
-
|
|
186
|
-
3. 如果已存在任一关键词,跳过更新
|
|
187
|
-
4. 如果不存在,在 body 末尾追加:
|
|
188
|
-
|
|
189
|
-
```bash
|
|
190
|
-
gh pr edit {pr-number} --body "$(cat <<'EOF'
|
|
191
|
-
{existing-body}
|
|
192
|
-
|
|
193
|
-
Closes #{issue-number}
|
|
194
|
-
EOF
|
|
195
|
-
)"
|
|
196
|
-
```
|
|
197
|
-
|
|
198
|
-
5. 如果 task.md 不包含 `issue_number`,记录 `Development: N/A`
|
|
26
|
+
### 2. 验证任务存在
|
|
199
27
|
|
|
200
|
-
|
|
28
|
+
按 active、blocked、completed 的顺序定位匹配任务目录,再继续后续步骤。
|
|
201
29
|
|
|
202
|
-
|
|
30
|
+
### 3. 读取任务信息
|
|
203
31
|
|
|
204
|
-
|
|
205
|
-
pr_comments_jsonl="$(mktemp)"
|
|
206
|
-
|
|
207
|
-
gh api "repos/$repo/issues/{pr-number}/comments" \
|
|
208
|
-
--paginate \
|
|
209
|
-
--jq '.[] | {id, body}' > "$pr_comments_jsonl"
|
|
210
|
-
```
|
|
211
|
-
|
|
212
|
-
用隐藏标识定位唯一 summary 评论:
|
|
213
|
-
|
|
214
|
-
```html
|
|
215
|
-
<!-- sync-pr:{task-id}:summary -->
|
|
216
|
-
```
|
|
217
|
-
|
|
218
|
-
从评论列表中提取已有 summary comment id:
|
|
219
|
-
|
|
220
|
-
```bash
|
|
221
|
-
summary_comment_id="$(
|
|
222
|
-
jq -r 'select(.body | contains("<!-- sync-pr:{task-id}:summary -->")) | .id' \
|
|
223
|
-
"$pr_comments_jsonl" | head -1
|
|
224
|
-
)"
|
|
225
|
-
```
|
|
226
|
-
|
|
227
|
-
摘要内容要求:
|
|
228
|
-
- 面向代码审查者,不重复罗列 PR diff 已经展示的文件变更
|
|
229
|
-
- 从 `plan.md` 的 `## 决策`、`## 技术方法`、`## 实施步骤` 中提取 2-4 条关键技术决策
|
|
230
|
-
- 关键技术决策的描述必须自包含,不要引用内部文档的编号或术语(如 `方案 A/B`);审查者应能独立理解每条决策的含义
|
|
231
|
-
- 从 `review.md`、`review-r{N}.md`、`refinement.md`、`refinement-r{N}.md` 构建审查历程表格
|
|
232
|
-
- 从 `implementation.md` 或 `refinement.md` 的测试章节提取测试结果
|
|
233
|
-
|
|
234
|
-
审查历程表格建议字段:
|
|
235
|
-
- `轮次`
|
|
236
|
-
- `结论`
|
|
237
|
-
- `问题统计`,例如 `B:1 M:2 m:0`
|
|
238
|
-
- `修复状态`
|
|
239
|
-
|
|
240
|
-
如果尚无审查产物,使用一行占位记录,例如 `Round 1 | Pending | N/A | N/A`。
|
|
32
|
+
从 task.md 提取 `pr_number`、`issue_number`、任务标题、type 和最新时间戳。
|
|
241
33
|
|
|
242
|
-
|
|
34
|
+
### 4. 读取上下文文件
|
|
243
35
|
|
|
244
|
-
|
|
245
|
-
<!-- sync-pr:{task-id}:summary -->
|
|
246
|
-
## 审查摘要
|
|
36
|
+
读取最新的方案、实现、审查和修复产物,用于生成 PR 元数据和 reviewer 摘要。
|
|
247
37
|
|
|
248
|
-
|
|
249
|
-
**更新时间**:{当前时间}
|
|
38
|
+
### 5. 解析仓库坐标并检查 label 就绪状态
|
|
250
39
|
|
|
251
|
-
|
|
40
|
+
先解析 `repo="$(gh repo view --json nameWithOwner --jq '.nameWithOwner')"`,再确认 `type:` labels 是否已经初始化。
|
|
252
41
|
|
|
253
|
-
|
|
254
|
-
- {decision-2}
|
|
42
|
+
### 6. 同步元数据
|
|
255
43
|
|
|
256
|
-
|
|
44
|
+
把映射后的 type label、相关 `in:` labels 和 milestone 同步到 PR 上。
|
|
257
45
|
|
|
258
|
-
|
|
259
|
-
|------|------|----------|----------|
|
|
260
|
-
| Round 1 | Pending | N/A | N/A |
|
|
46
|
+
> PR 状态保护、milestone 推断,以及 PR 已关闭/已合并时的跳过规则见 `reference/delivery-detection.md`。编辑 PR 元数据前先读取 `reference/delivery-detection.md`。
|
|
261
47
|
|
|
262
|
-
###
|
|
48
|
+
### 7. 同步 Development 关联
|
|
263
49
|
|
|
264
|
-
|
|
50
|
+
如果存在 `issue_number`,确保 PR 正文包含 `Closes #{issue-number}` 或等价的关闭关键字。
|
|
265
51
|
|
|
266
|
-
|
|
267
|
-
*由 AI 自动生成 · 内部追踪:{task-id}*
|
|
268
|
-
```
|
|
52
|
+
### 8. 发布 reviewer 摘要
|
|
269
53
|
|
|
270
|
-
|
|
271
|
-
- 如果 `summary_comment_id` 为空 -> 创建新评论
|
|
272
|
-
- 如果 `summary_comment_id` 存在且内容发生变化 -> 更新原评论
|
|
273
|
-
- 如果 `summary_comment_id` 存在且内容无变化 -> 跳过
|
|
54
|
+
> 隐藏标记、幂等 summary 评论更新、review history 格式,以及评论创建/更新规则见 `reference/comment-publish.md`。发布摘要前先读取 `reference/comment-publish.md`。
|
|
274
55
|
|
|
275
|
-
|
|
56
|
+
> **Shell 安全规则**(发布评论前必读):
|
|
57
|
+
> 1. `{comment-body}` 必须替换为**实际的内联文本**。先用 Read 工具读取文件,再将全文粘贴到 heredoc body 中。**禁止**在 `<<'EOF'` 内部使用 `$(cat ...)`、`$(< ...)`、`$(...)`、`${...}`。带引号 heredoc 会阻止所有命令替换和变量展开,它们会被当作字面文本输出。
|
|
58
|
+
> 2. 构造含 `<!-- -->` 的字符串时,**禁止使用 `echo`**。bash/zsh 中 `echo` 会将 `!` 转义为 `\!`,导致隐藏标识可见。所有评论内容统一使用 `cat <<'EOF'` heredoc 或 `printf '%s\n'` 构造。
|
|
276
59
|
|
|
277
|
-
|
|
278
|
-
gh api "repos/$repo/issues/{pr-number}/comments" -X POST -f body="$(cat <<'EOF'
|
|
279
|
-
{comment-body}
|
|
280
|
-
EOF
|
|
281
|
-
)"
|
|
282
|
-
```
|
|
283
|
-
|
|
284
|
-
更新已有评论时,执行:
|
|
285
|
-
|
|
286
|
-
```bash
|
|
287
|
-
gh api "repos/$repo/issues/comments/{comment-id}" -X PATCH -f body="$(cat <<'EOF'
|
|
288
|
-
{comment-body}
|
|
289
|
-
EOF
|
|
290
|
-
)"
|
|
291
|
-
```
|
|
292
|
-
|
|
293
|
-
### 10. 更新任务状态
|
|
60
|
+
### 9. 更新任务状态
|
|
294
61
|
|
|
295
62
|
获取当前时间:
|
|
296
63
|
|
|
@@ -298,37 +65,23 @@ EOF
|
|
|
298
65
|
date "+%Y-%m-%d %H:%M:%S"
|
|
299
66
|
```
|
|
300
67
|
|
|
301
|
-
|
|
302
|
-
- **追加**到 `## Activity Log`(不要覆盖之前的记录):
|
|
303
|
-
```
|
|
304
|
-
- {yyyy-MM-dd HH:mm:ss} — **Sync to PR** by {agent} — PR metadata synced, summary {created|updated|skipped} on PR #{pr-number}
|
|
305
|
-
```
|
|
306
|
-
|
|
307
|
-
### 11. 告知用户
|
|
68
|
+
更新 `last_synced_to_pr_at`,并追加 Sync to PR 的 Activity Log。
|
|
308
69
|
|
|
309
|
-
|
|
310
|
-
进度已同步到 PR #{pr-number}。
|
|
311
|
-
|
|
312
|
-
已同步内容:
|
|
313
|
-
- Labels:{type-label-result}, {in-label-result}
|
|
314
|
-
- Milestone:{milestone-result}
|
|
315
|
-
- Development:{development-result}
|
|
316
|
-
- Summary:{created|updated|skipped}
|
|
70
|
+
### 10. 告知用户
|
|
317
71
|
|
|
318
|
-
|
|
319
|
-
```
|
|
72
|
+
汇总已同步的 labels、milestone、development 状态、summary 结果以及 PR URL。
|
|
320
73
|
|
|
321
74
|
## 注意事项
|
|
322
75
|
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
76
|
+
- 隐藏 summary 标记必须保持 `<!-- sync-pr:{task-id}:summary -->`
|
|
77
|
+
- 面向 reviewer 只保留一条摘要评论
|
|
78
|
+
- 如果 PR 已关闭或已合并,必须报告 `PR #{number} is closed/merged, metadata sync skipped`
|
|
79
|
+
- 发布摘要时遵守步骤 8 的 Shell 安全规则,不要在带引号 heredoc 中依赖命令替换,也不要用 `echo` 构造 HTML 注释标记
|
|
327
80
|
|
|
328
81
|
## 错误处理
|
|
329
82
|
|
|
330
|
-
-
|
|
331
|
-
-
|
|
332
|
-
- PR
|
|
333
|
-
- PR
|
|
334
|
-
-
|
|
83
|
+
- 未找到关联任务:`No task found associated with PR #{pr-number}`
|
|
84
|
+
- 任务未找到:`Task {task-id} not found`
|
|
85
|
+
- 缺少 PR 编号:`Task has no pr_number field`
|
|
86
|
+
- PR 不存在:`PR #{number} not found`
|
|
87
|
+
- GitHub CLI 认证失败:`Please check GitHub CLI authentication`
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# PR Summary Comment Publication
|
|
2
|
+
|
|
3
|
+
Read this file before creating or updating the single reviewer-facing PR summary comment.
|
|
4
|
+
|
|
5
|
+
## Create or Update the Single Idempotent Review Summary
|
|
6
|
+
|
|
7
|
+
Use the hidden marker:
|
|
8
|
+
|
|
9
|
+
```html
|
|
10
|
+
<!-- sync-pr:{task-id}:summary -->
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Fetch existing comments through the Issues comments API, not a separate PR comment API.
|
|
14
|
+
|
|
15
|
+
Recommended summary sections:
|
|
16
|
+
- `## Review Summary`
|
|
17
|
+
- `### Key Technical Decisions`
|
|
18
|
+
- `### Review History`
|
|
19
|
+
- `### Test Results`
|
|
20
|
+
|
|
21
|
+
Summary content rules:
|
|
22
|
+
- write for reviewers, not for end users
|
|
23
|
+
- do not restate the raw file diff
|
|
24
|
+
- extract 2-4 self-contained technical decisions from `plan.md`
|
|
25
|
+
- avoid internal shorthand such as `Plan A/B`; each decision must make sense on its own
|
|
26
|
+
- build a review-history table from `review.md`, `review-r{N}.md`, `refinement.md`, and `refinement-r{N}.md`
|
|
27
|
+
- include test results from `implementation.md` or refinement artifacts
|
|
28
|
+
|
|
29
|
+
Recommended review-history columns:
|
|
30
|
+
- `Round`
|
|
31
|
+
- `Verdict`
|
|
32
|
+
- `Finding Counts`
|
|
33
|
+
- `Fix Status`
|
|
34
|
+
|
|
35
|
+
If a summary comment already exists:
|
|
36
|
+
- update it only when the content changed
|
|
37
|
+
- otherwise skip the write
|
|
38
|
+
|
|
39
|
+
If no summary comment exists:
|
|
40
|
+
- create one with the marker and the current summary body
|
|
41
|
+
|
|
42
|
+
Update an existing comment with:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
gh api "repos/$repo/issues/comments/{comment-id}" -X PATCH -f body="$(cat <<'EOF'
|
|
46
|
+
{comment-body}
|
|
47
|
+
EOF
|
|
48
|
+
)"
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Suggested summary body:
|
|
52
|
+
|
|
53
|
+
```markdown
|
|
54
|
+
<!-- sync-pr:{task-id}:summary -->
|
|
55
|
+
## Review Summary
|
|
56
|
+
|
|
57
|
+
**Task**: {task-id}
|
|
58
|
+
**Updated At**: {current-time}
|
|
59
|
+
|
|
60
|
+
### Key Technical Decisions
|
|
61
|
+
|
|
62
|
+
- {decision-1}
|
|
63
|
+
- {decision-2}
|
|
64
|
+
|
|
65
|
+
### Review History
|
|
66
|
+
|
|
67
|
+
| Round | Verdict | Finding Counts | Fix Status |
|
|
68
|
+
|-------|---------|----------------|------------|
|
|
69
|
+
| Round 1 | Pending | N/A | N/A |
|
|
70
|
+
|
|
71
|
+
### Test Results
|
|
72
|
+
|
|
73
|
+
- {test-summary}
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
*Generated by AI · Internal tracking: {task-id}*
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Update Task Status
|
|
80
|
+
|
|
81
|
+
Append:
|
|
82
|
+
`- {yyyy-MM-dd HH:mm:ss} — **Sync to PR** by {agent} — PR metadata synced, summary {created|updated|skipped} on PR #{pr-number}`
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# PR 摘要评论发布
|
|
2
|
+
|
|
3
|
+
在创建或更新面向 reviewer 的唯一 PR 摘要评论之前先读取本文件。
|
|
4
|
+
|
|
5
|
+
## 创建或更新唯一且幂等的审查摘要
|
|
6
|
+
|
|
7
|
+
使用如下隐藏标记:
|
|
8
|
+
|
|
9
|
+
```html
|
|
10
|
+
<!-- sync-pr:{task-id}:summary -->
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
已有评论必须通过 Issues comments API 获取,而不是单独的 PR comments API。
|
|
14
|
+
|
|
15
|
+
推荐摘要章节:
|
|
16
|
+
- `## 审查摘要`
|
|
17
|
+
- `### 关键技术决策`
|
|
18
|
+
- `### 审查历程`
|
|
19
|
+
- `### 测试结果`
|
|
20
|
+
|
|
21
|
+
摘要内容规则:
|
|
22
|
+
- 面向 reviewer 编写,而不是面向终端用户
|
|
23
|
+
- 不要简单复述原始文件 diff
|
|
24
|
+
- 从 `plan.md` 中提取 2-4 条自包含的技术决策
|
|
25
|
+
- 避免使用 `方案 A/B` 这类内部简称;每条决策都必须独立可读
|
|
26
|
+
- 用 `review.md`、`review-r{N}.md`、`refinement.md` 和 `refinement-r{N}.md` 构建审查历程表
|
|
27
|
+
- 包含来自 `implementation.md` 或修复产物中的测试结果
|
|
28
|
+
|
|
29
|
+
推荐审查历程列:
|
|
30
|
+
- `轮次`
|
|
31
|
+
- `结论`
|
|
32
|
+
- `问题统计`
|
|
33
|
+
- `修复状态`
|
|
34
|
+
|
|
35
|
+
如果摘要评论已经存在:
|
|
36
|
+
- 只有内容发生变化时才更新
|
|
37
|
+
- 否则跳过写入
|
|
38
|
+
|
|
39
|
+
如果摘要评论不存在:
|
|
40
|
+
- 使用隐藏标记和当前摘要正文创建一条新评论
|
|
41
|
+
|
|
42
|
+
更新已有评论时,使用:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
gh api "repos/$repo/issues/comments/{comment-id}" -X PATCH -f body="$(cat <<'EOF'
|
|
46
|
+
{comment-body}
|
|
47
|
+
EOF
|
|
48
|
+
)"
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
建议摘要正文:
|
|
52
|
+
|
|
53
|
+
```markdown
|
|
54
|
+
<!-- sync-pr:{task-id}:summary -->
|
|
55
|
+
## 审查摘要
|
|
56
|
+
|
|
57
|
+
**任务**:{task-id}
|
|
58
|
+
**更新时间**:{当前时间}
|
|
59
|
+
|
|
60
|
+
### 关键技术决策
|
|
61
|
+
|
|
62
|
+
- {decision-1}
|
|
63
|
+
- {decision-2}
|
|
64
|
+
|
|
65
|
+
### 审查历程
|
|
66
|
+
|
|
67
|
+
| 轮次 | 结论 | 问题统计 | 修复状态 |
|
|
68
|
+
|------|------|----------|----------|
|
|
69
|
+
| Round 1 | Pending | N/A | N/A |
|
|
70
|
+
|
|
71
|
+
### 测试结果
|
|
72
|
+
|
|
73
|
+
- {test-summary}
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
*由 AI 自动生成 · 内部追踪:{task-id}*
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## 更新任务状态
|
|
80
|
+
|
|
81
|
+
追加:
|
|
82
|
+
`- {yyyy-MM-dd HH:mm:ss} — **Sync to PR** by {agent} — PR metadata synced, summary {created|updated|skipped} on PR #{pr-number}`
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# PR Metadata Guards
|
|
2
|
+
|
|
3
|
+
Read this file before inferring milestones or deciding whether metadata sync should be skipped.
|
|
4
|
+
|
|
5
|
+
Initialize label state first:
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
gh label list --search "type:" --limit 1 --json name --jq 'length'
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
If the result is `0`, run `init-labels` before retrying metadata sync.
|
|
12
|
+
|
|
13
|
+
Type label examples:
|
|
14
|
+
- `bug`, `bugfix` -> `type: bug`
|
|
15
|
+
- `refactor`, `refactoring` -> `type: enhancement`
|
|
16
|
+
|
|
17
|
+
## Sync the Milestone
|
|
18
|
+
|
|
19
|
+
Milestone priority:
|
|
20
|
+
1. current PR milestone
|
|
21
|
+
2. explicit `milestone` in task.md
|
|
22
|
+
3. milestone inherited from the Issue
|
|
23
|
+
4. inferred release line
|
|
24
|
+
5. `General Backlog`
|
|
25
|
+
|
|
26
|
+
Milestone inference algorithm:
|
|
27
|
+
1. if the current branch matches `{major}.{minor}.x`, use that exact release line
|
|
28
|
+
2. if the current branch is `main` or `master`, inspect existing `{major}.{minor}.x` branches and target `(X+1).0.x`
|
|
29
|
+
3. if no release line branch exists, inspect the latest `vX.Y.Z` tag and fall back to `X.Y.x`
|
|
30
|
+
4. if none of the above resolve, fall back to `General Backlog`
|
|
31
|
+
|
|
32
|
+
Execution order:
|
|
33
|
+
1. preserve an existing PR milestone when present
|
|
34
|
+
2. otherwise prefer explicit `milestone` in task.md
|
|
35
|
+
3. otherwise inherit the Issue milestone if it exists
|
|
36
|
+
4. otherwise apply the branch/tag inference above
|
|
37
|
+
5. if the target milestone is unavailable, fall back to `General Backlog`
|
|
38
|
+
6. if even `General Backlog` is unavailable, record `Milestone: skipped (not found)`
|
|
39
|
+
|
|
40
|
+
Useful commands:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
gh pr view {pr-number} --json milestone
|
|
44
|
+
gh issue view {issue-number} --json labels,milestone
|
|
45
|
+
git branch --show-current
|
|
46
|
+
git branch -a | grep -oE '[0-9]+\.[0-9]+\.x' | sort -V | tail -1
|
|
47
|
+
git tag --list 'v*' --sort=-v:refname | head -1
|
|
48
|
+
gh pr edit {pr-number} --add-label "{type-label}"
|
|
49
|
+
gh pr edit {pr-number} --add-label "in: {module}"
|
|
50
|
+
gh pr edit {pr-number} --milestone "{milestone-title}"
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
If the PR is closed or merged, stop metadata sync and report:
|
|
54
|
+
`PR #{number} is closed/merged, metadata sync skipped`
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# PR 元数据保护规则
|
|
2
|
+
|
|
3
|
+
在推断 milestone 或决定是否跳过元数据同步之前先读取本文件。
|
|
4
|
+
|
|
5
|
+
先初始化 label 状态:
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
gh label list --search "type:" --limit 1 --json name --jq 'length'
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
如果结果是 `0`,先执行 `init-labels`,再重试元数据同步。
|
|
12
|
+
|
|
13
|
+
Type label 示例:
|
|
14
|
+
- `bug`, `bugfix` -> `type: bug`
|
|
15
|
+
- `refactor`, `refactoring` -> `type: enhancement`
|
|
16
|
+
|
|
17
|
+
## 同步 Milestone
|
|
18
|
+
|
|
19
|
+
Milestone 优先级:
|
|
20
|
+
1. PR 当前已有的 milestone
|
|
21
|
+
2. task.md 中显式设置的 `milestone`
|
|
22
|
+
3. 从 Issue 继承的 milestone
|
|
23
|
+
4. 推断得到的 release line
|
|
24
|
+
5. `General Backlog`
|
|
25
|
+
|
|
26
|
+
Milestone 推断算法:
|
|
27
|
+
1. 如果当前分支匹配 `{major}.{minor}.x`,直接使用该 release line
|
|
28
|
+
2. 如果当前分支是 `main` 或 `master`,检查现有的 `{major}.{minor}.x` 分支,并目标设为 `(X+1).0.x`
|
|
29
|
+
3. 如果不存在 release line 分支,则检查最新的 `vX.Y.Z` tag,并回退到 `X.Y.x`
|
|
30
|
+
4. 如果以上都无法得出结果,则回退到 `General Backlog`
|
|
31
|
+
|
|
32
|
+
执行顺序:
|
|
33
|
+
1. 如果 PR 已经设置 milestone,优先保留
|
|
34
|
+
2. 否则优先使用 task.md 中显式设置的 `milestone`
|
|
35
|
+
3. 否则继承已有的 Issue milestone
|
|
36
|
+
4. 否则应用上面的分支 / tag 推断规则
|
|
37
|
+
5. 如果目标 milestone 不可用,则回退到 `General Backlog`
|
|
38
|
+
6. 如果连 `General Backlog` 都不可用,则记录 `Milestone: skipped (not found)`
|
|
39
|
+
|
|
40
|
+
常用命令:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
gh pr view {pr-number} --json milestone
|
|
44
|
+
gh issue view {issue-number} --json labels,milestone
|
|
45
|
+
git branch --show-current
|
|
46
|
+
git branch -a | grep -oE '[0-9]+\.[0-9]+\.x' | sort -V | tail -1
|
|
47
|
+
git tag --list 'v*' --sort=-v:refname | head -1
|
|
48
|
+
gh pr edit {pr-number} --add-label "{type-label}"
|
|
49
|
+
gh pr edit {pr-number} --add-label "in: {module}"
|
|
50
|
+
gh pr edit {pr-number} --milestone "{milestone-title}"
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
如果 PR 已关闭或已合并,停止元数据同步,并报告:
|
|
54
|
+
`PR #{number} is closed/merged, metadata sync skipped`
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: test-integration
|
|
3
|
-
description:
|
|
4
|
-
Execute the project's integration test workflow.
|
|
5
|
-
Triggered when the user requests running integration tests
|
|
6
|
-
or end-to-end verification.
|
|
3
|
+
description: "Run the integration test workflow"
|
|
7
4
|
---
|
|
8
5
|
|
|
9
6
|
# Run Integration Tests
|