Commit Graph
63 Commits
Author SHA1 Message Date
zhanghongyu_0626 aa23e1ae1d Merge branch 'data-analysis-agent-work' into merger 2026-09-09 20:53:59 +08:00
zhanghongyu_0626 bf8f271840 feat(redis): Update Redis configuration and enhance compatibility with Docker
- Changed Redis port mapping in `docker-compose.yml` from `6379:6379` to `6380:6379` to avoid conflicts with Windows Redis.
- Updated `.env.example` to reflect the new Redis URL (`redis://127.0.0.1:6380/0`), ensuring proper configuration for Docker users.
- Enhanced Redis client initialization in `database.py` and `redis_gateway.py` to utilize a new `_redis_kwargs` function for improved compatibility with Windows Redis 3.x and Docker Redis 7.
- Added a new PowerShell script `start-redis.ps1` to facilitate starting Redis in Docker, providing a seamless setup experience for developers.

This update significantly improves the Redis integration, ensuring a smoother development process and better compatibility across environments.
2026-09-09 20:19:55 +08:00
zhanghongyu_0626 95969678e2 feat(chat): Implement comprehensive chat functionality for customer and advisor interactions
- Introduced new chat components including `ChatPanel` and `VisitorChatWidget` to facilitate real-time conversations for customers and visitors.
- Developed a robust chat API with endpoints for synchronous and streaming interactions, enhancing user engagement.
- Added new pages for customer interactions, including `CustomerChatPage`, `CustomerProfilePage`, `CustomerHoldingsPage`, and `CustomerTradesPage`, integrating chat capabilities seamlessly.
- Enhanced the advisor experience with the `AdvisorCustomersPage` and `RiskAlertsPage`, allowing for efficient management of customer interactions and risk alerts.
- Updated routing and state management to support new chat functionalities, ensuring a cohesive user experience across the application.

This update significantly improves the chat capabilities within the application, providing users with enhanced tools for communication and support.
2026-09-09 20:17:50 +08:00
zhanghongyu_0626 2945108f66 feat(kb): Enhance knowledge base with new collections and search functionality
- Added new configuration for knowledge base root directory in `.env.example` and `settings.py`.
- Implemented `find_products` method in `CoreReadOnlyRepository` for fuzzy product search based on user queries.
- Introduced `search_cs_knowledge` function in `rag_service.py` to facilitate semantic search across new `fin_*` collections.
- Updated document parsing to support Markdown and YAML front-matter for knowledge base entries.
- Created multiple new FAQ and policy documents in the `data/kb_collections` directory to enrich the knowledge base.

This update significantly improves the knowledge retrieval capabilities for customer service interactions, ensuring more relevant and accurate responses.
2026-09-09 20:00:06 +08:00
zhanghongyu_0626 b841f68295 feat(visitor): Implement visitor chat functionality and enhance customer service interactions
- Added a new visitor chat API endpoint (`/api/chat/visitor`) to allow unauthenticated users to engage in conversations without requiring customer data.
- Introduced a visitor context dependency to manage visitor interactions seamlessly.
- Enhanced the chat API to support explicit session termination and improved response handling for customer service interactions.
- Updated the database configuration to include Redis client support for caching visitor data.
- Added a new customer note repository to persist user notes independently of the L1 profile slots.

This update significantly improves the customer service experience by enabling visitor interactions and ensuring efficient data handling for both registered and unregistered users.
2026-09-09 18:32:00 +08:00
zyi b19a2415f9 feat: 数据分析 Agent 实现(API/服务/表结构元数据/文档/测试)
- 新增 app/api、app/service 数据分析 Agent 全套服务与接口
- schemas.py 重构为 schemas 包(analyst schema)
- 新增 SQL 防注入、guardrail、缓存、字典、LLM 等服务
- 新增 tests 测试套件与 scripts/dev、scripts/setup 脚本
- 补充需求规格、架构说明书、开发清单、表设计等文档
2026-09-09 18:04:45 +08:00
zhanghongyu_0626 ad930c26b1 feat(frontend): Implement initial P0 scaffolding and enhance dashboard features
- Established the P0 scaffolding for the frontend, including login, layout, and routing for four roles.
- Integrated the Customer Wealth Dashboard, Advisor Clients Dashboard, Analyst Market Dashboard, and Risk Alerts Dashboard.
- Updated the API client to support fetching customer and product data, enhancing the overall functionality of the dashboard.
- Added error handling components to improve user experience during data fetching.
- Enhanced charting capabilities using Ant Design Charts for better data visualization.

