處理 AI review findings 並改寫 Node.js entrypoint #2
@@ -82,5 +82,23 @@
|
|||||||
"role": "Bard",
|
"role": "Bard",
|
||||||
"original_finding": "在測試中建立 `codex` 指令時,Here-document 與命令混雜,可讀性較低。",
|
"original_finding": "在測試中建立 `codex` 指令時,Here-document 與命令混雜,可讀性較低。",
|
||||||
"reason": "測試 helper 需要動態產生可執行的假 codex 指令,here-document 在此處比額外 fixture 檔更直觀且維持測試自含;此項屬風格偏好,不影響行為正確性。"
|
"reason": "測試 helper 需要動態產生可執行的假 codex 指令,here-document 在此處比額外 fixture 檔更直觀且維持測試自含;此項屬風格偏好,不影響行為正確性。"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"location": "Dockerfile:10",
|
||||||
|
"role": "Assassin",
|
||||||
|
"original_finding": "Codex 外掛市集來源指向 `gitea.jsc.idv.tw`,未驗證來源的安全性。若該伺服器遭駭,將導致自動安裝惡意或篡改過的外掛,進而導致供應鏈攻擊。",
|
||||||
|
"reason": "Dockerfile 已使用 `codex plugin marketplace add --ref` 將 doc 與 code-review marketplace 固定到指定 commit SHA;此 action 需要安裝內部 Gitea marketplace 外掛,來源伺服器信任與存取控管屬部署環境治理,不適合在 Dockerfile 內改成其他來源。"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"location": "Dockerfile:24",
|
||||||
|
"role": "Leo",
|
||||||
|
"original_finding": "插件 URL 與版本參照 (REF) 硬編碼在 Dockerfile 中,未來若需更新插件或更換來源,需重新編譯整個 Docker 映像檔,維護成本較高。",
|
||||||
|
"reason": "此 Docker Action 需要可重現的建置結果;將 marketplace URL 與 ref 固定在 Dockerfile ARG 中,可讓外掛版本變更必須經由映像檔重建與 code review,避免外部設定在執行時靜默改變供應鏈內容。"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"location": "tests/entrypoint_test.sh:65",
|
||||||
|
"role": "Maya",
|
||||||
|
"original_finding": "測試案例對於輸入參數的邊界測試(例如 `PROMPT` 為空字串、極長字串)不足。",
|
||||||
|
"reason": "目前測試已包含 `test_empty_prompt` 與 `test_prompt_with_shell_characters`,覆蓋空字串與含 shell 特殊字元的 PROMPT 傳遞;此 finding 對最新測試內容已不成立。"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -1,34 +1 @@
|
|||||||
[
|
[]
|
||||||
{
|
|
||||||
"level": "warning",
|
|
||||||
"role": "Assassin",
|
|
||||||
"problem": "Codex 外掛市集來源指向 `gitea.jsc.idv.tw`,未驗證來源的安全性。若該伺服器遭駭,將導致自動安裝惡意或篡改過的外掛,進而導致供應鏈攻擊。",
|
|
||||||
"suggestion": "若可能,請將外掛來源固定在受信任的內部儲存庫或使用經簽署的外掛版本。確保來源伺服器具有嚴格的存取控管與安全性掃描。",
|
|
||||||
"location": "Dockerfile:10",
|
|
||||||
"is_new": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"level": "warning",
|
|
||||||
"role": "Leo",
|
|
||||||
"location": "Dockerfile:24",
|
|
||||||
"problem": "插件 URL 與版本參照 (REF) 硬編碼在 Dockerfile 中,未來若需更新插件或更換來源,需重新編譯整個 Docker 映像檔,維護成本較高。",
|
|
||||||
"suggestion": "建議將這些插件清單與版本資訊移至外部設定檔 (如 plugins.json),並在 Dockerfile 中讀取該檔案進行安裝,增加彈性。",
|
|
||||||
"is_new": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"level": "warning",
|
|
||||||
"role": "Mage",
|
|
||||||
"location": "Dockerfile:18",
|
|
||||||
"problem": "若 sh \"$install_script\" 安裝過程失敗,rm -f 由於被 && 連接,不會被執行,導致 build 過程中殘留不必要的暫存檔案,雖然 Docker Layer 會自動清除,但仍屬不佳的清理實作。",
|
|
||||||
"suggestion": "建議改用 trap 進行清理,或確保 rm -f 指令在 failure 情境下也能執行,例如:sh \"$install_script\" || { rm -f \"$install_script\"; exit 1; }",
|
|
||||||
"is_new": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"level": "info",
|
|
||||||
"role": "Maya",
|
|
||||||
"problem": "測試案例對於輸入參數的邊界測試(例如 `PROMPT` 為空字串、極長字串)不足。",
|
|
||||||
"suggestion": "增加針對 `PROMPT` 輸入為空字串或是包含特殊 Shell 跳脫字元的測試案例。",
|
|
||||||
"location": "tests/entrypoint_test.sh:65",
|
|
||||||
"is_new": false
|
|
||||||
}
|
|
||||||
]
|
|
||||||
|
|||||||
Reference in New Issue
Block a user