From 4f5cf431f6673be8883ee3fb88f205e45ec515db Mon Sep 17 00:00:00 2001 From: lanrtop Date: Fri, 3 Jul 2026 08:55:15 +0900 Subject: [PATCH] =?UTF-8?q?fix(agent-infra):=20=E8=85=90=E5=8C=96=E8=AF=8A?= =?UTF-8?q?=E6=96=AD=E4=BF=AE=E5=A4=8D=E6=8C=87=E5=BC=95=E6=AD=BB=E5=BE=AA?= =?UTF-8?q?=E7=8E=AF=E2=80=94=E2=80=94=E6=98=8E=E7=A4=BA=E8=AF=84=E5=88=86?= =?UTF-8?q?=E5=9F=BA=E4=BA=8E=20git=20=E6=8F=90=E4=BA=A4=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 用户按指引"重新生成三件套"两轮无法清除红色诊断:生成只改工作区文件, 而评分比较的是 git 提交时间戳。修复指引现明确要求 commit。 enterprise-system 实测:commit project-context.yaml 后诊断转绿。 Rules-Applied: R11 --- .blueprint/modules/agent-infrastructure.md | 12 ++++++++++++ src-tauri/src/commands/agent_infra.rs | 4 ++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.blueprint/modules/agent-infrastructure.md b/.blueprint/modules/agent-infrastructure.md index e0e6870..7276023 100644 --- a/.blueprint/modules/agent-infrastructure.md +++ b/.blueprint/modules/agent-infrastructure.md @@ -125,3 +125,15 @@ - depends: C, D - files: src-tauri/src/commands/agent_infra.rs, src-tauri/src/lib.rs, src/lib/commands.ts, src/components/dashboard/AgentInfraPanel.tsx - acceptance: `get_agent_health(project_path, project_id)` 聚合 infra stack + doc freshness,生成问题列表 + Markdown 修正文本;AgentInfraPanel 加载时从 cache 读健康徽章,「重新检测 & 生成修正指令」按钮触发完整诊断,结果显示健康状态+可复制 textarea(含复制按钮) + +## 复盘笔记 + +【陷阱记录】腐化诊断修复指引死循环(2026-07-03) +任务类型: 前端组件(诊断指引缺陷) +是否返工: 是(用户按指引"重新生成三件套"操作两轮无效) +返工原因: 腐化评分基于 git 提交时间(防"改了不提交"假新鲜,设计正确),但修复指引只说"重新生成"未说"需 commit"——生成动作只改工作区文件,git 时间戳不变,诊断永远无法清除,形成指引死循环 +有效策略: 修复指引文案显式说明评分依据("必须 git commit 该文件——评分基于 git 提交时间而非文件修改时间");enterprise-system 实测 commit 后转绿 +遗留风险: 生成三件套的结果提示未加"记得提交"引导(文案在前端 AgentInfraPanel,影响小,下次顺手) +auto_applied_rules: R11 +rule_effectiveness: R11=有效(首次实战触发:诊断建议执行后未解决问题 → 修指引 + 记录失败案例) + diff --git a/src-tauri/src/commands/agent_infra.rs b/src-tauri/src/commands/agent_infra.rs index 7e1b68b..b261898 100644 --- a/src-tauri/src/commands/agent_infra.rs +++ b/src-tauri/src/commands/agent_infra.rs @@ -846,7 +846,7 @@ pub fn get_agent_health( issues.push(AgentHealthIssue { level: "error".into(), title: format!("文档严重腐化:{stale_count} 个契约文件更新超 30 天未同步 project-context.yaml"), - fix: "检查并更新 docs/ai-context/project-context.yaml 的契约描述,或重新生成三件套".into(), + fix: "更新(或重新生成)docs/ai-context/project-context.yaml 后【必须 git commit 该文件】——评分基于 git 提交时间而非文件修改时间,只改不提交无法清除本项".into(), }); overall = "red".to_string(); } @@ -857,7 +857,7 @@ pub fn get_agent_health( issues.push(AgentHealthIssue { level: "warn".into(), title: format!("文档腐化风险:{stale_count} 个契约文件更新后 14-30 天未同步"), - fix: "检查并更新 docs/ai-context/project-context.yaml 中的契约描述".into(), + fix: "更新 docs/ai-context/project-context.yaml 中的契约描述并 git commit(评分基于提交时间)".into(), }); if overall != "red" { overall = "yellow".to_string();