niceeval 0.6.2 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/INDEX.md +23 -23
- package/README.zh.md +6 -6
- package/dist/agents/types.d.ts +2 -2
- package/dist/i18n/zh-CN.d.ts +3 -3
- package/dist/report/aggregate.d.ts +32 -26
- package/dist/report/aggregate.js +157 -76
- package/dist/report/built-in/index.d.ts +2 -0
- package/dist/report/built-in/index.js +8 -0
- package/dist/report/components.d.ts +91 -164
- package/dist/report/components.js +377 -114
- package/dist/report/compute.d.ts +86 -73
- package/dist/report/compute.js +592 -432
- package/dist/report/flag.d.ts +28 -17
- package/dist/report/flag.js +86 -16
- package/dist/report/format.d.ts +11 -11
- package/dist/report/format.js +17 -15
- package/dist/report/index.d.ts +16 -17
- package/dist/report/index.js +20 -22
- package/dist/report/load.js +3 -2
- package/dist/report/locale.d.ts +49 -34
- package/dist/report/locale.js +106 -58
- package/dist/report/metrics.d.ts +10 -3
- package/dist/report/metrics.js +46 -12
- package/dist/report/primitives.d.ts +42 -15
- package/dist/report/primitives.js +135 -26
- package/dist/report/react/AttemptList.d.ts +10 -8
- package/dist/report/react/AttemptList.js +18 -10
- package/dist/report/react/DeltaTable.js +19 -18
- package/dist/report/react/EvalList.d.ts +3 -3
- package/dist/report/react/EvalList.js +0 -0
- package/dist/report/react/ExperimentComparison.d.ts +4 -2
- package/dist/report/react/ExperimentComparison.js +5 -4
- package/dist/report/react/ExperimentList.d.ts +3 -3
- package/dist/report/react/ExperimentList.js +16 -15
- package/dist/report/react/MetricBars.js +5 -4
- package/dist/report/react/MetricLine.js +12 -5
- package/dist/report/react/MetricMatrix.js +1 -1
- package/dist/report/react/MetricScatter.js +54 -17
- package/dist/report/react/MetricTable.js +2 -12
- package/dist/report/react/ScopeSummary.d.ts +10 -0
- package/dist/report/react/ScopeSummary.js +17 -0
- package/dist/report/react/Scoreboard.js +6 -6
- package/dist/report/react/cell.js +2 -2
- package/dist/report/react/fixtures.d.ts +5 -9
- package/dist/report/react/fixtures.js +105 -149
- package/dist/report/react/index.d.ts +15 -5
- package/dist/report/react/index.js +18 -7
- package/dist/report/report.d.ts +137 -20
- package/dist/report/report.js +261 -34
- package/dist/report/text/faces.d.ts +17 -19
- package/dist/report/text/faces.js +225 -157
- package/dist/report/text/plot.js +1 -1
- package/dist/report/text/table.js +2 -2
- package/dist/report/tree.d.ts +90 -40
- package/dist/report/tree.js +252 -94
- package/dist/report/types.d.ts +245 -300
- package/dist/report/types.js +4 -3
- package/dist/report/web.d.ts +21 -5
- package/dist/report/web.js +42 -16
- package/dist/results/select.d.ts +38 -16
- package/dist/results/select.js +73 -25
- package/dist/results/types.d.ts +38 -14
- package/dist/shared/aggregate.d.ts +3 -2
- package/dist/shared/aggregate.js +5 -4
- package/docs-site/zh/README.md +44 -0
- package/docs-site/zh/examples/ai-agent-application.mdx +63 -0
- package/docs-site/zh/examples/coding-agent-extensions.mdx +57 -0
- package/docs-site/zh/examples/index.mdx +50 -0
- package/docs-site/zh/{concepts → explanation}/adapter.mdx +11 -11
- package/docs-site/zh/{concepts → explanation}/assert.mdx +7 -7
- package/docs-site/zh/{concepts → explanation}/drive.mdx +8 -8
- package/docs-site/zh/{concepts → explanation}/evals.mdx +4 -4
- package/docs-site/zh/{concepts → explanation}/experiment.mdx +8 -8
- package/docs-site/zh/{concepts → explanation}/hitl.mdx +8 -8
- package/docs-site/zh/{concepts → explanation}/judge.mdx +5 -5
- package/docs-site/zh/{concepts → explanation}/overview.mdx +5 -5
- package/docs-site/zh/{guides → explanation}/runner.mdx +1 -1
- package/docs-site/zh/{concepts → explanation}/tier.mdx +6 -6
- package/docs-site/zh/{guides → how-to}/agent-feedback-loop.mdx +7 -7
- package/docs-site/zh/{guides → how-to}/authoring.mdx +2 -2
- package/docs-site/zh/{guides → how-to}/connect-otel.mdx +6 -6
- package/docs-site/zh/{guides → how-to}/connect-your-agent.mdx +18 -18
- package/docs-site/zh/{guides → how-to}/custom-reports.mdx +6 -6
- package/docs-site/zh/{guides → how-to}/experiments.mdx +3 -3
- package/docs-site/zh/{guides → how-to}/publish-report.mdx +2 -2
- package/docs-site/zh/{guides → how-to}/sandbox-agent.mdx +2 -2
- package/docs-site/zh/{guides → how-to}/sandbox-providers.mdx +1 -1
- package/docs-site/zh/{guides → how-to}/viewing-results.mdx +6 -6
- package/docs-site/zh/{guides → how-to}/write-experiment.mdx +3 -3
- package/docs-site/zh/{guides → how-to}/write-send.mdx +13 -13
- package/docs-site/zh/index.mdx +23 -25
- package/docs-site/zh/introduction.mdx +8 -8
- package/docs-site/zh/reference/builtin-agents.mdx +5 -5
- package/docs-site/zh/reference/capabilities.mdx +6 -6
- package/docs-site/zh/reference/cli.mdx +9 -7
- package/docs-site/zh/reference/define-agent.mdx +1 -1
- package/docs-site/zh/reference/events.mdx +3 -3
- package/docs-site/zh/{guides → reference}/official-adapters.mdx +7 -7
- package/docs-site/zh/{guides → reference}/report-components.mdx +5 -5
- package/docs-site/zh/{guides → reference}/results-data.mdx +5 -5
- package/docs-site/zh/{guides → troubleshooting}/debug-sandbox.mdx +2 -2
- package/docs-site/zh/{guides → troubleshooting}/debugging.mdx +4 -2
- package/docs-site/zh/{quickstart.mdx → tutorials/quickstart.mdx} +5 -17
- package/package.json +6 -2
- package/src/agents/index.ts +2 -2
- package/src/agents/openai-compat.ts +1 -1
- package/src/agents/streaming.ts +2 -2
- package/src/agents/types.ts +3 -3
- package/src/cli.ts +42 -23
- package/src/context/context.ts +1 -1
- package/src/context/session.test.ts +1 -1
- package/src/context/session.ts +1 -1
- package/src/i18n/en.ts +18 -16
- package/src/i18n/zh-CN.ts +16 -15
- package/src/report/aggregate.ts +175 -87
- package/src/report/built-in/index.tsx +9 -0
- package/src/report/components.tsx +625 -285
- package/src/report/compute.ts +717 -515
- package/src/report/dual-render.test.tsx +738 -1148
- package/src/report/flag.ts +97 -33
- package/src/report/format.ts +18 -22
- package/src/report/index.ts +113 -58
- package/src/report/load.ts +3 -2
- package/src/report/locale.ts +120 -69
- package/src/report/metrics.ts +42 -12
- package/src/report/primitives.tsx +190 -45
- package/src/report/react/AttemptList.tsx +32 -20
- package/src/report/react/DeltaTable.tsx +63 -45
- package/src/report/react/EvalList.tsx +0 -0
- package/src/report/react/ExperimentComparison.tsx +12 -7
- package/src/report/react/ExperimentList.tsx +38 -26
- package/src/report/react/MetricBars.tsx +5 -4
- package/src/report/react/MetricLine.tsx +13 -8
- package/src/report/react/MetricMatrix.tsx +2 -2
- package/src/report/react/MetricScatter.tsx +74 -20
- package/src/report/react/MetricTable.tsx +4 -76
- package/src/report/react/ScopeSummary.tsx +86 -0
- package/src/report/react/Scoreboard.tsx +28 -10
- package/src/report/react/cell.tsx +2 -2
- package/src/report/react/enhance.js +57 -5
- package/src/report/react/fixtures.ts +109 -156
- package/src/report/react/index.tsx +24 -39
- package/src/report/react/render.test.tsx +139 -104
- package/src/report/react/styles.css +181 -91
- package/src/report/report.test.ts +761 -1031
- package/src/report/report.ts +425 -47
- package/src/report/text/faces.ts +257 -164
- package/src/report/text/plot.ts +1 -1
- package/src/report/text/table.ts +2 -2
- package/src/report/tree.ts +362 -104
- package/src/report/types.ts +257 -287
- package/src/report/web.ts +63 -20
- package/src/results/attempt-evidence.test.ts +4 -4
- package/src/results/attempt-evidence.ts +5 -5
- package/src/results/copy.ts +6 -6
- package/src/results/host-equivalence.test.ts +26 -14
- package/src/results/index.ts +10 -4
- package/src/results/open.ts +8 -4
- package/src/results/results.test.ts +4 -3
- package/src/results/select.ts +104 -34
- package/src/results/types.ts +36 -14
- package/src/runner/feedback/human.test.ts +1 -1
- package/src/runner/run.ts +1 -1
- package/src/sandbox/cli-commands.ts +2 -2
- package/src/scoring/judge.test.ts +1 -1
- package/src/shared/aggregate.ts +5 -4
- package/src/show/compose.ts +50 -67
- package/src/show/index.ts +107 -56
- package/src/show/render.ts +43 -27
- package/src/show/report-host.test.ts +188 -0
- package/src/show/report-host.ts +375 -0
- package/src/show/show.test.ts +86 -36
- package/src/view/app/App.test.tsx +69 -0
- package/src/view/app/App.tsx +144 -48
- package/src/view/app/components/AttemptModal.tsx +324 -63
- package/src/view/app/components/CodeView.tsx +10 -4
- package/src/view/app/i18n.ts +31 -17
- package/src/view/app/main.tsx +13 -8
- package/src/view/app/pages/{RunsPage.tsx → AttemptsPage.tsx} +6 -6
- package/src/view/app/types.ts +4 -1
- package/src/view/client-dist/app.css +1 -1
- package/src/view/client-dist/app.js +14 -14
- package/src/view/data.test.ts +9 -3
- package/src/view/data.ts +145 -49
- package/src/view/index.ts +48 -44
- package/src/view/server.ts +35 -15
- package/src/view/shared/types.ts +34 -5
- package/src/view/styles.css +224 -0
- package/src/view/view-report.test.ts +161 -57
- package/dist/report/built-ins/experiment-comparison.d.ts +0 -39
- package/dist/report/built-ins/experiment-comparison.js +0 -119
- package/dist/report/built-ins/index.d.ts +0 -2
- package/dist/report/built-ins/index.js +0 -2
- package/dist/report/react/GroupSummary.d.ts +0 -8
- package/dist/report/react/GroupSummary.js +0 -8
- package/dist/report/react/RunOverview.d.ts +0 -8
- package/dist/report/react/RunOverview.js +0 -12
- package/docs-site/zh/example/ai-agent-application.mdx +0 -152
- package/docs-site/zh/example/claude-code-codex-plugin.mdx +0 -167
- package/docs-site/zh/example/claude-code-codex-skill.mdx +0 -152
- package/docs-site/zh/example/showcase.mdx +0 -39
- package/src/report/built-in-user-parity.test.tsx +0 -597
- package/src/report/built-ins/experiment-comparison.tsx +0 -179
- package/src/report/built-ins/index.ts +0 -7
- package/src/report/react/GroupSummary.tsx +0 -66
- package/src/report/react/RunOverview.tsx +0 -109
- /package/docs-site/zh/{example/tier1-ai-sdk-v7.mdx → examples/integrations/ai-sdk-v7.mdx} +0 -0
- /package/docs-site/zh/{example/tier1-claude-sdk.mdx → examples/integrations/claude-sdk.mdx} +0 -0
- /package/docs-site/zh/{example/tier1-codex-sdk.mdx → examples/integrations/codex-sdk.mdx} +0 -0
- /package/docs-site/zh/{example/tier1-langgraph.mdx → examples/integrations/langgraph.mdx} +0 -0
- /package/docs-site/zh/{example/tier1-pi-sdk.mdx → examples/integrations/pi-sdk.mdx} +0 -0
- /package/docs-site/zh/{guides → how-to}/ci-integration.mdx +0 -0
- /package/docs-site/zh/{guides → how-to}/dataset-fanout.mdx +0 -0
- /package/docs-site/zh/{guides → how-to}/fixtures.mdx +0 -0
- /package/docs-site/zh/{guides → how-to}/reporters.mdx +0 -0
- /package/docs-site/zh/{guides → how-to}/scoring-guide.mdx +0 -0
package/dist/report/types.d.ts
CHANGED
|
@@ -1,21 +1,23 @@
|
|
|
1
|
-
import type { AttemptHandle,
|
|
1
|
+
import type { AttemptHandle, Scope, ScopeWarning, Snapshot } from "../results/types.ts";
|
|
2
2
|
import type { AttemptLocator } from "../results/locator.ts";
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
5
|
-
export type {
|
|
3
|
+
import type { ExperimentRunInfo, JsonValue, Verdict } from "../types.ts";
|
|
4
|
+
import type { LocalizedText, ReportLocale } from "./locale.ts";
|
|
5
|
+
export type { ScopeWarning };
|
|
6
6
|
export type { AttemptLocator };
|
|
7
|
-
export type {
|
|
7
|
+
export type { LocalizedText, ReportLocale };
|
|
8
|
+
/** 所有官方计算函数的第一参:Scope(warnings 随行)或手工挑的快照数组(没有挑选过程,自然无警告)。 */
|
|
9
|
+
export type ReportInput = Scope | readonly Snapshot[];
|
|
8
10
|
/** 两级聚合里单级的折叠方式。 */
|
|
9
|
-
export type Aggregator = "mean" | "sum" | "min" | "max" | ((values: number[]) => number);
|
|
11
|
+
export type Aggregator = "mean" | "sum" | "min" | "max" | ((values: readonly number[]) => number);
|
|
10
12
|
/**
|
|
11
13
|
* 两级聚合:「每格 attempt 数相等」是幻觉(earlyExit 让失败的题天然比通过的题样本多),
|
|
12
14
|
* 平铺求均值会让分数和重试策略纠缠;所以先题内折叠、再跨题折叠,默认宏平均。
|
|
13
15
|
*/
|
|
14
16
|
export interface MetricAggregate {
|
|
15
|
-
/** 第一级:同一
|
|
17
|
+
/** 第一级:同一 experiment × eval 的多个 attempt 先折成题级值;默认 "mean"。 */
|
|
16
18
|
perEval?: Aggregator;
|
|
17
|
-
/**
|
|
18
|
-
|
|
19
|
+
/** 第二级:题级值再跨 experiment × eval 折成终值;默认 "mean"。 */
|
|
20
|
+
acrossEvals?: Aggregator;
|
|
19
21
|
}
|
|
20
22
|
/**
|
|
21
23
|
* 指标:纯函数,吃一个 AttemptHandle 吐一个值(null = 此 attempt 测不了这个指标,
|
|
@@ -26,16 +28,13 @@ export interface MetricAggregate {
|
|
|
26
28
|
export interface Metric<Name extends string = string> {
|
|
27
29
|
/** MetricColumn.key 与列头的来源;同一次计算里重名是错误。 */
|
|
28
30
|
name: Name;
|
|
29
|
-
/**
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
*/
|
|
33
|
-
label?: LocalizedLabel;
|
|
34
|
-
description?: string;
|
|
35
|
-
/** 渲染提示:越高越好还是越低越好(排序方向、轴向、涨跌配色用)。 */
|
|
36
|
-
better?: "higher" | "lower";
|
|
31
|
+
/** 列头;省略时用 name。渲染面按 locale 解析,缺项走 LocalizedText 回退规则。 */
|
|
32
|
+
label?: LocalizedText;
|
|
33
|
+
description?: LocalizedText;
|
|
37
34
|
/** 驱动内置格式化:"%" → 87%、"ms" → 1.2s、"$" → $0.31、其余 → 1.2k 缩写。 */
|
|
38
35
|
unit?: string;
|
|
36
|
+
/** 渲染提示:越高越好还是越低越好(排序方向、轴向、涨跌配色用)。 */
|
|
37
|
+
better?: "higher" | "lower";
|
|
39
38
|
/**
|
|
40
39
|
* 声明式前置:不满足 → null,语义等价于在 value 开头 return null。
|
|
41
40
|
* 单独设字段是因为这一步最容易忘(忘了它,code-golf 会奖励「写得短的坏代码」)。
|
|
@@ -43,51 +42,58 @@ export interface Metric<Name extends string = string> {
|
|
|
43
42
|
where?: (attempt: AttemptHandle) => boolean;
|
|
44
43
|
value(attempt: AttemptHandle): number | null | Promise<number | null>;
|
|
45
44
|
aggregate?: MetricAggregate;
|
|
46
|
-
/** 覆盖 unit
|
|
47
|
-
display?: (value: number) => string;
|
|
45
|
+
/** 覆盖 unit 驱动的内置格式化;只格式化同一个终值,不按 locale 分裂计算口径。 */
|
|
46
|
+
display?: (value: number, locale: ReportLocale) => string;
|
|
48
47
|
}
|
|
49
48
|
/**
|
|
50
|
-
*
|
|
51
|
-
* - "evalGroup" = eval id
|
|
52
|
-
* - "snapshot" = "<experimentId> @ <startedAt>"
|
|
49
|
+
* 内置维度就是结果已有的身份字段。
|
|
50
|
+
* - "evalGroup" = eval id 的完整父路径("a/b/c" → "a/b";无 "/" 取完整 id,与可比组同一条派生规则)
|
|
51
|
+
* - "snapshot" = "<experimentId> @ <startedAt>",把两次快照并排成行
|
|
53
52
|
*/
|
|
54
|
-
export type
|
|
53
|
+
export type BuiltInDimension = "agent" | "model" | "experiment" | "eval" | "evalGroup" | "snapshot";
|
|
54
|
+
/** 自定义维度:一个函数把 attempt 分到组。 */
|
|
55
|
+
export interface CustomDimension {
|
|
55
56
|
name: string;
|
|
56
|
-
of
|
|
57
|
-
};
|
|
58
|
-
/**
|
|
59
|
-
* flag() 的产物:把 experiment 声明的 flags 当维度(series / rows / columns / points
|
|
60
|
-
* 槽,按声明值分组)或轴(MetricLine 的 x 槽,要求数值并驱动刻度)。
|
|
61
|
-
* 未声明该 flag 的 experiment 不猜:分组如实归「(unset)」,作轴不画点、注脚报数。
|
|
62
|
-
*/
|
|
63
|
-
export interface FlagRef {
|
|
64
|
-
readonly kind: "flag";
|
|
65
|
-
readonly name: string;
|
|
66
|
-
/** 组标签 / 轴标签;函数形态把声明值折成组名(如 `(v) => \`${v} agents\``)。 */
|
|
67
|
-
readonly label?: string | ((value: string | number | boolean) => string);
|
|
68
|
-
readonly unit?: string;
|
|
57
|
+
of(attempt: AttemptHandle): string;
|
|
69
58
|
}
|
|
70
59
|
/**
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
*
|
|
60
|
+
* flag() / runConfig() 的产物:把 experiment 声明的 flag 或顶层运行配置当分组维度。
|
|
61
|
+
* 读取的 JSON 值可能是任意形状,分组显示键按稳定 JSON 规则生成;缺失值显示内置文案
|
|
62
|
+
* `(missing)`,不同原始值撞出同一显示键时计算报错并要求改用 CustomDimension。
|
|
74
63
|
*/
|
|
75
|
-
export interface
|
|
76
|
-
readonly kind: "
|
|
64
|
+
export interface DimensionRef {
|
|
65
|
+
readonly kind: "flag" | "runConfig";
|
|
77
66
|
readonly name: string;
|
|
78
|
-
|
|
79
|
-
readonly label?: string | ((value: string | number | boolean) => string);
|
|
67
|
+
readonly label?: LocalizedText;
|
|
80
68
|
readonly unit?: string;
|
|
81
69
|
}
|
|
82
|
-
/**
|
|
83
|
-
export type
|
|
84
|
-
/**
|
|
85
|
-
export
|
|
70
|
+
/** 维度槽的输入:内置维度、自定义维度,或 flag() / runConfig() 的产物。 */
|
|
71
|
+
export type DimensionInput = BuiltInDimension | CustomDimension | DimensionRef;
|
|
72
|
+
/** MetricLine 的 x 轴:必须是数值;字符串配置显式映射,组件不猜 low < medium < high。 */
|
|
73
|
+
export interface NumericAxis {
|
|
74
|
+
name: string;
|
|
75
|
+
label?: LocalizedText;
|
|
76
|
+
unit?: string;
|
|
77
|
+
of(attempt: AttemptHandle): number | null;
|
|
78
|
+
}
|
|
79
|
+
export interface DimensionOptions {
|
|
80
|
+
label?: LocalizedText;
|
|
81
|
+
unit?: string;
|
|
82
|
+
}
|
|
83
|
+
export interface NumericAxisOptions extends DimensionOptions {
|
|
84
|
+
}
|
|
85
|
+
export interface NumericRunConfigAxisOptions extends NumericAxisOptions {
|
|
86
|
+
/** 字符串配置到数值轴的显式映射;数值配置不需要。 */
|
|
87
|
+
map?: Readonly<Record<string, number>>;
|
|
88
|
+
}
|
|
89
|
+
/** runConfig() 的可用键:ExperimentRunInfo 字段全集,外加桥接到快照顶层权威字段的 model / agent。 */
|
|
90
|
+
export type RunConfigKey = keyof ExperimentRunInfo | "model" | "agent";
|
|
86
91
|
export interface MetricColumn {
|
|
87
92
|
/** = metric.name,与 cells 的键对应。 */
|
|
88
93
|
key: string;
|
|
89
|
-
/** 数据层原样携带 metric.label(可本地化)
|
|
90
|
-
label:
|
|
94
|
+
/** 数据层原样携带 metric.label(可本地化);渲染面按 locale 解析。 */
|
|
95
|
+
label: LocalizedText;
|
|
96
|
+
description?: LocalizedText;
|
|
91
97
|
unit?: string;
|
|
92
98
|
/** 渲染提示:排序方向、轴向、涨跌配色。 */
|
|
93
99
|
better?: "higher" | "lower";
|
|
@@ -95,332 +101,271 @@ export interface MetricColumn {
|
|
|
95
101
|
export interface MetricCell {
|
|
96
102
|
/** 聚合后的值;null = 该组没有任何有效样本。 */
|
|
97
103
|
value: number | null;
|
|
98
|
-
/**
|
|
99
|
-
|
|
100
|
-
|
|
104
|
+
/**
|
|
105
|
+
* 已格式化的显示值;计算函数为官方生成面覆盖的每个 locale(当前 en、zh-CN)生成,
|
|
106
|
+
* renderer 按 LocalizedText 回退规则选择,其它 locale 回退 en。
|
|
107
|
+
*/
|
|
108
|
+
display: LocalizedText;
|
|
109
|
+
/** 有效 attempt 数(指标返回非 null 的 attempt)。 */
|
|
101
110
|
samples: number;
|
|
102
|
-
/**
|
|
111
|
+
/** 本格子覆盖的 attempt 总数,包含值为 null 的 attempt。 */
|
|
103
112
|
total: number;
|
|
104
113
|
/**
|
|
105
|
-
*
|
|
114
|
+
* 本格子覆盖的全部 attempt(包含指标值为 null 的证据)—— 回到证据的引用。必填(可空数组):
|
|
106
115
|
* 「每个数字点进去就是证据」是页面的核心承诺,可选字段会让深链静默缺失。
|
|
107
116
|
*/
|
|
108
117
|
refs: AttemptLocator[];
|
|
109
118
|
}
|
|
110
119
|
/**
|
|
111
|
-
*
|
|
112
|
-
*
|
|
113
|
-
*
|
|
114
|
-
* `lastRunAt` 则渲染成行键下的一行紧凑摘要——与 view 原生榜单同一份信息密度。
|
|
115
|
-
* `MetricTable` 只表达维度 × 指标,没有实体下钻——要展开到 experiment 的 Eval 或
|
|
116
|
-
* Eval 的 Attempt,用 `ExperimentList` / `EvalList`,这里不再有 `subRows`。
|
|
120
|
+
* 数据形状的字段命名规则(docs/feature/reports/library/metric-views.md「共用数据形状」):
|
|
121
|
+
* 维度名字段 = 产生它的选项名 + `Dimension` 后缀,值是解析后的维度 name;
|
|
122
|
+
* 条目数组一律叫 `rows`(Matrix 的稀疏格子叫 `cells`);条目内的 key / series 是维度值,不带后缀。
|
|
117
123
|
*/
|
|
118
|
-
export interface
|
|
119
|
-
|
|
120
|
-
model?: string;
|
|
121
|
-
/** eval 级折叠计票(foldEvalVerdict 口径,与 view 榜单同一套):每题折成单一判定后计数。 */
|
|
122
|
-
verdicts?: {
|
|
123
|
-
passed: number;
|
|
124
|
-
failed: number;
|
|
125
|
-
errored: number;
|
|
126
|
-
skipped: number;
|
|
127
|
-
};
|
|
128
|
-
/**
|
|
129
|
-
* `rows: "experiment"` 专属:这一行覆盖的 eval 数(去重后,summarizeItems 口径,与
|
|
130
|
-
* `verdicts` 四项之和一致)。其它行维度(agent/eval/自定义…)没有「这一行是几道题」的
|
|
131
|
-
* 独立语义(题本身就是行),不携带这个字段。
|
|
132
|
-
*/
|
|
133
|
-
evals?: number;
|
|
134
|
-
/**
|
|
135
|
-
* `rows: "experiment"` 专属:这一行覆盖的 attempt 总数(原始计数,含多轮重试)。
|
|
136
|
-
* 大于 `evals` 说明存在多轮重试(early-exit 复测 / flaky 重跑);等于 `evals` 说明
|
|
137
|
-
* 每题只跑了一轮。同上,只在 `rows: "experiment"` 时语义成立。
|
|
138
|
-
*/
|
|
139
|
-
attempts?: number;
|
|
140
|
-
/**
|
|
141
|
-
* `rows: "experiment"` 专属:这一行覆盖范围内快照 `startedAt` 的最大值(最近一次运行
|
|
142
|
-
* 时间,ISO 8601,字符串比较即可比大小)。组内没有任何 item 时缺席。
|
|
143
|
-
*/
|
|
144
|
-
lastRunAt?: string;
|
|
145
|
-
}
|
|
146
|
-
/** 列键 K 来自 columns 元组的字面量 name:拼错列名编译不过,不是运行时 undefined。 */
|
|
147
|
-
export interface TableData<K extends string = string> {
|
|
148
|
-
/** 行维度名,如 "agent"。 */
|
|
149
|
-
dimension: string;
|
|
124
|
+
export interface TableData {
|
|
125
|
+
rowDimension: string;
|
|
150
126
|
columns: MetricColumn[];
|
|
151
|
-
rows: {
|
|
127
|
+
rows: Array<{
|
|
152
128
|
key: string;
|
|
153
|
-
cells: Record<
|
|
154
|
-
|
|
155
|
-
}[];
|
|
129
|
+
cells: Record<string, MetricCell>;
|
|
130
|
+
}>;
|
|
156
131
|
}
|
|
157
132
|
export interface MatrixData {
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
/** 列维度名,如 "agent"。 */
|
|
161
|
-
columns: string;
|
|
133
|
+
rowDimension: string;
|
|
134
|
+
columnDimension: string;
|
|
162
135
|
metric: MetricColumn;
|
|
163
|
-
/**
|
|
164
|
-
cells: {
|
|
136
|
+
/** 稀疏格子:没有 attempt 的组合不生成格子。 */
|
|
137
|
+
cells: Array<{
|
|
165
138
|
row: string;
|
|
166
139
|
column: string;
|
|
167
140
|
cell: MetricCell;
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
export interface ScoreboardData {
|
|
171
|
-
/**
|
|
172
|
-
* 被打分的维度名,如 "agent"。
|
|
173
|
-
* (计算函数的维度槽叫 rows,与 MetricTable.data 统一;数据形状上行数组已占用
|
|
174
|
-
* rows 一词,维度名沿用 TableData 的 dimension。)
|
|
175
|
-
*/
|
|
176
|
-
dimension: string;
|
|
177
|
-
fullMarks: number;
|
|
178
|
-
/** 实际生效的权重表(按匹配顺序:最长前缀在前)—— 成绩单可审计。 */
|
|
179
|
-
weights: {
|
|
180
|
-
prefix: string;
|
|
181
|
-
weight: number;
|
|
182
|
-
}[];
|
|
183
|
-
rows: {
|
|
184
|
-
key: string;
|
|
185
|
-
/** 已折算到 fullMarks。 */
|
|
186
|
-
total: {
|
|
187
|
-
value: number;
|
|
188
|
-
display: string;
|
|
189
|
-
};
|
|
190
|
-
subjects: {
|
|
191
|
-
/** 科目(subjects 维度的值)。 */
|
|
192
|
-
key: string;
|
|
193
|
-
/** 加权得分。 */
|
|
194
|
-
earned: number;
|
|
195
|
-
/** 科目分值合计。 */
|
|
196
|
-
possible: number;
|
|
197
|
-
/** 题数。 */
|
|
198
|
-
evals: number;
|
|
199
|
-
/** 无任何样本、按 0 计的题数 —— 固定分母的如实注脚。 */
|
|
200
|
-
missing: number;
|
|
201
|
-
}[];
|
|
202
|
-
}[];
|
|
141
|
+
}>;
|
|
203
142
|
}
|
|
204
143
|
export interface ScatterData {
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
/**
|
|
208
|
-
series?: string;
|
|
209
|
-
/** better: "lower" → 组件反向画轴,「好」的角落恒在右上。 */
|
|
144
|
+
pointDimension: string;
|
|
145
|
+
seriesDimension?: string;
|
|
146
|
+
/** 轴方向跟随 better:lower 反向渲染(值大在左/下),「更好」恒指向右上;刻度显示真实值。 */
|
|
210
147
|
x: MetricColumn;
|
|
211
148
|
y: MetricColumn;
|
|
212
|
-
rows: {
|
|
213
|
-
/** 点的键,如 "compare/bub-high"。 */
|
|
149
|
+
rows: Array<{
|
|
214
150
|
key: string;
|
|
215
|
-
/** 所属系列,如 "bub"。 */
|
|
216
151
|
series?: string;
|
|
217
152
|
x: MetricCell;
|
|
218
153
|
/** 任一为 null 的点组件不画,注脚如实报数(点仍留在 rows 里,可数)。 */
|
|
219
154
|
y: MetricCell;
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
/** MetricLine 的 x 轴:experiment 声明的 flag,数值驱动刻度。 */
|
|
223
|
-
export interface LineAxis {
|
|
224
|
-
/** flag 名。 */
|
|
225
|
-
key: string;
|
|
226
|
-
label: string;
|
|
227
|
-
unit?: string;
|
|
155
|
+
}>;
|
|
228
156
|
}
|
|
229
157
|
export interface LineData {
|
|
230
|
-
x:
|
|
231
|
-
|
|
232
|
-
|
|
158
|
+
x: {
|
|
159
|
+
key: string;
|
|
160
|
+
label: LocalizedText;
|
|
161
|
+
unit?: string;
|
|
162
|
+
};
|
|
163
|
+
seriesDimension?: string;
|
|
233
164
|
y: MetricColumn;
|
|
234
|
-
rows: {
|
|
235
|
-
/**
|
|
165
|
+
rows: Array<{
|
|
166
|
+
/** 点身份 = (series, x):x 值的稳定十进制字符串,同一 series 内唯一。 */
|
|
236
167
|
key: string;
|
|
237
168
|
series?: string;
|
|
238
|
-
/** flag 声明值;未声明或非数值 → null,点不画、注脚报数。 */
|
|
239
169
|
x: number | null;
|
|
240
|
-
|
|
241
|
-
xDisplay: string;
|
|
170
|
+
xDisplay: LocalizedText;
|
|
242
171
|
y: MetricCell;
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
/**
|
|
246
|
-
* 一组 experiment(如自定义报告里同一 `<Section>` 内的全部 experiment)的摘要:
|
|
247
|
-
* experiment/eval/attempt 数量、eval 级折叠计票、通过率、总成本、最后运行时间——
|
|
248
|
-
* 恢复旧 `GroupSelector` 卡片曾展示的信息密度,但通过率是官方 `MetricCell` 形态,
|
|
249
|
-
* 不是裸数字,渲染面不用另外拼格式。
|
|
250
|
-
*/
|
|
251
|
-
export interface GroupSummaryData {
|
|
252
|
-
/** 组内 experiment 数(去重后的 experimentId 个数)。 */
|
|
253
|
-
experiments: number;
|
|
254
|
-
/**
|
|
255
|
-
* 组内 eval 数,按完整身份键(experimentId + eval id)去重——多 experiment 的组里
|
|
256
|
-
* 两个 experiment 各自的同名 eval(如都叫 "algebra/a")算两道题,不会被误合并成一道。
|
|
257
|
-
*/
|
|
258
|
-
evals: number;
|
|
259
|
-
/** 组内 attempt 总数(原始计数,一轮 attempt 一票,不折叠)。 */
|
|
260
|
-
attempts: number;
|
|
261
|
-
/**
|
|
262
|
-
* eval 级折叠计票:同一 eval 的多轮 attempt 先折成一个判定(`foldEvalVerdict`,任一轮
|
|
263
|
-
* 通过则通过,否则取最严重的),再计数——与 `TableRowMeta.verdicts`、view 榜单同一口径,
|
|
264
|
-
* 不是 attempt 原始票数的直接计票。
|
|
265
|
-
*/
|
|
266
|
-
verdicts: {
|
|
267
|
-
passed: number;
|
|
268
|
-
failed: number;
|
|
269
|
-
errored: number;
|
|
270
|
-
skipped: number;
|
|
271
|
-
};
|
|
272
|
-
/**
|
|
273
|
-
* 组的通过率:eval 级折叠计票的 `passed / (passed + failed + errored)`(`skipped` 不进
|
|
274
|
-
* 分母)——这是旧 `GroupSelector` 卡片的口径,不是 `OverviewData.totals.passRate` 那种
|
|
275
|
-
* `computeCell` 两级聚合(两者服务不同问题:「这组题多少算过」vs「每次运行成功多少」)。
|
|
276
|
-
* 分母为 0(组内没有任何已跑的 eval)时 `value` 为 `null`,不编 0%。
|
|
277
|
-
*/
|
|
278
|
-
passRate: MetricCell;
|
|
279
|
-
/** 组内可测成本(`attemptCostUSD`)求和;一次 attempt 都没报成本 = `null`,不编 `0`。 */
|
|
280
|
-
totalCostUSD: number | null;
|
|
281
|
-
/** 组内快照 `startedAt` 的最大值(字符串比较,ISO 8601 天然可比);组内没有任何 item 时缺席。 */
|
|
282
|
-
lastRunAt?: string;
|
|
172
|
+
}>;
|
|
283
173
|
}
|
|
284
|
-
export interface
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
174
|
+
export interface ScoreboardData {
|
|
175
|
+
rowDimension: string;
|
|
176
|
+
questions: string[];
|
|
177
|
+
fullMarks: number;
|
|
178
|
+
/** 实际生效的权重表(最长前缀在前)—— 成绩单可审计。 */
|
|
179
|
+
weights: Array<{
|
|
180
|
+
prefix: string;
|
|
181
|
+
weight: number;
|
|
182
|
+
}>;
|
|
183
|
+
/** Scope 中存在但不在题集内、被忽略的 eval 数(注脚显示)。 */
|
|
184
|
+
ignoredEvals: number;
|
|
185
|
+
rows: Array<{
|
|
186
|
+
key: string;
|
|
187
|
+
total: {
|
|
188
|
+
/** fullMarks × earned / possible。 */
|
|
189
|
+
value: number;
|
|
190
|
+
display: LocalizedText;
|
|
191
|
+
/** 题集中该行完全没有 attempt 的题数(按 0 计,分开计数)。 */
|
|
192
|
+
notRun: number;
|
|
193
|
+
/** 有 attempt 但指标为 null(测不了)的题数(按 0 计,分开计数)。 */
|
|
194
|
+
unscorable: number;
|
|
195
|
+
refs: AttemptLocator[];
|
|
196
|
+
};
|
|
197
|
+
subjects: Array<{
|
|
198
|
+
key: string;
|
|
199
|
+
/** 加权后的 [0, 1] 题目分数之和。 */
|
|
200
|
+
earned: number;
|
|
201
|
+
/** 本分科题目的权重之和。 */
|
|
202
|
+
possible: number;
|
|
203
|
+
questions: number;
|
|
204
|
+
notRun: number;
|
|
205
|
+
unscorable: number;
|
|
206
|
+
display: LocalizedText;
|
|
207
|
+
refs: AttemptLocator[];
|
|
208
|
+
}>;
|
|
209
|
+
}>;
|
|
317
210
|
}
|
|
318
|
-
export interface DeltaData
|
|
211
|
+
export interface DeltaData {
|
|
212
|
+
byDimension: string;
|
|
319
213
|
columns: MetricColumn[];
|
|
320
|
-
|
|
321
|
-
|
|
214
|
+
/** FlagPairs 派生形态下的配对域实验数;字面 pairs 不携带(空态文案用)。 */
|
|
215
|
+
experiments?: number;
|
|
216
|
+
rows: Array<{
|
|
322
217
|
key: string;
|
|
323
|
-
/**
|
|
218
|
+
/** 作者在 DeltaPair 里声明(或派生规则生成)的 label,原样透传;renderer 据此显示行名。 */
|
|
219
|
+
label: LocalizedText;
|
|
324
220
|
a: {
|
|
325
|
-
|
|
221
|
+
key: string;
|
|
326
222
|
};
|
|
327
|
-
/** 对比侧。 */
|
|
328
223
|
b: {
|
|
329
|
-
|
|
224
|
+
key: string;
|
|
330
225
|
};
|
|
331
|
-
cells: Record<
|
|
226
|
+
cells: Record<string, {
|
|
332
227
|
a: MetricCell;
|
|
333
228
|
b: MetricCell;
|
|
334
|
-
/** b.value - a.value
|
|
229
|
+
/** b.value - a.value;任一侧缺失则为 null。 */
|
|
335
230
|
delta: number | null;
|
|
336
|
-
|
|
337
|
-
|
|
231
|
+
display: LocalizedText;
|
|
232
|
+
outcome: "improved" | "regressed" | "unchanged" | "unavailable";
|
|
338
233
|
}>;
|
|
339
|
-
}
|
|
234
|
+
}>;
|
|
235
|
+
}
|
|
236
|
+
export interface DeltaPair {
|
|
237
|
+
label: LocalizedText;
|
|
238
|
+
a: string;
|
|
239
|
+
b: string;
|
|
240
|
+
}
|
|
241
|
+
/** pairsByFlag() 的产物:按一个 flag 机械导出全部 A/B 对;只在 by 为 "experiment" 时成立。 */
|
|
242
|
+
export interface FlagPairs {
|
|
243
|
+
readonly kind: "flagPairs";
|
|
244
|
+
readonly flag: string;
|
|
245
|
+
/** a 侧的 flag 取值;缺省表示「未声明该 flag」的实验作 a。 */
|
|
246
|
+
readonly baseline?: JsonValue;
|
|
247
|
+
}
|
|
248
|
+
export interface VerdictTally {
|
|
249
|
+
passed: number;
|
|
250
|
+
failed: number;
|
|
251
|
+
errored: number;
|
|
252
|
+
skipped: number;
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* 一个范围的摘要:快照时间窗、experiment / eval / attempt 数、两级判定计票、端到端成功率
|
|
256
|
+
* 和总成本。eval 的身份键是 experimentId + evalId;data 恒携带两级计票,渲染面显示哪一级
|
|
257
|
+
* 由呈现 prop `votes` 决定,不改变 data(docs/feature/reports/library/summaries.md)。
|
|
258
|
+
*/
|
|
259
|
+
export interface ScopeSummaryData {
|
|
260
|
+
/** 贡献当前数据的快照时间范围;空范围为 null,不编造当前时间。 */
|
|
261
|
+
range: {
|
|
262
|
+
earliestStartedAt: string | null;
|
|
263
|
+
latestStartedAt: string | null;
|
|
264
|
+
};
|
|
265
|
+
experiments: number;
|
|
266
|
+
/** experimentId + evalId 的去重计数,与 evalVerdicts 同分母。 */
|
|
267
|
+
evals: number;
|
|
268
|
+
attempts: number;
|
|
269
|
+
/** 每个 experimentId + evalId 先折成最终 verdict 后计票。 */
|
|
270
|
+
evalVerdicts: VerdictTally;
|
|
271
|
+
/** attempt 原始计票,不折叠。 */
|
|
272
|
+
attemptVerdicts: VerdictTally;
|
|
273
|
+
/** 官方两级 endToEndPassRate,不从任一计票重算。 */
|
|
274
|
+
endToEndPassRate: MetricCell;
|
|
275
|
+
/** costUSD 按 attempt 求和;缺失成本不伪造为 0。 */
|
|
276
|
+
totalCostUSD: MetricCell;
|
|
277
|
+
}
|
|
278
|
+
/** 一个可比组的数据;三个子块都只消费本组快照,不能含其它父目录的引用。 */
|
|
279
|
+
export interface ExperimentComparisonGroupData {
|
|
280
|
+
/** experiment id 的完整父路径;根目录 experiment 使用完整 id。 */
|
|
281
|
+
key: string;
|
|
282
|
+
summary: ScopeSummaryData;
|
|
283
|
+
scatter: ScatterData;
|
|
284
|
+
experiments: ExperimentListItem[];
|
|
285
|
+
}
|
|
286
|
+
export interface ExperimentComparisonData {
|
|
287
|
+
groups: ExperimentComparisonGroupData[];
|
|
340
288
|
}
|
|
341
289
|
/**
|
|
342
|
-
* `AttemptList` 一项 =
|
|
343
|
-
*
|
|
344
|
-
*
|
|
345
|
-
* diagnostics 属于 locator 下钻详情,不塞进比较列表,但随数据携带 —— `AttemptList.data` 的 `redact`
|
|
346
|
-
* 钩子覆盖它们的自由文本(见 docs/feature/reports/library.md「AttemptList」)。
|
|
290
|
+
* `AttemptList` 一项 = 一次 attempt:身份、判定、算好的单行结果摘要与证据引用。
|
|
291
|
+
* 完整 assertions、Judge evidence、diagnostics、cause 与 stack 不进列表 data;
|
|
292
|
+
* 需要完整结构时经 locator 回读取面(resolveLocator → AttemptHandle)。
|
|
347
293
|
*/
|
|
348
294
|
export interface AttemptListItem {
|
|
349
|
-
evalId: string;
|
|
350
295
|
experimentId: string;
|
|
296
|
+
evalId: string;
|
|
351
297
|
attempt: number;
|
|
352
298
|
agent: string;
|
|
353
299
|
verdict: Verdict;
|
|
354
|
-
/**
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
300
|
+
/**
|
|
301
|
+
* 该轮的单行结果摘要,已按 Scoring display 契约折好:failed 取主失败断言摘要,
|
|
302
|
+
* errored 取结构化 error 的一层摘要(phase · code · message),passed / skipped 为 null。
|
|
303
|
+
* 渲染面只做宽度截断,不重算摘要。
|
|
304
|
+
*/
|
|
305
|
+
failureSummary: string | null;
|
|
306
|
+
/** 主失败之外还有几条失败断言("+N more failures" 的 N);无失败为 0。 */
|
|
307
|
+
moreFailures: number;
|
|
308
|
+
/** 当前 attempt 的 examScore 与证据引用。 */
|
|
309
|
+
examScore: MetricCell;
|
|
359
310
|
durationMs: number;
|
|
360
|
-
|
|
311
|
+
/** 缺失为 null(测不了),不伪造 0;attempt 级条目的缺失一律用 null,不用省略字段。 */
|
|
312
|
+
costUSD: number | null;
|
|
361
313
|
locator: AttemptLocator;
|
|
362
314
|
}
|
|
363
315
|
/**
|
|
364
|
-
* `
|
|
365
|
-
*
|
|
366
|
-
* Attempt(升序,供进一步展开到 `AttemptList`)。失败原因属于各 Attempt,不在父行挑一轮重复。
|
|
316
|
+
* `EvalList` 一项 = 一个 `experimentId + evalId`(同一个 Eval 跑在两个 experiment 上是
|
|
317
|
+
* 两条不同结果,不合并)。失败原因只存在于各 AttemptListItem,不在 Eval 父项重复一份。
|
|
367
318
|
*/
|
|
319
|
+
export interface EvalListItem {
|
|
320
|
+
experimentId: string;
|
|
321
|
+
evalId: string;
|
|
322
|
+
/** 任一轮 passed 即 passed,否则 failed > errored > skipped。 */
|
|
323
|
+
verdict: Verdict;
|
|
324
|
+
examScore: MetricCell;
|
|
325
|
+
durationMs: MetricCell;
|
|
326
|
+
costUSD: MetricCell;
|
|
327
|
+
attempts: AttemptListItem[];
|
|
328
|
+
}
|
|
329
|
+
/** `ExperimentList` 一项里,一个 Eval 的展开行。 */
|
|
368
330
|
export interface ExperimentListEvalRow {
|
|
369
331
|
evalId: string;
|
|
370
|
-
/** 折叠判定(任一 attempt 通过则通过,否则取最严重的)。 */
|
|
371
332
|
verdict: Verdict;
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
/** 这道题内 attempt 的平均成本。 */
|
|
375
|
-
cost: MetricCell;
|
|
376
|
-
/** 这道题的全部 Attempt,按 attempt 序号升序。 */
|
|
333
|
+
durationMs: MetricCell;
|
|
334
|
+
costUSD: MetricCell;
|
|
377
335
|
attempts: AttemptListItem[];
|
|
378
336
|
}
|
|
379
337
|
/**
|
|
380
|
-
* `
|
|
381
|
-
* 声明的 flags、
|
|
382
|
-
*
|
|
383
|
-
*
|
|
338
|
+
* `experimentListData` 的一项 = 一个 experiment:身份(experimentId/agent/model)、
|
|
339
|
+
* 声明的 flags、eval 级最终 verdict 计票、官方两级聚合汇总指标,以及展开到每道 Eval 的
|
|
340
|
+
* `evalRows`(按 eval id 升序)。一行只有一套 agent / model / flags 是输入约束:
|
|
341
|
+
* 同一 experiment 混入不一致可比性配置时计算按完整用户反馈失败。
|
|
384
342
|
*/
|
|
385
343
|
export interface ExperimentListItem {
|
|
386
344
|
experimentId: string;
|
|
387
345
|
agent: string;
|
|
388
346
|
model?: string;
|
|
389
|
-
flags?: Record<string,
|
|
390
|
-
/** eval
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
skipped: number;
|
|
396
|
-
};
|
|
397
|
-
/** 官方两级聚合口径(endToEndPassRate),与 `MetricTable.data(..., columns: [endToEndPassRate])` 同一台引擎。 */
|
|
398
|
-
passRate: MetricCell;
|
|
399
|
-
cost: MetricCell;
|
|
400
|
-
duration: MetricCell;
|
|
347
|
+
flags?: Record<string, JsonValue>;
|
|
348
|
+
/** eval 级最终 verdict 计票(Result 列的构成)。 */
|
|
349
|
+
evalVerdicts: VerdictTally;
|
|
350
|
+
endToEndPassRate: MetricCell;
|
|
351
|
+
costUSD: MetricCell;
|
|
352
|
+
durationMs: MetricCell;
|
|
401
353
|
tokens: MetricCell;
|
|
402
|
-
/** 这个 experiment 覆盖的 eval 数(去重后,与
|
|
354
|
+
/** 这个 experiment 覆盖的 eval 数(去重后,与 evalVerdicts 四项之和一致)。 */
|
|
403
355
|
evals: number;
|
|
404
356
|
/** 这个 experiment 覆盖的 attempt 总数(原始计数,含多轮重试)。 */
|
|
405
357
|
attempts: number;
|
|
406
358
|
/** 所含快照中最近的 startedAt。 */
|
|
407
359
|
lastRunAt: string;
|
|
408
|
-
/** 展开到这个 experiment 的 Eval,按 eval id 升序。 */
|
|
409
360
|
evalRows: ExperimentListEvalRow[];
|
|
410
361
|
}
|
|
411
|
-
/**
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
verdict: Verdict;
|
|
421
|
-
/** examScore 的两级聚合;单一 eval 分组下即这道题的题级分数。 */
|
|
422
|
-
score: MetricCell;
|
|
423
|
-
duration: MetricCell;
|
|
424
|
-
cost: MetricCell;
|
|
425
|
-
attempts: AttemptListItem[];
|
|
362
|
+
/** 三个实体列表共用的计算选项。 */
|
|
363
|
+
export interface EntityListDataOptions {
|
|
364
|
+
/**
|
|
365
|
+
* 展示层遮蔽:只改写这次组件数据中的自由文本——条目本身与任何嵌套 attempt 条目的
|
|
366
|
+
* `failureSummary`;身份与分类字段(experimentId、evalId、locator、数值指标)不经它。
|
|
367
|
+
* 只作用于这次计算产出的组件数据,不改盘上或任何导出目录里的 artifact;
|
|
368
|
+
* 发布 artifact 的脱敏用 copySnapshots({ redact })。
|
|
369
|
+
*/
|
|
370
|
+
redact?: (text: string) => string;
|
|
426
371
|
}
|