mirror of
https://github.com/ThearchyHelios/AgentLab.git
synced 2026-11-22 12:11:58 +00:00
口径卡分母为 0 时算不出来就是空值,和「缺少输入」分开说;指标清单按格式渲染。助手节点手册讲口径卡的那段写明分母可能为 0 时写「… if 分母 else None」、不要写 else 0,附示例;画布校验加一条提醒 metrics.zero_for_undefined(按语法树认:条件表达式一边有除法、另一边是常量 0,两边对调、套在 round 里、嵌套的都认)。输入都齐、计算式自己交回空值的指标多记 undefined: true(状态仍是 missing_input,按状态认的地方和老运行不受影响),清单、写作目录、引用解析不了的原因、运行对比、证据面板都说「算不出来(这组输入下计算式没有值,比如分母为 0)」;推演把它当不带值的字段。指标清单({{ nodes.卡.text }})改用卡上渲染好的 rendered:比率 0.0007 显示成 0.07%、金额带千分位,和报告里 [[m:]] 一致;有值却显示不出来的照实说,不拼原值
This commit is contained in:
@@ -350,6 +350,8 @@ export const EVIDENCE_TEXT = {
|
||||
unmatchedPlain: '无法追溯的数字:',
|
||||
uncited: '该数字未使用引用标记,系统无法核对其来源',
|
||||
missingValue: '缺少输入:口径卡本次未计算出该指标的值',
|
||||
/** 指标没有值、但不是缺输入:输入都齐,计算式自己算不出来(比如分母为 0) */
|
||||
undefinedValue: '算不出来:这组输入下计算式没有值(比如分母为 0),不是缺少输入',
|
||||
/** 指标拿截断的查询结果整组算出来(计数、求和……):值只算到了取回的那部分,出具按缺口降档 */
|
||||
incomplete: '结果不完整',
|
||||
incompleteFallback: '基于被截断的查询结果计算,结果不完整',
|
||||
|
||||
@@ -1361,6 +1361,8 @@ function MetricPart({ step, entry, inputs, runId, runClass, seal, pending, faile
|
||||
// 口径卡里 rendered 为「—」有两种:value 为 null 是缺输入,不为 null 是有值但按格式显示不出来
|
||||
const dash = rendered === NONE || entry?.rendered === NONE
|
||||
const missing = entry?.status === 'missing_input' || (value == null && (dash || !resolved))
|
||||
// 没有值的两种:缺输入,和输入都齐、计算式自己算不出来(分母为 0,口径卡记了 undefined)
|
||||
const undefinedValue = missing && (step?.undefined === true || entry?.undefined === true)
|
||||
const unshowable = !missing && dash && value != null
|
||||
// 拿截断的查询结果整组算出来的:值是真的算出来的,但只算到了取回的那部分,出具已按缺口降档
|
||||
const incomplete = step?.incomplete === true || entry?.incomplete === true
|
||||
@@ -1416,7 +1418,12 @@ function MetricPart({ step, entry, inputs, runId, runClass, seal, pending, faile
|
||||
)}
|
||||
{dualCheck && <DualCheckLine check={dualCheck} formal={runClass === 'formal'} />}
|
||||
<Integrity step={step} seal={seal} />
|
||||
{missing && <p className="mt-1" style={{ color: 'var(--st-waiting)' }} data-ev-missing="">{EVIDENCE_TEXT.missingValue}</p>}
|
||||
{missing && (
|
||||
<p className="mt-1" style={{ color: 'var(--st-waiting)' }} data-ev-missing=""
|
||||
{...(undefinedValue ? { 'data-ev-undefined': '' } : {})}>
|
||||
{undefinedValue ? EVIDENCE_TEXT.undefinedValue : EVIDENCE_TEXT.missingValue}
|
||||
</p>
|
||||
)}
|
||||
{incomplete && (
|
||||
<p className="mt-1" style={{ color: 'var(--st-waiting)' }} data-ev-incomplete-reason="">{incompleteReason}</p>
|
||||
)}
|
||||
|
||||
@@ -2399,6 +2399,8 @@ export interface EvidenceStep extends Omit<EvidenceInput, 'status'> {
|
||||
sql_check_failed?: boolean
|
||||
/** metric:没通过的原因(人话,「所依据的查询未通过 SQL 检查(…),结果不可靠」) */
|
||||
sql_check_reason?: string
|
||||
/** metric:没有值,不是缺输入,是输入都齐、计算式自己算不出来(分母为 0)。状态仍是 missing_input */
|
||||
undefined?: boolean
|
||||
/** metric(期 4):这个指标的双盲复算状态。没有双盲复算复核过这份指标集时没有这个键 */
|
||||
dual_check?: EvidenceDualCheck
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user