feat(analyst): Implement data analysis agent with authentication and query handling
- Introduced `analyst_auth_adapter.py` for managing authentication context and access control for the data analysis agent. - Added new API endpoints in `analyst.py` for chat, dashboard, asset management, and metrics, utilizing the new authentication context. - Created Pydantic models in `analyst_schemas.py` for request and response structures, ensuring consistent data handling. - Updated SQL guard logic in `sql_guard.py` to enforce access restrictions based on user roles and contexts. - Implemented migration scripts for new database tables related to the data analysis agent, enhancing data management capabilities. - Removed legacy authentication code from `auth.py`, streamlining the authentication process. This update significantly enhances the data analysis capabilities, providing a robust framework for querying and managing data securely.
This commit is contained in:
+14
-3
@@ -5,7 +5,7 @@
|
||||
|
||||
## 进行中
|
||||
|
||||
**前端 P0 主链路真接(2026-09-09)**:ChatPanel · 游客/客户/风控/顾问/分析 Chat · 平台只读页 · 行情 · 风控台账处置 · **730 passed** · **19 Vitest** ✓
|
||||
**前端 P0 主链路真接(2026-09-09)**:ChatPanel · 游客/客户/风控/顾问/分析 Chat · 平台只读页 · 行情 · 风控台账处置 · **773 passed** · **19 Vitest** · **analytics 问数页已接**
|
||||
|
||||
**Redis Docker(2026-09-09)**:`jinrong-redis` @ **6380** · `.env REDIS_URL` 已对齐 · `scripts/dev/start-redis.ps1` ✓
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
- [x] **代销平台 API v0.1 实现**(2026-09-08):`customers/products/advisors/staff/compliance` + `service/platform/` + `PLATFORM_RESPONSE_DESENSITIZE` · **530 passed 0 skipped**
|
||||
- [x] **`web/` P0 脚手架 init**(2026-09-09):Vite+AntD+HashRouter · 登录真接 · AppLayout · 四角色路由 · 占位页 · 见 `web/README.md` · 设计 `docs/superpowers/specs/2026-09-09-frontend-p0-design.md`
|
||||
- [ ] **接口契约发群**(login + 平台读 API + simulate/trade;强调重复功能以平台路径为准)
|
||||
- [ ] **前端 P0 真接**(主链路已完成;余 analytics 问数 · 契约发群 · simulate 说明)
|
||||
- [ ] **前端 P0 真接**(analytics 问数已接 · 契约发群 · simulate 说明)
|
||||
- [ ] 同步 `MEMORY/REQUIREMENTS/FRAMEWORK` 与各 Agent 负责人联调节奏
|
||||
|
||||
### 前端 `web/` · P0 待接(后端已就绪)
|
||||
@@ -32,7 +32,7 @@
|
||||
- [x] **risk 预警台账全页**:`GET /api/risk/alerts` 筛选/分页表格 + `POST .../handle` 处置 UI
|
||||
- [x] **advisor Chat**:SSE + AgentBanner · 名下客户列表页
|
||||
- [x] **`/app/analytics/chat`**:SSE · `X-Agent-Type: analyst`
|
||||
- [ ] **`/app/analytics/query`**:PermissionGate + 问数 Mock/403 展示
|
||||
- [x] **`/app/analytics/query`**:`AnalystQueryPanel` · `POST /api/analyst/chat` · 四角色权限内问数
|
||||
- [ ] **Vitest**:`authStore` · SSE 解析已绿(19 例)· 可补 ChatPanel hook 测试
|
||||
- [ ] **前端 P0 收尾**:接口契约发群 · simulate 交易 Disabled 菜单说明
|
||||
|
||||
@@ -57,6 +57,17 @@
|
||||
- [x] **客服 RAG 接 fin_* 三库**:`VisitorRagService` → `search_cs_knowledge`(`fin_product` / `fin_policy` / `fin_faq`);宿主 Tool 仍走 `kb_product_rules`(T-21)
|
||||
- [x] **tool 层实现 + 种子文档**:`document_parser` / `embedding_tool` / `milvus_tool` + `data/kb_collections/*`(2026-09-09)
|
||||
|
||||
### 数据分析 Agent · S3 接缝(2026-09-09 已接线)
|
||||
|
||||
> 清单:`docs/项目框架设计/数据分析Agent-合并说明.md` · merge `data-analysis-agent-work` · **773 passed**
|
||||
|
||||
- [x] **merge + 接缝**:`analyst_router` · `analyst_auth_adapter` · `analyst_schemas` · 废弃 `utils/auth.py`
|
||||
- [x] **鉴权 G1–G4 + G8**:`assert_analyst_query_access` · customer `self` 域 · 尾注「AI 分析有风险」
|
||||
- [x] **Wave6 测试**:`test_wave6_*` · +43 例
|
||||
- [x] **前端问数页**:`web/src/pages/analytics/AnalystQueryPage.tsx` · `api/analyst.ts`
|
||||
- [x] **迁移 SQL(本机)**:`scripts/agent/migrate-analyst-d07-d11.sql`(三资产表 · 2026-09-09 已执行 · **无种子数据**)
|
||||
- [ ] **Scope B 冒烟**:四 Demo 角色各一条问数(需 MySQL + 可选 DeepSeek Key)
|
||||
|
||||
### 风控 Agent · 后端已就绪 · 前端/运维未接(盘点 2026-09-09)
|
||||
|
||||
**HTTP 接口(后端已实现 · 前端/演示未接)**
|
||||
|
||||
Reference in New Issue
Block a user