This update lays the groundwork for further development of the frontend application, ensuring a robust structure for future features and integrations.
2026-09-09 15:50:33 +08:00
zhanghongyu_0626 cbcac98cdd feat(docs): Update API documentation and add new specifications for market data
- Enhanced AGENTS.md to include new draft specifications for market data in Phase B.
- Updated MEMORY.md with details on the C-05 market data source selection and the new API contract for v0.2.
- Introduced a new document for frontend P0 design specifications, outlining the architecture and features for the initial web application.
- Added a new document for C-05 market data source comparison, detailing the requirements and options for future data integration.
- Updated existing API contracts to reflect the latest changes and ensure consistency across documentation.

This update improves the clarity and comprehensiveness of the API documentation, supporting ongoing development efforts and future integrations.
2026-09-09 10:29:08 +08:00
zhanghongyu_0626 c9cac1cdf9 feat(api): 更新代销平台 API v0.1,增强适当性检查功能
- 在 `risk_suitability_log` 表中新增 `check_source` 枚举值 `platform`,支持代销平台的适当性检查。
- 更新相关 SQL 脚本以适应新的数据结构,确保数据一致性。
- 修改文档以反映 API 的最新状态和测试基线,确保文档与实现保持一致。
- 测试基线更新至 530 passed, 0 skipped,确保系统稳定性。

此更新为代销平台提供了更全面的适当性检查能力,提升了系统的功能性与可维护性。
2026-09-08 21:44:16 +08:00
zhanghongyu_0626 ef56c56435 feat(api): 实现代销平台 API v0.1,包括客户、产品、理财师、合规及员工接口
- 新增多个 API 路由:`/api/customers`, `/api/products`, `/api/advisors`, `/api/compliance`, `/api/staff`,支持客户信息、产品详情、理财师客户列表、合规判定及员工上下文查询。
- 引入平台服务层,封装核心只读操作,支持数据脱敏功能。
- 更新依赖注入,确保各 API 路由的权限控制与数据访问一致性。
- 添加相应的单元测试,确保新接口的功能完整性与稳定性。

此更新为代销平台提供了基础的 REST API 支持,增强了系统的可扩展性与可维护性。
2026-09-08 21:01:07 +08:00
zhanghongyu_0626 f0bce1270b feat(api): 添加代销平台 API 契约文档及相关更新
- 新增《接口契约-代销平台API-v0.1.md》,定义代销平台 REST API 的路由风格、命名规范及端点清单。
- 更新 AGENTS.md,包含代销平台 API 契约的路径信息。
- 修改 ITERATION.md 和 MEMORY.md,反映代销平台 API 的实施进度及相关文档的状态。
- 更新 TODO.md,明确代销平台 API 的实现优先级。

此更新为代销平台 API 的开发提供了清晰的指导,确保各模块间的接口一致性与可维护性。
2026-09-08 20:18:00 +08:00
zhanghongyu_0626 f87e11f104 feat(merge): 完成 AL-09 合并接线,整合风控模块与宿主 Wave 0
- 合并 `risk-control-agent` 分支至 `merger`,实现 JWT 统一与模块 API 恢复。
- 更新 `auth_service` 和 `auth_adapter`,确保对外登录/token 统一。
- 增强 chat 模块,支持会话管理与流式对话(SSE)。
- 测试基线更新至 502 passed, 1 skipped,确保系统稳定性。

