[aide] flow-design: 流程图设计完成

This commit is contained in:
2025-12-17 04:03:48 +08:00
parent 1cb2c894cb
commit 0630bfc4cd
8 changed files with 217 additions and 4 deletions

View File

@@ -0,0 +1,76 @@
@startuml git-branch-finish-logic
!theme plain
title 程序逻辑流图aide flow finish 安全合并
start
:FlowTracker.next_part("finish", summary);
partition "分支合并准备" {
:从 FlowStatus 获取分支信息;
note right
- source_branch
- start_commit
- task_branch (当前分支)
end note
:记录 end_commit = rev_parse_head();
}
partition "检测源分支变更" {
:GitIntegration.has_commits_since(start_commit, source_branch);
if (源分支有新提交?) then (是)
partition "创建临时分支处理" {
:从 start_commit 检出临时分支;
:temp_branch = task_branch + "-merge";
:git checkout -b temp_branch start_commit;
:在临时分支执行 squash 合并;
:git merge --squash task_branch;
:git commit -m "任务压缩提交";
:BranchManager.record_branch_finish();
note right
status: "merged-to-temp"
temp_branch: temp_branch
end note
:输出警告;
note right
"⚠ 源分支有新提交"
"已在临时分支完成合并"
"请手动处理后续操作"
end note
}
else (否)
partition "正常合并流程" {
:切回源分支;
:git checkout source_branch;
:软重置到起始提交;
:git reset --soft start_commit;
:创建压缩提交;
:git add .;
:git commit -m "[aide] 任务: {summary}";
:BranchManager.record_branch_finish();
note right
status: "finished"
end_commit: 新提交哈希
end note
}
endif
}
partition "更新分支概况" {
:BranchManager.save_branches();
note right: 同时生成 JSON 和 MD
}
:继续原有 finish 逻辑;
stop
@enduml

View File

@@ -0,0 +1,60 @@
@startuml git-branch-logic
!theme plain
title 程序逻辑流图aide flow start 分支创建
start
:FlowTracker.start(phase, summary);
partition "Git 状态检查" {
:GitIntegration.is_clean();
if (工作目录干净?) then (否)
:git add .;
:git commit -m "保存未提交的变更";
else (是)
endif
:GitIntegration.has_commits();
if (有提交历史?) then (否)
:创建 .gitkeep;
:git commit -m "初始提交";
else (是)
endif
}
partition "分支创建" {
:记录 source_branch = get_current_branch();
:记录 start_commit = rev_parse_head();
:BranchManager.get_next_branch_number();
note right: 从 branches.json 读取
:branch_name = "aide/" + 编号;
:GitIntegration.create_branch(branch_name);
:GitIntegration.checkout(branch_name);
:BranchManager.record_branch_start();
note right
记录到 branches.json:
- branch_name
- source_branch
- start_commit
- task_id
- task_summary
- started_at
- status: "active"
end note
:BranchManager.save_branches();
note right: 同时生成 JSON 和 MD
}
:继续原有 start 逻辑;
:保存 FlowStatus;
:git add . && commit;
stop
@enduml

View File

@@ -0,0 +1,64 @@
@startuml git-branch-management-task
!theme plain
title 任务执行流程图Git 分支管理功能实现
start
partition "子计划 1: Git 分支管理核心功能" {
:扩展 GitIntegration 类;
note right
新增方法:
- get_current_branch()
- is_clean()
- has_commits()
- create_branch()
- checkout()
- has_commits_since()
- reset_soft()
end note
:创建 BranchManager 类;
note right
branch.py 新文件
管理分支编号和概况文档
end note
:修改 FlowTracker.start();
note right
集成分支创建逻辑
end note
:修改 FlowTracker (finish 逻辑);
note right
集成安全合并策略
end note
:测试验证子计划 1;
}
partition "子计划 2: 流程更新" {
:更新 command/run.md 续接逻辑;
note right
智能判断细则符合度
end note
:更新确认机制;
note right
待定项: aide decide
细则: AskUserQuestion
end note
:测试验证子计划 2;
}
partition "子计划 3: 文档更新" {
:更新 aide skill;
:更新 flow 命令文档;
:更新 CHANGELOG;
:测试验证子计划 3;
}
:完成验证;
stop
@enduml