Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| db83b3ee11 | |||
| b17a8757b2 | |||
| 58479c7c6d | |||
| 0de87d6629 | |||
| bc914c401c |
@@ -3,147 +3,35 @@
|
|||||||
"level": "critical",
|
"level": "critical",
|
||||||
"role": "Rex",
|
"role": "Rex",
|
||||||
"location": "app/git.js:14",
|
"location": "app/git.js:14",
|
||||||
"suggestion": "請避免將敏感資料(如 GITEA_TOKEN)直接寫入程式碼,應使用安全的秘密管理工具來管理這些敏感資訊。",
|
"suggestion": "請避免將 GIT_TOKEN 直接寫入腳本中,應使用安全的秘密管理工具來管理這些敏感資訊.",
|
||||||
"is_new": true
|
"is_new": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"level": "warning",
|
"level": "warning",
|
||||||
"role": "Rex",
|
"role": "Leo",
|
||||||
"location": "app/git.js:14",
|
"location": "app/git.js:14",
|
||||||
"suggestion": "在 cloneRepo 函數中,請確保 GIT_TOKEN 不會被寫入到檔案系統中,避免敏感資訊洩漏。",
|
"suggestion": "建議在 cloneRepo 函數中增加對於 GIT_TOKEN 的安全性處理,避免敏感資訊洩漏.",
|
||||||
"is_new": true
|
"is_new": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"level": "warning",
|
"level": "warning",
|
||||||
"role": "Leo",
|
"role": "Leo",
|
||||||
"location": "app/findings.js:93",
|
"location": "app/findings.js:93",
|
||||||
"suggestion": "建議在 loadExclusions 函式中增加對於 JSON 格式的驗證,確保讀取的資料符合預期格式,避免潛在的錯誤。",
|
"suggestion": "建議在 loadExclusions 函式中增加對於 JSON 格式的驗證,確保讀取的資料符合預期格式,避免潛在的錯誤.",
|
||||||
"is_new": false
|
"is_new": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"level": "warning",
|
"level": "warning",
|
||||||
"role": "Leo",
|
"role": "Leo",
|
||||||
"location": "app/findings.js:40",
|
"location": "app/findings.js:40",
|
||||||
"suggestion": "在 applyExclusions 函式中,建議增加對於 findings 和 exclusions 參數的有效性檢查,以提高程式的健壯性。",
|
"suggestion": "在 applyExclusions 函式中,建議增加對於 findings 和 exclusions 參數的有效性檢查,以提高程式的健壯性.",
|
||||||
"is_new": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"level": "warning",
|
|
||||||
"role": "Zara",
|
|
||||||
"location": "app/findings.js:40",
|
|
||||||
"suggestion": "在 applyExclusions 函數中,使用 Array.prototype.some 進行過濾時,可能會導致性能問題,特別是當 findings 和 exclusions 的數量都很大時。建議使用更高效的資料結構(如 HashSet)來加速查詢。",
|
|
||||||
"is_new": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"level": "warning",
|
|
||||||
"role": "Aria",
|
|
||||||
"location": "README.md:4",
|
|
||||||
"suggestion": "建議將「讀取排除問題檔案,用來過濾PR問題表格中不需要處理的問題」的描述改為「讀取排除問題檔案,過濾 PR 問題表格中不需要處理的問題」,以保持一致性。",
|
|
||||||
"is_new": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"level": "warning",
|
|
||||||
"role": "Maya",
|
|
||||||
"location": "app/findings.js:40",
|
|
||||||
"suggestion": "建議在 applyExclusions 函數中增加對 findings 內容的驗證,確保其格式正確,以提高測試的穩定性和可靠性。",
|
|
||||||
"is_new": false
|
"is_new": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"level": "info",
|
"level": "info",
|
||||||
"role": "Leo",
|
"role": "Leo",
|
||||||
"location": "README.md",
|
"location": "README.md",
|
||||||
"suggestion": "建議在 README 中增加對於新功能(如排除問題過濾)的詳細說明,以便未來的維護者能快速了解其功能。",
|
"suggestion": "建議在 README 中增加對於新功能(如排除問題過濾)的詳細說明,以便未來的維護者能快速了解其功能.",
|
||||||
"is_new": false
|
"is_new": true
|
||||||
},
|
|
||||||
{
|
|
||||||
"level": "info",
|
|
||||||
"role": "Leo",
|
|
||||||
"location": "app/main.js",
|
|
||||||
"suggestion": "建議在 main 函式中增加對於每個步驟的詳細註解,讓未來的維護者能更容易理解程式邏輯。",
|
|
||||||
"is_new": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"level": "info",
|
|
||||||
"role": "Zara",
|
|
||||||
"location": "app/findings.js:39",
|
|
||||||
"suggestion": "在過濾 findings 時,建議將過濾條件的邏輯提取為獨立函數,以提高可讀性和可維護性。",
|
|
||||||
"is_new": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"level": "info",
|
|
||||||
"role": "Zara",
|
|
||||||
"location": "app/main.js:64",
|
|
||||||
"suggestion": "在讀取排除問題檔案時,建議考慮使用非同步方法(如 fs.promises.readFile)來避免阻塞事件循環,提升效能。",
|
|
||||||
"is_new": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"level": "info",
|
|
||||||
"role": "Aria",
|
|
||||||
"location": "README.md:8",
|
|
||||||
"suggestion": "建議將「如果PR問題表格中有嚴重問題,則不要讓 workflow 執行成功(exit 1)」的描述改為「如果 PR 問題表格中有嚴重問題,則不要讓 workflow 執行成功(exit 1)」以提高可讀性。",
|
|
||||||
"is_new": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"level": "info",
|
|
||||||
"role": "Aria",
|
|
||||||
"location": "TODO.md:4",
|
|
||||||
"suggestion": "建議將「階段四:findings 寫入與 comment 發布」的標題改為「階段四:排除問題過濾」,以更清楚地反映內容。",
|
|
||||||
"is_new": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"level": "info",
|
|
||||||
"role": "Aria",
|
|
||||||
"location": "TODO.md:6",
|
|
||||||
"suggestion": "建議將「階段五:findings 寫入與 comment 發布」的標題改為「階段五:findings 寫入與 comment 發布」,以保持一致性。",
|
|
||||||
"is_new": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"level": "info",
|
|
||||||
"role": "Aria",
|
|
||||||
"location": "TODO.md:8",
|
|
||||||
"suggestion": "建議將「階段六:記憶區 commit/push 與錯誤處理」的標題改為「階段六:記憶區 commit/push 與錯誤處理」,以保持一致性。",
|
|
||||||
"is_new": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"level": "info",
|
|
||||||
"role": "Aria",
|
|
||||||
"location": "TODO.md:10",
|
|
||||||
"suggestion": "建議將「階段七:阻擋嚴重問題 PR(第 8 點)」的標題改為「階段七:阻擋嚴重問題 PR(第 8 點)」以保持一致性。",
|
|
||||||
"is_new": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"level": "info",
|
|
||||||
"role": "Aria",
|
|
||||||
"location": "app/config.js",
|
|
||||||
"suggestion": "建議在 EXCLUSIONS_PATH 的定義上方添加註解,說明該常數的用途,以提高可讀性。",
|
|
||||||
"is_new": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"level": "info",
|
|
||||||
"role": "Aria",
|
|
||||||
"location": "app/findings.js",
|
|
||||||
"suggestion": "建議在 loadExclusions 函數的開頭添加註解,說明該函數的用途,以提高可讀性。",
|
|
||||||
"is_new": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"level": "info",
|
|
||||||
"role": "Aria",
|
|
||||||
"location": "app/findings.js",
|
|
||||||
"suggestion": "建議在 applyExclusions 函數的開頭添加註解,說明該函數的用途,以提高可讀性。",
|
|
||||||
"is_new": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"level": "info",
|
|
||||||
"role": "Maya",
|
|
||||||
"location": "app/findings.js:7",
|
|
||||||
"suggestion": "建議為 loadExclusions 和 applyExclusions 函數撰寫單元測試,以確保其功能正確並能處理邊界條件。",
|
|
||||||
"is_new": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"level": "info",
|
|
||||||
"role": "Maya",
|
|
||||||
"location": "app/main.js:48",
|
|
||||||
"suggestion": "建議在每個主要步驟之後增加測試用例,以驗證每個步驟的輸出是否符合預期。",
|
|
||||||
"is_new": false
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@@ -15,14 +15,14 @@
|
|||||||
- 驗收:log 中能看到 deduplication/resolution confirmation 成功或失敗(如 402),降級時有「保留所有問題」等明確訊息。
|
- 驗收:log 中能看到 deduplication/resolution confirmation 成功或失敗(如 402),降級時有「保留所有問題」等明確訊息。
|
||||||
- 完成
|
- 完成
|
||||||
|
|
||||||
## 階段四:排除問題過濾
|
## 階段四:AI 排除問題過濾
|
||||||
- 目標:讀取排除問題檔案,過濾 PR 問題表格中不需要處理的問題。
|
- 目標:讀取排除問題檔案(exclusions.json)進行規則過濾,並呼叫 AI 判斷剩餘問題是否為誤報或不適用,兩層過濾後產生最終問題清單。
|
||||||
- 驗收:log 中能看到排除問題檔案讀取成功或不存在的訊息,以及過濾後 findings 數量變化。
|
- 驗收:log 中能看到排除問題檔案讀取成功或不存在的訊息、規則過濾數量變化,以及「AI 誤報過濾: N -> M 筆」或降級訊息。
|
||||||
- 完成
|
- 完成
|
||||||
|
|
||||||
## 階段五:findings 寫入與 comment 發布
|
## 階段五:findings 寫入與 comment 發布
|
||||||
- 目標:findings.jsonl 正確寫入,comment 發布順序正確(舊問題→非嚴重→嚴重),每步有 log。
|
- 目標:findings.jsonl 正確寫入,comment 發布順序正確(舊問題→非嚴重→嚴重),每步有 log。
|
||||||
- 驗收:log 中能看到 findings 寫入、comment sync 的詳細訊息與順序。
|
- 驗收:log 中能看到 findings.json 寫入、comment sync 的詳細訊息與順序。
|
||||||
- 完成
|
- 完成
|
||||||
|
|
||||||
## 階段六:記憶區 commit/push 與錯誤處理
|
## 階段六:記憶區 commit/push 與錯誤處理
|
||||||
|
|||||||
+1
-1
@@ -82,7 +82,7 @@ async function main() {
|
|||||||
console.log(` Step3b dedup findings total=${sorted.length} (critical=${sorted.filter(f=>f.level==='critical').length} warning=${sorted.filter(f=>f.level==='warning').length} info=${sorted.filter(f=>f.level==='info').length})`);
|
console.log(` Step3b dedup findings total=${sorted.length} (critical=${sorted.filter(f=>f.level==='critical').length} warning=${sorted.filter(f=>f.level==='warning').length} info=${sorted.filter(f=>f.level==='info').length})`);
|
||||||
|
|
||||||
// Step4: 讀取排除問題檔案,過濾 PR 問題表格,並請 AI 判斷誤報
|
// Step4: 讀取排除問題檔案,過濾 PR 問題表格,並請 AI 判斷誤報
|
||||||
console.log('\n🚫 Step4: 排除問題過濾');
|
console.log('\n🚫 Step4: AI 排除問題過濾');
|
||||||
const exclusions = loadExclusions(repoDir || WORKSPACE);
|
const exclusions = loadExclusions(repoDir || WORKSPACE);
|
||||||
const ruleFiltered = applyExclusions(sorted, exclusions);
|
const ruleFiltered = applyExclusions(sorted, exclusions);
|
||||||
const filtered = await filterFalsePositivesWithAI(ruleFiltered);
|
const filtered = await filterFalsePositivesWithAI(ruleFiltered);
|
||||||
|
|||||||
Reference in New Issue
Block a user