|
|
@@ -392,6 +392,9 @@ export function formatRunResult(agentName: string, run: Record<string, unknown>,
|
|
|
const artifacts = Array.isArray(run.artifacts) ? run.artifacts : []
|
|
|
const metadata: Record<string, unknown> = { ...run, ...extra, status, artifacts }
|
|
|
const science = asRecord(asRecord(run.research)?.science)
|
|
|
+ const outcome = asRecord(science?.outcome)
|
|
|
+ const outcomes = outcome?.schema_version === 1 && Array.isArray(outcome.lines)
|
|
|
+ ? outcome.lines.filter((line): line is string => typeof line === "string").map(line => line.replace(/[\r\n\x00-\x1f]/g, " ")) : []
|
|
|
const operation = asRecord(science?.operation)
|
|
|
const resultOnly = ["review_results", "clarify"].includes(getString(operation?.operation))
|
|
|
const acceptance = asRecord(asRecord(science?.acceptance)?.dimensions)
|
|
|
@@ -424,11 +427,12 @@ export function formatRunResult(agentName: string, run: Record<string, unknown>,
|
|
|
title:
|
|
|
status === "completed"
|
|
|
? science
|
|
|
- ? scientificLabel(science.status)
|
|
|
+ ? outcomes.length ? getString(outcome?.headline) : scientificLabel(science.status)
|
|
|
: `AgentPaaS ${agentName}`
|
|
|
: `AgentPaaS ${agentName}(${labels[status] ?? "状态待核查"})`,
|
|
|
output: [
|
|
|
- ...(science ? [`研究状态:${scientificLabel(science.status)}。执行结束不代表科学结论成立。`] : []),
|
|
|
+ ...outcomes,
|
|
|
+ ...(science && !outcomes.length ? [`研究状态:${scientificLabel(science.status)}。执行结束不代表科学结论成立。`] : []),
|
|
|
...(operation?.operation === "review_results" ? ["本次操作:复核已有结果;保留研究定义与实验记录,未重新规划或执行实验。"] : []),
|
|
|
...(operation?.operation === "clarify" ? ["本次操作:等待说明研究意图;未启动研究或实验。"] : []),
|
|
|
...(asRecord(acceptance?.plan_review)?.status === "not_reassessed" ? ["原方案:本次未重审,原有待修订项继续保留;review-parent-gate.json。"] : []),
|
|
|
@@ -441,7 +445,7 @@ export function formatRunResult(agentName: string, run: Record<string, unknown>,
|
|
|
...(!resultOnly ? [`高层研究计划含 ${researchIR.planned_actions ?? "未报告"} 项行动,不代表全部已执行;详情见 execution-ir.json。`] : []),
|
|
|
...(researchIR.engine === "lambda_cek" ? ["执行引擎:Lambda / CEK;程序凭据不代表科学结论成立。"] : []),
|
|
|
] : []),
|
|
|
- ...(science?.execution_status === "conditional_diagnostic_completed"
|
|
|
+ ...(!outcomes.length && science?.execution_status === "conditional_diagnostic_completed"
|
|
|
? ["模拟状态:已完成设定模型下的诊断;证据充分性与现实适用性须另行判断。"]
|
|
|
: []),
|
|
|
...(status === "failed"
|