fix(summarize): 缺 setDistillCursor 时降级内存游标而非抛错 - #279
Conversation
Anans 复审留下的非阻塞建议第 1 条:第三方宿主用旧版 service 构造时, persistCursor 在方法缺失分支硬抛错,会把 #274 之前能正常工作的宿主 变成每轮蒸馏即崩。降级为 warn + 内存游标(#274 前语义,本进程不重蒸, 跨重启重放由 saveWithDedupe 三元组兜底);方法存在但抛错仍向上传播, 恰一次回滚语义不动(对应回滚测试用例保持原样)。 补回归测试:缺方法时蒸馏照跑、记忆落库、不持久化、进程内不重蒸。 Anans 建议第 2 条(内存优先读)经评估不改:memoryDir 允许双宿主共用, DB 优先是跨进程游标一致的依据,内存优先会复活跨进程重复蒸馏。
|
Understand this PR’s impact Explore downstream dependencies and potential security impact with Blast Radius. Important Review skippedReview was skipped as selected files did not have any reviewable changes. ⚙️ Run configurationConfiguration used: Repository: slow-stack/dsh-mneme/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: slow-stack/dsh-mneme/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review. 📝 WalkthroughWalkthrough当 Changes游标兼容性
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
* chore: v0.8.6 发布准备(版本号 + 测试徽章 + CHANGELOG/路线图占位行) 请在 CHANGELOG 与两个 README 的占位行补描述后再合并。 * chore(release): v0.8.6 发布说明与路线图补齐 CHANGELOG 的 [Unreleased] 转为 v0.8.6 小节,并补上三份未登账的改动: 工具暴露开关与描述纪律(#276)、蒸馏游标持久化(#229/#274)与旧宿主降级路径 (#279)、能力说明第 5 条文案精确性(#277)、CI 与徽章口径收敛(#281/#273/#272)。 两个 README 的 v0.8.6 占位行补描述(版本历史 + 路线图),测试徽章与注释数按 badge:sync 对齐到 1275。 --------- Co-authored-by: modusensus <modusensus@users.noreply.github.com>
背景
#274 复审(Anans-Ivresse APPROVED)留了三条非阻塞建议,本 PR 落第 1 条;第 2、3 条经评估不做,理由见下。
变更
persistCursor在service.setDistillCursor缺失时不再抛错,降级为 warn + 内存游标(lastDistilledSeqMap,#274 之前的语义):saveWithDedupe三元组 +summarizeDedupeMinSim向量近重档兜底([Bug] lastDistilledSeq 为进程内存态:宿主重启后蒸馏窗口从头重放,已蒸馏历史被重复处理 #229 边界确认时已接受的成本)。summarize.test.js既有回滚用例保持原样。测试
service.setDistillCursor后蒸馏照跑、记忆落库、无持久化游标、第二轮不重蒸(内存游标生效)。npm test:1248 tests,1247 passed + 1 skipped,0 fail(含新用例)。npm run sync+check-sync通过(src ↔ lib 平价)。不做的两条(Anans 建议第 2、3 条)
memoryDir允许双宿主共用(store 的 WAL +busy_timeout多进程就绪,AGENTS.md 并行协作节)。读库优先是跨进程游标一致的依据——两个宿主进程各持内存 map 互相看不见对方推进的游标,恰好复活 [Bug] lastDistilledSeq 为进程内存态:宿主重启后蒸馏窗口从头重放,已蒸馏历史被重复处理 #229 要修的重复蒸馏,只是从「跨重启」变成「跨进程」。SQLite 主键点查微秒级,turn/end 是人类频率,收益不抵风险。previousSeq计算处汇合,交叉场景结构上已走通;补测属于为覆盖数字写测试。Fixes #274(复审建议跟进)
Summary by CodeRabbit