chore(ai-review 狀態): 解決 usage.js findings 並補 SRP 誤報排除
AI / 計算版本號 (pull_request) Successful in 2s
AI / Code Review (pull_request) Failing after 51s

This commit is contained in:
Jeffery
2026-06-23 13:07:27 +08:00
parent 54f268c81b
commit 3bf9255a0d
2 changed files with 7 additions and 66 deletions
+6
View File
@@ -434,5 +434,11 @@
"role": "Rogue",
"original_finding": "`Promise.allSettled` 的結果處理邏輯過於冗長,產生不必要的中間變數。",
"reason": "主觀風格。`resolveOutcome` Map 是為了讓並行結果能依原 open 索引亂序對齊(保留 carried/resolved 的順序與 botFinding 對應),現有寫法清楚且正確,非缺陷。"
},
{
"location": "app/usage.js",
"role": "Leo",
"original_finding": "`usage.js` 模組目前承擔了 Token 計算、Rate Limit 記錄、以及各平台帳號額度查詢等多重職責(SRP),未來若支援更多平台會變得龐大難維護;建議將各平台 QuotaStrategy 拆分至獨立檔案。",
"reason": "過早最佳化。目前 usage.js 仍圍繞單一「使用量」領域且體積適中(約 250 行),token 計算與額度查詢彼此關聯(同屬使用量呈現);在尚未有多平台 strategy 膨脹的實際痛點前拆檔,徒增檔案與匯入複雜度。待 strategy 數量明顯成長再拆分較合適。"
}
]