Commit Graph
146 Commits
Author SHA1 Message Date
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 61711cb70a fix: Wave 0 独立 AI 评审闭环(有条件通过→闭环, 273 绿)——P2-1 python-jose>=3.5.0(防 CVE-2024-33663/33664) P2-2 audit 降级+OPTIONS 测试 P2-3 JWT 通道 chat 3 例 P2-4 debug 兜底双闸门(dev+无 RS256 公钥) P2-5 留痕失败降级显式化(401/403 拒绝语义不漂移, _safe_unauth_audit 保护 repo 构造); P3 顺手: 401 归 platform/值域外 400 补留痕/Bearer 大小写不敏感/jti 加 uuid/CLI permissions+exp 上限/dev 默认密钥 warning/LLM 单例加锁/chat 主角色优先序+message strip+guard 日志脱敏/必填 claims 参数化+none 算法固化; P3 登记项(会话枚举/seq_no 锁/trace_id 口径/文档同步)归 M4 文档 2026-09-07 03:03:12 +08:00
GaoYiYuan_0626 ee5c78af66 feat: T-06 chat 最小闭环——api/chat(X-Agent-Type 分流+准入矩阵+customer 归属固定本人/advisor G-01 归属校验+SessionGuard actor/agent 一致+closed 409) + session_repository(agent_session/agent_message, 派生表补 alias 修 MySQL 1248) + memory_service(Redis 窗口 sess:{agent}:{id}:msgs TTL2h N20, miss/异常回源 MySQL) + main 挂载 + tests/test_chat 12 例, 260 绿 2026-09-07 02:41:42 +08:00
GaoYiYuan_0626 fb18c04a8a feat: T-07 LangGraph StateGraph 骨架——compose(system 四 Agent 边界 prompt)→llm(DeepSeek/langchain-openai, 无 key 降级)→guard(customer/risk 免责声明+has_disclaimer, 未知类型 fail-safe 最严口径) + chat() 入口 + 图/LLM 单例缓存与测试隔离出口 + tests/test_agent_service 8 例(mock LLM 不依赖外网) 2026-09-07 02:34:57 +08:00
GaoYiYuan_0626 3cec034026 feat: T-02 审计中间件——http_access 全量访问审计(auth 注入 request.state, 排障路径跳过, 写库失败降级) + 独立 request_id(X-Request-Id 白名单透传贯通, B7 复审 P3-4) + 422/404/405/500 统一错误体(500 由 trace 中间件兜底生成并回写 trace 头, B7 复审 P2-2) + input_guard_log 双写(deps 401/403 留痕, platform 网关跳过 ENUM 口径, 挂账⑧收口) + repo.insert_input_guard_log + tests/test_audit_middleware 12 例, 240 绿 2026-09-07 02:32:03 +08:00
GaoYiYuan_0626 36f476f450 feat: T-01 JWT 鉴权——auth_service(Auth SDK: HS256/RS256 验签+必填claims显式校验+jti吊销 fail-open) + deps 工厂替换(Bearer 全环境, debug 头降级 dev 兜底) + X-Agent-Type 交叉校验(手册§4.6/§5.4 准入矩阵) + issue_dev_token CLI + redis_gateway exists/set_ex + lifespan 改验 jwt_ready + tests/test_auth_jwt 18 例, 228 绿 2026-09-07 02:23:33 +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 e7bd8880e2 test: B8 主体——conftest(演示数据校验/幂等代跑/TRD-TEST- teardown)+集成测试 A-1~A-5/A-7/A-9+trace一致性+审计JSON(11例)+_ddl.py 单一事实源+L3 DEL 行为断言(B7复审P2-1)+locks 文案中性化(P3-2), 196 绿 2026-09-06 23:27:37 +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
GaoYiYuan_0626 429e2f9e38 docs: 交接文档 B7 后全面同步——MEMORY bootstrap 补风控步骤/文档索引补 PRD 与开发计划/验证门闸补 pytest, ENVIRONMENT 对齐 R-02 已实现 2026-09-06 21:47:54 +08:00
GaoYiYuan_0626 5c83cda10a docs: L3 锁外 DEL 竞态窗口留痕(一期无读路径无影响,对话线接缓存时改双删, B7 自查) 2026-09-06 21:14:06 +08:00
GaoYiYuan_0626 6195349dd6 feat: main 集成(路由挂载/trace 中间件/lifespan) + B7 挂账收口(引擎工厂/统一错误体/锁公共化/L3 缓存 DEL/死代码清理/处置原子事务/启动期 debug 校验, B7) 2026-09-06 20:48:50 +08:00
GaoYiYuan_0626 a78e9d4d31 fix: B6 复审收口——测试 Redis 隔离/网关审计口径 platform/死常量清理/回归断言补强
- P2: test_risk_api env 注入 FakePublisher,aml 推送不触真 Redis
- P3: deny/_authz_audit 增 agent_type 参数,simulate 越权审计传 platform
  (与网关放行审计同口径);删 HANDLE_RESULTS 死常量(Literal 单处定义)
