lili 5659eb66c6 feat(ai-knowledge): P-B 授权过滤 fail-closed,检索结果补齐 §5.3 合同字段 + omittedSources
专题-03 AI 检索串联第二期(P-B):在 P-A 最小检索链路上叠加按用途授权 + 来源状态门控(fail-closed),检索结果补齐 §5.3 可追溯合同字段,被过滤来源透出 omittedSources 供审计。

- §4.3 用途门:binding.bindingScope 须含 "search" 上下文检索用途(阅读/导出≠检索),否则拒
- §4.3 来源状态门:projection.status ∈ {revoked,recalled,delisted,blocked,owner_missing,unauthorized} 一律拒;active/stale 纳入(stale 非阻断);active binding 无投影则 fail-closed
- §5.3 授权快照门:缺 authorizationSnapshot 的来源不进 Prompt
- §5.3 chunk 补字段:sourceOwner/sourceObjectVersion/authorizationSnapshot/sourceStatus/allowedPurpose
- omittedSources:被授权门过滤的来源(kbId/reason/sourceStatus)透出;executor metadata 透出 omittedSourceCount
- 全部消费已有 binding + source_binding_projection 数据,无新建授权模型/表

验证:knowledge 11 单测 + ai 6 单测 + ArchUnit(BcBoundary/AiGrantRuntime)全绿。端到端真链路(真 RAGFlow 摄入 + 真 New-API 生成 + 授权门生效)验收待补(攒 P-B 后一次做)。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-23 03:59:36 -07:00
..