merge(risk-control-agent): fund convert T+1 on merger base (plan A)

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-12 17:52:17 +08:00
co-authored by Cursor
110 changed files with 29829 additions and 168 deletions
+2 -2
View File
@@ -21,14 +21,14 @@
| --- | --- | --- | --- | --- |
| F-01 | JWT + RBAC + 数据归属 | 越权 403 + audit;JWT 手册 §13 | **已完成(T-01,2026-09-07)**:auth_service 验签/吊销 + deps 工厂(Bearer 全环境 + dev debug 头兜底)+ X-Agent-Type 准入矩阵 + 归属断言(B6 已有);越权 403 + audit + input_guard_log 双写 | ~~T-01~~ |
| F-02 | 全量审计留痕 | trace_id 可还原 | **已完成(T-02,2026-09-07)**:http_access 审计中间件 + X-Trace-Id/X-Request-Id 双贯通 + 4xx/500 统一错误体;业务判定审计 B6 已接 | ~~T-02~~ |
| F-03 | 输入防护 | input_guard_log | **完成(2026-09-07,T-03)**:prompt_injection(词表 42 条纯函数检测,命中即拒)/ oversize(4000,Pydantic 硬顶 20000)/ rate_limit(Redis 固定窗口 actor 级 30 次/分 fail-open);chat 链路 blocked 全留痕,fail-fast 不建会话 | — |
| F-03 | 输入防护 | input_guard_log | **完成(2026-09-07,T-03)**:prompt_injection(词表纯函数检测,T-03 初版 42 条、2026-09-09 实测扩至 **45 条** = 18+11+9+7,命中即拒)/ oversize(4000,Pydantic 硬顶 20000)/ rate_limit(Redis 固定窗口 actor 级 30 次/分 fail-open);chat 链路 blocked 全留痕,fail-fast 不建会话 | — |
| F-04 | Core 只读层 | 不改 Core 账;Repository 只 SELECT | **已完成(T-04,2026-09-07)**:core_ro(含风控扩展)经 app/tool/core_tools.py 三只读 Tool 接入 chat(L0/持仓/流水);Tool 层归属校验(A-01 语义:customer 本人/advisor assigned/risk_officer 全量)+ agent_tool_call 全留痕;Core 侧仍仅 SELECT | ~~T-04~~ |
| R0-DB | MySQL 共用 11 表 + Redis | 01-mysql-共用底座.sql | SQL 已定;本机已灌库(B9b 走查验证) | T-05(本机已完成) |
| R0-CORE | Core 模拟 + 同步 | reset.ps1 + sync 脚本 | **脚本已落地** | T-05 |
**F-01 部分完成说明:** B6 已落地 `app/api/deps.py`(AuthContext Pydantic + `get_auth_context()` 工厂,dev 从 `X-Debug-Role`/`X-Debug-Actor` 头构造;T-01 就绪后仅替换工厂内部为 JWT 解析)。
**F-04 完成说明(T-04,2026-09-07):** `app/repository/core_ro.py`(含风控扩展)仅 SELECT 不变;对话接入经 `app/tool/core_tools.py`(query_customer_profile / query_holdings / query_recent_trades,TOOL_REGISTRY 白名单)+ `app/service/tool_service.py`(run_tool:归属校验→执行→agent_tool_call 落库);agent_service 图为 START→tool→llm→guard,customer_id 由会话注入不接受 LLM 生成。风控四 Tool 归 C1 复用同一 runner。
**F-04 完成说明(T-04,2026-09-07):** `app/repository/core_ro.py`(含风控扩展)仅 SELECT 不变;对话接入经 `app/tool/core_tools.py`(query_customer_profile / query_holdings / query_recent_trades,TOOL_REGISTRY 白名单)+ `app/service/tool_service.py`(run_tool:归属校验→执行→agent_tool_call 落库);agent_service 图为 START→tool→llm→guard,customer_id 由会话注入不接受 LLM 生成。风控五 Tool(C1 四只 + C5 追加 query_overdue_alerts,RISK_TOOL_REGISTRY 实 5 个)复用同一 runner。
## Wave 1 · 内部 Agent P0