Commit Graph

1 Commits

Author SHA1 Message Date
Blizzard 165ecb4ec6 test(dispatcher): RAG 管线集成测试 —— 检索→注入→生成→refs→忠实度评测整条链
补全核心链路最后一块。此前只测了 retriever 组件的解析,整条 RAG 管线没被集成覆盖。

新增 rag_integration_test.go 4 例:
- ConversationInjectsAndReturnsRefs:input→retriever→agent,断言 kb_search 被调、
  kb 按 owner 作用域(u42/travel)、检索片段注入 agent system prompt、refs 经 runGraph 回流。
- RefsDriveGroundedEval:有 refs 时 evaluate 走「含检索资料」的 grounded judge 路径,
  记录忠实度分(而非无来源路径)。
- ReportSectionInjectsRefs:报告 writeSection 检索命中注入撰写 prompt。
- DegradesWhenRetrieverDown:kb_search 失败 → 空 refs,agent 仍正常出答案、整图不失败。

go test -race ./internal/eino 干净,四模块全绿。至此核心编排链 + RAG 管线均有集成兜底。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 14:21:11 +08:00