feat(tests): Conduct fourth round of end-to-end testing for customer trade functionality

- Completed 203 test cases with 162 passing, 6 failing, and 2 skipped, identifying 2 critical defects (P0: authentication privilege escalation, P1: suitability disclosure not enforced).
- Enhanced test coverage by verifying front-end rendering values against back-end raw responses, addressing previous gaps in validation.
- Documented findings and defects in the new test log and README files, ensuring clarity on test outcomes and areas for improvement.
- Updated the TODO list to reflect the current state of defects and testing priorities, emphasizing the need for immediate attention to identified issues.

This round of testing significantly improves the robustness of the customer trade functionality, ensuring compliance and security standards are met.
This commit is contained in:
2026-09-13 18:51:52 +08:00
parent 647c07062e
commit 02a4f35c79
22 changed files with 3022 additions and 149 deletions
+9 -2
View File
@@ -9,7 +9,14 @@
**项目是什么:** 金融四 Agent(客户财富 / 代理人 / 数据分析 / 风控)共用数据层与合规底座;**不**互调 LLM,跨 Agent 走 L1/L2/L3 画像与预警表。
**当前进度:** 需求与表设计已定 · **926 pytest passed**(全量 · **65 failed** 均为顾问 `test_sprint*` 集成)· **896 passed**(排除 `test_sprint*` · 仅 **`test_agent_kb_eval`** 红)· **27 Vitest** · **Redis @ 6380** · **`merger` 未 commit** · **前端设计栈补强未 commit(2026-09-13:Inter 自托管 + Radix 状态阶)** · **客户线交易 + 选购清单 + 持仓快照/行情快捷交易未 commit(2026-09-13)** · **顾问线已 fast-forward 合入 `merger`** · **端到端第三轮(真浏览器 + 真 HTTP)174 用例 161 PASS / 12 FAIL / 1 SKIP → 6 缺陷待修**([FE-001](tests/2026-09-12-agent-frontend-e2e/TEST-LOG-2026-09-12-FE-001.md) · **D1 已关闭** ✅ · D2 KYC `created_at` · D3 Milvus 集合 `released` · **F1 转换页预置跨主体必失败** · **F2 `alert_id`/`alert_ids` 字段名不匹配** · **F3 无路由级角色守卫** · **F4 确认日默认越界**)
**当前进度:** 需求与表设计已定 · **926 pytest passed**(全量 · **65 failed** 均为顾问 `test_sprint*` 集成)· **896 passed**(排除 `test_sprint*` · 仅 **`test_agent_kb_eval`** 红)· **27 Vitest** · **Redis @ 6380** · **`merger` 未 commit** · **前端设计栈补强未 commit(2026-09-13:Inter 自托管 + Radix 状态阶)** · **客户线交易 + 选购清单 + 持仓快照/行情快捷交易未 commit(2026-09-13)** · **顾问线已 fast-forward 合入 `merger`** · **端到端第三轮(真浏览器 + 真 HTTP)174 用例 161 PASS / 12 FAIL / 1 SKIP → 6 缺陷待修**([FE-001](tests/2026-09-12-agent-frontend-e2e/TEST-LOG-2026-09-12-FE-001.md) · **D1 已关闭** ✅ · D2 KYC `created_at` · D3 Milvus 集合 `released` · ~~F1 转换页预置跨主体必失败~~ ✅ **第四轮复跑已转绿** · ~~F2 `alert_id`/`alert_ids` 字段名不匹配~~ ✅ **已转绿** · ~~F3 无路由级角色守卫~~ ✅ **已转绿** · F4 确认日默认越界)
**端到端第四轮(客户线交易 · 真浏览器 + 真 HTTP + 真库对账)203 用例 162 PASS / 6 FAIL / 2 SKIP → 2 缺陷**([CT-001](tests/2026-09-13-customer-trade-e2e/TEST-LOG-2026-09-13-CT-001.md) · **未修,只报告**)
- ❌ **P0 `/api/auth/login` 无条件信任调用方传入的 `roles`** —— `jwt_service.py:118-120` 首行 `if roles: return roles` + `auth.py` 无 env 门禁:dev 下可自造任意角色 token(`STAFF-99999` 实测提权成功并代客下单落库)。生产 RS256 会拒,**但演示环境即 dev**
- ❌ **P1 R4「需揭示」在交易网关被静默放行** —— `trade_gateway.py:534` 适当性字段只在 `blocked` 分支返回,`allowed_with_disclosure` 丢失 `requires_disclosure`;**申购(CT4-01/02)与转换(CT7-07)两通道同根因**。前端 `tradeEligibility`、对话清单、products API **三处都已判 R4 不可自助** ⇒ 单点实现缺失
- ⚠️ **赎回写路径整组未覆盖** —— CT6 因库内 T+2 可用份额 `15000 < 申报 35000` 提前 `return`,FIFO/费率/超份额断言**一条未跑**(脚本降级 SKIP 而非假 PASS 是正确的)
- ✅ 本轮补上的口径:前端渲染值首次与后端 raw **核对到分**(总资产 Δ 恰为提交金额 · 明细行文本对齐 · `jr:trade-completed` 派发/不派发可区分)
- ✅ 数据副作用已完全回滚:5 张写表 `95/59/73/19/0` 精确回到首值,既有手工演示态未误伤
**工作分支:** 主线 **`merger`**(已纳入顾问线 + 基金转换线 · HEAD **`c09b987`**);保留 **`integrate/advisor-agent`** 作历史指针;历史 `risk-control-agent` 交付冻结。
@@ -128,7 +135,7 @@
- **名称:** JinRong 金融四 Agent 智能管家
- **当前阶段:** **代销平台 v0.1 + AL-09 + 客服 Wave3 + 客户交易/选购清单(2026-09-13)+ 问数 D-06/D-11 + 投资顾问 Agent 接缝(2026-09-12)**
- **当前优先级:** 客户交易本机验收 · **修 F1/F2** · merger commit(含未提交客户线/字体栈)· battery · sprint pytest
- **当前优先级:** **修 P0 鉴权提权 + P1 R4 需揭示**(第四轮 [CT-001](tests/2026-09-13-customer-trade-e2e/TEST-LOG-2026-09-13-CT-001.md) 上报)· 补 CT6 赎回覆盖 · merger commit(含未提交客户线/字体栈)· battery · sprint pytest
------