Files
zclaw_openfang/docs/features/AUDIT_TRACKER.md
iven 8b9d506893 refactor(saas): 架构重构 + 性能优化 — 借鉴 loco-rs 模式
Phase 0: 知识库
- docs/knowledge-base/loco-rs-patterns.md — loco-rs 10 个可借鉴模式研究

Phase 1: 数据层重构
- crates/zclaw-saas/src/models/ — 15 个 FromRow 类型化模型
- Login 3 次查询合并为 1 次 AccountLoginRow 查询
- 所有 service 文件从元组解构迁移到 FromRow 结构体

Phase 2: Worker + Scheduler 系统
- crates/zclaw-saas/src/workers/ — Worker trait + 5 个具体实现
- crates/zclaw-saas/src/scheduler.rs — TOML 声明式调度器
- crates/zclaw-saas/src/tasks/ — CLI 任务系统

Phase 3: 性能修复
- Relay N+1 查询 → 精准 SQL (relay/handlers.rs)
- Config RwLock → AtomicU32 无锁 rate limit (state.rs, middleware.rs)
- SSE std::sync::Mutex → tokio::sync::Mutex (relay/service.rs)
- /auth/refresh 阻塞清理 → Scheduler 定期执行

Phase 4: 多环境配置
- config/saas-{development,production,test}.toml
- ZCLAW_ENV 环境选择 + ZCLAW_SAAS_CONFIG 精确覆盖
- scheduler 配置集成到 TOML
2026-03-29 19:21:48 +08:00

3.1 KiB

ZCLAW 审计追踪表 (V9)

创建日期: 2026-03-29 审计版本: V9 追踪规则: 每个发现项记录状态变更,修复后需附验证方法


P0: 阻断级

ID 问题 状态 负责人 目标日期 验证方法
SEC-V9-01 prompt/service.rs:94,97,100 SQL 注入 OPEN - - grep "format!" prompt/service.rs 无 SQL 拼接

P1: 严重级

ID 问题 状态 负责人 目标日期 验证方法
BREAK-01 LlmDriverForExtraction 无生产实现 OPEN - - grep "impl LlmDriverForExtraction" desktop/src-tauri/
BREAK-02 记忆提取未接入 post_conversation_hook OPEN - - grep "process_conversation" kernel_commands.rs
BREAK-03 审批后不自动执行 Hand OPEN - - 验证 approval_respond 中 approved=true 触发执行
BREAK-04 pipeline-complete 事件未监听 OPEN - - grep "pipeline-complete" desktop/src/

P2: 高优先级

ID 问题 状态 负责人 目标日期 验证方法
DEAD-01 PromptInjector 全文件死代码 OPEN - - 决策:接入或清理
DEAD-02 MemoryRetriever 全文件死代码 OPEN - - 决策:接入或清理
DEAD-03 GrowthTracker 全文件死代码 OPEN - - 决策:接入或清理
DEAD-05 39 个未调用 saas-client 方法 OPEN - - 评估是否需要桌面端入口
DOC-01 Tauri 命令数文档 58+ vs 实际 130 OPEN - - 更新 06-tauri-backend 文档
DOC-02 智能层文档引用已删除模块 OPEN - - 更新 02-intelligence-layer 文档
TYPE-01 Desktop/Admin 类型不一致 (6 组) OPEN - - 统一类型定义
G-07 account_api_keys 被 relay 绕过 OPEN - - 决策:统一 key 管理或标记独立功能

P3: 中优先级

ID 问题 状态 负责人 目标日期 验证方法
CONF-01 配置参数孤儿 (batch_window_ms 等) OPEN - - 实现消费或移除
SEC-V9-02 relay 输入验证可加强 OPEN - - 添加基本校验
AUDIT-01 前端 audit-logger 无消费者 OPEN - - grep "auditLogger" desktop/src/
DEAD-04 director.rs 907 行孤立代码 OPEN - - 移至 feature flag 后面
ADMIN-01 config_sync_logs 无 Admin 页面 OPEN - - 添加页面
ADMIN-02 operation_logs 无 Admin 页面 OPEN - - 添加页面

P4: 低优先级

ID 问题 状态 负责人 目标日期 验证方法
DOC-03 SKILL.md 数量 69→70 OPEN - - 更新 README.md
DOC-04 Hands 数量 CLAUDE.md vs README 不一致 OPEN - - 统一口径
EVAL-01 zclaw-channels 评估 OPEN - - 决定保留或删除
IFACE-01 trigger_update 接口不匹配 OPEN - - 对齐 TS/Rust 参数

状态变更日志

日期 ID 变更 备注
2026-03-29 - V9 审计创建 20 个发现项