优化: 立项回滚级联删 + df-ideas 死代码清理

- T-09: idea.rs:149 立项失败回滚 delete→purge_with_descendants(防孤儿子记录)
- T-12: capture.rs 删 CaptureInput/IdeaCapture 死代码,保留 Idea/IdeaScores 共享实体
- T-10: 无改动(normalize_path 已含 canonicalize,判定已解决)
This commit is contained in:
2026-06-14 15:19:41 +08:00
parent 4aa689e110
commit 89da9fad9a
2 changed files with 2 additions and 55 deletions

View File

@@ -146,7 +146,7 @@ pub async fn promote_idea(
if let Err(e) = state.ideas.update_full(&updated).await {
// 回写失败:补偿删除已建项目,避免悬空项目(idea.promoted_to 仍空,可重试立项)
tracing::error!("想法 {id} 回写失败,补偿删除已建项目 {project_id}: {e}");
if let Err(del_err) = state.projects.delete(&project_id).await {
if let Err(del_err) = state.projects.purge_with_descendants(&project_id).await {
tracing::error!("补偿删除项目 {project_id} 也失败(需人工清理): {del_err}");
}
return Err(format!("想法立项回写失败(已回滚项目创建): {}", e));