feat(knowledge): v3.3 UI 重构 + v2 后端存储与 FTS5 检索管线#9
Merged
Conversation
- 重构知识组件:拆分为 ProjectBrowser/ProjectWorkspace/KnowledgeNotesPanel/ KnowledgeBoardPanel/KnowledgeTasksPanel,新增 BreadcrumbNav/MarkdownPreview/ BacklinksPanel/BoardTaskCard/ProjectCard/QuickCreateBar/ThemeToggle - 删除旧版 BoardCard/BoardPane/KnowledgeTopbar/NoteList/NotePreview/NotesPane/ ProjectSidebar/TasksPane - 设置页知识库区接入可配置根目录选择器(knowledgeRootPath) - 更新 tauri 能力与依赖配置 - 同步更新 ARCHITECTURE/API/PRD/TESTING/GLOSSARY/TODO_INVENTORY/具体能力构思 文档
后端(packages/db + packages/server-local): - 新增知识实体表(projects/notes/tags/note_tags/board_columns/knowledge_tasks/ knowledge_chunks)+ FTS5 虚拟表 knowledge_chunks_fts - createKnowledgeStore 同步 CRUD(tags 同步、级联删除、backlinks、moveTask 重排) - Markdown-header 分块 + content-hash 去重 + FTS5 BM25 检索 (项目范围过滤、按 source 去重、index_status 生命周期) - 混合文件镜像:entity ↔ Markdown front-matter/JSONL,Obsidian 友好布局, export/import + root-path 端点(SQLite 权威 + 文件镜像) - /api/knowledge/* CRUD + search + index-status + reindex + mirror, sqlite 未加载时降级 503 前端(apps/desktop): - useKnowledgeApi:乐观本地缓存(与 mock 同形状 KnowledgeDataSource 接口), 写失败回滚+提示,loadAll 失败回退 mock - useKnowledgeWorkspace 数据源切换为 api(mock 回退),编排层与 14 组件零改动 - KnowledgeView onMounted loadAll + 降级 banner - api.ts 新增知识端点方法 类型(packages/shared):知识实体 + IndexMode/KnowledgeIndexState/ AiRetrievalMode/ContextLevel/AiAnswer/KnowledgeChunkIndexStatus 测试:desktop 28、server-local 23+5skip、db 9+1skip 全绿; sqlite-native 不可用时 skipIf(CI 跑)
|
Important Fenno AI is not enabled for this organization Fenno AI is currently in internal testing and is not yet open for external organizations. If you would like to request access, sign in to Fenno AI Console, choose Give Feedback in the lower-left corner, and tell us what you need. We will follow up promptly. |
CI(linux) 跑 indexer 集成测试时,「按项目范围搜索」用例失败:FTS5 默认 unicode61 分词器对中文不分词,"向量" 短语匹配不上「向量检索…」正文。 - knowledge_chunks_fts 改用 tokenize='trigram'(FTS5 内置,SQLite 3.34+, 对中文做 3-gram 分词) - sanitizeFtsQuery 改为前缀查询 "term"*,使短词(<3 字符)也能经 trigram 前缀展开命中
trigram 分词器索引 3-gram,查询词 <3 字符(如「向量」)的 MATCH 前缀查询仍不命中。改为:查询词均 ≥3 字符时走 FTS5 MATCH + BM25 排序; 否则回退 LIKE %term% 子串扫描(保留项目范围过滤),按命中返回。 Phase 3 向量检索将接管语义排序,此 LIKE 路径为短词兜底。
该脚本在 d53f4bf 引入时 git 存为 100644(非可执行),CI checkout 后 'Verify documentation consistency' 步骤 Permission denied (exit 126)。
6 tasks
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.
概述
知识工作空间 v3.3 UI 重构 + v2 后端存储与 FTS5 检索管线 + 文档完善。本 PR 合并
docs/quality-improvement分支相对main的全部积压工作(6 个提交)。包含的提交
377a0dafix(wallpaper): 优化 wallpaper 表现0126b1efeat(knowledge): v3.3 本地知识工作空间架构转型d53f4bfdocs: 综合文档质量提升03e0f22docs: docs/ 文件翻译为中文cbb7582feat(knowledge): v3.3 知识工作空间 UI 重构与文档更新bf6e6d3feat(knowledge): v2 知识库后端存储与 FTS5 检索管线 + 前端 API 接入主要变更
知识工作空间 UI(v3.3)
ProjectBrowser/ProjectWorkspace/KnowledgeNotesPanel/KnowledgeBoardPanel/KnowledgeTasksPanel,新增BreadcrumbNav/MarkdownPreview/BacklinksPanel/BoardTaskCard/ProjectCard/QuickCreateBar/ThemeToggleknowledgeRootPath)v2 后端检索管线
knowledge_chunks_ftscreateKnowledgeStore同步 CRUD(tags 同步、级联删除、backlinks、moveTask 重排)index_status生命周期)/api/knowledge/*CRUD + search + index-status + reindex + mirror,sqlite 未加载时降级 503前端 API 接入
useKnowledgeApi:乐观本地缓存(与 mock 同形状KnowledgeDataSource接口),写失败回滚+提示,loadAll失败回退 mockuseKnowledgeWorkspace数据源切换为 api(mock 回退),编排层与 14 个组件零改动KnowledgeViewonMountedloadAll+ 降级 banner类型(packages/shared)
知识实体 +
IndexMode/KnowledgeIndexState/AiRetrievalMode/ContextLevel/AiAnswer/KnowledgeChunkIndexStatus测试计划
pnpm typecheck全绿(shared/ai/tts/db/desktop/server-local)pnpm -r test全绿:desktop 28、server-local 23+5skip、db 9+1skip、ai 2、tts 1pnpm dev:tauri跑知识工作空间 CRUD + FTS 搜索(本机无 sqlite-native binding,走 503→mock 降级路径,UI 不变)后续(已建 issue,不在本 PR)
说明
createDatabase走 memory fallback;SQLite 专属测试skipIf,CI 会跑。node:sqlite迁移为后续 SEA 打包任务(见 ARCHITECTURE.md 6.4)。tasks(open|done)与 v2knowledge_tasks(四态)未统一,knowledge 用独立表,避免影响 v1 pet 面板/focus 行为。