此更新标志着风控模块的成功集成,提升了系统的整体功能与可维护性。
2026-09-08 20:00:39 +08:00
zhanghongyu_0626andCursor 452b427365 merge: 合并远程 risk-control-agent 到 merger
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-08 17:56:12 +08:00
zhanghongyu_0626 4685dce518 Update README.md to refine project deliverables and clarify document relationships
- Changed section title from "三份交付物" to "交付物" for clarity.
- Added a new document entry for "04-从需求到公共API开发方法.md" detailing the development methodology from requirements to API.
- Enhanced the explanation of the relationships between documents to better illustrate their interconnections and usage contexts.
2026-09-08 17:47:53 +08:00
GaoYiYuan_0626 2d0e2fa0fe docs: README/AGENTS/MEMORY 同步前端接入面(方案 B+C)与 503 基线 2026-09-08 14:29:33 +08:00
GaoYiYuan_0626 458dbdc7a6 docs: 登记方案 C 交付与遗留项 2026-09-08 14:24:08 +08:00
GaoYiYuan_0626 af7ba00327 docs: 同步前端接入方案 B 交付与风险经理对话线口径 2026-09-08 14:08:42 +08:00
GaoYiYuan_0626 96dcec931e docs: 合并注意事项手册(给合并执行人) + 文档口径清理
- 新增《合并注意事项-风控模块并入main.md》:面向合并执行人的 AL-09 操作手册——
  基底锁定(本地 main 3995cb4,origin/main 停在 Initial commit 勿用)/20 冲突文件
  指引裁决表/14 个静默并入文件清单(11 代码+3 测试,双套风险与边界防呆)/三处
  硬伤处置(issuer 不统一/STAFF-90001 必保/infer_roles fail-open P1)/合并后
  必测清单(边界测试→中间件顺序→chat 签名→重灌→全量)/演示库重灌提醒
- TODO/MEMORY 口径落账:接口实调验收通过(2026-09-07 AI 代验:三接口契约+三
  鉴权边界 401/403/403 零偏差,前端未 init 口径为后端接口验证);合并 main
  移交合并执行人;模块侧开放项=actor_id 透传评估+前端入口归属拍板;修正
  AL-09 旧口径(9 文件→实测 20 文件);删重复待办行
2026-09-07 20:52:58 +08:00
GaoYiYuan_0626 cfbd056e32 docs: 统一重构档措辞——验收门改为『合并 main 前交付检查点(非分支开发阻塞)』;同步分支已推送远程 + 本地跟踪已建立 + 领先 origin/main 84/落后 0 2026-09-07 20:27:22 +08:00
GaoYiYuan_0626 1d00e53c8e docs: C4~C6 收尾—挂账 #1~#9 逐项核对结论 + risk-m4 tag 落账同步 2026-09-07 20:07:47 +08:00
zhanghongyu_0626 7d854e03ff Add project management documentation for JinRong financial project
- Introduced three key documents:
  - **01-每日会议纪要模板与流程.md**: A template for daily meeting minutes and processes.
  - **02-项目开发计划.md**: A project-level development plan outlining the project timeline, team roles, and dependencies.
  - **03-表设计文档.md**: A readable table design document serving as a dictionary for understanding database structures and relationships.
- Created a README.md to index project management documents and their purposes.
- Enhanced documentation to support a 5-person full-stack novice team in project execution and collaboration.
2026-09-07 20:04:53 +08:00
GaoYiYuan_0626 323d98bdc2 docs: C4~C6 文档落账同步(勾 TODO/MEMORY/交接文档 + 演示 SOP A-12 + 02-redis-keys C6 联动)
- TODO/MEMORY/交接文档:C4/C5/C6 全部标记完成,基线更新为 482 绿(406+30+17+17+12)
- 演示 SOP 补 A-12 代理人行为链走查步骤(debug 头透传 actor + cron 扫描脚本)
- 02-redis-keys.md §2.6 C6 联动清单(代理人维度独立出单线/推送/去重口径)
2026-09-07 19:57:52 +08:00
GaoYiYuan_0626 90d0660b44 feat: C5 FR-9 预警处置时效升级(RISK-007,P0)
- 仓储:新增 list_pending_alerts_all / update_alert_escalation(统一读改写 payload,
  升级标记独占写入,status/handler_* 列不碰;_parse_alert 补 created_at/handled_at
  字符串→datetime 解析,兼容 sqlite 原生 DDL)