- P3: 补 start_date/end_date 过滤+分页 422 边界+suitability api 层审计断言;
  补 app/service/risk/__init__.py
- 挂账: B7 行新增④项(启动期拒绝/引擎工厂覆盖三实例化点/handle 原子性/
  input_guard_log);B9b 行核查单(disclaimer/scan 幂等/Swagger 手测/analyst);
  TODO.md T-30/T-31/T-32 进度同步
2026-09-06 19:21:15 +08:00
GaoYiYuan_0626 3e40a2bb49 fix: B6 评审修复——鉴权审计统一 deny/401 留痕、start_date/end_date 对齐 PRD、simulate 回挂鉴权、异常与审计注入收敛
- P1-1: 403/401 全部经 deps.deny/_authz_audit 留痕(event_type='authz')
- P2-1: GET /alerts 参数名 start_date/end_date 对齐 PRD;page/page_size 用 fastapi.Query
- P2-2: /api/simulate/trade 回挂 get_auth_context(risk_demo 或本人),越权 403+审计
- P2-3: suitability/aml 直调补审计+request_ref 透传
- P3-1: 多角色 fail-closed 口径固化进测试;P3-3/P3-4 core_ro/risk_repo 必传;
  P3-5 LookupError→NotFoundError 统一;P3-9 alert_service import 上提
- 测试: test_risk_api 权限矩阵/审计断言/多角色组合/非 dev 拒绝;
  test_trade_gateway 客户本人 vs 越权 403(P3-4 模拟 _repo 注入 sqlite)
