From 114c0df380bb43ca5acc7f1a6429272d227c57db Mon Sep 17 00:00:00 2001 From: "sayurinana(vm)" Date: Fri, 19 Dec 2025 05:39:19 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=EF=BC=9Aaide/024=20-=20?= =?UTF-8?q?=E4=BC=98=E5=8C=96=20finish=20=E5=90=8E=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E4=B8=AD=E7=9A=84=E4=BB=BB=E5=8A=A1=E5=90=8D?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .aide/branches.json | 14 ++- .aide/branches.md | 11 ++ .aide/logs/2025-12-19T05-31-03-status.json | 123 +++++++++++++++++++++ CHANGELOG.md | 2 + aide-program/aide/flow/branch.py | 30 ++++- task-now.md | 3 - 6 files changed, 175 insertions(+), 8 deletions(-) create mode 100644 .aide/logs/2025-12-19T05-31-03-status.json diff --git a/.aide/branches.json b/.aide/branches.json index cae1a9b..c15159c 100644 --- a/.aide/branches.json +++ b/.aide/branches.json @@ -1,5 +1,5 @@ { - "next_number": 24, + "next_number": 25, "branches": [ { "number": 1, @@ -270,6 +270,18 @@ "status": "finished", "end_commit": "91c9bca5d5356e7c06d018fab0138152ab96c56a", "finished_at": "2025-12-19T05:17:07+08:00" + }, + { + "number": 24, + "branch_name": "aide/024", + "source_branch": "master", + "start_commit": "5942bd2d6c906d57574aba6a4bff52f6ae649604", + "task_id": "2025-12-19T05-31-03", + "task_summary": "开始任务准备: 优化 finish 后提交信息中的任务名格式", + "started_at": "2025-12-19T05:31:03+08:00", + "status": "finished", + "end_commit": "4fdf7664c19b276336970421e1788a27c19815d7", + "finished_at": "2025-12-19T05:39:19+08:00" } ] } diff --git a/.aide/branches.md b/.aide/branches.md index 9c5dd72..fa3fab7 100644 --- a/.aide/branches.md +++ b/.aide/branches.md @@ -1,5 +1,16 @@ # Git 分支概况 +## aide/024 + +- **任务**: 开始任务准备: 优化 finish 后提交信息中的任务名格式 +- **任务ID**: 2025-12-19T05-31-03 +- **源分支**: master +- **起始提交**: 5942bd2 +- **结束提交**: 4fdf766 +- **状态**: finished +- **起始时间**: 2025-12-19 05:31 +- **结束时间**: 2025-12-19 05:39 + ## aide/023 - **任务**: 开始任务准备: 为 user-docs 添加分步执行和接续执行能力 diff --git a/.aide/logs/2025-12-19T05-31-03-status.json b/.aide/logs/2025-12-19T05-31-03-status.json new file mode 100644 index 0000000..ba591dd --- /dev/null +++ b/.aide/logs/2025-12-19T05-31-03-status.json @@ -0,0 +1,123 @@ +{ + "task_id": "2025-12-19T05-31-03", + "current_phase": "finish", + "current_step": 14, + "started_at": "2025-12-19T05:31:03+08:00", + "history": [ + { + "timestamp": "2025-12-19T05:31:03+08:00", + "action": "start", + "phase": "task-optimize", + "step": 1, + "summary": "开始任务准备: 优化 finish 后提交信息中的任务名格式", + "git_commit": "9b8814a16b93b0119007991b6e4525319309c5b3" + }, + { + "timestamp": "2025-12-19T05:33:45+08:00", + "action": "next-step", + "phase": "task-optimize", + "step": 2, + "summary": "任务分析完成:修改 branch.py 去除提交信息中的任务名前缀", + "git_commit": "0922f60205c1a2017251671f78075fa593229160" + }, + { + "timestamp": "2025-12-19T05:35:01+08:00", + "action": "next-step", + "phase": "task-optimize", + "step": 3, + "summary": "任务细则已确认", + "git_commit": "4b499cef435649bddd27e5cf60ce833f654a3bd5" + }, + { + "timestamp": "2025-12-19T05:35:14+08:00", + "action": "next-part", + "phase": "flow-design", + "step": 4, + "summary": "进入流程设计环节", + "git_commit": "e7028827d841419dfcedebe302f529581b35f6ea" + }, + { + "timestamp": "2025-12-19T05:36:13+08:00", + "action": "next-step", + "phase": "flow-design", + "step": 5, + "summary": "流程图设计完成", + "git_commit": "dabdad8ee9ca142f46255b831fb3c16c52017f8f" + }, + { + "timestamp": "2025-12-19T05:36:29+08:00", + "action": "next-part", + "phase": "impl", + "step": 6, + "summary": "流程设计完成,进入实现环节", + "git_commit": "837fcbef5cc629e34e5f8ab6cd41659c8a013014" + }, + { + "timestamp": "2025-12-19T05:36:43+08:00", + "action": "next-step", + "phase": "impl", + "step": 7, + "summary": "代码实现完成:添加 _clean_task_summary 函数并修改提交信息生成逻辑", + "git_commit": "ba78733192b47e2b47082f2078119136fef7340d" + }, + { + "timestamp": "2025-12-19T05:36:55+08:00", + "action": "next-part", + "phase": "verify", + "step": 8, + "summary": "实现完成,进入验证环节", + "git_commit": "eda0235c71db77fdad3467d4246250c17198686d" + }, + { + "timestamp": "2025-12-19T05:37:38+08:00", + "action": "next-step", + "phase": "verify", + "step": 9, + "summary": "验证完成: 所有测试用例通过,_clean_task_summary 函数工作正常", + "git_commit": "1f47af58d7f58251b67841a528e8ca6e6b150db7" + }, + { + "timestamp": "2025-12-19T05:37:49+08:00", + "action": "next-part", + "phase": "docs", + "step": 10, + "summary": "验证通过,进入文档环节", + "git_commit": "6814f8ec9c9c5c244d9e2d4e8c50a4c278c9373d" + }, + { + "timestamp": "2025-12-19T05:38:24+08:00", + "action": "next-step", + "phase": "docs", + "step": 11, + "summary": "文档更新完成", + "git_commit": "bfd3c8f488b773808c9124a69272f908f63f1765" + }, + { + "timestamp": "2025-12-19T05:38:35+08:00", + "action": "next-part", + "phase": "confirm", + "step": 12, + "summary": "文档更新完成,进入用户确认环节", + "git_commit": "82086b484b873078843528b217e61b08e66b2496" + }, + { + "timestamp": "2025-12-19T05:39:08+08:00", + "action": "next-step", + "phase": "confirm", + "step": 13, + "summary": "用户确认通过", + "git_commit": "ba0748a19c11b01a8e59d468f55b8516efe34e4a" + }, + { + "timestamp": "2025-12-19T05:39:19+08:00", + "action": "next-part", + "phase": "finish", + "step": 14, + "summary": "用户确认通过,进入收尾", + "git_commit": "4fdf7664c19b276336970421e1788a27c19815d7" + } + ], + "source_branch": "master", + "start_commit": "5942bd2d6c906d57574aba6a4bff52f6ae649604", + "task_branch": "aide/024" +} diff --git a/CHANGELOG.md b/CHANGELOG.md index dfe8a6b..9f05021 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,8 @@ - 正常完成:`完成:<分支名> - <任务名>` - 强制清理:`任务中断,清理:<分支名> - <任务名>` - 替代原有的 `{短哈希}的任务收尾` 格式,更加语义化 +- 新增 `_clean_task_summary()` 函数,移除任务名中的"开始任务准备:"前缀 + - 支持半角/全角冒号、有无空格的多种格式 **decide 界面源文件显示** diff --git a/aide-program/aide/flow/branch.py b/aide-program/aide/flow/branch.py index d7d77f8..71025b4 100644 --- a/aide-program/aide/flow/branch.py +++ b/aide-program/aide/flow/branch.py @@ -87,6 +87,26 @@ class BranchesData: return BranchesData(next_number=next_number, branches=branches) +# 需要从 task_summary 中移除的前缀列表(finish 提交信息使用) +_TASK_SUMMARY_PREFIXES = [ + "开始任务准备: ", + "开始任务准备:", + "开始任务准备: ", + "开始任务准备:", +] + + +def _clean_task_summary(task_summary: str) -> str: + """清理 task_summary 中的前缀。 + + 用于生成 finish 提交信息时,移除 "开始任务准备:" 等前缀。 + """ + for prefix in _TASK_SUMMARY_PREFIXES: + if task_summary.startswith(prefix): + return task_summary[len(prefix):] + return task_summary + + class BranchManager: """管理 aide flow 任务分支""" @@ -620,10 +640,11 @@ class BranchManager: # 8. 创建收尾提交 self.git.add_all() + clean_summary = _clean_task_summary(branch_info.task_summary) if is_force_clean: - commit_msg = f"任务中断,清理:{task_branch} - {branch_info.task_summary}" + commit_msg = f"任务中断,清理:{task_branch} - {clean_summary}" else: - commit_msg = f"完成:{task_branch} - {branch_info.task_summary}" + commit_msg = f"完成:{task_branch} - {clean_summary}" self.git.commit(commit_msg) return True, f"任务分支已合并到 {source_branch}" @@ -720,10 +741,11 @@ class BranchManager: # 8. 创建压缩提交 self.git.add_all() + clean_summary = _clean_task_summary(task_summary) if is_force_clean: - commit_msg = f"[aide] 强制清理压缩提交: {task_summary}" + commit_msg = f"[aide] 强制清理压缩提交: {clean_summary}" else: - commit_msg = f"[aide] 任务压缩提交: {task_summary}" + commit_msg = f"[aide] 任务压缩提交: {clean_summary}" self.git.commit(commit_msg) action_name = "强制清理" if is_force_clean else "任务完成" diff --git a/task-now.md b/task-now.md index 4b0dc8b..e69de29 100644 --- a/task-now.md +++ b/task-now.md @@ -1,3 +0,0 @@ -现在的finish后原分支的提交信息里,分支名后的任务名里的"开始任务准备:"是哪里来的,我希望不要有这段内容,只要有后面的实际任务名就行, - -你可以执行`git lg`来快速查看历史提交, \ No newline at end of file