diff --git a/.gitea/ai-review/exclusions.json b/.gitea/ai-review/exclusions.json index 4ffa10c..6a36245 100644 --- a/.gitea/ai-review/exclusions.json +++ b/.gitea/ai-review/exclusions.json @@ -488,5 +488,35 @@ "role": "Assassin", "original_finding": "extractUsage 對不預期 payload 僅返回 null,過度信任 API 回應結構,可能導致計費或配額相關監控被繞過;建議增加 Schema Validation、異常明確記錄。", "reason": "誤判/過度設計。extractUsage 僅用於「使用量顯示統計」,非計費或配額強制;回傳 null 是「此回應無可辨識 usage 資訊」的正確訊號,呼叫端以 0 計入並降級顯示,不影響任何金流或門檻判斷。對 best-effort 顯示統計加 schema validation 與錯誤記錄屬過度設計。" + }, + { + "location": "app/comments.test.js:250", + "role": "Maya", + "original_finding": "新增的 postFindingsReview 使用統計功能,但在測試中完全未驗證輸出內容;應斷言 body 含 usageSection 與統計數據。", + "reason": "誤判,測試已存在。`app/comments.test.js` 的 'appends usageSection verbatim after the stats block' 斷言 body.endsWith(usageSection) 與結構,'counts both new and old findings in the summary' 斷言四欄新舊統計列;body 內容已被多個案例驗證。" + }, + { + "location": "app/findings.test.js:154", + "role": "Maya", + "original_finding": "filterFalsePositivesWithAI 測試不足,缺乏對內部函數 judgeFindingIsFalsePositive 的獨立單元測試。", + "reason": "誤判/不適用。judgeFindingIsFalsePositive 是 findings.js 的私有函式(未匯出),其 verdict 處理(false_positive/confirmed/異常值/拋錯)已透過公開呼叫端 filterFalsePositivesWithAI 的多個案例完整覆蓋;為測試實作細節而匯出私有函式不符測試原則。" + }, + { + "location": "app/findings.test.js:145", + "role": "Maya", + "original_finding": "filterFalsePositivesWithAI 未測試平行裁決部分成功、部分失敗時的結果一致性(失敗者保守保留)。", + "reason": "誤判,測試已存在。'keeps failed and confirmed, drops only confirmed false positives (mixed parallel)' 正是模擬一個拋錯、一個誤報、一個成立,驗證只剔除確認誤報、保留失敗與成立者。" + }, + { + "location": "app/findings.test.js:189", + "role": "Maya", + "original_finding": "未測試 resolveMissingLineNumbers 當 chatFn 回傳無效行號時的處理(fallback)。", + "reason": "誤判,測試已存在。'resolveMissingLineNumbers keeps the filename after exhausting retries' 以 chatFn 持續回 {line:0}(無效行號)驗證進入 fallback、保留檔名;另有 'swallows chatFn exceptions' 覆蓋拋錯情境。" + }, + { + "location": "app/resolve.test.js:21", + "role": "Maya", + "original_finding": "parseBotReviewComment 的測試沒有驗證解析失敗時回傳 null 的行為。", + "reason": "誤判,測試已存在。'returns null for free-form human comments' 已斷言自由格式留言、空字串、null 皆回傳 null。" } ] diff --git a/.gitea/ai-review/findings.json b/.gitea/ai-review/findings.json index 7669a87..fe51488 100644 --- a/.gitea/ai-review/findings.json +++ b/.gitea/ai-review/findings.json @@ -1,45 +1 @@ -[ - { - "level": "critical", - "role": "Maya", - "location": "app/comments.test.js:250", - "problem": "新增的 `postFindingsReview` 使用統計功能,但在測試中完全未驗證輸出內容。", - "suggestion": "應斷言 `reviewCalls[0].body` 確實包含了預期的 `usageSection` 資訊與統計數據。" - }, - { - "level": "critical", - "role": "Maya", - "location": "app/findings.test.js:154", - "problem": "`filterFalsePositivesWithAI` 測試不足,缺乏對 `judgeFindingIsFalsePositive` 內部的獨立單元測試。", - "suggestion": "為內部函數 `judgeFindingIsFalsePositive` 補寫測試,單獨驗證其對不同 Verdict 值(false_positive, confirmed, 異常值)的處理邏輯。" - }, - { - "level": "warning", - "role": "Maya", - "problem": "在 `filterFalsePositivesWithAI` 的測試中,雖然模擬了平行處理,但並未測試當多個並行裁決(Promise.all)中,部分成功、部分失敗時的結果一致性(即確保失敗者保守保留)。", - "suggestion": "增加測試案例:模擬其中一個 sub-agent 拋出錯誤、另一個判為誤報、第三個判為成立,驗證最終結果是否正確地保留了「失敗者」與「成立者」,且只剔除「確認誤報者」。", - "location": "app/findings.test.js:145", - "is_new": false - }, - { - "level": "warning", - "role": "Maya", - "location": "app/findings.test.js:189", - "problem": "未測試 `resolveMissingLineNumbers` 當 `chatFn` 回傳無效行號時的處理。", - "suggestion": "補上測試案例:模擬 `chatFn` 回傳無效行號,確保其進入 fallback 邏輯。" - }, - { - "level": "warning", - "role": "Maya", - "location": "app/resolve.test.js:21", - "problem": "在 `parseBotReviewComment` 的測試中,沒有驗證解析失敗時的行為。", - "suggestion": "補上邊界測試:輸入不完整的內容,驗證函數是否正確回傳 `null`。" - }, - { - "level": "info", - "role": "Maya", - "location": "app/resolve.test.js:133", - "problem": "`judgeConversations` 的測試中,未對「AI 回傳空陣列」或「所有 Verdict 皆為空」的情境進行邊界驗證。", - "suggestion": "補上邊界測試,驗證該情境下是否將所有對話歸類為 `open`(保守保留)。" - } -] +[]