feat(harness,rag): dual LLM audit fields, run conclusion, and hybrid quality
Persist provider reasoning and assistant text separately on agent_reasoning_audit (DeepSeekAssistantMessage path), extract diagnosis_run.conclusion, enrich RAG tool audit (step_id/query/qualityScore), gate empty mysql tools, drop devtools, and align MVP docs after live E2E verification.
This commit is contained in:
@@ -9,70 +9,59 @@ import java.util.Map;
|
||||
/**
|
||||
* L1 向量命中后、后处理前的统一候选结构。
|
||||
*
|
||||
* <p>由检索适配器从 {@code KnowledgeSearchHit} / 向量结果映射而来。
|
||||
* 后处理会基于它做归一化、规则 boost、chunk 级去重并生成 {@link EvidenceBlock}。</p>
|
||||
* <p>后处理:{@code RetrievalScoreNormalizer} → qualityScore;按 {@link #originalRank} 保序;
|
||||
* evidenceKey 去重 / 截断;不再用关键词 boost 改序。</p>
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
public class RetrievedEvidenceCandidate {
|
||||
|
||||
/** 向量库记录 id。 */
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 文档级 id(metadata.docId 等)。
|
||||
* 用于每文档 chunk 上限;不等于 evidenceKey。
|
||||
*/
|
||||
private String docId;
|
||||
|
||||
/** 文档内切片序号;可能为空(老数据)。 */
|
||||
private Integer chunkIndex;
|
||||
|
||||
/**
|
||||
* 片段级去重/投影主键。
|
||||
* 通常为 docId#chunk-N,fallback 为 vector:{id}。
|
||||
*/
|
||||
private String evidenceKey;
|
||||
|
||||
/**
|
||||
* 来源标识(_source / source / filePath / docId 等)。
|
||||
* 可与同文档其他 chunk 重复;不再作为唯一去重键。
|
||||
*/
|
||||
private String source;
|
||||
|
||||
private String title;
|
||||
|
||||
private String breadcrumb;
|
||||
|
||||
/** chunk 正文原文(后处理前未截断或仅底层原样)。 */
|
||||
private String content;
|
||||
|
||||
/** 固定为 L1(向量层);预留多路召回标记。 */
|
||||
private String retrievalLayer;
|
||||
|
||||
/** 所属 attempt 名,如 FILTERED_VECTOR。 */
|
||||
private String retrievalAttempt;
|
||||
|
||||
/**
|
||||
* 兼容 L2 距离分(越小越相似),后处理会 normalize 成 baseScore。
|
||||
* 引擎主分:dense=L2;hybrid=融合分。量纲由 {@link #scoreLabel} 解释。
|
||||
*/
|
||||
private Double score;
|
||||
|
||||
/** 底层原始分。 */
|
||||
private Double rawScore;
|
||||
|
||||
/** rawScore 语义标签:l2_distance / similarity。 */
|
||||
/**
|
||||
* {@code dense} | {@code hybrid}(及可被 canonicalize 的历史别名)。
|
||||
*/
|
||||
private String scoreLabel;
|
||||
|
||||
/** 向量召回顺序(从 1 起),规则 rerank 前的名次。 */
|
||||
/**
|
||||
* 检索返回名次(从 1 起)——后处理排序权威。
|
||||
*/
|
||||
private Integer originalRank;
|
||||
|
||||
/**
|
||||
* 扁平化 metadata(string map)。
|
||||
* 可能含 docId、chunkIndex、category、kb_scope 等。
|
||||
* hybrid 命中可选的 dense L2,仅供质量闸门;不参与排序。
|
||||
*/
|
||||
private Double denseDistance;
|
||||
|
||||
private Map<String, String> metadata;
|
||||
|
||||
/** 初步命中原因,后处理会追加 boost reasons。 */
|
||||
/**
|
||||
* 初步命中原因;后处理可追加 L0 重叠解释(无分值)。
|
||||
*/
|
||||
private List<String> hitReasons;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user