AC1 lancedb_ipc.go:159/:200 硬编码 importance 1.0 改为规则调用: EffectiveMemoryImportance(m) 显式值优先; 规则开⇒档位; 关(默认)⇒回落1.0(零行为变化) EffectiveEpisodeImportance() episode 原始日志 规则开⇒0.3 预留档; 关⇒1.0 AC2 规则档位(全库实测标定, 每档>=1%, 无值==1.0): core=0.9(4.11%) / normal×wiki,llm_distill=0.7(70.06%) / normal×legacy,unknown=0.4(25.84%) / normal×recovery=0.3(预留档) 未纳入: 内容深度(78.1%<50字⇒切档违反>=1%) / 时间衰减(排序已有运行时recency项, 避免双衰减) / 图谱连接度(红线不碰图谱) AC3 存量回填: rust bin importance_backfill(仅写 importance 一列, id IN 组提交 25 版本, 提交冲突有界退避, verify 逐行复算, rollback=整表1.0 一个版本)。 生产执行: 46,930 行全部回填, 恒1.0 行数 46,930 -> 0 (verify mismatch=0) 备份: ~/.hermes/state/t_789898bd-importance-backup/memories-id-importance.csv (46,913 行, 全部 1.0) AC4 golden 集合 before/after: mrr 0.4345→0.4345, ndcg 0.4722→0.4722, keyword 14/14 不变(差 0%, <±10%) AC5 回滚开关 ZHIYI_IMPORTANCE_RULE(off=默认, 逐位等同改动前); 回滚命令: importance_backfill --data-dir /var/lib/memoryweave --mode rollback 单测: go test ./internal/storage/ 全过(5 个新 importance 用例); 回归: storage+models+api/routes 全过
35 lines
858 B
TOML
35 lines
858 B
TOML
[package]
|
|
name = "zhiyi-consolidate"
|
|
version = "0.1.0"
|
|
edition = "2021"
|
|
|
|
[dependencies]
|
|
lancedb = "0.15"
|
|
chrono = "0.4"
|
|
|
|
tokio = { version = "1", features = ["rt"] }
|
|
futures = "0.3"
|
|
arrow = "53"
|
|
arrow-array = "53"
|
|
serde = { version = "1", features = ["derive"] }
|
|
serde_json = "1"
|
|
clap = { version = "4", features = ["derive"] }
|
|
reqwest = { version = "0.12", features = ["json", "blocking"] }
|
|
|
|
# 图谱 SQLite
|
|
rusqlite = { version = "0.31", features = ["bundled"] }
|
|
tokenizers = "0.23.1"
|
|
|
|
[features]
|
|
default = []
|
|
|
|
[[bin]]
|
|
name = "zhiyi-consolidate"
|
|
path = "src/main.rs"
|
|
|
|
# t_789898bd:存量 importance 回填一次性工具(只写 importance 列,组提交 ~25 版本)。
|
|
# 新增 [[bin]] 不影响 zhiyi-consolidate 二进制本身(sidecar 不用重新部署/重启)。
|
|
[[bin]]
|
|
name = "importance_backfill"
|
|
path = "src/bin/importance_backfill.rs"
|