feat(ai-review 對話收斂): 讀 PR review 留言判斷解決狀態並收斂 findings #42

Merged
jiantw83 merged 68 commits from ai-review-resolve/20260623-110950 into develop 2026-06-23 08:29:38 +00:00
Showing only changes of commit 348036aea3 - Show all commits
+9 -6
View File
@@ -64,24 +64,27 @@ function newFindingsOnly(findings) {
return findings.filter(f => f.is_new !== false);
}
// 等級無法歸入 critical/warning/info(例如缺漏或無法辨識)時,歸入「無法標示」
const isUnclassified = f => !LEVEL_ORDER.includes(f.level);
export function formatFindingsStats(findings) {
const oldFindings = findings.filter(f => f.is_new === false);
const newFindings = newFindingsOnly(findings);
const row = (label, items) => `| ${label} | ${countBy(items, f => f.level === 'critical')} 筆 | ${countBy(items, f => f.level === 'warning')} 筆 | ${countBy(items, f => f.level === 'info')} 筆 |`;
const row = (label, items) => `| ${label} | ${countBy(items, f => f.level === 'critical')} 筆 | ${countBy(items, f => f.level === 'warning')} 筆 | ${countBy(items, f => f.level === 'info')} | ${countBy(items, isUnclassified)} |`;
return [
'| 類型 | 🔴 嚴重 | 🟡 警告 | 🔵 建議 |',
'| --- | --- | --- | --- |',
row('舊問題', oldFindings),
'| 類型 | 🔴 嚴重 | 🟡 警告 | 🔵 建議 | ⚪ 無法標示 |',
'| --- | --- | --- | --- | --- |',
row('新問題', newFindings),
row('舊問題', oldFindings),
].join('\n');
}
export function formatFindingsStatsLine(findings) {
const oldFindings = findings.filter(f => f.is_new === false);
const newFindings = newFindingsOnly(findings);
const row = items => `嚴重${countBy(items, f => f.level === 'critical')} / 警告${countBy(items, f => f.level === 'warning')} / 建議${countBy(items, f => f.level === 'info')}`;
return `: ${row(oldFindings)}: ${row(newFindings)}`;
const row = items => `嚴重${countBy(items, f => f.level === 'critical')} / 警告${countBy(items, f => f.level === 'warning')} / 建議${countBy(items, f => f.level === 'info')} / 無法標示${countBy(items, isUnclassified)}`;
return `: ${row(newFindings)}: ${row(oldFindings)}`;
}
function buildReviewSummary(findings, usageSection = '') {