fix(audit): 修复深度审计 P1/P2 问题 — 记忆统一、持久化、前端适配
Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled

H3: 重写 memory_commands.rs 统一到 VikingStorage 单一存储,移除双写
H4: 心跳引擎 record_interaction() 持久化到 VikingStorage,启动时恢复
M4: 反思结果/状态持久化到 VikingStorage metadata,重启后自动恢复
- HandApprovalModal import 修正 (handStore 替代 gatewayStore)
- kernel-client.ts 幽灵调用替换为 kernel_status
- PersistentMemoryStore dead_code warnings 清理
- 审计报告和 README 更新至 v0.6.3,完成度 58%→62%
This commit is contained in:
iven
2026-03-27 09:59:55 +08:00
parent a71c4138cc
commit b7bc9ddcb1
11 changed files with 477 additions and 238 deletions

View File

@@ -14,7 +14,7 @@ pub mod crypto;
// Re-export main types for convenience
pub use persistent::{
PersistentMemory, PersistentMemoryStore, MemorySearchQuery, MemoryStats,
generate_memory_id, configure_embedding_client, is_embedding_configured,
PersistentMemory, PersistentMemoryStore, MemoryStats,
configure_embedding_client, is_embedding_configured,
EmbedFn,
};

View File

@@ -143,6 +143,7 @@ pub struct PersistentMemoryStore {
conn: Arc<Mutex<SqliteConnection>>,
}
#[allow(dead_code)] // Legacy: operations migrated to VikingStorage, kept for backward compat
impl PersistentMemoryStore {
/// Create a new persistent memory store
pub async fn new(app_handle: &tauri::AppHandle) -> Result<Self, String> {
@@ -497,6 +498,7 @@ impl PersistentMemoryStore {
}
/// Generate a unique memory ID
#[allow(dead_code)] // Legacy: kept for potential migration use
pub fn generate_memory_id() -> String {
let uuid_str = Uuid::new_v4().to_string().replace("-", "");
let short_uuid = &uuid_str[..8];