From d16d680f0f47799633bf673c80b001e728ff881f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8C=83=E6=99=BA=E9=B9=8F?= Date: Thu, 20 Aug 2026 22:26:30 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20AI=20=E4=BF=AE=E5=A4=8D=E9=93=BE?= =?UTF-8?q?=E8=B7=AF=E6=89=A9=E5=B1=95=20+=20=E4=BF=AE=E5=A4=8D=E9=A2=84?= =?UTF-8?q?=E8=A7=88=E4=B8=A4=E6=AD=A5=E7=A1=AE=E8=AE=A4=20+=20=E8=87=AA?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E8=A7=84=E5=88=99/AI=20=E5=AE=A1=E6=9F=A5?= =?UTF-8?q?=E6=9D=A1=E7=9B=AE=E6=94=AF=E6=8C=81=20AI=20=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - AI 修复:无原生 fix 的 linter 条目走 AI 修复(aiFixEngine/fixPrompt,AI 重检收敛),自定义规则与 AI 审查条目新增 AI 修复按钮(customFixEngine),自定义规则条目展开显示 AI 建议(suggestion 字段) - 修复预览:面板触发修复先用内置 diff 预览,面板内「应用/取消」两步确认后才写入(fixPreview/fixPending,单条与分 tab 批量均支持) - 修复面板交互:linter/custom/ai 分 tab「全部修复」、已修复+撤销、pending 按钮状态同步 - bug 修复:修复按钮失败后卡 ⏳ 不恢复;custom/ai 修复不稳定(空修复重试、AI 重检收敛判定放宽、降级接受最后一次有效修复) - 移除 AI codeDiff 展示块 --- _AI_USAGE_LOG.md | 7 + .../specs/2026-08-19-fix-preview-design.md | 271 +++++++++++ .../specs/2026-08-20-custom-ai-fix-design.md | 139 ++++++ ...026-08-20-custom-rule-suggestion-design.md | 50 ++ src/activation/commands.ts | 455 +++++++++++++++++- src/ai/engine.ts | 33 +- src/ai/schema.ts | 3 +- src/extension.ts | 7 +- src/fix/aiFixEngine.ts | 139 ++++++ src/fix/customFixEngine.ts | 151 ++++++ src/fix/fixEngine.ts | 8 +- src/fix/fixPending.ts | 77 +++ src/fix/fixPreview.ts | 77 +++ src/fix/fixPrompt.ts | 91 ++++ src/fix/fixSession.ts | 6 +- src/i18n/messages.ts | 45 ++ src/merger/merger.ts | 11 + src/panel/webview.ts | 144 ++++-- src/utils/report.ts | 5 - src/views/reviewPanel.js | 21 + 20 files changed, 1655 insertions(+), 85 deletions(-) create mode 100644 docs/superpowers/specs/2026-08-19-fix-preview-design.md create mode 100644 docs/superpowers/specs/2026-08-20-custom-ai-fix-design.md create mode 100644 docs/superpowers/specs/2026-08-20-custom-rule-suggestion-design.md create mode 100644 src/fix/aiFixEngine.ts create mode 100644 src/fix/customFixEngine.ts create mode 100644 src/fix/fixPending.ts create mode 100644 src/fix/fixPreview.ts create mode 100644 src/fix/fixPrompt.ts diff --git a/_AI_USAGE_LOG.md b/_AI_USAGE_LOG.md index bc89f61..115cc90 100644 --- a/_AI_USAGE_LOG.md +++ b/_AI_USAGE_LOG.md @@ -212,3 +212,10 @@ | 2026-08-18 20:28 | ① 用户提出 → ② 需求澄清 → ③ 方案设计 → ④ 人类审批 → ⑤ 编码实现 → ⑥ 审查验证 | 修复审查面板点击「修复」无反应:根因是 webview.ts 审查面板用内联