- escalation_service.scan_and_escalate:扫描判级(普通 4h/24h、AML 1h/4h 短通道)、
  幂等闸门(仅升不降)、先持久化再推送、按 (customer_id,level) 降噪合并一次推送、
  通知链累积(L1 含 risk_manager / L2 含 compliance)、逐单+任务级审计
- scripts/cron/escalation_scan.py:15min 定时扫描壳(sys.path 引导 + new_trace + JSON 摘要)
- 对话线 query_overdue_alerts Tool + 注册表 + 意图词(置于 alert_query 之前)+ summarize 分支
- C5 前置:seed STAFF-31001/31002(risk_manager) + deps 矩阵放行 + chat.py 显式 deny +
  risk.py 台账全量只读分支;JWT 手册 §5.3/§5.4/§6.1 增补 risk_manager
- 测试:conftest 回拨 fixture + test_escalation_service(9) + risk_api/manager(5) +
  chat deny(1) + chat_tools overdue(2);全量 470 绿(453+17)
2026-09-07 19:28:04 +08:00
GaoYiYuan_0626 fe4801bc0a feat: C4 FR-8 持仓集中度预警(RISK-006)
依据《实现方案-风控追加需求v1.1-C4C6.md》§2;不改表结构(alert_type/status
复用 payload 承载,audit_log.event_type 为 VARCHAR 可直接扩)。

1. settings.py + .env.example:一次性加齐风控追加 v1.1 共 11 项配置(C4~C6 共用)。
2. core_ro.concentration_profile(customer_id, limit=500):一次 SQL 取明细
   (LIMIT limit+1 探测截断)+ Python 端按 min_risk_code in (R4,R5) 聚合;
   收口挂账 #1(PRD 字面为 list_holdings,改聚合封装,docstring 注明偏离)。
3. rules.py:RULE_SCORES/RULE_ALERT_TYPES 加 RISK-006=60/pattern;RuleHit 加
   alert_subtype;RiskThresholds 加 concentration_threshold 且 from_settings
   必须补读(评审 P1-2:漏读会让 conftest monkeypatch 失效打穿现有断言);
   新增纯函数 rule_concentration——空仓不触发、截断视同达标(保守告警)、
   阈值边界 79.9% 不触发 / 80% 触发、R4+R5 为 0 不触发。
4. engine.process_trade_event:run_rules 之后、record_trade_alerts 之前并入
   集中度命中(不动 run_rules 签名);命中后 L3 打 high_risk_concentration
   标签 + 写 risk_concentration 审计(金额只落合计与前 5 条摘要)。
5. risk_repository:find_pending_event_alert 改候选 LIMIT 50 + Python 过滤掉
   payload.alert_subtype 含 agent_behavior 的单(评审 P0-1:代理人维度行为链单
   不得充当客户维度事件单的聚合锚点);append_alert_event 加 extra_subtypes
   合并进 payload.alert_subtype(不传时行为与原先一致,向后兼容)。
6. alert_service:subtypes 集合维护(空集不注入 payload,评审 P2-3);
   追加时 alert_type 按「老单规则 ∪ 本批规则」重算(评审 P1-3,修掉既有
   large_amount 单被本批仅 RISK-006(60) 翻转为 pattern 的缺陷);
   _publish_alert 加 notify_role/extra 可选参数(C5/C6 复用)。
7. 对话线:chat_tools.customer_context 加 profile(concentration_ratio/
   r45_value/total_value/holdings_truncated),tool_service.summarize 加
   「高风险持仓占比 X%(仅供参考)」;不新增意图词。
8. 02-redis-keys.md 增补 alert_subtype / escalation_level 附加推送字段。

