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.
Files changed (218) hide show
  1. package/INDEX.md +23 -23
  2. package/README.zh.md +6 -6
  3. package/dist/agents/types.d.ts +2 -2
  4. package/dist/i18n/zh-CN.d.ts +3 -3
  5. package/dist/report/aggregate.d.ts +32 -26
  6. package/dist/report/aggregate.js +157 -76
  7. package/dist/report/built-in/index.d.ts +2 -0
  8. package/dist/report/built-in/index.js +8 -0
  9. package/dist/report/components.d.ts +91 -164
  10. package/dist/report/components.js +377 -114
  11. package/dist/report/compute.d.ts +86 -73
  12. package/dist/report/compute.js +592 -432
  13. package/dist/report/flag.d.ts +28 -17
  14. package/dist/report/flag.js +86 -16
  15. package/dist/report/format.d.ts +11 -11
  16. package/dist/report/format.js +17 -15
  17. package/dist/report/index.d.ts +16 -17
  18. package/dist/report/index.js +20 -22
  19. package/dist/report/load.js +3 -2
  20. package/dist/report/locale.d.ts +49 -34
  21. package/dist/report/locale.js +106 -58
  22. package/dist/report/metrics.d.ts +10 -3
  23. package/dist/report/metrics.js +46 -12
  24. package/dist/report/primitives.d.ts +42 -15
  25. package/dist/report/primitives.js +135 -26
  26. package/dist/report/react/AttemptList.d.ts +10 -8
  27. package/dist/report/react/AttemptList.js +18 -10
  28. package/dist/report/react/DeltaTable.js +19 -18
  29. package/dist/report/react/EvalList.d.ts +3 -3
  30. package/dist/report/react/EvalList.js +0 -0
  31. package/dist/report/react/ExperimentComparison.d.ts +4 -2
  32. package/dist/report/react/ExperimentComparison.js +5 -4
  33. package/dist/report/react/ExperimentList.d.ts +3 -3
  34. package/dist/report/react/ExperimentList.js +16 -15
  35. package/dist/report/react/MetricBars.js +5 -4
  36. package/dist/report/react/MetricLine.js +12 -5
  37. package/dist/report/react/MetricMatrix.js +1 -1
  38. package/dist/report/react/MetricScatter.js +54 -17
  39. package/dist/report/react/MetricTable.js +2 -12
  40. package/dist/report/react/ScopeSummary.d.ts +10 -0
  41. package/dist/report/react/ScopeSummary.js +17 -0
  42. package/dist/report/react/Scoreboard.js +6 -6
  43. package/dist/report/react/cell.js +2 -2
  44. package/dist/report/react/fixtures.d.ts +5 -9
  45. package/dist/report/react/fixtures.js +105 -149
  46. package/dist/report/react/index.d.ts +15 -5
  47. package/dist/report/react/index.js +18 -7
  48. package/dist/report/report.d.ts +137 -20
  49. package/dist/report/report.js +261 -34
  50. package/dist/report/text/faces.d.ts +17 -19
  51. package/dist/report/text/faces.js +225 -157
  52. package/dist/report/text/plot.js +1 -1
  53. package/dist/report/text/table.js +2 -2
  54. package/dist/report/tree.d.ts +90 -40
  55. package/dist/report/tree.js +252 -94
  56. package/dist/report/types.d.ts +245 -300
  57. package/dist/report/types.js +4 -3
  58. package/dist/report/web.d.ts +21 -5
  59. package/dist/report/web.js +42 -16
  60. package/dist/results/select.d.ts +38 -16
  61. package/dist/results/select.js +73 -25
  62. package/dist/results/types.d.ts +38 -14
  63. package/dist/shared/aggregate.d.ts +3 -2
  64. package/dist/shared/aggregate.js +5 -4
  65. package/docs-site/zh/README.md +44 -0
  66. package/docs-site/zh/examples/ai-agent-application.mdx +63 -0
  67. package/docs-site/zh/examples/coding-agent-extensions.mdx +57 -0
  68. package/docs-site/zh/examples/index.mdx +50 -0
  69. package/docs-site/zh/{concepts → explanation}/adapter.mdx +11 -11
  70. package/docs-site/zh/{concepts → explanation}/assert.mdx +7 -7
  71. package/docs-site/zh/{concepts → explanation}/drive.mdx +8 -8
  72. package/docs-site/zh/{concepts → explanation}/evals.mdx +4 -4
  73. package/docs-site/zh/{concepts → explanation}/experiment.mdx +8 -8
  74. package/docs-site/zh/{concepts → explanation}/hitl.mdx +8 -8
  75. package/docs-site/zh/{concepts → explanation}/judge.mdx +5 -5
  76. package/docs-site/zh/{concepts → explanation}/overview.mdx +5 -5
  77. package/docs-site/zh/{guides → explanation}/runner.mdx +1 -1
  78. package/docs-site/zh/{concepts → explanation}/tier.mdx +6 -6
  79. package/docs-site/zh/{guides → how-to}/agent-feedback-loop.mdx +7 -7
  80. package/docs-site/zh/{guides → how-to}/authoring.mdx +2 -2
  81. package/docs-site/zh/{guides → how-to}/connect-otel.mdx +6 -6
  82. package/docs-site/zh/{guides → how-to}/connect-your-agent.mdx +18 -18
  83. package/docs-site/zh/{guides → how-to}/custom-reports.mdx +6 -6
  84. package/docs-site/zh/{guides → how-to}/experiments.mdx +3 -3
  85. package/docs-site/zh/{guides → how-to}/publish-report.mdx +2 -2
  86. package/docs-site/zh/{guides → how-to}/sandbox-agent.mdx +2 -2
  87. package/docs-site/zh/{guides → how-to}/sandbox-providers.mdx +1 -1
  88. package/docs-site/zh/{guides → how-to}/viewing-results.mdx +6 -6
  89. package/docs-site/zh/{guides → how-to}/write-experiment.mdx +3 -3
  90. package/docs-site/zh/{guides → how-to}/write-send.mdx +13 -13
  91. package/docs-site/zh/index.mdx +23 -25
  92. package/docs-site/zh/introduction.mdx +8 -8
  93. package/docs-site/zh/reference/builtin-agents.mdx +5 -5
  94. package/docs-site/zh/reference/capabilities.mdx +6 -6
  95. package/docs-site/zh/reference/cli.mdx +9 -7
  96. package/docs-site/zh/reference/define-agent.mdx +1 -1
  97. package/docs-site/zh/reference/events.mdx +3 -3
  98. package/docs-site/zh/{guides → reference}/official-adapters.mdx +7 -7
  99. package/docs-site/zh/{guides → reference}/report-components.mdx +5 -5
  100. package/docs-site/zh/{guides → reference}/results-data.mdx +5 -5
  101. package/docs-site/zh/{guides → troubleshooting}/debug-sandbox.mdx +2 -2
  102. package/docs-site/zh/{guides → troubleshooting}/debugging.mdx +4 -2
  103. package/docs-site/zh/{quickstart.mdx → tutorials/quickstart.mdx} +5 -17
  104. package/package.json +6 -2
  105. package/src/agents/index.ts +2 -2
  106. package/src/agents/openai-compat.ts +1 -1
  107. package/src/agents/streaming.ts +2 -2
  108. package/src/agents/types.ts +3 -3
  109. package/src/cli.ts +42 -23
  110. package/src/context/context.ts +1 -1
  111. package/src/context/session.test.ts +1 -1
  112. package/src/context/session.ts +1 -1
  113. package/src/i18n/en.ts +18 -16
  114. package/src/i18n/zh-CN.ts +16 -15
  115. package/src/report/aggregate.ts +175 -87
  116. package/src/report/built-in/index.tsx +9 -0
  117. package/src/report/components.tsx +625 -285
  118. package/src/report/compute.ts +717 -515
  119. package/src/report/dual-render.test.tsx +738 -1148
  120. package/src/report/flag.ts +97 -33
  121. package/src/report/format.ts +18 -22
  122. package/src/report/index.ts +113 -58
  123. package/src/report/load.ts +3 -2
  124. package/src/report/locale.ts +120 -69
  125. package/src/report/metrics.ts +42 -12
  126. package/src/report/primitives.tsx +190 -45
  127. package/src/report/react/AttemptList.tsx +32 -20
  128. package/src/report/react/DeltaTable.tsx +63 -45
  129. package/src/report/react/EvalList.tsx +0 -0
  130. package/src/report/react/ExperimentComparison.tsx +12 -7
  131. package/src/report/react/ExperimentList.tsx +38 -26
  132. package/src/report/react/MetricBars.tsx +5 -4
  133. package/src/report/react/MetricLine.tsx +13 -8
  134. package/src/report/react/MetricMatrix.tsx +2 -2
  135. package/src/report/react/MetricScatter.tsx +74 -20
  136. package/src/report/react/MetricTable.tsx +4 -76
  137. package/src/report/react/ScopeSummary.tsx +86 -0
  138. package/src/report/react/Scoreboard.tsx +28 -10
  139. package/src/report/react/cell.tsx +2 -2
  140. package/src/report/react/enhance.js +57 -5
  141. package/src/report/react/fixtures.ts +109 -156
  142. package/src/report/react/index.tsx +24 -39
  143. package/src/report/react/render.test.tsx +139 -104
  144. package/src/report/react/styles.css +181 -91
  145. package/src/report/report.test.ts +761 -1031
  146. package/src/report/report.ts +425 -47
  147. package/src/report/text/faces.ts +257 -164
  148. package/src/report/text/plot.ts +1 -1
  149. package/src/report/text/table.ts +2 -2
  150. package/src/report/tree.ts +362 -104
  151. package/src/report/types.ts +257 -287
  152. package/src/report/web.ts +63 -20
  153. package/src/results/attempt-evidence.test.ts +4 -4
  154. package/src/results/attempt-evidence.ts +5 -5
  155. package/src/results/copy.ts +6 -6
  156. package/src/results/host-equivalence.test.ts +26 -14
  157. package/src/results/index.ts +10 -4
  158. package/src/results/open.ts +8 -4
  159. package/src/results/results.test.ts +4 -3
  160. package/src/results/select.ts +104 -34
  161. package/src/results/types.ts +36 -14
  162. package/src/runner/feedback/human.test.ts +1 -1
  163. package/src/runner/run.ts +1 -1
  164. package/src/sandbox/cli-commands.ts +2 -2
  165. package/src/scoring/judge.test.ts +1 -1
  166. package/src/shared/aggregate.ts +5 -4
  167. package/src/show/compose.ts +50 -67
  168. package/src/show/index.ts +107 -56
  169. package/src/show/render.ts +43 -27
  170. package/src/show/report-host.test.ts +188 -0
  171. package/src/show/report-host.ts +375 -0
  172. package/src/show/show.test.ts +86 -36
  173. package/src/view/app/App.test.tsx +69 -0
  174. package/src/view/app/App.tsx +144 -48
  175. package/src/view/app/components/AttemptModal.tsx +324 -63
  176. package/src/view/app/components/CodeView.tsx +10 -4
  177. package/src/view/app/i18n.ts +31 -17
  178. package/src/view/app/lib/artifact-url.ts +14 -3
  179. package/src/view/app/main.tsx +13 -8
  180. package/src/view/app/pages/{RunsPage.tsx → AttemptsPage.tsx} +6 -6
  181. package/src/view/app/types.ts +4 -1
  182. package/src/view/artifact-serving.test.ts +21 -1
  183. package/src/view/client-dist/app.css +1 -1
  184. package/src/view/client-dist/app.js +6 -6
  185. package/src/view/data.test.ts +9 -3
  186. package/src/view/data.ts +145 -49
  187. package/src/view/index.ts +48 -44
  188. package/src/view/server.ts +35 -15
  189. package/src/view/shared/types.ts +34 -5
  190. package/src/view/styles.css +224 -0
  191. package/src/view/view-report.test.ts +161 -57
  192. package/dist/report/built-ins/experiment-comparison.d.ts +0 -39
  193. package/dist/report/built-ins/experiment-comparison.js +0 -119
  194. package/dist/report/built-ins/index.d.ts +0 -2
  195. package/dist/report/built-ins/index.js +0 -2
  196. package/dist/report/react/GroupSummary.d.ts +0 -8
  197. package/dist/report/react/GroupSummary.js +0 -8
  198. package/dist/report/react/RunOverview.d.ts +0 -8
  199. package/dist/report/react/RunOverview.js +0 -12
  200. package/docs-site/zh/example/ai-agent-application.mdx +0 -152
  201. package/docs-site/zh/example/claude-code-codex-plugin.mdx +0 -167
  202. package/docs-site/zh/example/claude-code-codex-skill.mdx +0 -152
  203. package/docs-site/zh/example/showcase.mdx +0 -39
  204. package/src/report/built-in-user-parity.test.tsx +0 -597
  205. package/src/report/built-ins/experiment-comparison.tsx +0 -179
  206. package/src/report/built-ins/index.ts +0 -7
  207. package/src/report/react/GroupSummary.tsx +0 -66
  208. package/src/report/react/RunOverview.tsx +0 -109
  209. /package/docs-site/zh/{example/tier1-ai-sdk-v7.mdx → examples/integrations/ai-sdk-v7.mdx} +0 -0
  210. /package/docs-site/zh/{example/tier1-claude-sdk.mdx → examples/integrations/claude-sdk.mdx} +0 -0
  211. /package/docs-site/zh/{example/tier1-codex-sdk.mdx → examples/integrations/codex-sdk.mdx} +0 -0
  212. /package/docs-site/zh/{example/tier1-langgraph.mdx → examples/integrations/langgraph.mdx} +0 -0
  213. /package/docs-site/zh/{example/tier1-pi-sdk.mdx → examples/integrations/pi-sdk.mdx} +0 -0
  214. /package/docs-site/zh/{guides → how-to}/ci-integration.mdx +0 -0
  215. /package/docs-site/zh/{guides → how-to}/dataset-fanout.mdx +0 -0
  216. /package/docs-site/zh/{guides → how-to}/fixtures.mdx +0 -0
  217. /package/docs-site/zh/{guides → how-to}/reporters.mdx +0 -0
  218. /package/docs-site/zh/{guides → how-to}/scoring-guide.mdx +0 -0
