Repository navigation
feat(v2.0): 可控智能辅助(8/8 切片) - #11
Merged
Merged
Conversation
Tauri cannot pick the app binary once src/bin/trove-cli.rs exists, so release builds fail without default-run. Co-authored-by: Cursor <cursoragent@cursor.com>
Tauri only merges the default-run binary for universal-apple-darwin, so trove-cli must be lipo'd before the .app copy step. Co-authored-by: Cursor <cursoragent@cursor.com>
beforeBundleCommand cwd is the repository root, so the extra-bin lipo script must be invoked as scripts/lipo-extra-bins.mjs. Co-authored-by: Cursor <cursoragent@cursor.com>
Record default-run, universal lipo, WorkbenchAction serde tag, and CSV import/undo rules so the next release does not repeat the v1.4.0 build failures. Co-authored-by: Cursor <cursoragent@cursor.com>
…ontracts Co-authored-by: Cursor <cursoragent@cursor.com>
- 启动门槛评估:§9.1 四条门槛逐条核对(1/2 满足、3 冻结、4 切片 1 AC) - 父任务 08-19-v2-0-ai-assist-roadmap:切片地图(Wave A/B/C)、全局合同 7 条 - 切片 1 子任务 08-19-v2-0-ai-service-boundary:AI 服务边界 PRD - docs/v2-ai-assist-roadmap.md 发布并列入 README 索引 - 同步 main 的 v1.4.0 版本号
- design.md:模块边界、0019 迁移、配置三层分离(key 不入库存文件)、provider 抽象、sanitize 合同、UI、评估样本、回滚 - implement.md:7 步执行清单 + 验证命令 + 3 个 review gate
- migrations/0019_ai_suggestions.sql:建议台账表 + memories.sensitive 列 - domain/ai_suggestion.rs:AIFeature/AIConfig/建议信封/结构化校验(ambiguous 日期门禁) - AppSettings.ai serde default 全关:旧导出恢复后 AI 保持关闭 - schema_version 断言 18→19(db/backup 测试同步) - 已知无关 flaky:reminder_stats_respect_local_date_window(预先存在,见任务 notes)
- infrastructure/ai:同步 trait(线程池命令 + 20s 上限),OffProvider 零 I/O(门槛 4) - HttpProvider:OpenAI-compatible(Ollama /v1 与自定义 endpoint),rustls,无重试失败即 None - api key 存 app_data_dir/ai_provider_key(库外文件,不随备份/导出),内容不回读不落日志 - probe 分级提示:endpoint/model/key 缺失与不可达各白名单 hint key - 修复 configured() 把 key 文件路径误作 data_dir 的拼接 bug
- sanitize_context:敏感记忆/密码管理器来源/用户排除应用过滤(单测覆盖红线样本) - request 管线:feature 开关短路→未开放模板短路→sanitize→provider→结构化校验 - 坏输出落 dismissed 审计行,业务数据零污染;provider off/失败静默降级零落库 - decide 单向状态机(pending→终态)、list 限 200、clear_history 仅清派生表 - 0019 表补 sources_json 列;AppState 注入(data_dir 随 setup 传入) - cargo test 133 passed(1 个已知无关 flaky 见任务 notes)
- 命令:ai_provider_key_status/set/clear(key 只写不回读)、ai_provider_probe(即时按当前设置构造 provider)、ai_suggestion_list/decide/clear - Memory 域/迁移/读写/自动化联动补 sensitive 字段(serde default 兼容旧输入) - query SELECT 补 sensitive 列(列序与 map_memory_row 对齐)
- AIAssistSection:模式三选一(默认关)、Ollama/自定义配置、测试连接(分级提示文案)、 key 只写不回显(保存/清除双确认)、五功能开关默认关、建议历史+两步确认清空 - MemoryPage:敏感内容复选(标记后不发送给任何 AI 服务) - client.ts:AI 类型与 ai_* 命令封装;AppSettings.ai 必填 - pnpm build + tsc + 42 单测全绿
- fixtures:extract_dates(12)/extract_tasks(12,含敏感红线样本)/search_semantics(10 对非关键词查询) - tests/ai_eval_offline.rs:sanitize 红线、schema 校验、off/禁用零调用、坏输出仅审计、key 不入 settings、语义样本固化 - #[ignore] 在线档(Ollama)供切片 2+ 发版前手动回归 - application/infrastructure 模块转 pub 供集成测试访问(bin 不受影响)
- docs/ai-assist.md:模式配置、数据边界、可靠性承诺、FAQ - privacy-and-data.md 增补「智能辅助与数据边界」小节 - README 索引更新;PRD AC 全部勾选;implement.md 备注配置命令简化 - clippy 清零(新代码),133 lib 测试 + 8 eval 离线回归全绿
- domain:ExtractApplyInput(indices 去重/越界校验)+ ExtractApplyResult;LINK_KIND_AI_EXTRACT 入白名单 - 服务:request_extract(敏感记忆短路、pending 幂等不打 provider);apply_extract (ambiguous 不写日期、notes 来源引用、EntityLink ai_extract、失败保持 pending) - 命令:ai_extract_request / ai_suggestion_apply - UI:ExtractSuggestionsPanel(勾选/全选/原文摘录/日期待确认标记/都不合适双确认); MemoryPage 入口按钮(mode+extract 开关+非敏感条件) - 新增 6 个服务单测;139 lib 测试全绿(1 已知 flaky)
- ai-assist.md 增补提取使用流程与前提;设置页开关文案更新为已开放 - #[ignore] 在线档:extract→apply 全链路(含 ambiguous 不写日期断言) - PRD/implement 全项勾选
- domain:开放 Summary prompt(禁评价/禁编造/≤200 字约束写入模板,单测固化) - 服务:request_weekly_summary(snapshot 确定性数字 + 各组前 8 条标题,剪贴板 按 source_app sanitize、只发 20 字截断标签);重新生成自动 dismiss 旧 pending - weekly_review_complete 完成时清理 pending 摘要(失败不阻塞) - UI:WeeklySummaryCard(三态 + 确定性数字徽标对照 + 降级文案 + 刷新恢复) - 142 lib + 9 eval 测试全绿(1 已知 flaky)
added 22 commits
August 23, 2026 12:01
- domain:开放 Related prompt(title 必须与候选完全一致、不得编造候选之外条目,单测固化) - 服务:request_related——CJK bigram 子串检索候选(FTS unicode61 对中文整段分词不可用, 新增 SearchService.query_substring),过滤敏感/已双向链接/历史拒绝配对;模型输出按标题 精确回配候选,编造条目丢弃、全编造则整条作废 - confirm_related 幂等写 related EntityLink 后 accepted;reject_related_item 落 dismissed 配对记录(未来过滤)+ 剩余项清零自动收口 - UI:RelatedSuggestionsSection(逐条 关联/不相关 + 空态 + 降级文案),TaskDetailPanel 接入 - 新增 3 服务单测 + 契约/在线评估;146 lib + 10 eval + 42 前端全绿
- domain:开放 Suggest prompt(理由必须基于确定性特征、宁缺毋滥,单测固化) - 服务:request_daily_suggest——跨天收口 + 重生成收口 + 候选(今日池差集 focus/waiting/跳过配对, 特征行 ≤15)+ 标题回配防编造;reject_suggestion_item 泛化(顺带修复 pair 行 feature 硬编码 Related 的切片 4 同源 bug) - 命令:ai_daily_suggest_request/skip/accept(accept 仅记账,入重点走既有 dailyFocusAdd 撤销栈) - UI:DailySuggestionsCard(理由+特征摘录+加入重点/跳过,空态隐藏,降级重试) - 150 lib + 11 eval + 42 前端全绿
- migrations/0020:task_checklist_items 表(软删 + task 索引),schema 19→20 - domain:ChecklistItem/TaskChecklist/校验(trim/≤200 字/上限 50 温和文案) - TaskService.checklist_list/add/update/delete/reorder:完成冻结、删除级联软删 (无孤儿)、删除后序号归一化、reorder 全量校验;写操作触碰父任务 updated_at (不动 revision,避免乐观并发噪声) - SearchService.reindex_one:检查项文本并入任务搜索索引(按子条目可搜到任务) - 命令 5 个;ChecklistSection(回车追加/勾选/行内编辑/上下移/两步删除/完成只读) + TaskRow 进度徽标(独立 query,staleTime 30s) - 3 个服务单测(CRUD/冻结级联/上限与搜索);153 lib + 11 eval + 42 前端全绿
- domain:开放 Split prompt(不建任务/依据连续片段/宁缺毋滥,单测固化) - 服务:request_split——冻结校验、薄任务短路(<4 字零 provider 调用)、 依据子串校验(ungrounded 条目丢弃、全丢整条作废);apply_split 走既有 checklist_add(上限/校验复用),零任务字段写入(§9.3,单测断言前后一致) - 命令:ai_split_request / ai_split_apply - UI:ChecklistSection 内 AI 拆分按钮 + 草稿区(勾选/依据展示/都不合适) - 156 lib + 12 eval + 42 前端全绿
- migrations/0021:semantic_index 表(派生数据,可清空重建) - provider:embed 批量扩展(Ollama /api/embed、Custom /embeddings,批 32/60s/部分响应视为失败); embedding_model 与 chat model 分离 - SemanticIndexService:rebuild(排除清单/标签/剪贴板类型 SQL 过滤 + 2 万行上限 + 全量替换幂等)、 search(余弦 Top-K 阈值 0.35 + 模型一致性降级)、status、clear;5 个单测 - search_query:semantic 字段(serde default 兼容旧缓存),开关关闭零开销 - QuickWindow「语义匹配」分区(去重关键词命中、得分百分比、跳转复用 openHit) - 设置页:语义检索开关 + embedding 模型 + 索引状态/重建/清空(双确认) - 164 lib + 12 eval + 42 前端全绿
- ai-assist.md「语义检索」小节(重建/双列/派生数据性质);privacy 派生索引可删补录 - #[ignore] 在线档:10 对非关键词语义样本 ≥7 命中断言(OLLAMA_EMBED_MODEL) - PRD/implement 全项勾选
- 父任务 PRD 验收全勾(含 §9.6 对照与门槛 4 复核证据) - v2-ai-assist-roadmap.md 状态更新为已全部交付 - README 实现进度表新增 v2.0 已完成行
原测试硬编码 2026-08 日期,真实时钟下随运行日期漂移导致 7/30 天窗口断言失败 (CI 已红两次)。改为相对今天的偏移日期,保留原窗口语义。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
v2.0 可控智能辅助 — 全部 8 个切片
依据
docs/post-v1-iteration-design.md§9 设计合同与 v2.0 路线图(启动门槛评估通过后实施)。切片清单
隐私与安全(§9.4)
测试
文档
docs/v2-ai-assist-roadmap.md(已全部交付)、docs/ai-assist.md(配置与数据边界)、privacy 增补