WeKnora/internal/application/repository
wizardchen fc6f160eff fix(retriever/doris): code review cleanup
针对 4cce6f2e(接入 Apache Doris)的 code review 修复,主要修正若干阻断性
问题与可读性问题,并剔除不应进入主仓的本地工作流文件。

阻断性修复:
- docker-compose: Doris 镜像由 2.1.0 升至 4.1.0。原 2.1.0 不支持 HNSW
  ANN、cosine_distance_approximate 与 Stream Load partial_columns,
  按当前 DDL 一启动就会失败。
- DSN 字面量拼接改用 mysql.Config.FormatDSN()。原 fmt.Sprintf 在用户名/
  密码包含 `@`/`:`/`/` 等字符时会跑偏。覆盖 health check 与 engine
  factory 两处。

健壮性修复:
- 新增 validateEmbedding,写入与查询前拒绝 NaN/±Inf;strconv.FormatFloat
  对非有限值会输出 "NaN"/"+Inf" 拼成无效 SQL。
- waitANNReady 改为后台 goroutine + 独立 context,避免新维度首次写入路径
  阻塞最长 30s;ANN 未就绪时 Doris 会自动退化为 brute-force。

清理:
- annIndexReady 移除最终两个分支都 return true 的冗余写法。
- Save 移除冗余的双重 toDorisVectorEmbedding。
- testDorisConnection 把 "5.7.99 Doris-4.1.0" 解析为裸 "4.1.0",与
  Postgres/ES 的版本格式对齐。

剔除(不应合入主仓):
- docs/wiki/集成扩展/Doris改动与上游同步.md:纯 fork 维护工作流文档。
- scripts/e2e-doris.sh:作者本地 E2E 验证清单。

测试:
- repository_test 用 require.Eventually 适配 ANN 异步轮询。
- 现有 doris 单测全部通过。
2026-05-09 00:31:03 +08:00
..
memory/neo4j fix: revert to neo4j v6 and workaround Go 1.24 Windows compiler bug with -p=1 2026-04-11 22:08:02 +08:00
retriever fix(retriever/doris): code review cleanup 2026-05-09 00:31:03 +08:00
agent_share.go feat(api): integrate per-organization resource counts into organization listing 2026-02-09 11:40:25 +08:00
chunk.go feat: Implement deadlock retry mechanism for chunk creation 2026-04-22 21:17:21 +08:00
chunk_sqlite_test.go fix: SQLite/Lite mode compatibility for FAQ import and chunk operations 2026-04-15 20:37:10 +08:00
custom_agent.go refactor: 调整智能体配置,增强智能体选择与状态管理 2025-12-26 21:31:02 +08:00
datasource_repo.go refactor(datasource): remove WeCom document integration and related components 2026-03-30 20:46:07 +08:00
kbshare.go feat(api): integrate per-organization resource counts into organization listing 2026-02-09 11:40:25 +08:00
knowledge.go feat(knowledge): add SQL LIKE keyword escaping and metadata search functionality 2026-03-27 16:30:07 +08:00
knowledgebase.go feat: add pinning functionality for knowledge bases 2026-03-05 18:14:14 +08:00
knowledgebase_sqlite_test.go feat: add vector_store_id column to knowledge_bases for per-KB vector store binding 2026-04-20 19:53:44 +08:00
mcp_service.go feat: add built-in MCP service support 2026-03-05 21:57:01 +08:00
message.go feat(datasource): implement data source management functionality 2026-03-30 20:46:07 +08:00
model.go refactor: Update function signatures across multiple files to improve readability by adding context parameters and enhancing code structure 2025-11-28 16:17:52 +08:00
organization.go feat(api): integrate per-organization resource counts into organization listing 2026-02-09 11:40:25 +08:00
session.go fix(sessions): review fixes for keyword search / pinning / IM titles 2026-04-30 16:23:00 +08:00
tag.go feat(datasource): implement data source management functionality 2026-03-30 20:46:07 +08:00
tenant.go feat(datasource): implement data source management functionality 2026-03-30 20:46:07 +08:00
tenant_disabled_shared_agent.go feat(agent): enhance agent and skill management features 2026-02-09 11:40:25 +08:00
tenant_test.go fix(tenant): prevent api_key encryption loss on tenant settings update 2026-03-25 21:25:21 +08:00
user.go feat: add GetUserByTenantID functionality to user repository and service 2026-03-05 18:14:14 +08:00
vectorstore.go feat: add VectorStore service layer with types and connection testing 2026-04-13 22:57:17 +08:00
web_search_provider.go feat(web-search): refactor web search provider 2026-03-31 20:22:34 +08:00
wiki_log_entry.go perf(wiki): move ingest log to event table and index to on-demand API 2026-05-08 21:48:52 +08:00
wiki_log_entry_test.go perf(wiki): move ingest log to event table and index to on-demand API 2026-05-08 21:48:52 +08:00
wiki_page.go perf(wiki): move ingest log to event table and index to on-demand API 2026-05-08 21:48:52 +08:00
wiki_page_test.go perf(wiki): move ingest log to event table and index to on-demand API 2026-05-08 21:48:52 +08:00