@@ -1,99 +1,112 @@
1
- import type { AttemptListItem, AxisInput, DeltaData, DimensionInput, EvalListItem, ExperimentListItem, GroupSummaryData, LineData, MatrixData, Metric, OverviewData, ScatterData, ScoreboardData, TableData } from "./types.ts";
2
- import type { EvalResult } from "../types.ts";
3
- import { type SnapshotsInput } from "./aggregate.ts";
4
- export interface TableDataOptions<M extends readonly Metric[]> {
5
- /** 行维度(内置 / 自定义 / flag())。 */
1
+ import type { AttemptListItem, DeltaData, DeltaPair, DimensionInput, EntityListDataOptions, EvalListItem, ExperimentComparisonData, ExperimentListItem, FlagPairs, LineData, MatrixData, Metric, NumericAxis, ReportInput, ScatterData, ScopeSummaryData, ScoreboardData, TableData } from "./types.ts";
2
+ import type { JsonValue } from "../types.ts";
3
+ export interface MetricTableOptions {
4
+ /** 行维度(内置 / 自定义 / flag() / runConfig())。 */
6
5
  rows: DimensionInput;
7
- /** 每列一个指标;列键 = metric.name 的字面量,拼错编译不过。 */
8
- columns: M;
9
- /** 构建时排序,方向随 better(higher 降序,「好」的一头在上);缺数据行沉底。两面同口径,预排即终排。 */
10
- sort?: Metric;
11
- /** eval id 前缀过滤,同 CLI 位置参数语义。 */
12
- evals?: string | string[];
13
- }
14
- /** 一次 attempt 的有界结果摘要:error → skipReason → 一条主失败断言 + 其余失败计数。 */
15
- export declare function reasonFor(result: EvalResult): string | undefined;
16
- export declare function tableData<const M extends readonly Metric[]>(input: SnapshotsInput, opts: TableDataOptions<M>): Promise<TableData<M[number]["name"]>>;
17
- export interface AttemptListDataOptions {
6
+ /** 每列一个指标;非空元组,元素是静态 import Metric 实例。 */
7
+ columns: readonly [Metric, ...Metric[]];
18
8
  /**
19
- * 展示层遮蔽:error message/cause/stack、diagnostic message/data、断言 detail
20
- * evidence 经这个钩子;experimentId、evalId、locator、error/diagnostic code 与 lifecycle
21
- * operation 等身份和分类字段不经它。只作用于这次计算产出的组件数据,不改盘上 artifact。
9
+ * 初始行序:必须是 columns 中同一个 Metric 实例且声明了 better,方向随 better
10
+ * (「好」的一头在上),缺数据行沉底;省略时按行 key 字典序。
22
11
  */
23
- redact?: (text: string) => string;
12
+ sort?: Metric;
13
+ /** eval id 前缀过滤,同 CLI 位置参数语义;在聚合之前收窄题集。 */
14
+ evals?: string | readonly string[];
24
15
  }
25
- /** `AttemptList.data(selection)`:每个 Attempt 一项,顺序取自 Selection 展平顺序(不重排) */
26
- export declare function attemptListData(input: SnapshotsInput, opts?: AttemptListDataOptions): Promise<AttemptListItem[]>;
27
- /** `EvalList.data(selection)`:每个 `experimentId + evalId` 一项,按 evalId 再按 experimentId 升序。 */
28
- export declare function evalListData(input: SnapshotsInput): Promise<EvalListItem[]>;
29
- /** `ExperimentList.data(selection)`:每个 experiment 一项,按 experimentId 升序;展开到每道 Eval。 */
30
- export declare function experimentListData(input: SnapshotsInput): Promise<ExperimentListItem[]>;
31
- export interface MatrixDataOptions {
16
+ export declare function metricTableData(input: ReportInput, options: MetricTableOptions): Promise<TableData>;
17
+ export interface MetricMatrixOptions {
32
18
  rows: DimensionInput;
33
19
  columns: DimensionInput;
34
20
  cell: Metric;
35
21
  /** eval id 前缀过滤,同 CLI 位置参数语义。 */
36
- evals?: string | string[];
22
+ evals?: string | readonly string[];
37
23
  }
38
- export declare function matrixData(input: SnapshotsInput, opts: MatrixDataOptions): Promise<MatrixData>;
39
- export interface ScoreboardDataOptions {
40
- /** 给谁打分(被打分的维度);维度槽与 MetricTable.data 统一叫 rows。 */
24
+ export declare function metricMatrixData(input: ReportInput, options: MetricMatrixOptions): Promise<MatrixData>;
25
+ /** `attemptListData(input)`:每个 Attempt 一项,顺序取自 Scope 展平顺序(不重排)。 */
26
+ export declare function attemptListData(input: ReportInput, options?: EntityListDataOptions): Promise<AttemptListItem[]>;
27
+ /** `evalListData(input)`:每个 `experimentId + evalId` 一项,按 evalId 再按 experimentId 升序。 */
28
+ export declare function evalListData(input: ReportInput, options?: EntityListDataOptions): Promise<EvalListItem[]>;
29
+ /**
30
+ * `experimentListData(input)`:每个 experiment 一项,展开到每道 Eval;初始按端到端成功率
31
+ * 从高到低(缺数据沉底,同分按 id)。一行只有一套 agent / model / flags 是输入约束:
32
+ * 宿主注入的 current() Scope 保证每个 experiment 只由可比性配置一致的快照拼成;作者自选
33
+ * Snapshot[] 时若同一 experiment 混入不一致的可比性配置,按完整用户反馈失败并指引——
34
+ * 看跨配置演化用 snapshot 维度或 MetricLine,不把两套配置拼成一行冒充单一配置。
35
+ */
36
+ export declare function experimentListData(input: ReportInput, options?: EntityListDataOptions): Promise<ExperimentListItem[]>;
37
+ /**
38
+ * `scopeSummaryData(input)`:范围摘要——快照时间窗、experiment / eval / attempt 数、
39
+ * 两级判定计票、端到端成功率与总成本(docs/feature/reports/library/summaries.md)。
40
+ * data 恒携带两级计票;成功率来自官方两级指标引擎,不从任一计票重算。
41
+ */
42
+ export declare function scopeSummaryData(input: ReportInput): Promise<ScopeSummaryData>;
43
+ /** 完整父路径是组键;没有父路径的 experiment 不能互相比,自己形成单例组。 */
44
+ export declare function experimentComparisonGroupKey(experimentId: string): string;
45
+ /**
46
+ * `experimentComparisonData(input)`:先把 input 按可比组分区(experiment id 的完整父路径),
47
+ * 再为每组分别计算 ScopeSummary、成本 × 端到端成功率散点和 ExperimentList——分区发生在任何
48
+ * 指标计算之前,组外 attempt 不可能污染该组的坐标尺度、series、成功率、成本、排序或缺数据计数。
49
+ */
50
+ export declare function experimentComparisonData(input: ReportInput): Promise<ExperimentComparisonData>;
51
+ export interface ScoreboardOptions {
41
52
  rows: DimensionInput;
42
- /** 按什么分科;默认 "evalGroup"(考试里的「科目」)。 */
43
- subjects?: DimensionInput;
44
- /** eval id 前缀 每题分值;未列默认 1;前缀重叠时最长的生效。 */
45
- weights?: Record<string, number>;
46
- /** 折算满分;默认 100。 */
53
+ /** 固定题集;eval id 必须唯一。元素引用运行时数据,类型放宽为普通数组,空数组在计算时报错。 */
54
+ questions: readonly string[];
55
+ /** 分科函数;默认与 evalGroup 维度同一条规则:取 eval id 的完整父路径,无 `/` 取完整 id。 */
56
+ subject?: (evalId: string) => string;
57
+ /** 权重按 eval id 前缀匹配,多个命中时最长前缀生效;默认 1。 */
58
+ weights?: Readonly<Record<string, number>>;
47
59
  fullMarks?: number;
48
- /** 每题得分指标;缺省即 examScore,可换自定义(如「答对但超预算扣分」)。 */
49
60
  score?: Metric;
50
- /** 选中范围:eval id 前缀过滤;题集(分母)只遍历这个范围。 */
51
- evals?: string | string[];
52
61
  }
53
62
  /**
54
- * 逐题分值制,分母对所有被打分者恒定:
55
- * 题分值 = 命中的权重(默认 1) 题得分 = score 指标的题级值(perEval 折叠后)
56
- * 总分 = fullMarks × Σ(题得分 × 题分值) / Σ(题分值) Σ 遍历选中范围内全部题
57
- * 没跑到的题挣 0 分但留在分母里,missing 如实报 —— 这是显式的考试契约,不是「null ≠ 0」的例外。
63
+ * 固定题集分母:未跑题按 0 分计入 `notRun`,跑了但指标为 null 的题按 0 分计入 `unscorable`,
64
+ * 两个计数不合并——成绩单能回答「这 0 分是没去考还是考了判不了」。组件不从已观测 attempt
65
+ * 的并集猜分母;Scope 中题集之外的 eval 被忽略并计入 `ignoredEvals`。
58
66
  */
59
- export declare function scoreboardData(input: SnapshotsInput, opts: ScoreboardDataOptions): Promise<ScoreboardData>;
60
- export interface ScatterDataOptions {
67
+ export declare function scoreboardData(input: ReportInput, options: ScoreboardOptions): Promise<ScoreboardData>;
68
+ export interface MetricScatterOptions {
61
69
  /** 点维度:每个点 = 该组 attempt 的聚合。 */
62
70
  points: DimensionInput;
63
- /** 可选:同系列的点连成线;省略 = 纯散点。 */
71
+ /** 可选:只决定颜色和分组,默认不连线。 */
64
72
  series?: DimensionInput;
65
73
  x: Metric;
66
74
  y: Metric;
75
+ /** eval id 前缀过滤,同 CLI 位置参数语义。 */
76
+ evals?: string | readonly string[];
67
77
  }
68
- export declare function scatterData(input: SnapshotsInput, opts: ScatterDataOptions): Promise<ScatterData>;
69
- export interface LineDataOptions {
70
- /** x 轴:experiment 声明的 flag 或顶层运行配置 config()(要求数值),不解析 experiment 命名。 */
71
- x: AxisInput;
72
- y: Metric;
73
- /** 可选:每个系列一条线(flag / config 或普通维度);省略 = 单系列。 */
78
+ export declare function metricScatterData(input: ReportInput, options: MetricScatterOptions): Promise<ScatterData>;
79
+ export interface MetricLineOptions {
80
+ /** x 轴:NumericAxis(numericFlag() / numericRunConfig() 或自定义 of),不解析 experiment 命名。 */
81
+ x: NumericAxis;
74
82
  series?: DimensionInput;
83
+ y: Metric;
84
+ /** eval id 前缀过滤,同 CLI 位置参数语义。 */
85
+ evals?: string | readonly string[];
75
86
  }
76
- /** 每个点 = 一个 experiment 的聚合;同系列的点按 x 排序连线(排序在组件面,数据保持分组序)。 */
77
- export declare function lineData(input: SnapshotsInput, opts: LineDataOptions): Promise<LineData>;
78
- /** Selection 的 warnings 随行进 OverviewData,RunOverview 直接渲染 —— 诚实不靠使用者记得接线。 */
79
- export declare function overviewData(input: SnapshotsInput): Promise<OverviewData>;
80
87
  /**
81
- * 一组 experiment 的摘要:experiment/eval/attempt 数量、eval 级折叠计票、通过率(旧
82
- * `GroupSelector` 卡片口径,见 summarizeItems)、总成本(null-safe 求和)、最后运行时间
83
- * (组内快照 startedAt 最大值)。`input` 就是调用方已经收窄好的组 Selection(如自定义报告
84
- * experiment 组前缀 filter 出来的那份)——本函数不再自己分组。
88
+ * 点身份 = (series, x):落进同一桶的全部 attempt 先在各自 experiment × eval 内 perEval 聚合,
89
+ * acrossEvals 跨题折成该点唯一的 y——聚合顺序是 (series, x, experiment, eval),同一桶里有
90
+ * 多个 experiment 时它们合成一个点,不画垂直来回线。前提是 x 在同一 experiment × eval 内恒定:
91
+ * 自定义 NumericAxis.of() 对同一 experiment × eval 的不同 attempt 返回不同值时按完整用户反馈失败。
92
+ * x 为 null 的 attempt 不伪造 x 值,归入该 series 的未绘制行,组件报告未绘制数量。
85
93
  */
86
- export declare function groupSummaryData(input: SnapshotsInput): Promise<GroupSummaryData>;
87
- export interface DeltaPair {
88
- /** 基线侧:experiment id,或快照键 "<experimentId> @ <startedAt>"(时间轴对比用手挑的快照数组)。 */
89
- a: string;
90
- /** 对比侧,同上。 */
91
- b: string;
92
- label?: string;
93
- }
94
- export interface DeltaDataOptions<M extends readonly Metric[]> {
95
- /** 每行一对:B 相对 A。 */
96
- pairs: DeltaPair[];
97
- metrics: M;
94
+ export declare function metricLineData(input: ReportInput, options: MetricLineOptions): Promise<LineData>;
95
+ /**
96
+ * flag 派生 A/B 对(docs/feature/reports/library/metric-views.md「DeltaTable」):
97
+ * 配对域 = 同可比组 + 删除该 flag 后可比性配置深相等;a 取 baseline(缺省 = 未声明该 flag),
98
+ * b 侧该 flag 的每个其它取值各成一对;label 自动 `<a 末段> · <flag>=<显示键>`。
99
+ */
100
+ export declare function pairsByFlag(name: string, options?: {
101
+ baseline?: JsonValue;
102
+ }): FlagPairs;
103
+ export interface DeltaTableOptions {
104
+ /** 显式维度,必填——"baseline" 不会被猜成 experiment、agent、flag 或 snapshot 中的某一种。 */
105
+ by: DimensionInput;
106
+ /** 字面 pair 数组(自定义 label),或 pairsByFlag() 的派生声明;空数组在计算时报错。 */
107
+ pairs: readonly DeltaPair[] | FlagPairs;
108
+ metrics: readonly [Metric, ...Metric[]];
109
+ /** eval id 前缀过滤,同 CLI 位置参数语义。 */
110
+ evals?: string | readonly string[];
98
111
  }
99
- export declare function deltaData<const M extends readonly Metric[]>(input: SnapshotsInput, opts: DeltaDataOptions<M>): Promise<DeltaData<M[number]["name"]>>;
112
+ export declare function deltaTableData(input: ReportInput, options: DeltaTableOptions): Promise<DeltaData>;