fix(architecture): record agent sanitizer edge

This commit is contained in:
jxxghp
2026-09-01 12:15:58 +08:00
parent 449ef4b8df
commit 5948684d6d
4 changed files with 7 additions and 5 deletions

View File

@@ -755,7 +755,7 @@ flowchart LR
| 指标 | 当前值 |
|---|---:|
| Python 模块 | 919 |
| 内部导入边 | 7,688 |
| 内部导入边 | 7,689 |
| 非平凡 SCC | 1(精确 containment 的 TMDB 移植包环) |
| Application / Chain 具体 Adapter 直连 | 0 / 0 |
| Direct egress | 53(债务已清零,53 条精确 containment) |

View File

@@ -40,7 +40,7 @@
| 下载器/媒体服务器 | 依赖内置低层 Agent 工具或有限 REST operation | downloader-operation 与 mediaserver-operation Skill 通过固定脚本调用已配置 provider API |
| MCP/HTTP 工具管理 | 存在旧业务工具与同名 first-wins 选择空间 | 与主 Agent 共用严格唯一新目录;重名直接以 TOOL_IDENTITY_AMBIGUOUS 失败 |
| 退役代码 | 旧实现仍位于 app/agent/tools/impl | 77 个退役文件已直接删除,其中 72 个工具模块、5 个辅助模块 |
| 架构图 | 982 个宿主模块、8,430 条内部依赖边 | 919 个宿主模块、7,688 条内部依赖边,Application/Chain 具体 Adapter 直连仍为 0 |
| 架构图 | 982 个宿主模块、8,430 条内部依赖边 | 919 个宿主模块、7,689 条内部依赖边,Application/Chain 具体 Adapter 直连仍为 0 |
| 工作区状态 | 基线提交 871632af,与 origin/v3 对齐,初始工作区干净 | L1-L10 已完成并通过远端 CI;2026-09-01 继续修复集合总数在大结果截断预览中不可见的问题 |
## 3. 目标工具分层
@@ -371,6 +371,7 @@ action,并使用 MoviePilot 已配置的具体服务实例访问其自身 API
- 旧领域工具各自通过 `get_tool_message()` 展示目标和主要参数;收敛为 `moviepilot_api` 后,该方法只展示 `operation_id`,导致 Web Agent 与通知渠道在啰嗦模式下失去 `path_params`、`query` 和 `body` 的调用上下文
- `moviepilot_api` 现按路径、查询、请求体顺序生成最多 320 字符的主要参数摘要;空参数桶不展示,工具执行与 API 输入结构保持不变
- 参数摘要统一复用宿主递归脱敏器,设置凭据、密码、Cookie、Token 与 API key 等仅显示 `***`,避免为了恢复可观察性而泄露敏感输入
- 复用脱敏器新增 1 条 Agent 同域内部依赖边,宿主架构快照由 7,688 更新为 7,689;模块总数和跨层边界均未变化
- 新增 Web Agent 实际流式回调回归和设置凭据脱敏回归;扩展 Agent/API/流式专项 `487 passed`,完整锁定测试 4 个分片分别为 `1620 passed, 3 skipped`、`1860 passed, 4 skipped`、`1917 passed`、`2253 passed, 2 skipped`,合计 `7650 passed, 9 skipped`;Ruff、Pylint `10.00/10` 和全量 mypy ratchet 均通过
本文件作为本次重构的持续记录,保留阶段状态、实际变更、验证结果、提交状态与已知基线边界。

View File

@@ -94,7 +94,7 @@ ARCH-201 至 ARCH-204 均达到实现、验证、提交、推送和远端门禁
| 指标 | 当前值 | 解释 |
|---|---:|---|
| 宿主 Python 模块 / 内部依赖边 | 919 / 7,688 | `dependency-baseline.json` 当前快照 |
| 宿主 Python 模块 / 内部依赖边 | 919 / 7,689 | `dependency-baseline.json` 当前快照 |
| 非平凡 SCC | 1 | 仅保留精确 containment 的 29 模块 TMDB 移植包环 |
| 跨层 DB 边界债务 | 0 | Application、Chain、API、Agent、Runtime、Workflow 到 DB 的受控债务均为零 |
| Model/Oper 事务债务 | 0 | 自建 Session、自动事务装饰器、直接 commit/rollback 等基线均为零 |

View File

@@ -1089,8 +1089,8 @@
"runtime_only": true
}
},
"edge_count": 7688,
"edge_sha256": "3fd19c9e83839d9fca024010ca2826658af311b1d8cc5f19c8539c259da4f7ec",
"edge_count": 7689,
"edge_sha256": "4081c9ea853f12166316c5cb0def8a745399fe3dac1d90c0aedc1086f3c301f1",
"edges": [
"app -> app.foundation",
"app -> app.foundation.environment",
@@ -1726,6 +1726,7 @@
"app.agent.tools.impl.api -> app.agent.policy",
"app.agent.tools.impl.api -> app.agent.policy.api",
"app.agent.tools.impl.api -> app.agent.policy.contracts",
"app.agent.tools.impl.api -> app.agent.policy.sanitizer",
"app.agent.tools.impl.api -> app.agent.tools",
"app.agent.tools.impl.api -> app.agent.tools.base",
"app.agent.tools.impl.api -> app.agent.tools.tags",