- 挂账: P3-2/P3-7(响应外壳+disclaimer)→B7;P3-6(scan 幂等)→B9b 前
2026-09-06 18:58:48 +08:00
GaoYiYuan_0626 e3fcf28b27 feat: 鉴权依赖(debug头/归属断言/越权审计) + 风控4 API(台账/处置/校验/AML扫描, B6) 2026-09-06 18:37:53 +08:00
GaoYiYuan_0626 d1982804da docs: B5 复审 L1 审计断言挂账 B8 2026-09-06 18:23:07 +08:00
GaoYiYuan_0626 46a1f24870 fix: 引擎异常审计降级/审计全量输入输出/TRD-TEST 注入点(B5 评审 P1-1、P2-1~3、P3 批量) 2026-09-06 18:17:44 +08:00
GaoYiYuan_0626 2a95b65ec8 feat: 模拟交易网关(suitability 阻断→落库→引擎, convert 400, B5) 2026-09-06 18:05:44 +08:00
GaoYiYuan_0626 67f0e55537 docs: B4 复审观察项挂账(30 天口径/申赎方向/list_trades 收敛) 2026-09-06 17:47:30 +08:00
GaoYiYuan_0626 03f8b63780 fix: FR-4 payload 上下文补组装/种子名单唯一命中/规则流水升序等(B4 评审 P1-1、P2-2~5、P3×7) 2026-09-06 17:40:13 +08:00
GaoYiYuan_0626 e8e5f7e981 feat: AML 名单匹配/全量扫描 + 事件引擎编排 + R-05 scoring 占位(B4) 2026-09-06 17:19:54 +08:00
GaoYiYuan_0626 64fba1029a docs: L3 docstring 补 R-05 接入改造点留痕(复审 P3-1) 2026-09-06 17:10:23 +08:00
GaoYiYuan_0626 65d4618968 refactor: L3 risk_score 一期不写保持 NULL,归 R-05 首写(B3 评审 P3-4 用户拍板) 2026-09-06 17:04:38 +08:00
GaoYiYuan_0626 026c4ce75c fix: L3 乐观锁防丢更新/last_alert_id 保留语义/竞态日志(B3 评审 P1-1、P2-1~5) 2026-09-06 16:42:18 +08:00
GaoYiYuan_0626 1f4217899d feat: L3 画像最小写入 profile_l3(最高档合并防降级 + 并发首单兜底, B3) 2026-09-06 16:26:04 +08:00
GaoYiYuan_0626 645092d7ad fix: FakePublisher 对齐 publisher 契约(dict 入参,实现方序列化) 2026-09-06 15:49:25 +08:00
GaoYiYuan_0626 6f38c9b129 feat: 预警聚合/去重/审计/PubSub 推送 alert_service(B2) 2026-09-06 15:44:34 +08:00
GaoYiYuan_0626 19c72b9b0d feat: 风控规则纯函数 RISK-001~005(B1) 2026-09-06 15:40:55 +08:00
GaoYiYuan_0626 25fc1ebdd7 docs: 阶段 A 评审挂账登记(MySQL 对照→B9b/B2 职责/B3 并发/B6 枚举校验/B7 引擎工厂) 2026-09-06 15:37:42 +08:00
GaoYiYuan_0626 98b1fba695 fix: 评审修复——SUIT-008 配置贯通/精确规则编号 rule_id/trace 兜底/request_ref 透传/测试补强 2026-09-06 15:37:05 +08:00
GaoYiYuan_0626 3c07de67b7 feat: suitability 公共校验服务(SUIT-001~008) + AuthContext 模型冻结(A4) 2026-09-06 15:18:35 +08:00
GaoYiYuan_0626 4eb8b462cd feat: risk_repository 风控四表读写(A3) 2026-09-06 15:15:51 +08:00
GaoYiYuan_0626 fdf0c9675f feat: core_ro 扩展当日申赎合计查询 sum_trades_on_date(A2) 2026-09-06 15:11:01 +08:00
GaoYiYuan_0626 2f96f7c8e5 feat: trace 贯通与脱敏工具 + risk 阈值配置(A1) 2026-09-06 15:09:14 +08:00
GaoYiYuan_0626 487b9da5b1 docs: 风控模块 PRD v1.0/规则附表/架构 v1.1/开发计划 v1.1 + 文档联动修正 2026-09-06 15:09:13 +08:00
zhanghongyu_0626 1ddd44a6cb Add core database support and enhance documentation
- Introduced `MYSQL_CORE_DATABASE` in `.env.example` and `settings.py` for core database configuration.
- Added `CoreReadOnlyRepository` for read-only access to the `jinrong_core` database.
- Updated `AGENTS.md`, `README.md`, and various documentation files to reflect new agent onboarding processes and project structure.
- Revised requirements in `requirements.txt` to include `langgraph` and `langchain-core`.
- Enhanced `FLOW.md` with local bootstrap instructions for setting up the core simulation environment.
- Added new scripts for database creation and seeding for the core simulation library.
- Improved overall documentation for clarity on project architecture and memory management.
- Updated `TODO.md` to reflect current development priorities and tasks.
2026-09-05 17:39:16 +08:00
zhanghongyu_0626 0374010b37 Implement initial project structure and setup 2026-09-05 17:09:21 +08:00
zhanghongyu_0626andCursor 53701dbb48 Initial commit
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-04 17:23:15 +08:00