Compare commits
7 Commits
2ba61695d0
...
0079bd5cd4
| Author | SHA1 | Date | |
|---|---|---|---|
| 0079bd5cd4 | |||
| 575b07e9e5 | |||
| 714848745d | |||
| b1c422ad7b | |||
| f4a82c96ee | |||
| e808201ec3 | |||
| 645a30cace |
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"next_number": 16,
|
||||
"next_number": 19,
|
||||
"branches": [
|
||||
{
|
||||
"number": 1,
|
||||
@@ -174,6 +174,42 @@
|
||||
"status": "finished",
|
||||
"end_commit": "80ebbd4d85aaa8b3408cd83c35627c972057beda",
|
||||
"finished_at": "2025-12-18T12:50:59+08:00"
|
||||
},
|
||||
{
|
||||
"number": 16,
|
||||
"branch_name": "aide/016",
|
||||
"source_branch": "master",
|
||||
"start_commit": "645a30cace5e7653c19c60fa1f23c22d1db73d34",
|
||||
"task_id": "2025-12-18T13-29-05",
|
||||
"task_summary": "开始任务准备: 构建 auto-run 全自动任务执行命令",
|
||||
"started_at": "2025-12-18T13:29:05+08:00",
|
||||
"status": "finished",
|
||||
"end_commit": "645a30cace5e7653c19c60fa1f23c22d1db73d34",
|
||||
"finished_at": "2025-12-18T13:58:35+08:00"
|
||||
},
|
||||
{
|
||||
"number": 17,
|
||||
"branch_name": "aide/017",
|
||||
"source_branch": "master",
|
||||
"start_commit": "f4a82c96eec49822c39da4f68c87351fe527b0fe",
|
||||
"task_id": "2025-12-18T14-09-44",
|
||||
"task_summary": "开始任务准备: 调整aide收尾清理逻辑",
|
||||
"started_at": "2025-12-18T14:09:44+08:00",
|
||||
"status": "finished",
|
||||
"end_commit": "f4a82c96eec49822c39da4f68c87351fe527b0fe",
|
||||
"finished_at": "2025-12-18T18:18:43+08:00"
|
||||
},
|
||||
{
|
||||
"number": 18,
|
||||
"branch_name": "aide/018",
|
||||
"source_branch": "master",
|
||||
"start_commit": "714848745d2e443ff4ee1d907b3e3df0b5e65dc4",
|
||||
"task_id": "2025-12-18T18-38-48",
|
||||
"task_summary": "开始任务准备: aide flow clean 指令与分支概况文档分析",
|
||||
"started_at": "2025-12-18T18:38:48+08:00",
|
||||
"status": "force-cleaned",
|
||||
"end_commit": "19aa94e2e2e084b1c72b8b9e55d565948b8ac19d",
|
||||
"finished_at": "2025-12-18T20:33:37+08:00"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,5 +1,38 @@
|
||||
# Git 分支概况
|
||||
|
||||
## aide/018
|
||||
|
||||
- **任务**: 开始任务准备: aide flow clean 指令与分支概况文档分析
|
||||
- **任务ID**: 2025-12-18T18-38-48
|
||||
- **源分支**: master
|
||||
- **起始提交**: 7148487
|
||||
- **结束提交**: 19aa94e
|
||||
- **状态**: force-cleaned
|
||||
- **起始时间**: 2025-12-18 18:38
|
||||
- **结束时间**: 2025-12-18 20:33
|
||||
|
||||
## aide/017
|
||||
|
||||
- **任务**: 开始任务准备: 调整aide收尾清理逻辑
|
||||
- **任务ID**: 2025-12-18T14-09-44
|
||||
- **源分支**: master
|
||||
- **起始提交**: f4a82c9
|
||||
- **结束提交**: f4a82c9
|
||||
- **状态**: finished
|
||||
- **起始时间**: 2025-12-18 14:09
|
||||
- **结束时间**: 2025-12-18 18:18
|
||||
|
||||
## aide/016
|
||||
|
||||
- **任务**: 开始任务准备: 构建 auto-run 全自动任务执行命令
|
||||
- **任务ID**: 2025-12-18T13-29-05
|
||||
- **源分支**: master
|
||||
- **起始提交**: 645a30c
|
||||
- **结束提交**: 645a30c
|
||||
- **状态**: finished
|
||||
- **起始时间**: 2025-12-18 13:29
|
||||
- **结束时间**: 2025-12-18 13:58
|
||||
|
||||
## aide/015
|
||||
|
||||
- **任务**: 开始任务准备: 调整 Aide 工作流流程
|
||||
@@ -8,7 +41,8 @@
|
||||
- **起始提交**: 80ebbd4
|
||||
- **结束提交**: 80ebbd4
|
||||
- **状态**: finished
|
||||
- **时间**: 2025-12-18 12:14 ~ 12:50
|
||||
- **起始时间**: 2025-12-18 12:14
|
||||
- **结束时间**: 2025-12-18 12:50
|
||||
|
||||
## aide/014
|
||||
|
||||
@@ -18,7 +52,8 @@
|
||||
- **起始提交**: d2882c9
|
||||
- **结束提交**: d2882c9
|
||||
- **状态**: finished
|
||||
- **时间**: 2025-12-18 11:53 ~ 11:53
|
||||
- **起始时间**: 2025-12-18 11:53
|
||||
- **结束时间**: 2025-12-18 11:53
|
||||
|
||||
## aide/013
|
||||
|
||||
@@ -28,7 +63,8 @@
|
||||
- **起始提交**: f4b9620
|
||||
- **结束提交**: f4b9620
|
||||
- **状态**: finished
|
||||
- **时间**: 2025-12-18 10:41 ~ 11:22
|
||||
- **起始时间**: 2025-12-18 10:41
|
||||
- **结束时间**: 2025-12-18 11:22
|
||||
|
||||
## aide/012
|
||||
|
||||
@@ -37,7 +73,7 @@
|
||||
- **源分支**: master
|
||||
- **起始提交**: c6f45f9
|
||||
- **状态**: active
|
||||
- **时间**: 2025-12-18 10:09
|
||||
- **起始时间**: 2025-12-18 10:09
|
||||
|
||||
## aide/011
|
||||
|
||||
@@ -47,7 +83,8 @@
|
||||
- **起始提交**: 2042238
|
||||
- **结束提交**: 8ea9ce7
|
||||
- **状态**: finished
|
||||
- **时间**: 2025-12-18 10:03 ~ 10:03
|
||||
- **起始时间**: 2025-12-18 10:03
|
||||
- **结束时间**: 2025-12-18 10:03
|
||||
|
||||
## aide/010
|
||||
|
||||
@@ -57,7 +94,8 @@
|
||||
- **起始提交**: c8d20db
|
||||
- **结束提交**: 2034962
|
||||
- **状态**: finished
|
||||
- **时间**: 2025-12-17 06:34 ~ 06:35
|
||||
- **起始时间**: 2025-12-17 06:34
|
||||
- **结束时间**: 2025-12-17 06:35
|
||||
|
||||
## aide/009
|
||||
|
||||
@@ -67,7 +105,8 @@
|
||||
- **起始提交**: 6305f61
|
||||
- **结束提交**: d705a73
|
||||
- **状态**: finished
|
||||
- **时间**: 2025-12-17 06:31 ~ 06:32
|
||||
- **起始时间**: 2025-12-17 06:31
|
||||
- **结束时间**: 2025-12-17 06:32
|
||||
|
||||
## aide/008
|
||||
|
||||
@@ -77,7 +116,8 @@
|
||||
- **起始提交**: c685c31
|
||||
- **结束提交**: 92eb2ba
|
||||
- **状态**: finished
|
||||
- **时间**: 2025-12-17 06:27 ~ 06:28
|
||||
- **起始时间**: 2025-12-17 06:27
|
||||
- **结束时间**: 2025-12-17 06:28
|
||||
|
||||
## aide/007
|
||||
|
||||
@@ -87,7 +127,8 @@
|
||||
- **起始提交**: 8d4cae6
|
||||
- **结束提交**: 346ec90
|
||||
- **状态**: finished
|
||||
- **时间**: 2025-12-17 06:07 ~ 06:07
|
||||
- **起始时间**: 2025-12-17 06:07
|
||||
- **结束时间**: 2025-12-17 06:07
|
||||
|
||||
## aide/006
|
||||
|
||||
@@ -97,7 +138,8 @@
|
||||
- **起始提交**: 2b0c007
|
||||
- **结束提交**: d60f0ba
|
||||
- **状态**: finished
|
||||
- **时间**: 2025-12-17 06:03 ~ 06:05
|
||||
- **起始时间**: 2025-12-17 06:03
|
||||
- **结束时间**: 2025-12-17 06:05
|
||||
|
||||
## aide/005
|
||||
|
||||
@@ -107,7 +149,8 @@
|
||||
- **起始提交**: a1d7263
|
||||
- **结束提交**: b2f922b
|
||||
- **状态**: finished
|
||||
- **时间**: 2025-12-17 06:00 ~ 06:02
|
||||
- **起始时间**: 2025-12-17 06:00
|
||||
- **结束时间**: 2025-12-17 06:02
|
||||
|
||||
## aide/004
|
||||
|
||||
@@ -117,7 +160,8 @@
|
||||
- **起始提交**: 6179833
|
||||
- **结束提交**: 6179833
|
||||
- **状态**: finished
|
||||
- **时间**: 2025-12-17 05:54 ~ 05:55
|
||||
- **起始时间**: 2025-12-17 05:54
|
||||
- **结束时间**: 2025-12-17 05:55
|
||||
|
||||
## aide/003
|
||||
|
||||
@@ -127,7 +171,8 @@
|
||||
- **起始提交**: aa067fc
|
||||
- **结束提交**: aa067fc
|
||||
- **状态**: finished
|
||||
- **时间**: 2025-12-17 05:42 ~ 05:48
|
||||
- **起始时间**: 2025-12-17 05:42
|
||||
- **结束时间**: 2025-12-17 05:48
|
||||
|
||||
## aide/002
|
||||
|
||||
@@ -136,7 +181,7 @@
|
||||
- **源分支**: master
|
||||
- **起始提交**: be25738
|
||||
- **状态**: active
|
||||
- **时间**: 2025-12-17 05:33
|
||||
- **起始时间**: 2025-12-17 05:33
|
||||
|
||||
## aide/001
|
||||
|
||||
@@ -145,4 +190,4 @@
|
||||
- **源分支**: master
|
||||
- **起始提交**: bd72362
|
||||
- **状态**: active
|
||||
- **时间**: 2025-12-17 04:54
|
||||
- **起始时间**: 2025-12-17 04:54
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 82 KiB |
@@ -1,49 +0,0 @@
|
||||
@startuml program-logic
|
||||
title 程序逻辑流图:finish_branch_merge 重构
|
||||
|
||||
start
|
||||
:进入 finish_branch_merge();
|
||||
note right: branch.py
|
||||
|
||||
:获取分支信息\nbranch_info = get_active_branch_info();
|
||||
|
||||
if (源分支有新提交?) then (是)
|
||||
:创建临时分支合并\n(保持现有逻辑);
|
||||
:返回提示信息;
|
||||
stop
|
||||
else (否)
|
||||
:进入 _merge_normal();
|
||||
endif
|
||||
|
||||
partition "清理操作" {
|
||||
:删除 .aide/*.lock;
|
||||
:删除 task-spec.md;
|
||||
:清空 task-now.md\n(保留文件);
|
||||
:备份并删除\nflow-status.json;
|
||||
:备份并删除\ndecisions/*.json;
|
||||
}
|
||||
|
||||
partition "创建临时提交" {
|
||||
:git add -A;
|
||||
:git commit\n"清理任务临时文件";
|
||||
}
|
||||
|
||||
partition "切换并合并" {
|
||||
:git checkout\n源分支;
|
||||
:清理 .lock 文件;
|
||||
:git merge --squash\n任务分支;
|
||||
:构建提交信息\n格式: {hash}的任务收尾;
|
||||
:git add -A;
|
||||
:git commit\n收尾提交;
|
||||
}
|
||||
|
||||
partition "更新记录" {
|
||||
:更新分支记录\nstatus = finished;
|
||||
:git add -A;
|
||||
:git commit\n更新分支记录;
|
||||
}
|
||||
|
||||
:返回成功;
|
||||
stop
|
||||
|
||||
@enduml
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 86 KiB |
@@ -1,56 +0,0 @@
|
||||
@startuml task-flow
|
||||
!theme plain
|
||||
title 任务执行流程图:调整 Aide 工作流流程
|
||||
|
||||
start
|
||||
|
||||
partition "1. 准备阶段" {
|
||||
:读取 config.py;
|
||||
:添加 plans_path 默认配置;
|
||||
}
|
||||
|
||||
partition "2. run.md 修改 - 任务细则部分" {
|
||||
:定位"1.8 生成任务细则"部分;
|
||||
:增加复杂任务处理逻辑;
|
||||
note right
|
||||
- 判断是否为复杂任务
|
||||
- 创建 .aide/task-plans/ 目录
|
||||
- 生成 guide.md 总导览
|
||||
- 生成 spec-NN.md 子计划
|
||||
end note
|
||||
}
|
||||
|
||||
partition "3. run.md 修改 - 子计划执行部分" {
|
||||
:定位"复杂任务的子计划执行"部分;
|
||||
:明确文档结构和操作方式;
|
||||
}
|
||||
|
||||
partition "4. run.md 修改 - 插入 confirm 阶段" {
|
||||
:定位"阶段 5:文档更新"之后;
|
||||
:插入"阶段 6:用户确认 (confirm)";
|
||||
note right
|
||||
- 报告完成信息
|
||||
- 等待用户确认
|
||||
- 返工机制说明
|
||||
end note
|
||||
:将原"阶段 6:收尾"改为"阶段 7:收尾";
|
||||
}
|
||||
|
||||
partition "5. aide skill 更新" {
|
||||
:读取 aide.md;
|
||||
:添加 plans_path 配置说明;
|
||||
:更新环节列表(增加 confirm);
|
||||
}
|
||||
|
||||
partition "6. 验证" {
|
||||
:检查所有修改点;
|
||||
if (验证通过?) then (是)
|
||||
:完成;
|
||||
else (否)
|
||||
:修复问题;
|
||||
endif
|
||||
}
|
||||
|
||||
stop
|
||||
|
||||
@enduml
|
||||
115
.aide/logs/2025-12-18T13-29-05-status.json
Normal file
115
.aide/logs/2025-12-18T13-29-05-status.json
Normal file
@@ -0,0 +1,115 @@
|
||||
{
|
||||
"task_id": "2025-12-18T13-29-05",
|
||||
"current_phase": "finish",
|
||||
"current_step": 13,
|
||||
"started_at": "2025-12-18T13:29:05+08:00",
|
||||
"history": [
|
||||
{
|
||||
"timestamp": "2025-12-18T13:29:05+08:00",
|
||||
"action": "start",
|
||||
"phase": "task-optimize",
|
||||
"step": 1,
|
||||
"summary": "开始任务准备: 构建 auto-run 全自动任务执行命令",
|
||||
"git_commit": "26c735ed294c7a6a4790dce190129baa7a6048bc"
|
||||
},
|
||||
{
|
||||
"timestamp": "2025-12-18T13:31:10+08:00",
|
||||
"action": "next-step",
|
||||
"phase": "task-optimize",
|
||||
"step": 2,
|
||||
"summary": "任务解析完成",
|
||||
"git_commit": "4748a0a7a92746600c69bbe57c32d04d75fbef3c"
|
||||
},
|
||||
{
|
||||
"timestamp": "2025-12-18T13:34:59+08:00",
|
||||
"action": "next-step",
|
||||
"phase": "task-optimize",
|
||||
"step": 3,
|
||||
"summary": "任务细则已确认",
|
||||
"git_commit": "a10d9de196ef4ee2b61fa180ec5605c195803c3d"
|
||||
},
|
||||
{
|
||||
"timestamp": "2025-12-18T13:35:18+08:00",
|
||||
"action": "next-part",
|
||||
"phase": "flow-design",
|
||||
"step": 4,
|
||||
"summary": "进入流程设计环节",
|
||||
"git_commit": "f0909c5124d8bb3e81dcaac876ab8ff40b6fe7ca"
|
||||
},
|
||||
{
|
||||
"timestamp": "2025-12-18T13:36:15+08:00",
|
||||
"action": "next-step",
|
||||
"phase": "flow-design",
|
||||
"step": 5,
|
||||
"summary": "流程图设计完成",
|
||||
"git_commit": "5c1ada7991903f9394460fa8eedfcd7b1a320ee8"
|
||||
},
|
||||
{
|
||||
"timestamp": "2025-12-18T13:36:35+08:00",
|
||||
"action": "next-part",
|
||||
"phase": "impl",
|
||||
"step": 6,
|
||||
"summary": "流程设计完成,进入实现环节",
|
||||
"git_commit": "7a748544773259a10759da7578d96bc6aefdef23"
|
||||
},
|
||||
{
|
||||
"timestamp": "2025-12-18T13:50:07+08:00",
|
||||
"action": "next-step",
|
||||
"phase": "impl",
|
||||
"step": 7,
|
||||
"summary": "auto-run.md 实现完成",
|
||||
"git_commit": "a2531526536ee3b47a68fb8aea245180477f5bee"
|
||||
},
|
||||
{
|
||||
"timestamp": "2025-12-18T13:50:21+08:00",
|
||||
"action": "next-part",
|
||||
"phase": "verify",
|
||||
"step": 8,
|
||||
"summary": "实现完成,进入验证环节",
|
||||
"git_commit": "5fa9b25d78bf10e58faa14be122e32b9835572c9"
|
||||
},
|
||||
{
|
||||
"timestamp": "2025-12-18T13:51:18+08:00",
|
||||
"action": "next-step",
|
||||
"phase": "verify",
|
||||
"step": 9,
|
||||
"summary": "验证完成: 所有验证标准通过",
|
||||
"git_commit": "3fd58acbd07ae284b96eb0791aad74933bf5da2f"
|
||||
},
|
||||
{
|
||||
"timestamp": "2025-12-18T13:51:30+08:00",
|
||||
"action": "next-part",
|
||||
"phase": "docs",
|
||||
"step": 10,
|
||||
"summary": "验证通过,进入文档环节",
|
||||
"git_commit": "ffa5ba5d4e553f5ddda9d8e305b92a02c0084b9a"
|
||||
},
|
||||
{
|
||||
"timestamp": "2025-12-18T13:52:42+08:00",
|
||||
"action": "next-step",
|
||||
"phase": "docs",
|
||||
"step": 11,
|
||||
"summary": "文档更新完成",
|
||||
"git_commit": "ec847df46943eb3d89754c48380b53766b0b2da9"
|
||||
},
|
||||
{
|
||||
"timestamp": "2025-12-18T13:52:57+08:00",
|
||||
"action": "next-part",
|
||||
"phase": "confirm",
|
||||
"step": 12,
|
||||
"summary": "文档更新完成,进入用户确认环节",
|
||||
"git_commit": "360628db5766ec02d7df654eebcdb4451503f128"
|
||||
},
|
||||
{
|
||||
"timestamp": "2025-12-18T13:58:35+08:00",
|
||||
"action": "next-part",
|
||||
"phase": "finish",
|
||||
"step": 13,
|
||||
"summary": "用户确认通过,进入收尾",
|
||||
"git_commit": "e9e12a672e67b7630762a5d95588abed8cd338d3"
|
||||
}
|
||||
],
|
||||
"source_branch": "master",
|
||||
"start_commit": "645a30cace5e7653c19c60fa1f23c22d1db73d34",
|
||||
"task_branch": "aide/016"
|
||||
}
|
||||
155
.aide/logs/2025-12-18T14-09-44-status.json
Normal file
155
.aide/logs/2025-12-18T14-09-44-status.json
Normal file
@@ -0,0 +1,155 @@
|
||||
{
|
||||
"task_id": "2025-12-18T14-09-44",
|
||||
"current_phase": "finish",
|
||||
"current_step": 18,
|
||||
"started_at": "2025-12-18T14:09:44+08:00",
|
||||
"history": [
|
||||
{
|
||||
"timestamp": "2025-12-18T14:09:44+08:00",
|
||||
"action": "start",
|
||||
"phase": "task-optimize",
|
||||
"step": 1,
|
||||
"summary": "开始任务准备: 调整aide收尾清理逻辑",
|
||||
"git_commit": "58e6d2860c4aab56501416242b4ac635c2afa760"
|
||||
},
|
||||
{
|
||||
"timestamp": "2025-12-18T14:13:19+08:00",
|
||||
"action": "next-step",
|
||||
"phase": "task-optimize",
|
||||
"step": 2,
|
||||
"summary": "任务分析完成,无待定项",
|
||||
"git_commit": "748796325dbb94b666aea08439c009c30fa68aa4"
|
||||
},
|
||||
{
|
||||
"timestamp": "2025-12-18T14:14:15+08:00",
|
||||
"action": "next-step",
|
||||
"phase": "task-optimize",
|
||||
"step": 3,
|
||||
"summary": "任务细则已生成,自动确认",
|
||||
"git_commit": "cf57481bcff2d8e57ba8d3c2c66a7120d53e5221"
|
||||
},
|
||||
{
|
||||
"timestamp": "2025-12-18T14:14:27+08:00",
|
||||
"action": "next-part",
|
||||
"phase": "flow-design",
|
||||
"step": 4,
|
||||
"summary": "进入流程设计环节",
|
||||
"git_commit": "5369765724248c11e21c2a58184db149473c83c4"
|
||||
},
|
||||
{
|
||||
"timestamp": "2025-12-18T14:15:01+08:00",
|
||||
"action": "next-step",
|
||||
"phase": "flow-design",
|
||||
"step": 5,
|
||||
"summary": "流程图设计完成",
|
||||
"git_commit": "55904d9416a13df115dac01be763cfc626e1b837"
|
||||
},
|
||||
{
|
||||
"timestamp": "2025-12-18T14:15:26+08:00",
|
||||
"action": "next-part",
|
||||
"phase": "impl",
|
||||
"step": 6,
|
||||
"summary": "流程设计完成,进入实现环节",
|
||||
"git_commit": "3e7f1ab05855d18d344cee32c96a27ccd049bdd3"
|
||||
},
|
||||
{
|
||||
"timestamp": "2025-12-18T14:16:16+08:00",
|
||||
"action": "next-step",
|
||||
"phase": "impl",
|
||||
"step": 7,
|
||||
"summary": "完成代码修改:添加 pending-items.json 和流程图文件清理逻辑",
|
||||
"git_commit": "6f44b388c8e3cf1e25dd2465d80e474dcdc19fdd"
|
||||
},
|
||||
{
|
||||
"timestamp": "2025-12-18T14:17:04+08:00",
|
||||
"action": "next-part",
|
||||
"phase": "verify",
|
||||
"step": 8,
|
||||
"summary": "实现完成,进入验证环节",
|
||||
"git_commit": "e0823e096c4051a43695cae2214d2bb472fc955b"
|
||||
},
|
||||
{
|
||||
"timestamp": "2025-12-18T14:26:30+08:00",
|
||||
"action": "back-part",
|
||||
"phase": "task-optimize",
|
||||
"step": 9,
|
||||
"summary": "返工:添加 aide 命令递归查找 .aide 目录的需求",
|
||||
"git_commit": "1d2de3efe04fe1679c013c47c7995bf41fe19d68"
|
||||
},
|
||||
{
|
||||
"timestamp": "2025-12-18T14:50:27+08:00",
|
||||
"action": "next-step",
|
||||
"phase": "task-optimize",
|
||||
"step": 10,
|
||||
"summary": "完成代码实现:收尾清理增强 + 递归查找功能",
|
||||
"git_commit": "82633b90fd0cb423f870283cf41179d4bb62b574"
|
||||
},
|
||||
{
|
||||
"timestamp": "2025-12-18T18:13:11+08:00",
|
||||
"action": "next-part",
|
||||
"phase": "flow-design",
|
||||
"step": 11,
|
||||
"summary": "进入流程设计环节",
|
||||
"git_commit": "19d2e727542b3ab1320c956373064c8a272868be"
|
||||
},
|
||||
{
|
||||
"timestamp": "2025-12-18T18:13:31+08:00",
|
||||
"action": "next-part",
|
||||
"phase": "impl",
|
||||
"step": 12,
|
||||
"summary": "流程设计已有,进入实现环节",
|
||||
"git_commit": "ba8f4a9a6ce8a1f803a83febc1f02320525f11b7"
|
||||
},
|
||||
{
|
||||
"timestamp": "2025-12-18T18:13:42+08:00",
|
||||
"action": "next-part",
|
||||
"phase": "verify",
|
||||
"step": 13,
|
||||
"summary": "实现完成,进入验证环节",
|
||||
"git_commit": "47e21e2b2617573a3cd7adf8fca2d26dae3f19c6"
|
||||
},
|
||||
{
|
||||
"timestamp": "2025-12-18T18:14:24+08:00",
|
||||
"action": "next-part",
|
||||
"phase": "docs",
|
||||
"step": 14,
|
||||
"summary": "验证通过,进入文档更新环节",
|
||||
"git_commit": "beeb93e782498e9c1521bf34d93c85f81038b9d0"
|
||||
},
|
||||
{
|
||||
"timestamp": "2025-12-18T18:16:40+08:00",
|
||||
"action": "next-step",
|
||||
"phase": "docs",
|
||||
"step": 15,
|
||||
"summary": "CHANGELOG.md 已在之前更新完成",
|
||||
"git_commit": "e3b5e45d329f3a0c8ee06c6d88858d32a01d6de9"
|
||||
},
|
||||
{
|
||||
"timestamp": "2025-12-18T18:17:59+08:00",
|
||||
"action": "next-step",
|
||||
"phase": "docs",
|
||||
"step": 16,
|
||||
"summary": "完善 CHANGELOG.md 格式",
|
||||
"git_commit": "5ee698c22064fd0ef86c070a365aa6000c1273a3"
|
||||
},
|
||||
{
|
||||
"timestamp": "2025-12-18T18:18:13+08:00",
|
||||
"action": "next-part",
|
||||
"phase": "confirm",
|
||||
"step": 17,
|
||||
"summary": "文档更新完成,进入确认环节",
|
||||
"git_commit": "8f93eb8c40199206740f31b48737512fb59026bf"
|
||||
},
|
||||
{
|
||||
"timestamp": "2025-12-18T18:18:43+08:00",
|
||||
"action": "next-part",
|
||||
"phase": "finish",
|
||||
"step": 18,
|
||||
"summary": "确认完成,进入收尾环节",
|
||||
"git_commit": "8fb54dca415446b11643961a2c552f3fc59c8e10"
|
||||
}
|
||||
],
|
||||
"source_branch": "master",
|
||||
"start_commit": "f4a82c96eec49822c39da4f68c87351fe527b0fe",
|
||||
"task_branch": "aide/017"
|
||||
}
|
||||
195
.aide/logs/2025-12-18T18-38-48-status.json
Normal file
195
.aide/logs/2025-12-18T18-38-48-status.json
Normal file
@@ -0,0 +1,195 @@
|
||||
{
|
||||
"task_id": "2025-12-18T18-38-48",
|
||||
"current_phase": "task-optimize",
|
||||
"current_step": 23,
|
||||
"started_at": "2025-12-18T18:38:48+08:00",
|
||||
"history": [
|
||||
{
|
||||
"timestamp": "2025-12-18T18:38:48+08:00",
|
||||
"action": "start",
|
||||
"phase": "task-optimize",
|
||||
"step": 1,
|
||||
"summary": "开始任务准备: aide flow clean 指令与分支概况文档分析",
|
||||
"git_commit": "f74306e46f459e6642eb84c8463e86d9e0bc697b"
|
||||
},
|
||||
{
|
||||
"timestamp": "2025-12-18T18:42:34+08:00",
|
||||
"action": "next-step",
|
||||
"phase": "task-optimize",
|
||||
"step": 2,
|
||||
"summary": "任务内容解析完成,生成结构化任务描述",
|
||||
"git_commit": "e5211e7e1299da688db14baa65c37a6920f4c9ed"
|
||||
},
|
||||
{
|
||||
"timestamp": "2025-12-18T18:50:34+08:00",
|
||||
"action": "next-step",
|
||||
"phase": "task-optimize",
|
||||
"step": 3,
|
||||
"summary": "用户确认任务需求,发现分支哈希相同的 bug 原因",
|
||||
"git_commit": "3417151e189396a1b2ae8369603045e5c040057b"
|
||||
},
|
||||
{
|
||||
"timestamp": "2025-12-18T18:53:07+08:00",
|
||||
"action": "next-step",
|
||||
"phase": "task-optimize",
|
||||
"step": 4,
|
||||
"summary": "任务细则已确认",
|
||||
"git_commit": "345c44455cc05bbb1c128b96b98c9c6c4b46cb81"
|
||||
},
|
||||
{
|
||||
"timestamp": "2025-12-18T18:53:18+08:00",
|
||||
"action": "next-part",
|
||||
"phase": "flow-design",
|
||||
"step": 5,
|
||||
"summary": "进入流程设计环节",
|
||||
"git_commit": "ca07defc6e5760dccade2969aae608d5d27b9f4b"
|
||||
},
|
||||
{
|
||||
"timestamp": "2025-12-18T18:55:03+08:00",
|
||||
"action": "next-step",
|
||||
"phase": "flow-design",
|
||||
"step": 6,
|
||||
"summary": "流程图设计完成",
|
||||
"git_commit": "aa456b7f3f09d3e089df0ddd16fcc432648db8f9"
|
||||
},
|
||||
{
|
||||
"timestamp": "2025-12-18T18:55:18+08:00",
|
||||
"action": "next-part",
|
||||
"phase": "impl",
|
||||
"step": 7,
|
||||
"summary": "流程设计完成,进入实现环节",
|
||||
"git_commit": "65660e4265e1a67420bc62b503923444236323d7"
|
||||
},
|
||||
{
|
||||
"timestamp": "2025-12-18T18:56:06+08:00",
|
||||
"action": "next-step",
|
||||
"phase": "impl",
|
||||
"step": 8,
|
||||
"summary": "完成: decisions 清理逻辑修改为直接删除不备份",
|
||||
"git_commit": "9ed16d17f24c3e962dc91d85efdd198f434c5f6b"
|
||||
},
|
||||
{
|
||||
"timestamp": "2025-12-18T18:59:53+08:00",
|
||||
"action": "next-step",
|
||||
"phase": "impl",
|
||||
"step": 9,
|
||||
"summary": "完成: finish 流程重构,修复哈希 bug,添加 clean_branch_merge 方法",
|
||||
"git_commit": "e0cc0a4556577b953cec406f79d05857d2840829"
|
||||
},
|
||||
{
|
||||
"timestamp": "2025-12-18T19:01:34+08:00",
|
||||
"action": "next-step",
|
||||
"phase": "impl",
|
||||
"step": 10,
|
||||
"summary": "完成: 添加 aide flow clean 指令",
|
||||
"git_commit": "57cc51781e9a9e5aae02c7fef6604c739c6b4f47"
|
||||
},
|
||||
{
|
||||
"timestamp": "2025-12-18T19:02:57+08:00",
|
||||
"action": "next-step",
|
||||
"phase": "impl",
|
||||
"step": 11,
|
||||
"summary": "测试验证: clean 命令正确检测工作区状态",
|
||||
"git_commit": "f28cb62ccb5154afdc09a626608c56f0e23c3892"
|
||||
},
|
||||
{
|
||||
"timestamp": "2025-12-18T19:03:11+08:00",
|
||||
"action": "next-part",
|
||||
"phase": "verify",
|
||||
"step": 12,
|
||||
"summary": "实现完成,进入验证环节",
|
||||
"git_commit": "0f2de0a72b93b36a55e35dba718f78b2e50982e5"
|
||||
},
|
||||
{
|
||||
"timestamp": "2025-12-18T19:04:52+08:00",
|
||||
"action": "next-step",
|
||||
"phase": "verify",
|
||||
"step": 13,
|
||||
"summary": "验证完成: finish 流程、clean 指令、decisions 清理逻辑均已验证",
|
||||
"git_commit": "2c20dd4d11d804583e2e5ebe78203909a1b61dbf"
|
||||
},
|
||||
{
|
||||
"timestamp": "2025-12-18T19:05:06+08:00",
|
||||
"action": "next-part",
|
||||
"phase": "docs",
|
||||
"step": 14,
|
||||
"summary": "验证通过,进入文档环节",
|
||||
"git_commit": "52dde4809fd8359c962ea77d37f78f03b7560e84"
|
||||
},
|
||||
{
|
||||
"timestamp": "2025-12-18T19:07:09+08:00",
|
||||
"action": "next-step",
|
||||
"phase": "docs",
|
||||
"step": 15,
|
||||
"summary": "CHANGELOG.md 更新完成",
|
||||
"git_commit": "5e7b1381b9b23c72eed2a7af7486f3b2a1875fe6"
|
||||
},
|
||||
{
|
||||
"timestamp": "2025-12-18T19:07:24+08:00",
|
||||
"action": "next-part",
|
||||
"phase": "confirm",
|
||||
"step": 16,
|
||||
"summary": "文档更新完成,进入用户确认环节",
|
||||
"git_commit": "d3c1986de7b08f69051a6a2f5aa7d19fd5743456"
|
||||
},
|
||||
{
|
||||
"timestamp": "2025-12-18T19:29:56+08:00",
|
||||
"action": "back-part",
|
||||
"phase": "task-optimize",
|
||||
"step": 17,
|
||||
"summary": "返工:修复三个问题 - 1.结束提交哈希未记录到md 2.md时间格式调整 3.clean应自动提交脏工作区",
|
||||
"git_commit": "9858fa48c393b6b21f0ab8d51f54aec5d5b12a8e"
|
||||
},
|
||||
{
|
||||
"timestamp": "2025-12-18T19:33:43+08:00",
|
||||
"action": "next-part",
|
||||
"phase": "flow-design",
|
||||
"step": 18,
|
||||
"summary": "开始修复三个问题",
|
||||
"git_commit": "f166f406b52586a4b9e357b8f3b29d19b24dfb64"
|
||||
},
|
||||
{
|
||||
"timestamp": "2025-12-18T19:36:49+08:00",
|
||||
"action": "next-part",
|
||||
"phase": "impl",
|
||||
"step": 19,
|
||||
"summary": "开始验证修复",
|
||||
"git_commit": "878d10cd7b79d2a9aaf2889a37de122a2e025c31"
|
||||
},
|
||||
{
|
||||
"timestamp": "2025-12-18T19:38:06+08:00",
|
||||
"action": "next-part",
|
||||
"phase": "verify",
|
||||
"step": 20,
|
||||
"summary": "验证修复完成",
|
||||
"git_commit": "64552682b4f2d3f86ce7d97f3930d9251f0add4a"
|
||||
},
|
||||
{
|
||||
"timestamp": "2025-12-18T19:38:18+08:00",
|
||||
"action": "next-part",
|
||||
"phase": "docs",
|
||||
"step": 21,
|
||||
"summary": "更新文档",
|
||||
"git_commit": "64d626d32c861125dd636281eea8fd974d3bd90c"
|
||||
},
|
||||
{
|
||||
"timestamp": "2025-12-18T19:39:28+08:00",
|
||||
"action": "next-part",
|
||||
"phase": "confirm",
|
||||
"step": 22,
|
||||
"summary": "返工修复完成,进入用户确认",
|
||||
"git_commit": "1bf8ff39654b7d9c915f90684c1587f3e63a173b"
|
||||
},
|
||||
{
|
||||
"timestamp": "2025-12-18T19:50:49+08:00",
|
||||
"action": "back-part",
|
||||
"phase": "task-optimize",
|
||||
"step": 23,
|
||||
"summary": "返工:修复 find_project_root 向上查找逻辑",
|
||||
"git_commit": "05dace3dd55e5cf33236270180eb105dac6e3175"
|
||||
}
|
||||
],
|
||||
"source_branch": "master",
|
||||
"start_commit": "714848745d2e443ff4ee1d907b3e3df0b5e65dc4",
|
||||
"task_branch": "aide/018"
|
||||
}
|
||||
@@ -1,108 +0,0 @@
|
||||
{
|
||||
"task": "调整 Aide 工作流流程",
|
||||
"source": "task-now.md",
|
||||
"items": [
|
||||
{
|
||||
"id": 1,
|
||||
"title": "新阶段命名",
|
||||
"location": {
|
||||
"file": "task-now.md",
|
||||
"start": 3,
|
||||
"end": 9
|
||||
},
|
||||
"context": "需要在 docs 和 finish 之间插入一个用户确认阶段。当前 flow phases 为: task-optimize, flow-design, impl, verify, docs, finish。新阶段需要一个简洁且语义明确的英文名称。",
|
||||
"options": [
|
||||
{
|
||||
"value": "review",
|
||||
"label": "review",
|
||||
"score": 90,
|
||||
"pros": ["语义清晰,表示审阅", "简洁常用"],
|
||||
"cons": ["与 code review 可能混淆"]
|
||||
},
|
||||
{
|
||||
"value": "confirm",
|
||||
"label": "confirm",
|
||||
"score": 85,
|
||||
"pros": ["明确表示确认动作", "与任务流程含义一致"],
|
||||
"cons": ["较长"]
|
||||
},
|
||||
{
|
||||
"value": "approve",
|
||||
"label": "approve",
|
||||
"score": 75,
|
||||
"pros": ["表示批准/通过", "正式感强"],
|
||||
"cons": ["较正式,可能过于严肃"]
|
||||
}
|
||||
],
|
||||
"recommend": "review"
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"title": "复杂任务文档存储位置",
|
||||
"location": {
|
||||
"file": "task-now.md",
|
||||
"start": 27,
|
||||
"end": 28
|
||||
},
|
||||
"context": "复杂任务需要生成任务计划总导览和多个子计划细则,每个都是独立文档。需要确定这些文档的存储位置。",
|
||||
"options": [
|
||||
{
|
||||
"value": "aide_dir",
|
||||
"label": ".aide/task-plans/",
|
||||
"score": 90,
|
||||
"pros": ["与现有 .aide/ 结构一致", "集中管理", "自动被 gitignore"],
|
||||
"cons": ["路径较深"]
|
||||
},
|
||||
{
|
||||
"value": "root_dir",
|
||||
"label": "项目根目录",
|
||||
"score": 60,
|
||||
"pros": ["访问方便"],
|
||||
"cons": ["污染根目录", "需要手动 gitignore"]
|
||||
},
|
||||
{
|
||||
"value": "spec_alongside",
|
||||
"label": "与 task.spec 同目录",
|
||||
"score": 75,
|
||||
"pros": ["与现有细则位置一致"],
|
||||
"cons": ["需要额外的命名规范"]
|
||||
}
|
||||
],
|
||||
"recommend": "aide_dir"
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"title": "子计划文档命名规范",
|
||||
"location": {
|
||||
"file": "task-now.md",
|
||||
"start": 27,
|
||||
"end": 28
|
||||
},
|
||||
"context": "每个子计划需要独立的细则文档,需要确定命名规范以便识别和管理。",
|
||||
"options": [
|
||||
{
|
||||
"value": "numbered",
|
||||
"label": "数字编号: spec-01.md, spec-02.md",
|
||||
"score": 85,
|
||||
"pros": ["简洁", "顺序清晰"],
|
||||
"cons": ["无语义信息"]
|
||||
},
|
||||
{
|
||||
"value": "named",
|
||||
"label": "语义命名: spec-login.md, spec-payment.md",
|
||||
"score": 80,
|
||||
"pros": ["语义清晰", "易于识别"],
|
||||
"cons": ["命名需要额外考虑", "可能重名"]
|
||||
},
|
||||
{
|
||||
"value": "hybrid",
|
||||
"label": "混合: spec-01-login.md, spec-02-payment.md",
|
||||
"score": 90,
|
||||
"pros": ["兼顾顺序和语义", "易于排序和识别"],
|
||||
"cons": ["命名较长"]
|
||||
}
|
||||
],
|
||||
"recommend": "hybrid"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -10,9 +10,9 @@
|
||||
|
||||
| 指标 | 数值 |
|
||||
|------|------|
|
||||
| 总文件数 | 132(排除忽略项) |
|
||||
| 总目录数 | 53(含 5 个空目录) |
|
||||
| 代码行数 | 约 20082 行 |
|
||||
| 总文件数 | 139(排除忽略项) |
|
||||
| 总目录数 | 47(含 5 个空目录) |
|
||||
| 代码行数 | 约 21000 行 |
|
||||
| 主要语言 | Python |
|
||||
| 被忽略项 | 7 个目录 |
|
||||
|
||||
@@ -60,7 +60,7 @@ ccoptimize/
|
||||
│ ├── diagrams/ PlantUML 流程图
|
||||
│ ├── logs/ 历史任务归档
|
||||
│ └── project-docs/ 本文档目录
|
||||
├── aide-program/ 核心程序(~55 文件)
|
||||
├── aide-program/ 核心程序(~72 文件)
|
||||
│ ├── aide/ Python 源码
|
||||
│ │ ├── core/ 核心模块
|
||||
│ │ ├── env/ 环境检测
|
||||
@@ -70,10 +70,10 @@ ccoptimize/
|
||||
│ ├── docs/ 程序文档
|
||||
│ ├── lib/ 依赖库
|
||||
│ └── offline-installer/ 离线安装器
|
||||
├── aide-marketplace/ 插件市场(~20 文件)
|
||||
├── aide-marketplace/ 插件市场(~21 文件)
|
||||
│ ├── .claude-plugin/ 市场配置
|
||||
│ └── aide-plugin/ Aide 插件(版本 2.0.8)
|
||||
│ ├── commands/ 斜杠命令(含 install-linux/win)
|
||||
│ └── aide-plugin/ Aide 插件(版本 2.1.0)
|
||||
│ ├── commands/ 斜杠命令(含 auto-run/install-linux/win)
|
||||
│ ├── skills/ 技能定义
|
||||
│ └── docs/ 插件文档
|
||||
├── docs/ 项目文档
|
||||
@@ -118,20 +118,21 @@ Aide 是一套面向 LLM 驱动开发的工作流工具,核心设计原则:
|
||||
| 目录 | 用途 |
|
||||
|------|------|
|
||||
| `.aide/decisions/` | 待定项决策记录 |
|
||||
| `aide-program/.aide/decisions/` | 程序级决策记录 |
|
||||
| `aide-program/.aide/logs/` | 程序级日志归档 |
|
||||
| `.aide/diagrams/` | PlantUML 流程图 |
|
||||
| `discuss/` | 项目讨论记录 |
|
||||
| `reply/` | 项目回复记录 |
|
||||
| `statements/` | 声明文档 |
|
||||
|
||||
## 被忽略项
|
||||
|
||||
| 目录 | 说明 |
|
||||
|------|------|
|
||||
| `anthropic-agent-skills/` | 第三方技能库 |
|
||||
| `.venv/` | 虚拟环境 |
|
||||
| `.venv/` | 根目录虚拟环境 |
|
||||
| `aide-program/.venv/` | 程序虚拟环境 |
|
||||
| `__pycache__/` | Python 字节码 |
|
||||
| `cache/`, `.cache/`, `test-cache/` | 缓存目录 |
|
||||
| `cache/`, `.cache/` | 缓存目录 |
|
||||
| `test-cache/` | 测试缓存目录 |
|
||||
|
||||
## 使用指南
|
||||
|
||||
|
||||
@@ -6,10 +6,10 @@
|
||||
|
||||
- 项目名称:ccoptimize(Aide 工作流工具优化项目)
|
||||
- 主要语言:Python
|
||||
- 总文件数:132(排除忽略项)
|
||||
- 总目录数:53(含 5 个空目录)
|
||||
- 总文件数:139(排除忽略项)
|
||||
- 总目录数:47(含 5 个空目录)
|
||||
- 被忽略项:7 个目录
|
||||
- 代码行数:约 20082 行
|
||||
- 代码行数:约 21000 行
|
||||
|
||||
## 完整目录树(简化版 - 前两层)
|
||||
|
||||
@@ -25,9 +25,8 @@ ccoptimize/
|
||||
│ └── project-docs/ 项目文档目录(本文档所在)
|
||||
├── aide-marketplace/ Aide 插件市场
|
||||
│ ├── .claude-plugin/ 插件市场配置
|
||||
│ └── aide-plugin/ Aide 插件源码(版本 2.0.8)
|
||||
│ └── aide-plugin/ Aide 插件源码(版本 2.1.0)
|
||||
├── aide-program/ Aide 主程序
|
||||
│ ├── .aide/ 程序级配置
|
||||
│ ├── aide/ Python 源码目录
|
||||
│ ├── bin/ 可执行脚本
|
||||
│ ├── docs/ 程序文档
|
||||
@@ -67,8 +66,8 @@ ccoptimize/
|
||||
### 区块 1:aide-program(核心程序)
|
||||
|
||||
- **路径**:`aide-program/`
|
||||
- **文件数**:约 55 个源码文件
|
||||
- **空目录**:2 个(decisions/, logs/)
|
||||
- **文件数**:约 72 个文件(排除 .venv 和 __pycache__)
|
||||
- **空目录**:0 个
|
||||
- **状态**:已完成
|
||||
- **说明**:Aide 命令行工具的核心实现,包括:
|
||||
- `aide/core/` - 核心功能模块(配置、输出)
|
||||
@@ -82,26 +81,27 @@ ccoptimize/
|
||||
### 区块 2:aide-marketplace(插件市场)
|
||||
|
||||
- **路径**:`aide-marketplace/`
|
||||
- **文件数**:约 20 个文件
|
||||
- **文件数**:约 21 个文件
|
||||
- **空目录**:0 个
|
||||
- **状态**:已完成
|
||||
- **说明**:Aide 插件市场和 aide-plugin 源码(版本 2.0.8),包括:
|
||||
- **说明**:Aide 插件市场和 aide-plugin 源码(版本 2.1.0),包括:
|
||||
- `.claude-plugin/` - 市场配置
|
||||
- `aide-plugin/commands/` - 斜杠命令定义(含 install-linux、install-win)
|
||||
- `aide-plugin/commands/` - 斜杠命令定义(含 auto-run、install-linux、install-win)
|
||||
- `aide-plugin/skills/` - 技能定义
|
||||
- `aide-plugin/docs/` - 插件文档
|
||||
|
||||
### 区块 3:项目配置与文档(合并原区块 3 和 4)
|
||||
|
||||
- **路径**:`.aide/`, `docs/`, `discuss/`, `reply/`, `statements/`, 根目录配置文件
|
||||
- **文件数**:约 25 个文件
|
||||
- **空目录**:3 个(discuss/, reply/, statements/)
|
||||
- **文件数**:约 46 个文件
|
||||
- **空目录**:5 个(.aide/decisions/, .aide/diagrams/, discuss/, reply/, statements/)
|
||||
- **状态**:已完成
|
||||
- **说明**:项目级配置、Aide 数据目录和项目文档资源,包括:
|
||||
- `.aide/config.toml` - 项目配置
|
||||
- `.aide/branches.json/.md` - 分支概况数据
|
||||
- `.aide/pending-items.json` - 待定项数据
|
||||
- `.aide/diagrams/` - 流程图
|
||||
- `.aide/decisions/` - [空目录] 待定项决策记录
|
||||
- `.aide/diagrams/` - [空目录] PlantUML 流程图
|
||||
- `.aide/logs/` - 历史任务归档
|
||||
- `docs/` - 指南和概览文档
|
||||
- `discuss/`, `reply/`, `statements/` - [空目录]
|
||||
- 根目录 `.md` 文件
|
||||
|
||||
@@ -15,8 +15,9 @@ aide-marketplace/
|
||||
│ └── marketplace.json 市场元数据
|
||||
└── aide-plugin/ Aide 插件
|
||||
├── .claude-plugin/ 插件配置
|
||||
│ └── plugin.json 插件元数据(版本 2.0.8)
|
||||
│ └── plugin.json 插件元数据(版本 2.1.0)
|
||||
├── commands/ 斜杠命令定义
|
||||
│ ├── auto-run.md /aide:auto-run 全自动任务执行(572 行)
|
||||
│ ├── docs.md /aide:docs 文档管理(400 行)
|
||||
│ ├── install-linux.md /aide:install-linux Linux 环境安装(692 行)
|
||||
│ ├── install-win.md /aide:install-win Windows 环境安装
|
||||
@@ -49,7 +50,8 @@ aide-marketplace/
|
||||
| 文件 | 类型 | 说明 |
|
||||
|------|------|------|
|
||||
| .claude-plugin/marketplace.json | 配置 | 市场元数据,定义市场名和插件列表 |
|
||||
| aide-plugin/.claude-plugin/plugin.json | 配置 | 插件元数据,版本 2.0.8 |
|
||||
| aide-plugin/.claude-plugin/plugin.json | 配置 | 插件元数据,版本 2.1.0 |
|
||||
| aide-plugin/commands/auto-run.md | Command | /aide:auto-run 全自动任务执行流程 |
|
||||
| aide-plugin/commands/docs.md | Command | /aide:docs 项目文档管理流程 |
|
||||
| aide-plugin/commands/install-linux.md | Command | /aide:install-linux Linux 环境安装流程 |
|
||||
| aide-plugin/commands/install-win.md | Command | /aide:install-win Windows 环境安装流程 |
|
||||
@@ -73,11 +75,12 @@ aide-marketplace/
|
||||
| `/aide:load` | 项目认知载入 | aide | 否(由 run 调用) |
|
||||
| `/aide:docs` | 项目文档创建和维护 | aide | 是 |
|
||||
| `/aide:run` | 任务执行(核心命令) | aide | 否 |
|
||||
| `/aide:auto-run` | 全自动任务执行 | aide, task-parser | 是 |
|
||||
|
||||
### /aide:run 工作流程
|
||||
|
||||
```
|
||||
task-optimize → flow-design → impl → verify → docs → finish
|
||||
task-optimize → flow-design → impl → verify → docs → confirm → finish
|
||||
│ │
|
||||
├─ 任务分析 ├─ 流程图设计
|
||||
├─ 复杂度评估 └─ PlantUML 校验
|
||||
@@ -85,6 +88,23 @@ task-optimize → flow-design → impl → verify → docs → finish
|
||||
└─ 生成任务细则
|
||||
```
|
||||
|
||||
### /aide:auto-run 工作流程
|
||||
|
||||
`/aide:run` 的自动化版本,去除所有需要用户参与的环节:
|
||||
|
||||
```
|
||||
task-optimize → flow-design → impl → verify → docs → finish
|
||||
│ │
|
||||
├─ 待定项自动决策 └─ 跳过 confirm 阶段
|
||||
└─ 任务细则自动确认
|
||||
```
|
||||
|
||||
**与 /aide:run 的区别**:
|
||||
- 待定项自动决策(无需用户 Web 确认)
|
||||
- 任务细则自动确认(无需用户确认)
|
||||
- 跳过 confirm 阶段(无需用户验收)
|
||||
- 错误自动处理(优先委托子代理,否则自行解决)
|
||||
|
||||
### Skills(技能)
|
||||
|
||||
| 技能 | 触发方式 | 职责 |
|
||||
@@ -140,7 +160,7 @@ task-optimize → flow-design → impl → verify → docs → finish
|
||||
```json
|
||||
{
|
||||
"name": "aide-plugin",
|
||||
"version": "2.0.8",
|
||||
"version": "2.1.0",
|
||||
"description": "Aide 工作流体系插件"
|
||||
}
|
||||
```
|
||||
@@ -156,6 +176,9 @@ task-optimize → flow-design → impl → verify → docs → finish
|
||||
- Commands 定义"做什么"和"按什么顺序做"
|
||||
- Skills 定义"怎么调用工具"
|
||||
|
||||
2. **版本管理**:当前版本 2.0.8,原 `/aide:init`、`/aide:prep`、`/aide:exec` 已重组为 `/aide:setup`、`/aide:load`、`/aide:docs`、`/aide:run`,并新增 `/aide:install-linux`、`/aide:install-win` 环境安装命令
|
||||
2. **版本管理**:当前版本 2.1.0
|
||||
- 2.0.8 → 2.1.0:新增 `/aide:auto-run` 全自动任务执行命令
|
||||
- 原 `/aide:init`、`/aide:prep`、`/aide:exec` 已重组为 `/aide:setup`、`/aide:load`、`/aide:docs`、`/aide:run`
|
||||
- 新增 `/aide:install-linux`、`/aide:install-win` 环境安装命令
|
||||
|
||||
3. **触发机制**:Skills 按需触发,避免信息过载
|
||||
|
||||
@@ -11,9 +11,6 @@ Aide 命令行工具的核心实现,提供环境检测、流程追踪、待定
|
||||
|
||||
```
|
||||
aide-program/
|
||||
├── .aide/ 程序级 Aide 配置
|
||||
│ ├── config.toml 配置文件
|
||||
│ └── decisions/ [空目录] 决策记录
|
||||
├── aide/ Python 源码包
|
||||
│ ├── __init__.py 包入口(docstring)
|
||||
│ ├── __main__.py 模块入口
|
||||
|
||||
@@ -154,6 +154,8 @@ Claude Code 功能的完整指南系列:
|
||||
|
||||
| 目录 | 用途推断 |
|
||||
|------|----------|
|
||||
| .aide/decisions/ | 待定项决策记录存放目录 |
|
||||
| .aide/diagrams/ | PlantUML 流程图存放目录 |
|
||||
| discuss/ | 项目讨论记录存放目录 |
|
||||
| reply/ | 项目回复记录存放目录 |
|
||||
| statements/ | 声明文档目录(历史文件已清理) |
|
||||
|
||||
118
CHANGELOG.md
118
CHANGELOG.md
@@ -4,8 +4,126 @@
|
||||
|
||||
## 2025-12-18
|
||||
|
||||
### 修复
|
||||
|
||||
**修复 end_commit 记录逻辑**
|
||||
- `end_commit` 现在记录 tracker 创建的 finish 提交哈希(`[aide] finish: {summary}`)
|
||||
- `finished_at` 使用 finish 提交的时间戳
|
||||
- tracker.py:移除多余的 `[aide] finish: 更新状态文件` 提交,改为传递 end_commit 和 finished_at 给 branch_mgr
|
||||
- branch.py:finish_branch_merge 接收 end_commit 和 finished_at 参数
|
||||
- 正常 finish 流程不再创建额外的结束提交,直接使用 tracker 传入的值
|
||||
- 强制清理(clean)仍会创建自己的结束提交
|
||||
- flow-status.json 和 branches.json/md 的更新合并到同一个提交 `[aide] finish: 更新状态`
|
||||
- 新增 `git.amend()` 方法(备用)
|
||||
|
||||
**修复 find_project_root 在子项目中定位错误的问题**
|
||||
- 原因:从复制的测试目录运行时,因没有 `flow-status.json` 而向上查找到父项目
|
||||
- 解决:添加"步骤 0",如果当前目录已有 `.aide` 目录,直接使用不向上查找
|
||||
- 新的查找策略:
|
||||
0. 当前目录有 `.aide` → 直接使用
|
||||
1. 向上查找有 `flow-status.json` 的目录(活跃任务)
|
||||
2. 向上查找有 `config.toml` 的目录
|
||||
|
||||
### 新增功能
|
||||
|
||||
**`aide flow clean` 强制清理命令**
|
||||
- 用于在任务中途强制终止流程
|
||||
- 如果工作区不干净,自动创建一个提交
|
||||
- 执行流程与 finish 类似,但:
|
||||
- 提交消息格式为 `{start_commit[:7]}的强制清理`
|
||||
- 分支状态标记为 `force-cleaned`
|
||||
- 保留任务分支供后续参考
|
||||
|
||||
### 修复
|
||||
|
||||
**修复 finish 流程中起始/结束提交哈希相同的 bug**
|
||||
- 原因:切回源分支后才调用 `record_branch_finish`,导致 `rev_parse_head()` 获取的是源分支 HEAD
|
||||
- 解决:在任务分支上先创建"结束提交"并记录哈希,在最终保存时直接使用保存的变量
|
||||
- 新增 `record_end_commit` 方法:仅记录结束提交和时间,不更新状态
|
||||
- 在 `_merge_normal` 和 `_merge_with_temp_branch` 中,直接使用保存的 `end_commit` 变量,确保不会丢失
|
||||
|
||||
### 变更
|
||||
|
||||
**finish/clean 流程重构**
|
||||
- 新流程:结束提交 → 记录哈希 → 清理 → 清理提交 → 切回源分支 → squash 合并 → 更新状态(使用保存的end_commit) → 收尾提交
|
||||
- `_merge_normal` 方法新增 `is_force_clean` 参数,不再调用 `update_branch_status`,直接内联更新
|
||||
- `_merge_with_temp_branch` 方法也同步更新
|
||||
|
||||
**decisions 清理逻辑简化**
|
||||
- 清理时不再备份 `decisions/*.json`,直接删除
|
||||
- 移除备份目录创建逻辑
|
||||
|
||||
**branches.md 时间格式调整**
|
||||
- 起始时间和结束时间分别单独列出
|
||||
- 原格式:`- **时间**: 2025-12-18 10:30 ~ 11:45`
|
||||
- 新格式:
|
||||
- `- **起始时间**: 2025-12-18 10:30`
|
||||
- `- **结束时间**: 2025-12-18 11:45`
|
||||
|
||||
### 修改的文件
|
||||
- `aide-program/aide/core/config.py`
|
||||
- `find_project_root` 函数:添加步骤 0,当前目录有 .aide 时不向上查找
|
||||
- `aide-program/aide/flow/git.py`
|
||||
- 新增 `amend` 方法:将暂存区内容追加到上一次提交
|
||||
- `aide-program/aide/flow/branch.py`
|
||||
- `_cleanup_task_files` 方法:decisions 直接删除不备份
|
||||
- `record_branch_finish` 方法:保持兼容
|
||||
- 新增 `record_end_commit` 方法
|
||||
- `clean_branch_merge` 方法:脏工作区时自动创建提交
|
||||
- `_merge_normal` 方法:重构流程,结束提交后立即更新状态再清理
|
||||
- `_merge_with_temp_branch` 方法:同步重构
|
||||
- `_generate_markdown` 方法:时间格式分开显示
|
||||
- `aide-program/aide/flow/tracker.py`
|
||||
- 新增 `clean` 方法
|
||||
- `aide-program/aide/main.py`
|
||||
- 新增 `flow clean` 子命令
|
||||
- 新增 `handle_flow_clean` 处理函数
|
||||
|
||||
---
|
||||
|
||||
### 改进
|
||||
|
||||
**收尾清理逻辑增强**
|
||||
- 新增删除 `pending-items.json` 文件的清理步骤
|
||||
- 新增删除流程图目录(`.aide/diagrams/`)下所有文件的清理步骤
|
||||
- 支持删除 `.puml`、`.plantuml`、`.png` 文件
|
||||
- 保留目录本身
|
||||
|
||||
### 修改的文件
|
||||
- `aide-program/aide/flow/branch.py` - `_cleanup_task_files` 方法增加两个清理步骤
|
||||
|
||||
### 改进
|
||||
|
||||
**aide 命令递归查找项目根目录**
|
||||
- 新增 `find_project_root()` 函数,支持从子目录运行 aide 命令
|
||||
- 类似 git 查找 `.git` 目录的逻辑:从当前目录向上递归查找
|
||||
- 查找策略(两遍遍历):
|
||||
1. 优先查找包含 `flow-status.json` 的目录(活跃任务)
|
||||
2. 其次查找包含 `config.toml` 的目录
|
||||
- 解决了会话重启后工作目录变更导致任务状态"丢失"的问题
|
||||
|
||||
### 修改的文件
|
||||
- `aide-program/aide/core/config.py` - 新增 `find_project_root()` 函数
|
||||
- `aide-program/aide/main.py` - 所有 handler 函数改用 `find_project_root()` 替代 `Path.cwd()`
|
||||
|
||||
---
|
||||
|
||||
### 新增功能
|
||||
|
||||
**全自动任务执行命令 `/aide:auto-run`**
|
||||
- 基于 `/aide:run` 的全自动化版本
|
||||
- 去除所有用户交互环节:
|
||||
- 待定项自动决策(选择 recommend 或最高分选项)
|
||||
- 任务细则自动确认(无需用户确认)
|
||||
- 跳过 confirm 阶段(docs → finish)
|
||||
- 新增错误自动处理机制:
|
||||
- 优先委托 `general-purpose` 子代理解决
|
||||
- 无子代理时自行解决(需先记录并更新计划)
|
||||
- 新增计划外情况处理机制:
|
||||
- 必须先记录遇到的情况
|
||||
- 更新任务计划文档后才能继续
|
||||
- 适用场景:批量处理、后台执行、无需人工干预的任务
|
||||
|
||||
**用户确认阶段 (confirm)**
|
||||
- 在 docs 和 finish 之间新增 `confirm` 阶段
|
||||
- 用于用户审阅和测试已完成的工作
|
||||
|
||||
12
README.md
12
README.md
@@ -72,7 +72,7 @@ aide env ensure --runtime
|
||||
```
|
||||
/aide:run # 执行任务(核心命令)
|
||||
/aide:setup # 环境配置
|
||||
/aide:docs # 项目文档管理
|
||||
/aide:docs/reference # 项目文档管理
|
||||
```
|
||||
|
||||
## 核心功能
|
||||
@@ -81,7 +81,7 @@ aide env ensure --runtime
|
||||
|------|------|
|
||||
| `/aide:run` | 任务执行(核心命令),整合任务准备和执行流程 |
|
||||
| `/aide:setup` | 环境配置,检测和修复开发环境 |
|
||||
| `/aide:docs` | 项目文档创建和维护 |
|
||||
| `/aide:docs/reference` | 项目文档创建和维护 |
|
||||
| `/aide:load` | 项目认知载入(由 run 内部调用) |
|
||||
|
||||
## aide 命令行工具
|
||||
@@ -100,10 +100,10 @@ aide decide result # 获取决策结果
|
||||
|
||||
## 文档
|
||||
|
||||
- [项目详细说明](docs/project-details.md) - 项目架构和实现状态
|
||||
- [Aide 系统概述](docs/aide-overview.md) - 系统设计理念
|
||||
- [aide-plugin 文档](aide-marketplace/aide-plugin/docs/README.md) - 插件设计
|
||||
- [aide-program 文档](aide-program/docs/README.md) - 命令行工具设计
|
||||
- [项目详细说明](docs/reference/project-details.md) - 项目架构和实现状态
|
||||
- [Aide 系统概述](docs/reference/aide-overview.md) - 系统设计理念
|
||||
- [aide-plugin 文档](aide-marketplace/aide-plugin/docs/reference/README.md) - 插件设计
|
||||
- [aide-program 文档](aide-program/docs/reference/README.md) - 命令行工具设计
|
||||
|
||||
## 许可证
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
{
|
||||
"name": "aide-plugin",
|
||||
"description": "Aide 工作流体系插件,提供环境配置、项目认知、文档管理和任务执行的标准化流程",
|
||||
"version": "2.0.8",
|
||||
"description": "Aide 工作流体系插件,提供环境配置、项目认知、文档管理和任务执行(含全自动模式)的标准化流程",
|
||||
"version": "2.1.0",
|
||||
"author": {
|
||||
"name": "Aide Team"
|
||||
},
|
||||
"keywords": ["workflow", "task", "aide", "productivity", "documentation"]
|
||||
"keywords": ["workflow", "task", "aide", "productivity", "documentation", "automation"]
|
||||
}
|
||||
|
||||
571
aide-marketplace/aide-plugin/commands/auto-run.md
Normal file
571
aide-marketplace/aide-plugin/commands/auto-run.md
Normal file
@@ -0,0 +1,571 @@
|
||||
# Aide 全自动任务执行
|
||||
|
||||
你正在执行 Aide **全自动**任务执行流程。这是 `/aide:run` 的自动化版本,去除了所有需要用户参与的环节,适用于批量处理或后台执行场景。
|
||||
|
||||
**与 `/aide:run` 的主要区别**:
|
||||
- 待定项自动决策(无需用户 Web 确认)
|
||||
- 任务细则自动确认(无需用户确认)
|
||||
- 跳过 confirm 阶段(无需用户验收)
|
||||
- 错误自动处理(优先委托子代理,否则自行解决)
|
||||
|
||||
## 参数
|
||||
|
||||
- `$ARGUMENTS`:任务文档路径(可选)
|
||||
- 未传入时根据 flow 状态决定行为
|
||||
|
||||
---
|
||||
|
||||
## 前置准备
|
||||
|
||||
**首先触发 `aide` skill 学习 aide 命令的使用方法。**
|
||||
|
||||
这是一个非常长的任务,因此规划您的工作可能会很有益。**建议花费您的整个输出上下文来处理任务 - 只需确保您不会在有大量未提交的工作时用尽上下文。**继续系统地工作,直到您完成此任务。**您的上下文窗口将在接近其限制时自动压缩,允许您从中断的地方继续无限期地工作。因此,不要因为令牌预算问题而提前停止任务。**当您接近令牌预算限制时,在上下文窗口刷新前将您当前的进度和状态保存到内存中。始终尽可能坚持和自主,并完全完成任务,即使您的预算即将用尽。无论剩余上下文如何,永远不要人为地提前停止任何任务。
|
||||
|
||||
---
|
||||
|
||||
## 开始
|
||||
|
||||
### 检查 flow 状态
|
||||
|
||||
```bash
|
||||
aide flow status
|
||||
```
|
||||
|
||||
根据状态决定行为:
|
||||
|
||||
- **无活跃任务** 或 **当前任务已 finish** → 进入**新任务流程**
|
||||
- **当前任务未完成** → 进入**续接流程**
|
||||
|
||||
---
|
||||
|
||||
## 新任务流程
|
||||
|
||||
### 阶段 1:任务准备 (task-optimize)
|
||||
|
||||
#### 1.1 启动流程追踪
|
||||
|
||||
```bash
|
||||
aide flow start task-optimize "开始任务准备: <任务简述>"
|
||||
```
|
||||
|
||||
#### 1.2 确定任务文档
|
||||
|
||||
```bash
|
||||
# 如果传入了参数
|
||||
任务文档 = $ARGUMENTS
|
||||
|
||||
# 如果未传入参数,使用配置默认值
|
||||
aide config get task.source
|
||||
```
|
||||
|
||||
读取任务文档内容。如文档不存在,**报错退出**(全自动模式不支持交互式输入)。
|
||||
|
||||
#### 1.3 口语化内容检测
|
||||
|
||||
检查任务文档或用户对话是否具有以下口语化特征:
|
||||
|
||||
- 使用非正式的口头表达方式
|
||||
- 包含大量模糊表述("我觉得"、"好像"、"大概"、"应该"等)
|
||||
- 句子结构松散,缺乏条理性
|
||||
- 包含冗余或重复的表达
|
||||
- 思维跳跃,逻辑不连贯
|
||||
|
||||
**如果检测到口语化特征**:
|
||||
|
||||
1. 触发 `task-parser` skill 学习口语化内容解析方法
|
||||
2. 按照 skill 指南对内容进行深度理解和规范化转换
|
||||
3. 将转换后的结构化内容作为后续分析的基础
|
||||
|
||||
> 即使内容部分口语化,也应进行解析,提取核心意图
|
||||
|
||||
#### 1.4 任务分析
|
||||
|
||||
##### 深度理解任务
|
||||
|
||||
- 任务要解决什么问题?
|
||||
- 最终交付物是什么?
|
||||
- 成功的标准是什么?
|
||||
- 涉及哪些模块/系统?
|
||||
- 是否有技术难点?
|
||||
|
||||
##### 分析项目环境
|
||||
|
||||
根据需要阅读相关代码/文档,理解任务与项目现有结构的关系。
|
||||
|
||||
> 复杂任务(多子目标、多方案对比)建议使用 sequential-thinking 进行结构化分析
|
||||
|
||||
#### 1.5 复杂度评估
|
||||
|
||||
根据**任务复杂度评估指导原则**(见附录)评估任务复杂度:
|
||||
|
||||
- **简单/中等任务**:直接生成任务细则
|
||||
- **复杂/超大任务**:拆分为多个子计划
|
||||
|
||||
#### 1.6 任务优化
|
||||
|
||||
##### 准确性优化
|
||||
|
||||
- 识别**歧义**和**不明确之处**
|
||||
- 识别**隐含假设**和**未说明的前提**
|
||||
- 明确任务**边界**
|
||||
|
||||
##### 简洁性优化
|
||||
|
||||
- 识别**冗余表述**
|
||||
- 区分**真冗余**与**必要强调**
|
||||
|
||||
##### 可执行性优化
|
||||
|
||||
- 将抽象要求转化为**具体步骤**
|
||||
- 确保每个步骤有明确的**输入、输出、验证标准**
|
||||
- 识别可能的**替代方案**
|
||||
|
||||
##### 生成待定项
|
||||
|
||||
对于存在多种方案、有歧义、需要用户确认的内容,准备待定项数据。
|
||||
|
||||
#### 1.7 待定项自动处理
|
||||
|
||||
**必须执行**,无论是否有待定项:
|
||||
|
||||
1. **如果有待定项**:
|
||||
- 分析各待定项的选项
|
||||
- 对于每个待定项:
|
||||
- 如果有 `recommend` 字段,选择推荐选项
|
||||
- 如果无推荐,根据 `score` 字段选择最高分选项
|
||||
- 如果无评分,选择第一个选项
|
||||
- 记录决策理由到 flow 日志:
|
||||
```bash
|
||||
aide flow next-step "自动决策: <决策摘要>"
|
||||
```
|
||||
|
||||
2. **如果无待定项**:
|
||||
- 继续下一步(无需向用户报告)
|
||||
|
||||
#### 1.8 生成任务细则
|
||||
|
||||
**必须执行**:
|
||||
|
||||
##### 简单/中等任务
|
||||
|
||||
1. 根据分析结果生成任务细则文档
|
||||
2. 保存到配置的路径:
|
||||
```bash
|
||||
aide config get task.spec
|
||||
```
|
||||
|
||||
##### 复杂任务(需拆分为子计划)
|
||||
|
||||
1. 获取计划文档目录:
|
||||
```bash
|
||||
aide config get task.plans_path
|
||||
```
|
||||
2. 创建目录(如不存在)
|
||||
3. 生成以下文档:
|
||||
|
||||
**任务计划总导览(guide.md)**:
|
||||
|
||||
```markdown
|
||||
# 任务计划总导览
|
||||
|
||||
## 任务简述
|
||||
[一句话描述任务目标]
|
||||
|
||||
## 子计划列表
|
||||
|
||||
| # | 名称 | 状态 | 细则文档 |
|
||||
|---|------|------|----------|
|
||||
| 1 | [子计划1名称] | pending | spec-01.md |
|
||||
| 2 | [子计划2名称] | pending | spec-02.md |
|
||||
...
|
||||
|
||||
## 执行顺序
|
||||
[说明子计划之间的依赖关系和执行顺序]
|
||||
|
||||
## 备注
|
||||
[其他需要说明的内容]
|
||||
```
|
||||
|
||||
**各子计划细则(spec-01.md, spec-02.md, ...)**:
|
||||
|
||||
```markdown
|
||||
# 子计划 N:[名称]
|
||||
|
||||
## 目标
|
||||
[具体目标]
|
||||
|
||||
## 具体步骤
|
||||
1. [步骤1]
|
||||
2. [步骤2]
|
||||
...
|
||||
|
||||
## 验证标准
|
||||
- [标准1]
|
||||
- [标准2]
|
||||
|
||||
## 依赖
|
||||
- 前置:[依赖的子计划,如无则写"无"]
|
||||
- 后续:[依赖本计划的子计划,如无则写"无"]
|
||||
```
|
||||
|
||||
##### 自动确认
|
||||
|
||||
全自动模式下,生成任务细则后直接进入下一阶段:
|
||||
|
||||
```bash
|
||||
aide flow next-step "任务细则已生成,自动确认"
|
||||
```
|
||||
|
||||
### 阶段 2:流程设计 (flow-design)
|
||||
|
||||
```bash
|
||||
aide flow next-part flow-design "进入流程设计环节"
|
||||
```
|
||||
|
||||
#### 2.1 制定执行计划
|
||||
|
||||
- 具体的实现步骤
|
||||
- 每个步骤的预期产出
|
||||
- 潜在风险和应对方案
|
||||
|
||||
#### 2.2 创建流程图
|
||||
|
||||
在配置的流程图目录创建 PlantUML 源文件:
|
||||
|
||||
```bash
|
||||
aide config get flow.diagram_path
|
||||
```
|
||||
|
||||
##### 流程图类型
|
||||
|
||||
根据任务类型,需要创建不同类型的流程图:
|
||||
|
||||
| 类型 | 适用场景 | 必需性 |
|
||||
|------|----------|--------|
|
||||
| 任务执行流程图 | 所有任务 | **必需** |
|
||||
| 程序逻辑流图 | 含程序设计与代码编写的任务 | **必需** |
|
||||
|
||||
##### 任务执行流程图规范
|
||||
|
||||
展示任务执行的步骤顺序:
|
||||
|
||||
- **步骤分解**:将任务分解为具体的执行步骤
|
||||
- **顺序关系**:明确步骤之间的先后顺序
|
||||
- **决策点**:标注关键决策点和分支条件
|
||||
- **依赖关系**:体现步骤之间的依赖
|
||||
|
||||
##### 程序逻辑流图规范
|
||||
|
||||
展示程序代码的执行逻辑(仅限程序类任务):
|
||||
|
||||
- **入口点**:从程序入口函数(如 main、\_\_main\_\_)开始
|
||||
- **控制结构**:体现顺序、分支(if/switch)、循环(for/while)结构
|
||||
- **语义化抽象**:将代码逻辑抽象为人类可理解的业务描述,而非代码细节
|
||||
- **模块化表示**:
|
||||
- 函数/模块表示为"盒子"
|
||||
- 标注预期输入和输出
|
||||
- 复杂函数可单独绘制详图
|
||||
- **层次化组织**:
|
||||
- 主流程图展示程序整体执行流
|
||||
- 关键子系统/模块可单独绘制详细流程图
|
||||
- 通过引用关联主图与详图
|
||||
|
||||
> **为什么需要程序逻辑流图**:
|
||||
> - 用户可以通过流程图快速理解程序的执行逻辑
|
||||
> - 在流程图阶段发现业务逻辑错误,避免实现后才发现方向错误
|
||||
> - 比逐行审阅代码更高效
|
||||
|
||||
##### 流程图示例结构
|
||||
|
||||
```plantuml
|
||||
@startuml
|
||||
' 主程序流程图
|
||||
start
|
||||
:初始化配置;
|
||||
:解析命令行参数;
|
||||
|
||||
if (参数有效?) then (是)
|
||||
:调用处理模块;
|
||||
note right: 详见 process-module.puml
|
||||
else (否)
|
||||
:显示错误信息;
|
||||
stop
|
||||
endif
|
||||
|
||||
:输出结果;
|
||||
stop
|
||||
@enduml
|
||||
```
|
||||
|
||||
**所有任务必须有流程图**,用于:
|
||||
- 规范化思考
|
||||
- 方便用户审阅
|
||||
- 早期发现逻辑错误
|
||||
|
||||
```bash
|
||||
aide flow next-step "流程图设计完成"
|
||||
```
|
||||
|
||||
#### 2.3 进入实现环节
|
||||
|
||||
```bash
|
||||
aide flow next-part impl "流程设计完成,进入实现环节"
|
||||
```
|
||||
|
||||
> aide flow 会自动校验 PlantUML 并生成 PNG
|
||||
|
||||
### 阶段 3:迭代实现 (impl)
|
||||
|
||||
按计划执行,每完成一个步骤:
|
||||
|
||||
```bash
|
||||
aide flow next-step "<完成内容简述>"
|
||||
```
|
||||
|
||||
遇到问题时:
|
||||
|
||||
```bash
|
||||
aide flow issue "<一般问题>"
|
||||
aide flow error "<严重错误>"
|
||||
```
|
||||
|
||||
#### 错误自动处理
|
||||
|
||||
全自动模式下,遇到错误时按以下流程处理:
|
||||
|
||||
1. **记录错误**:
|
||||
```bash
|
||||
aide flow error "<错误描述>"
|
||||
```
|
||||
|
||||
2. **尝试自动解决**:
|
||||
- **优先委托子代理**:如果存在 `general-purpose` 子代理,使用 Task 工具委托其解决
|
||||
- **自行解决**:如果无子代理可用,则自行解决
|
||||
|
||||
3. **自行解决前的必要操作**(见下文「计划外情况处理」)
|
||||
|
||||
需要回退时:
|
||||
|
||||
```bash
|
||||
aide flow back-step "<原因>"
|
||||
aide flow back-part <环节名> "<原因>"
|
||||
```
|
||||
|
||||
#### 计划外情况处理
|
||||
|
||||
当遇到以下情况时:
|
||||
- 只能自行解决的问题(无子代理可用)
|
||||
- 可能大幅消耗上下文的计划外情况
|
||||
- 需要重大决策但无法委托的情况
|
||||
|
||||
**必须执行以下操作后才能继续**:
|
||||
|
||||
1. **记录遇到的情况**:
|
||||
```bash
|
||||
aide flow issue "<情况描述>"
|
||||
```
|
||||
|
||||
2. **更新任务计划文档**:
|
||||
- 简单任务:更新 `task.spec`
|
||||
- 复杂任务:更新相应的子计划文档(`spec-NN.md`)
|
||||
- 新增「计划外处理」章节,说明:
|
||||
- 遇到的情况
|
||||
- 选择的处理方案
|
||||
- 预期影响
|
||||
|
||||
3. **记录更新完成**:
|
||||
```bash
|
||||
aide flow next-step "计划外情况已记录,继续执行"
|
||||
```
|
||||
|
||||
4. **执行处理方案**
|
||||
|
||||
> 这一机制确保即使上下文中断,也能通过文档恢复状态
|
||||
|
||||
### 阶段 4:验证交付 (verify)
|
||||
|
||||
```bash
|
||||
aide flow next-part verify "实现完成,进入验证环节"
|
||||
```
|
||||
|
||||
- 对照任务细则验证每个成功标准
|
||||
- 执行测试(如适用)
|
||||
- 验证失败则回退修复
|
||||
|
||||
```bash
|
||||
aide flow next-step "验证完成: <验证结论>"
|
||||
```
|
||||
|
||||
### 阶段 5:文档更新 (docs)
|
||||
|
||||
```bash
|
||||
aide flow next-part docs "验证通过,进入文档环节"
|
||||
```
|
||||
|
||||
更新相关文档:
|
||||
- `README.md`(如有用户可见变更)
|
||||
- `CHANGELOG.md`
|
||||
- 其他相关文档
|
||||
|
||||
```bash
|
||||
aide flow next-step "文档更新完成"
|
||||
```
|
||||
|
||||
### 阶段 6:收尾 (finish)
|
||||
|
||||
> 全自动模式跳过用户确认阶段,从文档更新直接进入收尾
|
||||
|
||||
```bash
|
||||
aide flow next-part finish "文档更新完成,进入收尾"
|
||||
```
|
||||
|
||||
- 清理临时文件
|
||||
- 检查遗漏的 TODO
|
||||
- 输出完成摘要
|
||||
|
||||
```bash
|
||||
aide flow next-step "任务完成"
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 续接流程
|
||||
|
||||
当检测到未完成的任务时:
|
||||
|
||||
### 1. 智能续接判断
|
||||
|
||||
1. **检查任务细则文档是否存在**:
|
||||
```bash
|
||||
aide config get task.spec
|
||||
```
|
||||
读取配置的细则文档路径。
|
||||
|
||||
2. **如果细则文档不存在**:
|
||||
- 旧状态已无效
|
||||
- **报错退出**:「检测到未完成的任务,但任务细则不存在。全自动模式无法继续。」
|
||||
|
||||
3. **如果细则文档存在**:
|
||||
- 阅读细则文档内容
|
||||
- 判断上次未完成任务的名称和步骤是否符合细则含义
|
||||
- **符合** → 接续之前的状态继续执行
|
||||
- **不符合** → 旧状态已无效,需要 start 新任务
|
||||
|
||||
4. **如果判断为应继续,但 git 状态不干净**:
|
||||
- aide flow 会自动执行 git add . 并创建清理提交
|
||||
- 这是预期行为,无需手动处理
|
||||
|
||||
### 2. 分析当前进度
|
||||
|
||||
```bash
|
||||
aide flow status
|
||||
aide flow show <task_id>
|
||||
```
|
||||
|
||||
了解:
|
||||
- 当前处于哪个环节
|
||||
- 已完成哪些步骤
|
||||
- 最后的操作是什么
|
||||
|
||||
### 2. 载入项目认知
|
||||
|
||||
调用 `/aide:load` 的逻辑,按需载入项目文档。
|
||||
|
||||
### 3. 读取任务细则
|
||||
|
||||
```bash
|
||||
aide config get task.spec
|
||||
```
|
||||
|
||||
读取任务细则,了解任务目标和计划。
|
||||
|
||||
### 4. 继续执行
|
||||
|
||||
根据当前环节,从中断处继续执行。
|
||||
|
||||
---
|
||||
|
||||
## 复杂任务的子计划执行
|
||||
|
||||
对于拆分为多个子计划的复杂任务:
|
||||
|
||||
### 文档结构
|
||||
|
||||
复杂任务的文档存放在 `task.plans_path` 配置的目录下(默认 `.aide/task-plans/`):
|
||||
|
||||
```
|
||||
.aide/task-plans/
|
||||
├── guide.md # 任务计划总导览
|
||||
├── spec-01.md # 子计划 1 细则
|
||||
├── spec-02.md # 子计划 2 细则
|
||||
└── spec-NN.md # 子计划 N 细则
|
||||
```
|
||||
|
||||
### 执行模式
|
||||
|
||||
```
|
||||
task-optimize → [flow-design → impl → verify → docs] × N → finish
|
||||
```
|
||||
|
||||
> 全自动模式:跳过 confirm 阶段,每个子计划完成 docs 后直接进入下一个子计划
|
||||
|
||||
### 流程
|
||||
|
||||
1. 完成 task-optimize:
|
||||
- 生成 `guide.md`(任务计划总导览)
|
||||
- 生成所有 `spec-NN.md`(子计划细则)
|
||||
2. 对每个子计划:
|
||||
- 进入 flow-design,为该子计划设计流程图
|
||||
- 进入 impl,实现该子计划
|
||||
- 进入 verify,验证该子计划
|
||||
- 进入 docs,更新该子计划相关文档
|
||||
- 更新 `guide.md` 中该子计划状态为 `completed`
|
||||
3. 所有子计划完成后,进入 finish
|
||||
|
||||
### 子计划切换
|
||||
|
||||
完成一个子计划的 docs 后:
|
||||
|
||||
```bash
|
||||
aide flow next-step "子计划 N 完成,开始子计划 N+1"
|
||||
aide flow back-part flow-design "开始下一个子计划的流程设计"
|
||||
```
|
||||
|
||||
### 子计划状态管理
|
||||
|
||||
每完成一个子计划,更新 `guide.md` 中的状态表:
|
||||
|
||||
| # | 名称 | 状态 | 细则文档 |
|
||||
|---|------|------|----------|
|
||||
| 1 | [子计划1名称] | **completed** | spec-01.md |
|
||||
| 2 | [子计划2名称] | **in_progress** | spec-02.md |
|
||||
| 3 | [子计划3名称] | pending | spec-03.md |
|
||||
|
||||
---
|
||||
|
||||
## 附录:任务复杂度评估指导原则
|
||||
|
||||
### 评估维度
|
||||
|
||||
1. **结构维度**:模块数量、文件数量、依赖关系
|
||||
2. **逻辑维度**:业务复杂度、状态管理、边界条件
|
||||
3. **集成维度**:外部依赖、数据格式、兼容性
|
||||
4. **风险维度**:技术风险、影响范围、回滚难度
|
||||
|
||||
### 复杂度等级
|
||||
|
||||
| 等级 | 特征 | 处理方式 |
|
||||
|------|------|----------|
|
||||
| 简单 | 单文件或少量文件,逻辑清晰 | 直接执行 |
|
||||
| 中等 | 2-4 个模块,有一定依赖 | 直接执行,注意顺序 |
|
||||
| 复杂 | 5+ 模块,复杂依赖 | **拆分为子计划** |
|
||||
| 超大 | 10+ 模块,全面重构 | 拆分为独立任务 |
|
||||
|
||||
### 拆分判断标准
|
||||
|
||||
满足以下任一条件时应拆分:
|
||||
1. 涉及 3 个以上独立功能模块
|
||||
2. 任务自然分为多个可独立交付的阶段
|
||||
3. 存在高风险环节,需要阶段性验证
|
||||
4. 存在明确的前后依赖关系
|
||||
5. 单次对话可能无法完成
|
||||
@@ -10,6 +10,74 @@ from tomli_w import dumps as toml_dumps
|
||||
|
||||
from aide.core import output
|
||||
|
||||
|
||||
def find_project_root(start_path: Path | None = None) -> Path:
|
||||
"""递归向上查找包含有效 .aide 目录的项目根目录。
|
||||
|
||||
类似于 git 查找 .git 目录的逻辑:从当前目录开始向上遍历,
|
||||
直到找到包含有效 .aide 目录的父目录。
|
||||
|
||||
查找策略(三遍遍历):
|
||||
0. 首先:如果当前目录有 .aide 目录,直接使用(不向上查找)
|
||||
1. 第一遍:优先查找包含 flow-status.json 的目录(活跃任务)
|
||||
2. 第二遍:如果第一遍未找到,查找包含 config.toml 的目录
|
||||
|
||||
这样可以确保:
|
||||
- 在子项目目录运行时,使用子项目的配置
|
||||
- 从子目录运行时,优先找到有活跃任务的项目根目录
|
||||
|
||||
Args:
|
||||
start_path: 起始路径,默认为当前工作目录
|
||||
|
||||
Returns:
|
||||
找到有效 .aide 目录的父目录路径,如果未找到则返回起始路径
|
||||
"""
|
||||
if start_path is None:
|
||||
start_path = Path.cwd()
|
||||
|
||||
start_path = start_path.resolve()
|
||||
|
||||
def search_upward(check_fn) -> Path | None:
|
||||
"""向上遍历查找满足条件的目录"""
|
||||
current = start_path
|
||||
while current != current.parent:
|
||||
if check_fn(current):
|
||||
return current
|
||||
current = current.parent
|
||||
# 检查根目录本身
|
||||
if check_fn(current):
|
||||
return current
|
||||
return None
|
||||
|
||||
def has_aide_dir(path: Path) -> bool:
|
||||
"""检查是否有 .aide 目录"""
|
||||
return (path / ".aide").is_dir()
|
||||
|
||||
def has_flow_status(path: Path) -> bool:
|
||||
"""检查是否有活跃任务状态文件"""
|
||||
return (path / ".aide" / "flow-status.json").exists()
|
||||
|
||||
def has_config(path: Path) -> bool:
|
||||
"""检查是否有配置文件"""
|
||||
return (path / ".aide" / "config.toml").exists()
|
||||
|
||||
# 步骤 0:如果当前目录有 .aide 目录,直接使用(不向上查找)
|
||||
if has_aide_dir(start_path):
|
||||
return start_path
|
||||
|
||||
# 第一遍:优先查找有活跃任务的目录
|
||||
result = search_upward(has_flow_status)
|
||||
if result is not None:
|
||||
return result
|
||||
|
||||
# 第二遍:查找有配置文件的目录
|
||||
result = search_upward(has_config)
|
||||
if result is not None:
|
||||
return result
|
||||
|
||||
# 未找到有效 .aide 目录,返回原始起始路径
|
||||
return start_path
|
||||
|
||||
DEFAULT_CONFIG = """################################################################################
|
||||
# Aide 配置文件 (config.toml)
|
||||
################################################################################
|
||||
|
||||
@@ -118,6 +118,8 @@ class BranchManager:
|
||||
- 清空任务原文件 (task.source),保留文件本身
|
||||
- 备份并删除 flow-status.json
|
||||
- 备份并删除 decisions/*.json
|
||||
- 删除 pending-items.json
|
||||
- 删除流程图目录下的所有文件 (.puml, .plantuml, .png)
|
||||
"""
|
||||
# 确保 logs 目录存在
|
||||
self.logs_dir.mkdir(parents=True, exist_ok=True)
|
||||
@@ -160,21 +162,34 @@ class BranchManager:
|
||||
except OSError:
|
||||
pass
|
||||
|
||||
# 5. 备份并删除 decisions/*.json
|
||||
# 5. 直接删除 decisions/*.json(不备份)
|
||||
decisions_dir = self.aide_dir / "decisions"
|
||||
if decisions_dir.exists():
|
||||
decision_files = list(decisions_dir.glob("*.json"))
|
||||
if decision_files:
|
||||
# 创建备份目录
|
||||
backup_decisions_dir = self.logs_dir / f"{task_id}-decisions"
|
||||
backup_decisions_dir.mkdir(parents=True, exist_ok=True)
|
||||
for decision_file in decision_files:
|
||||
for decision_file in decisions_dir.glob("*.json"):
|
||||
try:
|
||||
shutil.copy2(decision_file, backup_decisions_dir / decision_file.name)
|
||||
decision_file.unlink()
|
||||
except OSError:
|
||||
pass
|
||||
|
||||
# 6. 删除 pending-items.json
|
||||
pending_items_path = self.aide_dir / "pending-items.json"
|
||||
if pending_items_path.exists():
|
||||
try:
|
||||
pending_items_path.unlink()
|
||||
except OSError:
|
||||
pass
|
||||
|
||||
# 7. 删除流程图目录下的所有文件
|
||||
diagram_path = self.cfg.get_value("flow.diagram_path") or ".aide/diagrams"
|
||||
diagram_dir = self.root / diagram_path
|
||||
if diagram_dir.exists() and diagram_dir.is_dir():
|
||||
for diagram_file in diagram_dir.iterdir():
|
||||
if diagram_file.is_file() and diagram_file.suffix in (".puml", ".plantuml", ".png"):
|
||||
try:
|
||||
diagram_file.unlink()
|
||||
except OSError:
|
||||
pass
|
||||
|
||||
def load_branches(self) -> BranchesData:
|
||||
"""加载分支概况"""
|
||||
if self._data is not None:
|
||||
@@ -231,10 +246,13 @@ class BranchManager:
|
||||
if branch.end_commit:
|
||||
lines.append(f"- **结束提交**: {branch.end_commit[:7]}")
|
||||
lines.append(f"- **状态**: {branch.status}")
|
||||
time_str = branch.started_at[:16].replace("T", " ")
|
||||
# 起始时间
|
||||
start_time_str = branch.started_at[:16].replace("T", " ")
|
||||
lines.append(f"- **起始时间**: {start_time_str}")
|
||||
# 结束时间(单独列出)
|
||||
if branch.finished_at:
|
||||
time_str += f" ~ {branch.finished_at[11:16]}"
|
||||
lines.append(f"- **时间**: {time_str}")
|
||||
end_time_str = branch.finished_at[:16].replace("T", " ")
|
||||
lines.append(f"- **结束时间**: {end_time_str}")
|
||||
if branch.temp_branch:
|
||||
lines.append(f"- **临时分支**: {branch.temp_branch}")
|
||||
lines.append("")
|
||||
@@ -328,7 +346,7 @@ class BranchManager:
|
||||
end_commit: str | None = None,
|
||||
temp_branch: str | None = None,
|
||||
) -> None:
|
||||
"""记录分支结束信息"""
|
||||
"""记录分支结束信息(兼容旧接口,一次性更新所有字段)"""
|
||||
data = self.load_branches()
|
||||
branch_info = self.get_active_branch_info()
|
||||
|
||||
@@ -357,9 +375,97 @@ class BranchManager:
|
||||
self._current_branch_info = None
|
||||
self.save_branches()
|
||||
|
||||
def finish_branch_merge(self, task_summary: str) -> tuple[bool, str]:
|
||||
def record_end_commit(self, end_commit: str) -> None:
|
||||
"""记录结束提交和时间(不更新状态)
|
||||
|
||||
用于在任务分支上先记录结束点,再执行清理操作。
|
||||
"""
|
||||
data = self.load_branches()
|
||||
branch_info = self.get_active_branch_info()
|
||||
|
||||
if branch_info is None:
|
||||
return
|
||||
|
||||
# 更新分支信息(只更新 end_commit 和 finished_at)
|
||||
for i, branch in enumerate(data.branches):
|
||||
if branch.number == branch_info.number:
|
||||
data.branches[i] = BranchInfo(
|
||||
number=branch.number,
|
||||
branch_name=branch.branch_name,
|
||||
source_branch=branch.source_branch,
|
||||
start_commit=branch.start_commit,
|
||||
end_commit=end_commit,
|
||||
task_id=branch.task_id,
|
||||
task_summary=branch.task_summary,
|
||||
started_at=branch.started_at,
|
||||
finished_at=now_iso(),
|
||||
status=branch.status, # 保持原状态
|
||||
temp_branch=branch.temp_branch,
|
||||
)
|
||||
break
|
||||
|
||||
self._data = data
|
||||
self.save_branches()
|
||||
|
||||
def update_branch_status(self, status: str) -> None:
|
||||
"""更新分支状态(不修改其他字段)
|
||||
|
||||
用于在切回源分支后更新最终状态。
|
||||
"""
|
||||
data = self.load_branches()
|
||||
|
||||
# 查找当前任务分支(可能已不是当前分支)
|
||||
current_branch = self.git.get_current_branch()
|
||||
|
||||
# 优先使用缓存的分支信息
|
||||
target_number = None
|
||||
if self._current_branch_info is not None:
|
||||
target_number = self._current_branch_info.number
|
||||
else:
|
||||
# 查找最近的活跃分支
|
||||
for branch in reversed(data.branches):
|
||||
if branch.status == "active":
|
||||
target_number = branch.number
|
||||
break
|
||||
|
||||
if target_number is None:
|
||||
return
|
||||
|
||||
# 更新分支状态
|
||||
for i, branch in enumerate(data.branches):
|
||||
if branch.number == target_number:
|
||||
data.branches[i] = BranchInfo(
|
||||
number=branch.number,
|
||||
branch_name=branch.branch_name,
|
||||
source_branch=branch.source_branch,
|
||||
start_commit=branch.start_commit,
|
||||
end_commit=branch.end_commit,
|
||||
task_id=branch.task_id,
|
||||
task_summary=branch.task_summary,
|
||||
started_at=branch.started_at,
|
||||
finished_at=branch.finished_at,
|
||||
status=status,
|
||||
temp_branch=branch.temp_branch,
|
||||
)
|
||||
break
|
||||
|
||||
self._data = data
|
||||
self._current_branch_info = None
|
||||
self.save_branches()
|
||||
|
||||
def finish_branch_merge(
|
||||
self,
|
||||
task_summary: str,
|
||||
end_commit: str | None = None,
|
||||
finished_at: str | None = None,
|
||||
) -> tuple[bool, str]:
|
||||
"""执行分支合并逻辑
|
||||
|
||||
Args:
|
||||
task_summary: 任务摘要
|
||||
end_commit: 结束提交哈希(由 tracker 传入)
|
||||
finished_at: 结束时间(由 tracker 传入)
|
||||
|
||||
返回 (是否成功, 消息)
|
||||
"""
|
||||
branch_info = self.get_active_branch_info()
|
||||
@@ -377,48 +483,147 @@ class BranchManager:
|
||||
return self._merge_with_temp_branch(
|
||||
branch_info=branch_info,
|
||||
task_summary=task_summary,
|
||||
end_commit=end_commit,
|
||||
finished_at=finished_at,
|
||||
)
|
||||
else:
|
||||
# 正常合并流程
|
||||
return self._merge_normal(
|
||||
branch_info=branch_info,
|
||||
task_summary=task_summary,
|
||||
end_commit=end_commit,
|
||||
finished_at=finished_at,
|
||||
)
|
||||
|
||||
def clean_branch_merge(self) -> tuple[bool, str]:
|
||||
"""强制清理当前任务分支
|
||||
|
||||
如果工作区不干净,会自动创建一个提交。
|
||||
返回 (是否成功, 消息)
|
||||
"""
|
||||
# 如果工作区不干净,自动创建提交
|
||||
if not self.git.is_clean():
|
||||
self.git.add_all()
|
||||
self.git.commit("[aide] 强制清理前保存未提交的变更")
|
||||
|
||||
branch_info = self.get_active_branch_info()
|
||||
|
||||
if branch_info is None:
|
||||
return False, "未找到活跃的任务分支"
|
||||
|
||||
source_branch = branch_info.source_branch
|
||||
start_commit = branch_info.start_commit
|
||||
|
||||
# 检查源分支是否有新提交
|
||||
if self.git.has_commits_since(start_commit, source_branch):
|
||||
# 源分支有新提交,使用临时分支策略(强制清理模式)
|
||||
return self._merge_with_temp_branch(
|
||||
branch_info=branch_info,
|
||||
task_summary="强制清理",
|
||||
is_force_clean=True,
|
||||
)
|
||||
else:
|
||||
# 正常合并流程(强制清理模式)
|
||||
return self._merge_normal(
|
||||
branch_info=branch_info,
|
||||
task_summary="强制清理",
|
||||
is_force_clean=True,
|
||||
)
|
||||
|
||||
def _merge_normal(
|
||||
self,
|
||||
branch_info: BranchInfo,
|
||||
task_summary: str,
|
||||
is_force_clean: bool = False,
|
||||
end_commit: str | None = None,
|
||||
finished_at: str | None = None,
|
||||
) -> tuple[bool, str]:
|
||||
"""正常合并流程:清理 → 临时提交 → squash 合并 → 收尾提交"""
|
||||
"""正常合并流程:更新状态 → 清理 → squash 合并 → 收尾提交
|
||||
|
||||
Args:
|
||||
branch_info: 分支信息
|
||||
task_summary: 任务摘要
|
||||
is_force_clean: 是否为强制清理模式
|
||||
end_commit: 结束提交哈希(finish 时由 tracker 传入)
|
||||
finished_at: 结束时间(finish 时由 tracker 传入)
|
||||
"""
|
||||
source_branch = branch_info.source_branch
|
||||
task_branch = branch_info.branch_name
|
||||
task_id = branch_info.task_id
|
||||
start_commit = branch_info.start_commit
|
||||
branch_number = branch_info.number
|
||||
|
||||
# 1. 执行任务文件清理(在工作分支上)
|
||||
# === 在任务分支上执行 ===
|
||||
|
||||
# 对于强制清理,需要创建结束提交;对于正常 finish,使用 tracker 传入的
|
||||
if is_force_clean:
|
||||
# 1. 创建"结束提交"(强制清理模式)
|
||||
self.git.add_all()
|
||||
end_commit_msg = f"[aide] 强制清理: {task_summary}"
|
||||
self.git.commit(end_commit_msg)
|
||||
end_commit = self.git.rev_parse_head()
|
||||
finished_at = now_iso()
|
||||
|
||||
# 如果没有 end_commit(兜底),使用当前 HEAD
|
||||
if end_commit is None:
|
||||
end_commit = self.git.rev_parse_head()
|
||||
if finished_at is None:
|
||||
finished_at = now_iso()
|
||||
|
||||
# 2. 更新分支状态(记录 end_commit 和完成时间)
|
||||
status = "force-cleaned" if is_force_clean else "finished"
|
||||
data = self.load_branches()
|
||||
for i, branch in enumerate(data.branches):
|
||||
if branch.number == branch_number:
|
||||
data.branches[i] = BranchInfo(
|
||||
number=branch.number,
|
||||
branch_name=branch.branch_name,
|
||||
source_branch=branch.source_branch,
|
||||
start_commit=branch.start_commit,
|
||||
end_commit=end_commit,
|
||||
task_id=branch.task_id,
|
||||
task_summary=branch.task_summary,
|
||||
started_at=branch.started_at,
|
||||
finished_at=finished_at,
|
||||
status=status,
|
||||
temp_branch=branch.temp_branch,
|
||||
)
|
||||
break
|
||||
self._data = data
|
||||
self._current_branch_info = None
|
||||
self.save_branches()
|
||||
|
||||
# 3. 提交状态更新(包含 flow-status.json 和 branches.json/md)
|
||||
self.git.add_all()
|
||||
if is_force_clean:
|
||||
self.git.commit("[aide] 强制清理: 更新状态")
|
||||
else:
|
||||
self.git.commit("[aide] finish: 更新状态")
|
||||
|
||||
# 4. 执行任务文件清理
|
||||
self._cleanup_task_files(task_id)
|
||||
|
||||
# 2. 创建临时提交保存清理后的变更
|
||||
# 5. 创建"清理提交"
|
||||
self.git.add_all()
|
||||
self.git.commit("[aide] 清理任务临时文件")
|
||||
|
||||
# 3. 切回源分支
|
||||
# === 切回源分支执行 ===
|
||||
|
||||
# 6. 切回源分支
|
||||
self.git.checkout(source_branch)
|
||||
|
||||
# 切换分支后清理 lock 文件
|
||||
self._cleanup_lock_file()
|
||||
|
||||
# 4. squash 合并任务分支
|
||||
# 7. squash 合并任务分支
|
||||
self.git.merge_squash(task_branch)
|
||||
|
||||
# 5. 先更新分支记录(不再记录 end_commit)
|
||||
self.record_branch_finish(status="finished")
|
||||
|
||||
# 6. 创建收尾提交(包含 squash 内容和分支记录更新)
|
||||
# 格式:{起始哈希}的任务收尾
|
||||
# 8. 创建收尾提交
|
||||
self.git.add_all()
|
||||
short_hash = start_commit[:7] if start_commit else "unknown"
|
||||
if is_force_clean:
|
||||
commit_msg = f"{short_hash}的强制清理"
|
||||
else:
|
||||
commit_msg = f"{short_hash}的任务收尾"
|
||||
self.git.commit(commit_msg)
|
||||
|
||||
@@ -428,35 +633,103 @@ class BranchManager:
|
||||
self,
|
||||
branch_info: BranchInfo,
|
||||
task_summary: str,
|
||||
is_force_clean: bool = False,
|
||||
end_commit: str | None = None,
|
||||
finished_at: str | None = None,
|
||||
) -> tuple[bool, str]:
|
||||
"""临时分支合并策略:源分支有新提交时使用"""
|
||||
"""临时分支合并策略:源分支有新提交时使用
|
||||
|
||||
流程:更新状态 → 清理 → 临时分支 squash 合并
|
||||
|
||||
Args:
|
||||
branch_info: 分支信息
|
||||
task_summary: 任务摘要
|
||||
is_force_clean: 是否为强制清理模式
|
||||
end_commit: 结束提交哈希(finish 时由 tracker 传入)
|
||||
finished_at: 结束时间(finish 时由 tracker 传入)
|
||||
"""
|
||||
start_commit = branch_info.start_commit
|
||||
task_branch = branch_info.branch_name
|
||||
task_id = branch_info.task_id
|
||||
branch_number = branch_info.number
|
||||
temp_branch = f"{task_branch}-merge"
|
||||
|
||||
# 从起始提交检出临时分支
|
||||
# === 在任务分支上执行 ===
|
||||
|
||||
# 对于强制清理,需要创建结束提交;对于正常 finish,使用 tracker 传入的
|
||||
if is_force_clean:
|
||||
# 1. 创建"结束提交"(强制清理模式)
|
||||
self.git.add_all()
|
||||
end_commit_msg = f"[aide] 强制清理: {task_summary}"
|
||||
self.git.commit(end_commit_msg)
|
||||
end_commit = self.git.rev_parse_head()
|
||||
finished_at = now_iso()
|
||||
|
||||
# 如果没有 end_commit(兜底),使用当前 HEAD
|
||||
if end_commit is None:
|
||||
end_commit = self.git.rev_parse_head()
|
||||
if finished_at is None:
|
||||
finished_at = now_iso()
|
||||
|
||||
# 2. 更新分支状态(记录 end_commit 和完成时间)
|
||||
status = "force-cleaned-to-temp" if is_force_clean else "merged-to-temp"
|
||||
data = self.load_branches()
|
||||
for i, branch in enumerate(data.branches):
|
||||
if branch.number == branch_number:
|
||||
data.branches[i] = BranchInfo(
|
||||
number=branch.number,
|
||||
branch_name=branch.branch_name,
|
||||
source_branch=branch.source_branch,
|
||||
start_commit=branch.start_commit,
|
||||
end_commit=end_commit,
|
||||
task_id=branch.task_id,
|
||||
task_summary=branch.task_summary,
|
||||
started_at=branch.started_at,
|
||||
finished_at=finished_at,
|
||||
status=status,
|
||||
temp_branch=temp_branch,
|
||||
)
|
||||
break
|
||||
self._data = data
|
||||
self._current_branch_info = None
|
||||
self.save_branches()
|
||||
|
||||
# 3. 提交状态更新(包含 flow-status.json 和 branches.json/md)
|
||||
self.git.add_all()
|
||||
if is_force_clean:
|
||||
self.git.commit("[aide] 强制清理: 更新状态")
|
||||
else:
|
||||
self.git.commit("[aide] finish: 更新状态")
|
||||
|
||||
# 4. 执行任务文件清理
|
||||
self._cleanup_task_files(task_id)
|
||||
|
||||
# 5. 创建"清理提交"
|
||||
self.git.add_all()
|
||||
self.git.commit("[aide] 清理任务临时文件")
|
||||
|
||||
# === 切换到临时分支执行 ===
|
||||
|
||||
# 6. 从起始提交检出临时分支
|
||||
self.git.checkout_new_branch(temp_branch, start_commit)
|
||||
|
||||
# 切换分支后清理 lock 文件
|
||||
self._cleanup_lock_file()
|
||||
|
||||
# 在临时分支执行 squash 合并
|
||||
# 7. 在临时分支执行 squash 合并
|
||||
self.git.merge_squash(task_branch)
|
||||
|
||||
# 创建提交
|
||||
# 8. 创建压缩提交
|
||||
self.git.add_all()
|
||||
if is_force_clean:
|
||||
commit_msg = f"[aide] 强制清理压缩提交: {task_summary}"
|
||||
else:
|
||||
commit_msg = f"[aide] 任务压缩提交: {task_summary}"
|
||||
end_commit = self.git.commit(commit_msg)
|
||||
|
||||
# 记录完成(保留任务分支和临时分支)
|
||||
self.record_branch_finish(
|
||||
status="merged-to-temp",
|
||||
end_commit=end_commit,
|
||||
temp_branch=temp_branch,
|
||||
)
|
||||
self.git.commit(commit_msg)
|
||||
|
||||
action_name = "强制清理" if is_force_clean else "任务完成"
|
||||
return False, (
|
||||
f"⚠ 源分支 {branch_info.source_branch} 有新提交\n"
|
||||
f"已在临时分支 {temp_branch} 完成合并\n"
|
||||
f"已在临时分支 {temp_branch} 完成{action_name}合并\n"
|
||||
f"请手动处理后续操作"
|
||||
)
|
||||
|
||||
@@ -127,6 +127,13 @@ class GitIntegration:
|
||||
if result.returncode != 0:
|
||||
raise FlowError(_format_git_error(f"squash 合并分支 {branch} 失败", result))
|
||||
|
||||
def amend(self) -> str:
|
||||
"""将暂存区内容追加到上一次提交(不修改提交消息)"""
|
||||
result = self._run(["commit", "--amend", "--no-edit"], check=False)
|
||||
if result.returncode != 0:
|
||||
raise FlowError(_format_git_error("git commit --amend 失败", result))
|
||||
return self.rev_parse_head()
|
||||
|
||||
def _run(self, args: list[str], check: bool) -> subprocess.CompletedProcess[str]:
|
||||
return subprocess.run(
|
||||
["git", *args],
|
||||
|
||||
@@ -47,6 +47,37 @@ class FlowTracker:
|
||||
def error(self, description: str) -> bool:
|
||||
return self._run(action="error", to_phase=None, text=description)
|
||||
|
||||
def clean(self) -> bool:
|
||||
"""强制清理当前任务
|
||||
|
||||
前提条件:工作区必须干净
|
||||
"""
|
||||
try:
|
||||
self.storage.ensure_ready()
|
||||
|
||||
with self.storage.lock():
|
||||
status = self.storage.load_status()
|
||||
if status is None:
|
||||
output.err("未找到活跃任务,无需清理")
|
||||
return False
|
||||
|
||||
# 执行强制清理
|
||||
success, msg = self.branch_mgr.clean_branch_merge()
|
||||
|
||||
if success:
|
||||
output.ok(f"强制清理完成: {msg}")
|
||||
else:
|
||||
if "工作区不干净" in msg or "未找到活跃" in msg:
|
||||
output.err(msg)
|
||||
else:
|
||||
# 临时分支情况,需要手动处理
|
||||
output.warn(msg)
|
||||
return success
|
||||
|
||||
except FlowError as exc:
|
||||
output.err(str(exc))
|
||||
return False
|
||||
|
||||
def _run(self, *, action: str, to_phase: str | None, text: str) -> bool:
|
||||
try:
|
||||
self.storage.ensure_ready()
|
||||
@@ -129,12 +160,18 @@ class FlowTracker:
|
||||
|
||||
# 如果进入 finish 环节,执行分支合并(必须在提交后执行)
|
||||
if action == "next-part" and to_phase == "finish":
|
||||
# 再次提交状态文件(因为 save_status 更新了 git_commit hash)
|
||||
self.git.add_all()
|
||||
self.git.commit("[aide] finish: 更新状态文件")
|
||||
# finish 提交的哈希就是 end_commit
|
||||
finish_commit = None
|
||||
finish_timestamp = None
|
||||
if final_status.history:
|
||||
last_entry = final_status.history[-1]
|
||||
finish_commit = last_entry.git_commit
|
||||
finish_timestamp = last_entry.timestamp
|
||||
|
||||
success, merge_msg = self.branch_mgr.finish_branch_merge(
|
||||
task_summary=normalized_text,
|
||||
end_commit=finish_commit,
|
||||
finished_at=finish_timestamp,
|
||||
)
|
||||
if not success:
|
||||
output.warn(merge_msg)
|
||||
|
||||
@@ -8,7 +8,7 @@ from pathlib import Path
|
||||
from typing import Any
|
||||
|
||||
from aide.core import output
|
||||
from aide.core.config import ConfigManager
|
||||
from aide.core.config import ConfigManager, find_project_root
|
||||
from aide.env.manager import EnvManager
|
||||
from aide.flow.tracker import FlowTracker
|
||||
|
||||
@@ -140,6 +140,10 @@ def build_parser() -> argparse.ArgumentParser:
|
||||
flow_show.add_argument("task_id", help="任务 ID(时间戳格式,如 20251215-103000)")
|
||||
flow_show.set_defaults(func=handle_flow_show)
|
||||
|
||||
# aide flow clean
|
||||
flow_clean = flow_sub.add_parser("clean", help="强制清理当前任务(工作区需干净)")
|
||||
flow_clean.set_defaults(func=handle_flow_clean)
|
||||
|
||||
flow_parser.set_defaults(func=handle_flow_help)
|
||||
|
||||
# aide decide
|
||||
@@ -162,7 +166,7 @@ def build_parser() -> argparse.ArgumentParser:
|
||||
|
||||
|
||||
def handle_init(args: argparse.Namespace) -> bool:
|
||||
root = Path.cwd()
|
||||
root = find_project_root()
|
||||
cfg = ConfigManager(root)
|
||||
cfg.ensure_config()
|
||||
cfg.ensure_gitignore()
|
||||
@@ -174,7 +178,7 @@ def handle_env_default(args: argparse.Namespace) -> bool:
|
||||
"""aide env(无子命令)等同于 aide env ensure。"""
|
||||
if args.env_command is None:
|
||||
# 无子命令,执行默认的 ensure
|
||||
root = Path.cwd()
|
||||
root = find_project_root()
|
||||
cfg = ConfigManager(root)
|
||||
manager = EnvManager(root, cfg)
|
||||
return manager.ensure()
|
||||
@@ -183,7 +187,7 @@ def handle_env_default(args: argparse.Namespace) -> bool:
|
||||
|
||||
def handle_env_ensure(args: argparse.Namespace) -> bool:
|
||||
"""aide env ensure 处理。"""
|
||||
root = Path.cwd()
|
||||
root = find_project_root()
|
||||
cfg = ConfigManager(root)
|
||||
manager = EnvManager(root, cfg)
|
||||
|
||||
@@ -202,7 +206,7 @@ def handle_env_ensure(args: argparse.Namespace) -> bool:
|
||||
|
||||
def handle_env_list(args: argparse.Namespace) -> bool:
|
||||
"""aide env list 处理。"""
|
||||
root = Path.cwd()
|
||||
root = find_project_root()
|
||||
cfg = ConfigManager(root)
|
||||
manager = EnvManager(root, cfg)
|
||||
manager.list_modules()
|
||||
@@ -211,7 +215,7 @@ def handle_env_list(args: argparse.Namespace) -> bool:
|
||||
|
||||
def handle_env_set(args: argparse.Namespace) -> bool:
|
||||
"""aide env set 处理。"""
|
||||
root = Path.cwd()
|
||||
root = find_project_root()
|
||||
cfg = ConfigManager(root)
|
||||
manager = EnvManager(root, cfg)
|
||||
|
||||
@@ -238,7 +242,7 @@ def handle_env_set(args: argparse.Namespace) -> bool:
|
||||
|
||||
|
||||
def handle_config_get(args: argparse.Namespace) -> bool:
|
||||
root = Path.cwd()
|
||||
root = find_project_root()
|
||||
cfg = ConfigManager(root)
|
||||
value = cfg.get_value(args.key)
|
||||
if value is None:
|
||||
@@ -249,7 +253,7 @@ def handle_config_get(args: argparse.Namespace) -> bool:
|
||||
|
||||
|
||||
def handle_config_set(args: argparse.Namespace) -> bool:
|
||||
root = Path.cwd()
|
||||
root = find_project_root()
|
||||
cfg = ConfigManager(root)
|
||||
parsed_value = _parse_value(args.value)
|
||||
cfg.set_value(args.key, parsed_value)
|
||||
@@ -262,59 +266,67 @@ def handle_flow_help(args: argparse.Namespace) -> bool:
|
||||
|
||||
|
||||
def handle_flow_start(args: argparse.Namespace) -> bool:
|
||||
root = Path.cwd()
|
||||
root = find_project_root()
|
||||
cfg = ConfigManager(root)
|
||||
tracker = FlowTracker(root, cfg)
|
||||
return tracker.start(args.phase, args.summary)
|
||||
|
||||
|
||||
def handle_flow_next_step(args: argparse.Namespace) -> bool:
|
||||
root = Path.cwd()
|
||||
root = find_project_root()
|
||||
cfg = ConfigManager(root)
|
||||
tracker = FlowTracker(root, cfg)
|
||||
return tracker.next_step(args.summary)
|
||||
|
||||
|
||||
def handle_flow_back_step(args: argparse.Namespace) -> bool:
|
||||
root = Path.cwd()
|
||||
root = find_project_root()
|
||||
cfg = ConfigManager(root)
|
||||
tracker = FlowTracker(root, cfg)
|
||||
return tracker.back_step(args.reason)
|
||||
|
||||
|
||||
def handle_flow_next_part(args: argparse.Namespace) -> bool:
|
||||
root = Path.cwd()
|
||||
root = find_project_root()
|
||||
cfg = ConfigManager(root)
|
||||
tracker = FlowTracker(root, cfg)
|
||||
return tracker.next_part(args.phase, args.summary)
|
||||
|
||||
|
||||
def handle_flow_back_part(args: argparse.Namespace) -> bool:
|
||||
root = Path.cwd()
|
||||
root = find_project_root()
|
||||
cfg = ConfigManager(root)
|
||||
tracker = FlowTracker(root, cfg)
|
||||
return tracker.back_part(args.phase, args.reason)
|
||||
|
||||
|
||||
def handle_flow_issue(args: argparse.Namespace) -> bool:
|
||||
root = Path.cwd()
|
||||
root = find_project_root()
|
||||
cfg = ConfigManager(root)
|
||||
tracker = FlowTracker(root, cfg)
|
||||
return tracker.issue(args.description)
|
||||
|
||||
|
||||
def handle_flow_error(args: argparse.Namespace) -> bool:
|
||||
root = Path.cwd()
|
||||
root = find_project_root()
|
||||
cfg = ConfigManager(root)
|
||||
tracker = FlowTracker(root, cfg)
|
||||
return tracker.error(args.description)
|
||||
|
||||
|
||||
def handle_flow_clean(args: argparse.Namespace) -> bool:
|
||||
"""aide flow clean - 强制清理当前任务。"""
|
||||
root = find_project_root()
|
||||
cfg = ConfigManager(root)
|
||||
tracker = FlowTracker(root, cfg)
|
||||
return tracker.clean()
|
||||
|
||||
|
||||
def handle_flow_status(args: argparse.Namespace) -> bool:
|
||||
"""aide flow status - 查看当前任务状态。"""
|
||||
from aide.flow.storage import FlowStorage
|
||||
|
||||
root = Path.cwd()
|
||||
root = find_project_root()
|
||||
storage = FlowStorage(root)
|
||||
|
||||
try:
|
||||
@@ -346,7 +358,7 @@ def handle_flow_list(args: argparse.Namespace) -> bool:
|
||||
"""aide flow list - 列出所有任务。"""
|
||||
from aide.flow.storage import FlowStorage
|
||||
|
||||
root = Path.cwd()
|
||||
root = find_project_root()
|
||||
storage = FlowStorage(root)
|
||||
|
||||
try:
|
||||
@@ -374,7 +386,7 @@ def handle_flow_show(args: argparse.Namespace) -> bool:
|
||||
"""aide flow show <task_id> - 查看指定任务的详细状态。"""
|
||||
from aide.flow.storage import FlowStorage
|
||||
|
||||
root = Path.cwd()
|
||||
root = find_project_root()
|
||||
storage = FlowStorage(root)
|
||||
|
||||
try:
|
||||
|
||||
31
task-now.md
31
task-now.md
@@ -0,0 +1,31 @@
|
||||
对现有的 commands & skills & aide program 体系做一些调整:
|
||||
|
||||
1. 把init时的gitignore_aide默认值设为false
|
||||
|
||||
2. 我希望aide init能在任意目录执行原地初始化,像git init那样,不论其所处目录是否已经是.aide管理的工作目录的其中一个子目录,
|
||||
|
||||
3. 创建一个类似docs的命令,但这个新命令主要面向人类用户,尤其是目标用户很可能是从未接触过工作目录下的项目对此项目完全没有了解的陌生新人,
|
||||
- 入口是README.md,细节放在docs目录(因为是面向用户而非程序,所有都不要默认放在.aide目录下,而是直接放在外面,根目录下就好)下,(README.md和docs这两个路径都要在环境配置中设置,使用时必须用aide读取路径)
|
||||
- 需要单独讨论一下README应该放些什么样的东西,我想的是,在配置中指定一个`make-readme-rules.md`,
|
||||
- (需要注意,上面说的README.md、docs、make-readme-rules.md都是路径值,具体配置项的命名还需要你酌情考虑)
|
||||
- 然后如果当前项目不存在make-readme-rules.md,就要首先引导用户设定入口编写规范,(引导用户设定入口编写规范前,应提示用户,如果还没有对此项目运行过docs+load,建议先完成面向LLM文档的构建再重新启动对话加载项目文档后再运行此命令以便于LLM更好的分析和提供对面向用户文档的编写建议,除非这个项目真的非常非常的简单微型,然后确定完成了load或是确定不需要load后,再建议把这个制定过程作为一个完整的对话,在这次对话中专注于README文档编写规范的制定,为这项任务允许消耗全部的上下文,当任务完成之后,要使用`/exit`退出本次对话重新开始一个新的对话继续完成之前的任务)
|
||||
- 制作一个skills,包含一个SKILL.md和数个README.md规范模板,(需要把这数模版的编写作为一个完整的子任务单独执行,先完成该skill再实现这个第3点的其他需求)
|
||||
- 可以向用户介绍有哪些可用模板,或者提供一些可选的模块化README内容规范板块供用户自由拼搭,
|
||||
- 同时应该根据当前项目的项目文档(面向LLM的由docs命令构建的项目文档)进行分析,为用户提供可参考的建议
|
||||
- 我需要你尽情发挥你的创造力和专业性,指导我,像这种面向用户的文档应该写些什么,怎么写,怎么组织分布,
|
||||
- 如果是一个单纯的文档&材料类项目应该怎么处理
|
||||
- 如果是一个单一的cargo、springboot、flutter、android、vue、react等这类的单体项目应该怎么处理
|
||||
- 如果是一个项目下同时含有文档&材料和cargo等程序开发单体项目应该怎么处理
|
||||
- 如果该项目下同时含有多个单体项目,例如同时含有多个cargo lib crate、cargo bin crate、多个springboot单体服务、vue前端单体项目,又应该怎么处理
|
||||
- 这些情况之间是否应该有较明显的区分?
|
||||
- 我希望要在细节文档目录下,docs目录下创建一个专用于面向用户的长期维护的完善的流程图目录,不同于run时创建的专用于当时任务的流程图,而是供用户快速理解用,
|
||||
- 如果是不含程序开发内容的项目,就制作用于引导用户如何了解项目的流程图,
|
||||
- 如果含程序开发,则同时制作引导的流程图和对于该项目的流程图,程序方面的流程图参考run中的程序逻辑流图规范,要求以一整套程序开发项目为单位,编写一整套流程图,例如cargo一整个目录就是一整个项目
|
||||
- 如果同时含有多个开发项目,则要对于每一个项目都编写一套流程图,
|
||||
- 一套流程图是指一整个专用于这套流程图的目录,目录下含有一个guide.puml和其他子模块的puml,
|
||||
- 假设一个项目下同时含有一个cargo lib crate、一个 cargo bin crate 、一个vue项目,分别名为api-lib、api、user-interface,且假设已设定用户文档的流程图目录名为graph-guide,
|
||||
- 则graph-guide目录下应该至少含有三个目录api-lib、api、user-interface,和一个文件guide.puml,且每个子目录下都至少有一个guide.puml,
|
||||
- 在开始编写流程图前,应该要先根据load加载的项目文档对项目进行分析和流程图分划处理,用户文档的区块划分不同于项目文档,项目文档的要求是完完全全的深度且全面的覆盖,便于先脉络后枝叶的按需加载和检索,但用户文档要按照逻辑或业务呈现一个整体的形式为目标,
|
||||
- 先按需读取项目文档知道足够对项目信息做出业务逻辑整体的区块划分,然后再深入分析其复杂度和工作量,对流程图的编写工作进行步骤计划,
|
||||
- 步骤计划不一定是一个子项目一个计划,例如前面api-lib+api+ui的项目,可以分为3个整体区块,但不一定只要三步就能完成,如果api-lib过于庞大,可能即使每一次都消耗满上下文,分布工作10次也不一定能完成这一个区块的任务,
|
||||
- 必须先分划好区块,然后分析具体步骤计划,编写计划进度文档然后才能开始具体的流程图设计,
|
||||
Reference in New Issue
Block a user