From fcde1b0bc941ea7fd8cc52998fbd73a4832055ae Mon Sep 17 00:00:00 2001 From: Jeffery Date: Tue, 23 Jun 2026 17:32:49 +0800 Subject: [PATCH] =?UTF-8?q?fix(ai-review=20exclusions):=20=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=E8=BF=BD=E5=8A=A0=E6=8E=92=E9=99=A4=E8=A6=8F=E5=89=87?= =?UTF-8?q?=E6=99=82=E8=AE=80=E5=AF=AB=E7=9B=AE=E9=8C=84=E9=A1=9B=E5=80=92?= =?UTF-8?q?=E5=B0=8E=E8=87=B4=E6=97=A2=E6=9C=89=E8=A6=8F=E5=89=87=E8=A2=AB?= =?UTF-8?q?=E8=A6=86=E8=93=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit appendExclusions 原以 WORKSPACE 為主、repoDir 為鏡像,與 loadExclusions 相反, 會讀到空的 WORKSPACE 後把僅含本次新增的結果鏡像覆蓋掉 repoDir 既有規則, 改為以 repoDir 為主、WORKSPACE 為鏡像,順序與 loadExclusions 一致。 Co-Authored-By: Claude Opus 4.8 (1M context) --- app/main.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/main.js b/app/main.js index 6339511..9b128cb 100644 --- a/app/main.js +++ b/app/main.js @@ -115,7 +115,9 @@ async function main() { // Step7 過濾:套用排除規則 + 防守方 AI 誤報裁決 step('Step7', '排除規則與誤報過濾'); if (reconcile.excludedFindings.length > 0) { - appendExclusions(WORKSPACE, reconcile.excludedFindings, repoDir || WORKSPACE); + // 以 repoDir 為主(即將提交回去的來源分支副本),WORKSPACE 為鏡像; + // 順序須與下方 loadExclusions 一致,否則會讀到空的 WORKSPACE 而把既有排除規則覆蓋掉。 + appendExclusions(repoDir || WORKSPACE, reconcile.excludedFindings, WORKSPACE); } const exclusions = loadExclusions(repoDir || WORKSPACE, repoState, WORKSPACE); input(`待過濾 ${sorted.length} 筆;排除規則 ${exclusions.length} 條`);