feat(eval): add executor audit closure checks

This commit is contained in:
aruo
2026-07-08 10:21:39 +08:00
parent 6015bcbf6f
commit a08672b31e
20 changed files with 1142 additions and 188 deletions
@@ -0,0 +1,142 @@
{
"session": {
"sessionId": "eval-composer-fallback-no-raw-json",
"query": "库存服务慢响应是否可以直接输出 Executor JSON?",
"status": "SUCCESS",
"agentFlow": "CHAT",
"totalDurationMs": 47000,
"toolCallCount": 1,
"answer": "以下结论基于当前已获取证据,仍存在部分证据缺口,请谨慎参考。\n\n已确认信息:指标显示库存服务出现慢响应。\n\n仍需补充信息:当前没有线程池队列或线程耗尽证据,不能确认线程池方向。\n\n建议动作:补充查询库存服务线程池指标。",
"selfEvaluation": {
"verifier_evaluation": {
"verdict": "LOW_CONFID",
"groundedness_score": 0.45,
"critical_fact_count": 2,
"gatekeeper_result": {
"status": "pass",
"failed_rules": [],
"warnings": [],
"errors": []
},
"executor_structured_output": {
"answer_version": "executor_evidence_v2",
"claims": [
{
"claim_id": "claim-slow-response",
"claim_type": "symptom",
"claim_text": "库存服务出现慢响应",
"support_level": "direct",
"evidence_bindings": [
{
"tool_invocation_id": 1,
"tool_name": "query_metrics",
"evidence_excerpt": "inventory p99 latency increased"
}
]
},
{
"claim_id": "claim-thread-pool",
"claim_type": "root_cause",
"claim_text": "线程池已经耗尽",
"support_level": "weak",
"evidence_bindings": [
{
"tool_invocation_id": 1,
"tool_name": "query_metrics",
"evidence_excerpt": "inventory p99 latency increased"
}
]
}
],
"hypotheses": [],
"recommended_actions": [
{
"action_text": "补充查询库存服务线程池指标",
"reason": "当前只有慢响应指标"
}
],
"missing_info": ["线程池队列长度", "活跃线程数"]
},
"claim_checks": [
{
"claim_id": "claim-slow-response",
"claim_text": "库存服务出现慢响应",
"claim_type": "symptom",
"verification": "direct_observation",
"detail": "指标显示 inventory p99 latency increased",
"evidence_refs": [
{
"tool_invocation_id": 1,
"tool_name": "query_metrics"
}
]
},
{
"claim_id": "claim-thread-pool",
"claim_text": "线程池已经耗尽",
"claim_type": "root_cause",
"verification": "external_unknown",
"detail": "没有线程池队列或活跃线程指标,不能确认该结论",
"evidence_refs": []
}
],
"facts_checked": [
{
"fact": "库存服务出现慢响应",
"verification": "direct_evidence",
"detail": "指标显示 inventory p99 latency increased",
"evidence_refs": [
{
"tool_invocation_id": 1,
"tool_name": "query_metrics"
}
]
},
{
"fact": "线程池已经耗尽",
"verification": "external_unknown",
"detail": "没有线程池队列或活跃线程指标,不能确认该结论",
"evidence_refs": []
}
],
"composer_output": {
"status": "composer_malformed",
"detail": "used safe fallback rendering",
"answer_summary": "指标显示库存服务出现慢响应。",
"recommended_actions": [
{
"action_text": "补充查询库存服务线程池指标",
"reason": "当前只有慢响应指标"
}
],
"user_facing_answer": "以下结论基于当前已获取证据,仍存在部分证据缺口,请谨慎参考。\n\n已确认信息:指标显示库存服务出现慢响应。\n\n仍需补充信息:当前没有线程池队列或线程耗尽证据,不能确认线程池方向。\n\n建议动作:补充查询库存服务线程池指标。"
},
"tool_trace_summary": [
{
"tool_name": "query_metrics",
"success": true,
"evidence_level": "direct"
}
]
}
}
},
"steps": [],
"toolInvocations": [
{
"id": 1,
"sessionId": "eval-composer-fallback-no-raw-json",
"toolName": "query_metrics",
"outputPreview": "inventory p99 latency increased",
"success": true
}
],
"summary": {
"persistedStepCount": 3,
"returnedStepCount": 3,
"persistedToolCallCount": 1,
"returnedToolCallCount": 1,
"hasVerifierEvaluation": true,
"hasFeedback": false
}
}
@@ -0,0 +1,110 @@
{
"session": {
"sessionId": "eval-gatekeeper-fabricated-invocation",
"query": "支付失败是否能确认由日志中的连接池耗尽导致?",
"status": "SUCCESS",
"agentFlow": "CHAT",
"totalDurationMs": 39000,
"toolCallCount": 1,
"answer": "当前无法基于已获取证据生成可靠结论。\n\n证据引用校验失败:Executor 引用了不存在的工具调用记录,因此不能把连接池问题作为确认结论。建议重新收集日志证据后再判断。",
"selfEvaluation": {
"verifier_evaluation": {
"verdict": "REJECT",
"groundedness_score": 0.1,
"critical_fact_count": 1,
"gatekeeper_result": {
"status": "fail",
"failed_rules": ["evidence.invocation_ref"],
"warnings": [],
"errors": [
{
"rule_id": "evidence.invocation_ref",
"field": "claims[0].evidence_bindings[0].tool_invocation_id",
"message": "tool_invocation_id does not exist"
}
]
},
"executor_structured_output": {
"answer_version": "executor_evidence_v2",
"claims": [
{
"claim_id": "claim-1",
"claim_type": "root_cause",
"claim_text": "连接池耗尽导致支付失败",
"support_level": "direct",
"evidence_bindings": [
{
"tool_invocation_id": 99,
"tool_name": "query_logs",
"evidence_excerpt": "connection pool exhausted"
}
]
}
],
"hypotheses": [],
"recommended_actions": [
{
"action_text": "重新查询支付服务错误日志",
"reason": "当前 Executor 证据引用无法回溯"
}
],
"missing_info": ["需要有效的日志工具调用记录"]
},
"claim_checks": [
{
"claim_id": "claim-1",
"claim_text": "连接池耗尽导致支付失败",
"claim_type": "root_cause",
"verification": "unsupported",
"detail": "Gatekeeper 已判定证据引用不存在,不能确认该结论",
"evidence_refs": []
}
],
"facts_checked": [
{
"fact": "连接池耗尽导致支付失败",
"verification": "unsupported",
"detail": "Gatekeeper 已判定证据引用不存在,不能确认该结论",
"evidence_refs": []
}
],
"composer_output": {
"status": "valid",
"answer_summary": "证据引用校验失败,不能确认根因。",
"recommended_actions": [
{
"action_text": "重新查询支付服务错误日志",
"reason": "当前 Executor 证据引用无法回溯"
}
],
"user_facing_answer": "当前无法基于已获取证据生成可靠结论。\n\n证据引用校验失败:Executor 引用了不存在的工具调用记录,因此不能把连接池问题作为确认结论。建议重新收集日志证据后再判断。"
},
"tool_trace_summary": [
{
"tool_name": "query_logs",
"success": true,
"evidence_level": "direct"
}
]
}
}
},
"steps": [],
"toolInvocations": [
{
"id": 1,
"sessionId": "eval-gatekeeper-fabricated-invocation",
"toolName": "query_logs",
"outputPreview": "payment failed without matching connection pool exhaustion entry",
"success": true
}
],
"summary": {
"persistedStepCount": 3,
"returnedStepCount": 3,
"persistedToolCallCount": 1,
"returnedToolCallCount": 1,
"hasVerifierEvaluation": true,
"hasFeedback": false
}
}
@@ -0,0 +1,151 @@
{
"session": {
"sessionId": "eval-unsupported-claim-filtering",
"query": "订单超时是否可以确认由数据库主库故障导致?",
"status": "SUCCESS",
"agentFlow": "CHAT",
"totalDurationMs": 44000,
"toolCallCount": 1,
"answer": "以下结论基于当前已获取证据,仍存在部分证据缺口,请谨慎参考。\n\n已确认信息:日志显示订单接口出现超时。\n\n仍需补充信息:目前没有数据库故障日志或主库状态证据,不能把该方向写成确认根因。",
"selfEvaluation": {
"verifier_evaluation": {
"verdict": "LOW_CONFID",
"groundedness_score": 0.42,
"critical_fact_count": 2,
"gatekeeper_result": {
"status": "pass",
"failed_rules": [],
"warnings": [],
"errors": []
},
"executor_structured_output": {
"answer_version": "executor_evidence_v2",
"claims": [
{
"claim_id": "claim-timeout",
"claim_type": "symptom",
"claim_text": "订单接口出现超时",
"support_level": "direct",
"evidence_bindings": [
{
"tool_invocation_id": 1,
"tool_name": "query_logs",
"evidence_excerpt": "order api timeout"
}
]
},
{
"claim_id": "claim-db-primary",
"claim_type": "root_cause",
"claim_text": "数据库主库故障导致订单超时",
"support_level": "weak",
"evidence_bindings": [
{
"tool_invocation_id": 1,
"tool_name": "query_logs",
"evidence_excerpt": "order api timeout"
}
]
}
],
"hypotheses": [],
"recommended_actions": [
{
"action_text": "补充查询数据库主库状态和错误日志",
"reason": "当前只有订单接口超时日志"
}
],
"missing_info": ["数据库主库状态", "数据库错误日志"]
},
"claim_checks": [
{
"claim_id": "claim-timeout",
"claim_text": "订单接口出现超时",
"claim_type": "symptom",
"verification": "direct_observation",
"detail": "日志直接记录 order api timeout",
"evidence_refs": [
{
"tool_invocation_id": 1,
"tool_name": "query_logs"
}
]
},
{
"claim_id": "claim-db-primary",
"claim_text": "数据库主库故障导致订单超时",
"claim_type": "root_cause",
"verification": "unsupported",
"detail": "日志只能证明订单接口超时,不能证明数据库主库故障",
"evidence_refs": [
{
"tool_invocation_id": 1,
"tool_name": "query_logs"
}
]
}
],
"facts_checked": [
{
"fact": "订单接口出现超时",
"verification": "direct_evidence",
"detail": "日志直接记录 order api timeout",
"evidence_refs": [
{
"tool_invocation_id": 1,
"tool_name": "query_logs"
}
]
},
{
"fact": "数据库主库故障导致订单超时",
"verification": "unsupported",
"detail": "日志只能证明订单接口超时,不能证明数据库主库故障",
"evidence_refs": [
{
"tool_invocation_id": 1,
"tool_name": "query_logs"
}
]
}
],
"composer_output": {
"status": "valid",
"answer_summary": "日志显示订单接口超时,但数据库方向证据不足。",
"recommended_actions": [
{
"action_text": "补充查询数据库主库状态和错误日志",
"reason": "当前只有订单接口超时日志"
}
],
"user_facing_answer": "以下结论基于当前已获取证据,仍存在部分证据缺口,请谨慎参考。\n\n已确认信息:日志显示订单接口出现超时。\n\n仍需补充信息:目前没有数据库故障日志或主库状态证据,不能把该方向写成确认根因。"
},
"tool_trace_summary": [
{
"tool_name": "query_logs",
"success": true,
"evidence_level": "direct"
}
]
}
}
},
"steps": [],
"toolInvocations": [
{
"id": 1,
"sessionId": "eval-unsupported-claim-filtering",
"toolName": "query_logs",
"outputPreview": "order api timeout",
"success": true
}
],
"summary": {
"persistedStepCount": 3,
"returnedStepCount": 3,
"persistedToolCallCount": 1,
"returnedToolCallCount": 1,
"hasVerifierEvaluation": true,
"hasFeedback": false
}
}