chore(ai-review): 更新 findings 並登記誤報至 exclusions
CI / AI Code Review (pull_request) Failing after 1m17s

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jeffery
2026-06-26 14:41:41 +08:00
co-authored by Claude Opus 4.8
parent 55b5c6f68e
commit 74086e5f23
2 changed files with 14 additions and 64 deletions
-64
View File
@@ -7,22 +7,6 @@
"suggestion": "正式環境嚴禁使用 `--no-check-certificate`。若遇到憑證問題,應排查環境配置(如是否缺少根憑證),或是確實解決憑證驗證問題,確保套件來源可信。",
"is_new": true
},
{
"level": "critical",
"role": "Maya",
"location": "app/resolve.js:142",
"problem": "isSafeRepoPath 函式對於路徑穿越(Directory Traversal)的驗證邏輯至關重要,但目前新增處完全沒有相對應的安全性測試案例,無法確保無法被惡意路徑繞過。",
"suggestion": "請補齊測試案例,驗證包含 '../', '..\\', 或以絕對路徑開頭的惡意輸入,確保該函式能正確阻擋所有非預期的路徑穿越攻擊。",
"is_new": true
},
{
"level": "critical",
"role": "Maya",
"location": "app/llm.js:99",
"problem": "extractBalancedJSON 處理括號平衡解析的邏輯相當複雜,且直接操作字串索引,非常容易在處理特殊字元或不完整 JSON 片段時產生錯誤,目前完全沒有針對邊界條件的單元測試。",
"suggestion": "建議編寫針對性的單元測試,包含深層巢狀結構、跳脫字元字串、不完整 JSON、與非法起始字元的邊界測試案例,以確保解析器的魯棒性。",
"is_new": true
},
{
"level": "warning",
"role": "Assassin",
@@ -31,14 +15,6 @@
"suggestion": "建議釘選明確的 Alpine 版本號(例如 `alpine:3.20`),以確保每次建置的執行環境完全一致且可預測。",
"is_new": true
},
{
"level": "warning",
"role": "Assassin",
"location": "app/config.js:20",
"problem": "`getOpenCodeHttpsAgent` 函式明確回傳了 `rejectUnauthorized: false` 的 HTTPS Agent。在與 OpenCode 服務通訊時,這會完全停用憑證驗證,若傳輸過程被攔截,攻擊者可輕易偽裝成合法伺服器竊取機敏數據。",
"suggestion": "在生產環境下,請務必將此 Agent 設定為進行完整的憑證驗證。若因服務使用自簽憑證,應將該憑證加入容器的受信任憑證庫(CA Store)中,而非全域停用驗證。",
"is_new": true
},
{
"level": "warning",
"role": "Leo",
@@ -54,45 +30,5 @@
"problem": "Dockerfile 中留下了明確的安全性警告註解(關於 --no-check-certificate)。這種將安全性風險留在程式碼中並以註解提醒的做法,容易被未來的維護者忽略,導致潛在的安全性漏洞。",
"suggestion": "若此 flag 僅為暫時性,應盡快優化環境以移除它;若不可避免,應將此設定集中管理,而非在 Dockerfile 中寫死此類不安全的設定。",
"is_new": true
},
{
"level": "warning",
"role": "Leo",
"location": "app/main.js:63",
"problem": "main 函式過於龐大,擔任了過多的總指揮與細節實作職責(Step 1 到 Step 11)。隨著審查流程的邏輯增加,這段程式碼將變得極難閱讀與維護。",
"suggestion": "將每個 Step 拆解為獨立的函式(例如 runPreflight, checkBotCommit 等),讓 main 函式只保留高階的流程協調邏輯。",
"is_new": true
},
{
"level": "warning",
"role": "Maya",
"location": "app/findings.js:73",
"problem": "normalizeText 執行了複雜的字元正規化(NFKC、標點符號壓縮),這是 findings 去重比對的核心邏輯,但目前缺乏測試來驗證其對各種 Unicode 變體、全形/半形符號的處理是否符合預期。",
"suggestion": "請補上測試用例,輸入包含全形/半形標點符號、各種 Unicode 組合字元的測試資料,確保正規化結果的一致性。",
"is_new": true
},
{
"level": "warning",
"role": "Maya",
"location": "app/json.js:22",
"problem": "repairJSONArrayWithAI 是修正 JSON 陣列的重要邏輯,但新增後未見針對其「對 LLM 輸出內容進行修復」的情境進行測試,若模型輸出異常或格式混亂時,此函式是否能穩定產出合法 JSON 陣列未被驗證。",
"suggestion": "請建立測試用例,模擬各類 malformed JSON 字串(如缺少括號、註解、 markdown 殘留),驗證 repairer 是否能確實將其修復為可解析的 JSON 陣列。",
"is_new": true
},
{
"level": "info",
"role": "Bard",
"location": "app/comments.js:103",
"problem": "這裡同時出現了普通註解與 JSDoc,內容描述重複,顯得較為冗餘。",
"suggestion": "移除該行普通註解(// 等級無法...),僅保留下方的 JSDoc 即可。",
"is_new": true
},
{
"level": "info",
"role": "Maya",
"location": "app/comments.js:16",
"problem": "新增了許多輔助性的 formatting 函式(如 findingRow, buildTable 等),雖為內部使用,但這類字串處理邏輯若沒有測試覆蓋,極易因修改格式而導致 Markdown 輸出損壞。",
"suggestion": "雖然是輔助函式,但建議在 test/comments.test.js 中補齊這些 formatting 函式的斷言測試,確保輸出格式穩定。",
"is_new": true
}
]