JiuwenSwarm is an intelligent AI Agent built on openJiuwen. It extends the powerful capabilities of large language models directly to your fingertips through various communication apps you use daily.
Python
fix(simplify): exclude security vulnerabilities from /simplify scope, and report-only
ldstyle8026ecf2e8e3e
diff --git a/docs/en/SlashCommands.md b/docs/en/SlashCommands.mdindex e0f9a871cb..cacbf38789 100644--- a/docs/en/SlashCommands.md+++ b/docs/en/SlashCommands.md@@ -542,6 +542,7 @@ Timestamp format: `YYYY-MM-DD-HHmmss`.Parsed **locally by the TUI**, this command sends a dedicated RPC `command.simplify` to get a server-generated three-phase review prompt, then injects it as an Agent message (`logAsUser: false`). The Agent automatically reviews changed code for reuse, quality, and efficiency, and directly fixes issues found.+- **Scope**: reuse / quality / efficiency **only**. Security vulnerabilities (injection, XSS, hard-coded secrets, auth flaws, etc.) are **out of scope** — do not fix or report them here. Use `/security-review` for a read-only security report.- **Alias**: None.- **Applicable modes**: **`code.*` only**. Non-code mode shows an error prompting `Run /mode code first`.- **Parsing location**: TUI local (not a Gateway controlled channel); unavailable in IM.diff --git "a/docs/zh/Slash\345\221\275\344\273\244\350\241\250.md" "b/docs/zh/Slash\345\221\275\344\273\244\350\241\250.md"index 07dcc8824e..2fc1d4edf0 100644--- "a/docs/zh/Slash\345\221\275\344\273\244\350\241\250.md"+++ "b/docs/zh/Slash\345\221\275\344\273\244\350\241\250.md"@@ -561,6 +561,7 @@在 **TUI 本地解析**,通过专用 RPC `command.simplify` 获取服务端生成的三阶段审查 prompt,然后注入为 Agent 消息(`logAsUser: false`)。Agent 自动审查代码变更的复用性、质量与效率,并直接修复发现的问题。+- **范围**:仅复用 / 质量 / 效率。安全漏洞(注入、XSS、硬编码密钥、鉴权缺陷等)**不在范围内**,此处既不修复也不报告;请用 `/security-review` 获取只读的安全审查报告。- **别名**:无。- **适用模式**:**仅 `code.*`**。非 code 模式下提示先执行 `/mode code`。- **解析位置**:TUI 本地(非 Gateway 受控通道),IM 不可用。diff --git a/jiuwenswarm/server/agent_ws_server.py b/jiuwenswarm/server/agent_ws_server.pyindex 17ba9d5ce3..9057872913 100644--- a/jiuwenswarm/server/agent_ws_server.py+++ b/jiuwenswarm/server/agent_ws_server.py@@ -152,6 +152,13 @@ _SIMPLIFY_PROMPT_TEMPLATE = """\Review all changed files for reuse, quality, and efficiency. Fix any issues found.+## Scope++This review covers **reuse, quality, and efficiency only** — the three dimensions below. It is NOT a security review.++- Do NOT flag, fix, or report security vulnerabilities (injection, XSS, hard-coded secrets, auth flaws, etc.). Those are out of scope here and are handled by `/security-review`, which reports findings without modifying code.+- If you happen to notice a likely security issue while reviewing, do not fix it — at most note it in one line at the end ("possible security concern in <file>:<line>, run /security-review") and continue with the reuse/quality/efficiency review.+## Phase 1: Identify ChangesRun `git diff` (or `git diff HEAD` if there are staged changes) to see what changed. If there are no git changes, review the most recently modified files that the user mentioned or that you edited earlier in this conversation.diff --git a/tests/unit_tests/agentserver/test_agentserver_cli_commands.py b/tests/unit_tests/agentserver/test_agentserver_cli_commands.pyindex 1924d4e2e9..d2fda15509 100644--- a/tests/unit_tests/agentserver/test_agentserver_cli_commands.py+++ b/tests/unit_tests/agentserver/test_agentserver_cli_commands.py@@ -270,6 +270,9 @@ async def test_handle_command_simplify_returns_prompt(server, fake_ws):assert "perform all three reviews yourself directly" in prompt# No Additional Focus section when no target is givenassert "Additional Focus" not in prompt+ # Security is explicitly out of scope — must point to /security-review+ assert "security" in prompt.lower()+ assert "/security-review" in prompt@pytest.mark.asyncio