diff --git a/docs/architecture-overview.md b/docs/architecture-overview.md index a9c6fd598..c00d8ab40 100644 --- a/docs/architecture-overview.md +++ b/docs/architecture-overview.md @@ -754,8 +754,8 @@ flowchart LR | 指标 | 当前值 | |---|---:| -| Python 模块 | 936 | -| 内部导入边 | 7,832 | +| Python 模块 | 937 | +| 内部导入边 | 7,839 | | 非平凡 SCC | 1(精确 containment 的 TMDB 移植包环) | | Application / Chain 具体 Adapter 直连 | 0 / 0 | | Direct egress | 53(债务已清零,53 条精确 containment) | diff --git a/docs/architecture/optimization-checklist.md b/docs/architecture/optimization-checklist.md index 522235169..b9332a04c 100644 --- a/docs/architecture/optimization-checklist.md +++ b/docs/architecture/optimization-checklist.md @@ -94,7 +94,7 @@ ARCH-201 至 ARCH-204 均达到实现、验证、提交、推送和远端门禁 | 指标 | 当前值 | 解释 | |---|---:|---| -| 宿主 Python 模块 / 内部依赖边 | 936 / 7,832 | `dependency-baseline.json` 当前快照 | +| 宿主 Python 模块 / 内部依赖边 | 937 / 7,839 | `dependency-baseline.json` 当前快照 | | 非平凡 SCC | 1 | 仅保留精确 containment 的 29 模块 TMDB 移植包环 | | 跨层 DB 边界债务 | 0 | Application、Chain、API、Agent、Runtime、Workflow 到 DB 的受控债务均为零 | | Model/Oper 事务债务 | 0 | 自建 Session、自动事务装饰器、直接 commit/rollback 等基线均为零 | diff --git a/tests/fixtures/architecture/dependency-baseline.json b/tests/fixtures/architecture/dependency-baseline.json index d2d39d7ce..b65c4e8ac 100644 --- a/tests/fixtures/architecture/dependency-baseline.json +++ b/tests/fixtures/architecture/dependency-baseline.json @@ -1089,8 +1089,8 @@ "runtime_only": true } }, - "edge_count": 7832, - "edge_sha256": "3922707ade2b154adcb26bea725f9070ab9ccca109dd4ad9aa0c932cbbad9b74", + "edge_count": 7839, + "edge_sha256": "39801eb6ea7cf3ce011d8dcdb58c613c74d958c78d0dfc5fe26416b0454deba4", "edges": [ "app -> app.foundation", "app -> app.foundation.environment", @@ -1358,6 +1358,7 @@ "app.agent.llm.capability -> app.agent", "app.agent.llm.capability -> app.agent.llm", "app.agent.llm.capability -> app.agent.llm.helper", + "app.agent.llm.capability -> app.agent.shell", "app.agent.llm.capability -> app.application", "app.agent.llm.capability -> app.application.notification", "app.agent.llm.capability -> app.runtime", @@ -1424,6 +1425,8 @@ "app.agent.mcp -> app.adapters", "app.agent.mcp -> app.adapters.network", "app.agent.mcp -> app.adapters.network.http", + "app.agent.mcp -> app.agent", + "app.agent.mcp -> app.agent.shell", "app.agent.mcp -> app.application", "app.agent.mcp -> app.application.configuration", "app.agent.mcp -> app.runtime", @@ -1587,6 +1590,7 @@ "app.agent.prompt -> app.agent", "app.agent.prompt -> app.agent.llm", "app.agent.prompt -> app.agent.llm.capability", + "app.agent.prompt -> app.agent.shell", "app.agent.prompt -> app.runtime", "app.agent.prompt -> app.runtime.log", "app.agent.prompt -> app.runtime.settings", @@ -1705,6 +1709,7 @@ "app.agent.tools.factory -> app.schemas.notification", "app.agent.tools.factory -> app.schemas.types", "app.agent.tools.impl._terminal_session -> app.agent", + "app.agent.tools.impl._terminal_session -> app.agent.shell", "app.agent.tools.impl._terminal_session -> app.agent.tools", "app.agent.tools.impl._terminal_session -> app.agent.tools.impl", "app.agent.tools.impl._terminal_session -> app.agent.tools.impl._command_safety", @@ -1775,6 +1780,7 @@ "app.agent.tools.impl.edit_file -> app.runtime", "app.agent.tools.impl.edit_file -> app.runtime.log", "app.agent.tools.impl.execute_command -> app.agent", + "app.agent.tools.impl.execute_command -> app.agent.shell", "app.agent.tools.impl.execute_command -> app.agent.tools", "app.agent.tools.impl.execute_command -> app.agent.tools.base", "app.agent.tools.impl.execute_command -> app.agent.tools.impl", @@ -1858,6 +1864,7 @@ "app.agent.tools.impl.send_voice_message -> app.schemas", "app.agent.tools.impl.send_voice_message -> app.schemas.message", "app.agent.tools.impl.service -> app.agent", + "app.agent.tools.impl.service -> app.agent.shell", "app.agent.tools.impl.service -> app.agent.tools", "app.agent.tools.impl.service -> app.agent.tools.base", "app.agent.tools.impl.service -> app.agent.tools.tags", @@ -8925,7 +8932,7 @@ "app.workflow.actions.transfer_file -> app.workflow", "app.workflow.actions.transfer_file -> app.workflow.actions" ], - "module_count": 936, + "module_count": 937, "modules": [ "app", "app.adapters", @@ -9025,6 +9032,7 @@ "app.agent.prompt.transfer", "app.agent.runtime", "app.agent.session", + "app.agent.shell", "app.agent.skills", "app.agent.skills.metadata", "app.agent.skills.registry", diff --git a/tests/test_agent_shell.py b/tests/test_agent_shell.py index f6d1f460f..08d93a44a 100644 --- a/tests/test_agent_shell.py +++ b/tests/test_agent_shell.py @@ -340,6 +340,10 @@ def test_audio_ffmpeg_uses_windows_utf8_text_subprocess_kwargs(tmp_path: Path) - provider = OpenAIChatAudioProvider() with ( + patch( + "app.agent.llm.capability.shutil.which", + return_value="/usr/bin/ffmpeg", + ), patch( "app.agent.llm.capability.agent_text_subprocess_kwargs", return_value={