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} 條`);