测试:conftest 加 autouse _disable_concentration_rule(阈值推 1.01 做回归隔离,
现有用例断言零改动);test_risk_rules 加 RISK-006 纯函数 6 例;新建
tests/test_concentration_c4.py 11 例(与 RISK-001 同单聚合、score max=70、
L3 tag、risk_concentration 审计、仅集中度也出单、subtype 合并、P0-1 回归、
alert_type 不翻转、对话线 ratio)。全量 453 绿(436 + 17)。
2026-09-07 19:05:02 +08:00
GaoYiYuan_0626 8c226f0c6d chore: 风控Agent模块自治边界标注 + AL-09 合并预处置
背景:远端 main 新提交 3995cb4(09-07 17:20,交接文档漏记)为 Wave 0 鉴权/
chat/防护平行实现,与已完工 T-01/T-02/T-03/T-06 同名不同路径;试合并实测
20 文件冲突(原记 9 个),另有 13 个 main 新增文件不报冲突会静默并入。
拍板:风控 Agent 按独立封装模块自治,与宿主耦合收敛到 4 个接缝。

1. 《风控Agent模块边界与合并接缝标注》入库存档:A~D 四类文件归属表;
   4 接缝(S1 挂载点 main.py / S2 AuthContext / S3 settings / S4 引擎工厂);
   20 冲突文件逐个裁决(core_ro、model/suitability、conftest、02-seed-base
   以模块版为准;chat/main/settings/agent_service 等公共层以 main 为主);
   三处硬伤处置:issuer 不一致改为适配器映射不统一、STAFF-90001 必保、
   main infer_roles 未知 actor 默认 analyst(fail-open)记宿主侧 P1。
2. app/api/auth_adapter.py:S2 接缝适配器预制件(当前未接线,AL-09 接入)。
   鸭子类型读宿主 ctx 故不依赖宿主文件;sub→actor_id、trace_id→contextvar、
   perm_matches 兼容宿主 `前缀:*` 通配;缺主体即 HostAuthAdapterError,
   fail-closed 不静默降级。
3. tests/test_module_boundary.py:边界防呆 4 类断言——模块私有文件存在、
   禁止跨层 import 宿主私有实现(gateway.*/config.database/middleware.*/
   utils.input_guard/model.schemas)、AuthContext 契约完整(actor_id 与
   has_role 多参)、settings 私有字段与 AGENT_TYPES 四值不漂移。
4. tests/test_auth_adapter.py:适配器 11 例(映射/回退/fail-closed/trace 绑定/通配)。

