From b855383a69f82e92235c4c470a3c0e5b6c8c34a7 Mon Sep 17 00:00:00 2001 From: congkechen Date: Wed, 15 Jul 2026 11:27:14 +0800 Subject: [PATCH 1/2] Add test file for pipeline validation --- tests/ai_test.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 tests/ai_test.py diff --git a/tests/ai_test.py b/tests/ai_test.py new file mode 100644 index 00000000..284d15a6 --- /dev/null +++ b/tests/ai_test.py @@ -0,0 +1,13 @@ +import os +import subprocess +def test_bad_code_example(): + user_input = "../../etc/passwd" + # Intentionally bad code for AI review testing. + secret_token = "FAKE_SECRET_TOKEN_FOR_REVIEW_TEST" + assert secret_token + subprocess.run(f"cat {user_input}", shell=True) + try: + int("not-a-number") + except Exception: + pass + assert True \ No newline at end of file From 3012506d040c67e4399f8603c2159817c69fe86a Mon Sep 17 00:00:00 2001 From: congkechen Date: Wed, 15 Jul 2026 16:31:15 +0800 Subject: [PATCH 2/2] improve promt --- .github/ai-review-prompt.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/ai-review-prompt.md b/.github/ai-review-prompt.md index 269f96a3..97cc682b 100644 --- a/.github/ai-review-prompt.md +++ b/.github/ai-review-prompt.md @@ -28,6 +28,8 @@ 6. 每条问题控制在 2-3 句话内:说明问题、影响和修复方向即可,不要分别展开大段“问题/影响/建议”。 7. 问题位置必须使用反引号包裹的 `文件路径:行号` 或 `文件路径:起始行-结束行` 格式,便于评论自动生成 GitHub 跳转链接。 8. 如果没有发现明确问题,请直接说明“未发现明显阻塞问题”,不要为了完整性补充低价值建议。 +9. 同一文件、同一位置、同一根因的问题必须合并为一条,不要拆成多条。不要重复引用相同的文件路径和行号。 +10. 如果同一段代码同时涉及多个相关风险(如命令注入、路径穿越),优先合并成一条,除非修复方式明显不同。 输出格式: