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