基线:406 → 436 全绿(演示库已按演练 SOP §2 重灌:AML 8 条 / 演示 7 行 / sync 33 rows)。
2026-09-07 18:28:18 +08:00
GaoYiYuan_0626 1ac331b281 docs: 阶段一 AL-01~08 完成落账 + 文档同步——六件套反映换核完成(406 绿基线 425→406/SUIT-001~008 退役改 core_ro.check_suitability C×R 矩阵+JR-AST/FM 契约/risk_suitability_log 21 列/种子 33 客户 14 产品/risk-m1 已补打指向 3c07de6);TODO 进行中改阶段一验收门(唯一卡点=用户目视确认)+AL-09/10/11 待办;ITERATION 追加阶段一完成行;REQUIREMENTS R-02 换核标注;开发计划 M1 改已补打;入库存档《修改报告-对齐main基准.md》(阶段一执行依据)与《实现方案-风控追加需求v1.1-C4C6.md》(阶段二编码依据);吸收上会话遗留同步(分支口径 risk-control-agent/PRD v1.1 冻结标注/T-21 评审闭环/T-03/C1~C3 落账/交接文档指引) 2026-09-07 18:01:16 +08:00
GaoYiYuan_0626 b5fd52ef02 AL-08: 演示库重灌与种子核对对齐 main 基准——prepare_risk_demo.sql 改写 expires_at 口径(演示客户刷新为测评 90 天前/剩余 275 天,CUST-1004 保持过期演示 FM-03,替代 SUIT-008 evaluated_at+365 旧写法);演示 SOP 同步(§2 完成标志 33 客户口径+expires_at 剩余天数,A-1 预期改 SUIT_RISK_MISMATCH,A-2 改 FM-01 SUIT_AGE_CONFIRM 网点确认);网关阻断响应补全 main 契约字段(match_result/mismatch_type/requires_disclosure/needs_branch_confirm/rule_refs)+audit detail 加 block_response_code;集成测试 4 例旧口径断言更新(A-1 trace 一致性断机器码/A-1 audit JSON 断机器码/A-2 重写为 FM-01 语义/settings 退役断言)。SOP §2 脚本化全量重灌双库验证通过(AML 8 条/演示 7 行/sync 33 rows);全量 406 passed 0 failed 0 skipped(集成测试真库走 21 列新表+expires_at 数据恢复执行) 2026-09-07 17:49:39 +08:00
GaoYiYuan_0626 e99ec6775a AL-02: risk_suitability_log 重建 21 列对齐 main 基准——底座 SQL 采纳 main 版(product_name/investor_category/match_result 五值/mismatch_type 七值/requires_disclosure/needs_branch_confirm/risk_was_expired/block_response_code/check_source 四值/actor_id/rule_refs JSON + 6 索引);07-说明.md 直接采用 main 版 P0 契约;tests/_ddl.py sqlite 同步(21 列 + core_suitability_rule 新表 + core_customer/core_customer_risk/core_product 扩列,VARCHAR 近似 ENUM 与现有风格一致);修 test_risk_api 位置式 INSERT 补列名。全列 INSERT 验收通过;剩余 15 failed 均为旧契约断言(报告预告作废集,AL-05/06/07 清零) 2026-09-07 17:05:15 +08:00
zyiandCursor fd9464db0a Append Zhong Zhichao data-analyst work notes to user story doc.
EOF

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-07 16:06:18 +08:00
GaoYiYuan_0626 eae28bee4e docs: PRD/规则表/开发计划合并需求追加 v1.1 修订 2026-09-07 12:46:59 +08:00
zhangyong 5f0f86a007 Merge branch 'main' of http://47.106.207.27:3000/hongzhangyu/XingHuo 2026-09-07 12:15:59 +08:00
zhangyong a9521bcc62 docs(用户手册): 补充11到16条用户咨询需求
新增了包括风险对冲咨询、账户定期体检、税务筹划、财产隔离、定制生活服务以及反共识独立判断在内的6项用户需求条目
2026-09-07 12:15:20 +08:00
GaoYiYuan_0626 8fbbca6bb2 docs: T-21 文档同步——TODO 勾选(完成详情+三坑收口)/MEMORY 交接清单与仓库地图/FLOW milvus_tool 状态改已做; 下一项=前端 React 入口 2026-09-07 12:12:36 +08:00
zhanghongyu_0626 2c5440b8b0 Update ENVIRONMENT and ITERATION documentation; add industry background and role research
- Enhanced `ENVIRONMENT.md` with a new section on platform positioning and industry context, detailing the project's role as a comprehensive wealth management institution.
- Updated the service roles table to include insights from the four-role industry research.
- Added new files for "平台与行业背景" and "四角色行业调研" to provide detailed context and operational insights for the project's agents.
- Revised `ITERATION.md` to reflect the addition of these new documents and their relevance to user requirements.
2026-09-07 11:53:38 +08:00
GaoYiYuan_0626 5f32dd349c docs: T-03 文档同步(378 绿, 评审 PASS with findings P0=0)——TODO 勾选 + MEMORY/FRAMEWORK/REQUIREMENTS F-03 状态改为完成 + 下一步 T-21/前端 2026-09-07 11:18:28 +08:00
zhanghongyu_0626 3fb0ceb334 Enhance suitability assessment and documentation
- Implemented `check_suitability` method in `CoreReadOnlyRepository` for suitability determination based on customer and product risk levels.
- Added `build_suitability_log_row` function in `suitability.py` for mapping suitability check results to `risk_suitability_log`.
- Updated `AGENTS.md`, `ENVIRONMENT.md`, and `FLOW.md` to reflect changes in suitability assessment processes and documentation.
- Revised `FRAMEWORK.md` and `MEMORY.md` to clarify project structure and data flow related to suitability checks.
- Expanded `TODO.md` with tasks related to logging and auditing suitability assessments.
2026-09-07 11:15:30 +08:00
GaoYiYuan_0626 e5937d6ac9 docs: 阶段C 文档同步(345 绿, tag risk-m3, 独立评审 PASS P0=0)
- docs/memory/TODO.md: 勾选风控阶段 C 完结(C0~C3)
- docs/memory/MEMORY.md: §0/§1/仓库地图更新至阶段 C 收尾 + 下一步 T-21/T-03/前端
- .gitignore: 正式忽略交接文档.md 与 .workbuddy/(过程文件不提交约定)
2026-09-07 10:36:51 +08:00
GaoYiYuan_0626 397c0b2092 docs: 同步交接文档至 T-04 复审闭环(321 绿) + MEMORY/FLOW/TODO 测试数 297→321 + T-04 评审闭环状态 2026-09-07 09:59:37 +08:00
GaoYiYuan_0626 301c78edc3 feat: T-04 Core RO Tool 节点——chat Tool 接入+归属校验+agent_tool_call 落库
- app/tool/core_tools.py: 三只读 Tool(query_customer_profile/holdings/recent_trades, Core RO 仅 SELECT) + TOOL_REGISTRY 白名单(requires_customer); JSON 安全化(Decimal 两位/时间 isoformat)
- app/service/tool_service.py: match_intent 关键词意图(仅 customer/advisor; risk/analyst 空转归 C1/C2) + assert_tool_access 归属断言(customer 本人/advisor assigned/risk_officer 全量/其余拒, 口径对齐 deps.assert_customer_access) + run_tool 编排(白名单→校验→执行→agent_tool_call 落库, 落库失败降级 warning)
- agent_service: 图 START→tool→llm→guard; Tool 结果注入 LLM 上下文(SystemMessage); 降级回复带 Tool 摘要; chat() 可选 session 上下文(缺省空转, T-07 兼容)
- session_repository: insert_tool_call(message_id 一期 NULL, session_id+trace_id 可还原)
- 归属拒绝口径: Tool 层不抛 403 改 blocked 留痕(AUTH_403_* 同码), 对话内呈现——API 层 deny 铁律不变
- tests: test_chat_tools 20 例(三态+落库字段+降级+图注入) + test_chat 4 例(全链路/JWT 外 debug 通道), _ddl 补 agent_tool_call/core_holding, 297 绿
- 真库冒烟: uvicorn+真 MySQL/Redis chat 触发持仓查询 success 落痕 47ms, 现场已清理
2026-09-07 08:43:36 +08:00
GaoYiYuan_0626 3c3ce4e5d6 docs: 交接文档增量同步——演示库状态更新(已按 SOP 重灌+冒烟清理, pytest 可直接跑, 走查后需再重灌) + FLOW 尾注补 python-jose 漏装坑(与 redis 包同类, 附 import 自检命令) + JWT 默认密钥 warning 属预期/DEEPSEEK 空 chat 降级入本机状态 + AGENTS.md 代码入口刷新(main 全路由/鉴权工厂/Auth SDK/StateGraph) 2026-09-07 08:15:50 +08:00
GaoYiYuan_0626 b97e77747a docs: M2 收尾复核闭环(M4)+Wave 0 状态同步——M4 复核记录(任务映射/T-30~T-32 边界收口/成功体不包裹演进口径维持/agent_message.trace_id 请求级口径/会话枚举取舍登记), TODO(T-01/T-02/T-06/T-07 勾选+T-30~T-32 收口), MEMORY(§0 进度/仓库地图/下一步/273 绿), FLOW(§0 JWT 已做/§1 链路/§2 对话主链路状态), FRAMEWORK(能力模块+分层), REQUIREMENTS(F-01/F-02 完成/F-03 部分), 开发计划头注, 演示 SOP 补 JWT 通道签发演示 2026-09-07 03:08:27 +08:00
GaoYiYuan_0626 725a38d203 docs: 交接文档 B9b 后同步——MEMORY §0 补演示库走查残留警告(pytest 集成防护 fail 属预期, 先按 SOP 重灌)+B9b 评审闭环+阶段优先级改 Wave 0+文档资产表加演示 SOP, FLOW §0 状态行与本机 pytest 表述限定, 测试数统一 209 2026-09-07 02:04:32 +08:00
GaoYiYuan_0626 539d4915d7 fix: B9b 复审闭环——P2-1 SOP 交互重灌补 DROP jinrong_agent(reset.ps1 只重建 core+裸 CREATE TABLE 会 1050 中止); P2-2 补做 T-31 名下 P2-8 手工 SQL 对照收口(4 组合真库 SQL 推导与函数判定一致, 登记 SOP 核查单附行); P2-3 SOP 走查范围与 11/11 口径统一(A-6 归 M3/A-8 映射交代); P3: A-4/A-9 COUNT 当日窗+已处置单幂等用例+suitability/check 阻断响应补 G-08 两要素(advice/notice)+记忆文档数字同步; 留痕 scan_all 幂等读后写无锁取舍; 209 绿 2026-09-07 01:59:15 +08:00
GaoYiYuan_0626 03d77b9451 feat: B9b 演示走查——核查单收口: ①预警类 API 固定 disclaimer(alerts/handle/aml-scan) ②aml/scan 幂等防护(find_recent_aml_alert 同客户当日已有 aml 单不出单+skipped_existing) ⑥集成测试前置断言(A-1/A-3/A-4 清洁检查 fail+重灌提示, A-5 按 trade_id 定位); 演示 SOP 落地(脚本化重灌 MYSQL_PWD 方式); 真服务走查 A-1~A-5/A-7/A-9+核查单①②④⑤ 11/11 PASS(核查单⑥防护现场复现), 208 绿; M2 达成 2026-09-07 01:36:44 +08:00
GaoYiYuan_0626 e62fb1d291 fix: B9a 复审闭环——P2-1 skipped 分支 has_engine_error_audit 中间态警示(input_summary LIKE)+docstring 局限声明; P2-2 非首笔 trade 幂等用例; P3 顺手: 双脚本连接自检/ImportError 分支/非 dict payload raw 兜底/get_trade_by_id confirmed 过滤/勿并行声明, 8 例 204 绿, warning 路径真库复验后清理; docs 同步复审结论 2026-09-07 01:02:12 +08:00
GaoYiYuan_0626 fdf487dc32 feat: B9a 演示/运维脚本——subscribe_alerts(risk:pub:alert 订阅演示/连接自检/--duration) + rebuild_alerts(按 trade_id 幂等重放: find_alerts_by_trade payload LIKE 查已入单防重复出单与重复 append, 含 aml/已处置单) + core_ro.get_trade_by_id 只读扩展 + test_demo_scripts 5 例, 201 绿; 真库手工验证(出单→幂等 skip→missing exit1; 订阅端到端 trace 贯通)后现场清理; docs 同步(TODO/MEMORY/FLOW/开发计划) 2026-09-07 00:43:25 +08:00
GaoYiYuan_0626 be44d569a4 docs: 交接文档 B8 后全面同步——MEMORY 进度/B7·B8 复审闭环/196 绿/bootstrap 本机就位注记, FLOW §0 补本机状态与已知坑(mysql.exe 路径/reset.ps1 交互卡死), TODO 进行中改 B9a 2026-09-07 00:01:52 +08:00
GaoYiYuan_0626 516b1132a3 fix: B8 复审 P1-1——conftest except pytest.SkipRequested 引用不存在属性致 skip 路径炸收集(删, Skipped 继承 BaseException 直传, 错密码故障注入验证 skip 不 error); P3 顺手: teardown l3_snapshot 哨兵 + A-1 补 trace 响应头/suitability_log 两环; P2-1 演示库耦合前置断言挂 B9b 核查单⑥ 2026-09-06 23:52:59 +08:00
GaoYiYuan_0626 c6ad0885d3 test: B8 收敛——sqlite 测试 DDL 单一事实源 _ddl.py(10 文件 45 处手写 DDL 清零)+localtime 时区收敛(B5 评审 P3-4, utcnow 边界修复)+测试内遗留建表清理, 196 绿; docs 同步 B8 完成状态 2026-09-06 23:37:03 +08:00
GaoYiYuan_0626 fe29b736ea fix: B7 复审 P1-1——dispose_engines 显式 Engine.dispose()(手写单例字典替代 lru_cache, test_db 3 例, 独立评审有条件通过→闭环) 2026-09-06 23:06:32 +08:00