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.
This commit is contained in:
2026-09-07 11:15:30 +08:00
parent 1ddd44a6cb
commit 3fb0ceb334
44 changed files with 7479 additions and 250 deletions
+7 -4
View File
@@ -39,7 +39,7 @@
| 代理人助手 Agent | L2 画像、RAG、草稿 | L1 只读、Milvus | 空壳 service |
| 数据分析 Agent | NL→SQL→解读 | Core RO、画像只读 | 空壳 service |
| 风控监测 Agent | 预警、L3、R-02 适当性 | 交易事件、AML 名单 | 空壳 service |
| Core 只读层 | L0 事实查询 | `jinrong_core` | **core_ro.py 已实现** |
| Core 只读层 | L0 查询 + R-02 适当性计算 | `jinrong_core` | **core_ro.py + suitability.py 已实现** |
| 共用底座 | 会话、审计、输入防护 | MySQL 11 表 + Redis | SQL 已定;代码未接 |
| 同步脚本 | 归属、Neo4j | Core → agent / 图库 | **sync_*.py 已实现** |
@@ -52,7 +52,7 @@ api/ → 路由(chat、knowledge、admin);薄,不含业务
service/ → agent_service、rag_service、memory_service 【空壳】
tool/ → document_parser、embedding_tool、milvus_tool 【空壳】
repository/ → core_ro(Core 只读);后续 agent 库 Repository 【core_ro 已实现】
model/ → schemas(Pydantic)、entities(ORM) 【占位】
model/ → suitability(R-02 log 映射);schemas 占位 【suitability 已实现】
config/ → settings、database 【settings 已实现】
utils/ → response、exceptions、logger 【占位】
main.py → FastAPI 入口;当前仅 /health 【部分】
@@ -75,12 +75,15 @@ scripts/dev/ → rbac-seed-reference.md(联调账号)
| 层 | 存储 | 说明 |
| --- | --- | --- |
| L0 | `jinrong_core` 只读 | 正式 C1~C5、持仓、流水(模拟) |
| L1/L2/L3 | MySQL 画像表(agent 库) | 客户/代理人/风控 enrich |
| L0 | `jinrong_core` 只读 | KYC、正式 C1~C5、C×R 矩阵、持仓/产品(对齐客户手册) |
| L1/L2/L3 | MySQL 画像表(agent 库) | 客户/代理人/风控 enrich;**禁止覆盖 L0** |
| 适当性审计 | `risk_suitability_log` | 风控写;客户/代理人读;契约见表设计/07 |
| 会话 | Redis + MySQL | 窗口 + 永久审计 |
| RAG | Milvus + `data/kb/` | kb_product_rules 等 |
| 关系 | Neo4j | 客户-产品-代理人(Core 同步) |
**画像 JSON 约定:** [06-用户画像L1-L3设计.md](../项目框架设计/表设计/06-用户画像L1-L3设计.md)
------
## 5. 骨架一句话