Compare commits

...
Author SHA1 Message Date
AI Review Bot 96cb99c136 chore: update ai-review findings [ai-review-bot][success]
CI / 1. BUILD (pull_request) Successful in 1s
CI / 2. TEST (pull_request) Successful in 32s
CI / 3. RESULT (pull_request) Has been skipped
2026-07-11 10:04:19 +00:00
+18
View File
@@ -0,0 +1,18 @@
[
{
"level": "warning",
"role": "Leo",
"location": "src/index.js:401",
"problem": "這裡在 `catch` 裡重新手寫一次時間戳與前綴格式,和前面的 `info()` 形成兩套彼此獨立的輸出格式。未來只要調整 log 格式、時區或錯誤前綴,就必須記得同步兩處,半年後很容易出現訊息格式不一致的問題。",
"suggestion": "把時間戳與 prefix 組裝抽成共用的 formatter,例如 `formatLogLine()` 或 `formatTimestamp()`,讓 `info()` 與錯誤處理共用同一套輸出規則。",
"is_new": true
},
{
"level": "warning",
"role": "Maya",
"location": "src/index.js:401",
"problem": "這次把錯誤輸出從單純的 `[error] ...` 改成包含 `currentStage` 與台灣時區時間戳的格式,但沒有任何測試覆蓋失敗路徑。只要之後格式字串、stage 前綴或 `process.exit(1)` 的行為回歸,CI 很容易看不出來。",
"suggestion": "補一組針對 `main().catch()` 的單元測試:模擬 `main()` 拋錯或回傳 rejected promise,先設定 `currentStage`,再斷言 `process.stderr.write` 寫出的內容包含 `[階段][ERR][YYYY/MM/DD ...]: 錯誤訊息`,同時驗證 `process.exit(1)` 有被呼叫。建議再加一個 `currentStage === null` 時的案例,確認前綴會正確省略。",
"is_new": true
}
]