niceeval 0.13.1 → 0.13.2-canary.35
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 +1 -0
- package/README.md +9 -10
- package/README.zh.md +9 -10
- package/dist/agents/ai-sdk.cjs.map +1 -1
- package/dist/agents/ai-sdk.d.cts +1 -1
- package/dist/agents/ai-sdk.d.mts +1 -1
- package/dist/agents/ai-sdk.d.ts +1 -1
- package/dist/agents/coding-cli-versions.cjs +10 -1
- package/dist/agents/coding-cli-versions.cjs.map +1 -1
- package/dist/agents/coding-cli-versions.d.cts +8 -3
- package/dist/agents/coding-cli-versions.d.mts +8 -3
- package/dist/agents/coding-cli-versions.d.ts +8 -3
- package/dist/agents/coding-cli-versions.js +18 -12
- package/dist/agents/deepseek-harness.cjs +103 -0
- package/dist/agents/deepseek-harness.cjs.map +1 -0
- package/dist/agents/deepseek-harness.d.cts +12 -0
- package/dist/agents/deepseek-harness.d.mts +12 -0
- package/dist/agents/deepseek-harness.d.ts +12 -0
- package/dist/agents/deepseek-harness.js +7 -0
- package/dist/agents/deepseek-harness.js.map +1 -0
- package/dist/agents/index.cjs +5 -1
- package/dist/agents/index.cjs.map +1 -1
- package/dist/agents/index.d.cts +4 -0
- package/dist/agents/index.d.mts +4 -0
- package/dist/agents/index.d.ts +4 -0
- package/dist/agents/index.js +54 -50
- package/dist/agents/index.mjs +54 -50
- package/dist/agents/omp.cjs +170 -0
- package/dist/agents/omp.cjs.map +1 -0
- package/dist/agents/omp.d.cts +14 -0
- package/dist/agents/omp.d.mts +14 -0
- package/dist/agents/omp.d.ts +14 -0
- package/dist/agents/omp.js +7 -0
- package/dist/agents/omp.js.map +1 -0
- package/dist/agents/types.cjs.map +1 -1
- package/dist/agents/types.d.cts +2 -2
- package/dist/agents/types.d.mts +2 -2
- package/dist/agents/types.d.ts +2 -2
- package/dist/analysis/api.cjs +9 -1
- package/dist/analysis/api.cjs.map +1 -1
- package/dist/analysis/api.d.cts +21 -0
- package/dist/analysis/api.d.mts +21 -0
- package/dist/analysis/api.d.ts +21 -0
- package/dist/analysis/api.js +8 -6
- package/dist/i18n/en.cjs +7 -2
- package/dist/i18n/en.cjs.map +1 -1
- package/dist/i18n/en.d.cts +7 -2
- package/dist/i18n/en.d.mts +7 -2
- package/dist/i18n/en.d.ts +7 -2
- package/dist/o11y/parsers/hermes.cjs +1 -1
- package/dist/o11y/parsers/hermes.cjs.map +1 -1
- package/dist/report/built-in/analysis-values.cjs +21 -5
- package/dist/report/built-in/analysis-values.cjs.map +1 -1
- package/dist/report/built-in/analysis-values.d.cts +11 -9
- package/dist/report/built-in/analysis-values.d.mts +11 -9
- package/dist/report/built-in/analysis-values.d.ts +11 -9
- package/dist/report/built-in/overview.cjs +1 -0
- package/dist/report/built-in/overview.cjs.map +1 -1
- package/dist/report/built-in/result-components.cjs +58 -12
- package/dist/report/built-in/result-components.cjs.map +1 -1
- package/dist/report/built-in/result-components.d.cts +15 -0
- package/dist/report/built-in/result-components.d.mts +15 -0
- package/dist/report/built-in/result-components.d.ts +15 -0
- package/dist/report/built-in/run-membership-overview.cjs +100 -4
- package/dist/report/built-in/run-membership-overview.cjs.map +1 -1
- package/dist/report/built-in/standard.cjs +1 -0
- package/dist/report/built-in/standard.cjs.map +1 -1
- package/dist/report/built-in/standard.d.cts +1 -0
- package/dist/report/built-in/standard.d.mts +1 -0
- package/dist/report/built-in/standard.d.ts +1 -0
- package/dist/report/components/entity-lists/compute.cjs +40 -3
- package/dist/report/components/entity-lists/compute.cjs.map +1 -1
- package/dist/report/components/entity-lists/compute.d.cts +8 -6
- package/dist/report/components/entity-lists/compute.d.mts +8 -6
- package/dist/report/components/entity-lists/compute.d.ts +8 -6
- package/dist/report/components/entity-lists/content.cjs +31 -6
- package/dist/report/components/entity-lists/content.cjs.map +1 -1
- package/dist/report/components/entity-lists/index.cjs +3 -2
- package/dist/report/components/entity-lists/index.cjs.map +1 -1
- package/dist/report/components/entity-lists/index.d.cts +1 -1
- package/dist/report/components/entity-lists/index.d.mts +1 -1
- package/dist/report/components/entity-lists/index.d.ts +1 -1
- package/dist/report/definition/cell.cjs +3 -0
- package/dist/report/definition/cell.cjs.map +1 -1
- package/dist/report/definition/cell.d.cts +2 -0
- package/dist/report/definition/cell.d.mts +2 -0
- package/dist/report/definition/cell.d.ts +2 -0
- package/dist/report/definition/primitives.cjs +9 -2
- package/dist/report/definition/primitives.cjs.map +1 -1
- package/dist/runner/feedback/human.cjs +180 -16
- package/dist/runner/feedback/human.cjs.map +1 -1
- package/dist/runner/run.cjs +43 -0
- package/dist/runner/run.cjs.map +1 -1
- package/dist/sample/capability.cjs +93 -0
- package/dist/sample/capability.cjs.map +1 -1
- package/dist/sample/capability.d.cts +3 -1
- package/dist/sample/capability.d.mts +3 -1
- package/dist/sample/capability.d.ts +3 -1
- package/dist/sample/capability.js +8 -6
- package/dist/sandbox/docker-agent-image.cjs +5 -1
- package/dist/sandbox/docker-agent-image.cjs.map +1 -1
- package/dist/sandbox/docker-agent-image.d.cts +2 -0
- package/dist/sandbox/docker-agent-image.d.mts +2 -0
- package/dist/sandbox/docker-agent-image.d.ts +2 -0
- package/dist/sandbox/docker-agent-image.js +14 -10
- package/dist/sandbox/index.cjs +4 -2
- package/dist/sandbox/index.cjs.map +1 -1
- package/dist/sandbox/index.d.cts +1 -1
- package/dist/sandbox/index.d.mts +1 -1
- package/dist/sandbox/index.d.ts +1 -1
- package/dist/sandbox/index.js +120 -116
- package/dist/sandbox/index.mjs +120 -116
- package/docs-site/images/hitl-handshake-zh.svg +3 -3
- package/docs-site/zh/examples/integrations/ai-sdk-v7.mdx +3 -3
- package/docs-site/zh/examples/integrations/claude-sdk.mdx +3 -3
- package/docs-site/zh/examples/integrations/codex-sdk.mdx +5 -5
- package/docs-site/zh/examples/integrations/langgraph.mdx +3 -3
- package/docs-site/zh/examples/integrations/pi-sdk.mdx +5 -5
- package/docs-site/zh/explanation/adapter.mdx +5 -5
- package/docs-site/zh/explanation/assert.mdx +1 -1
- package/docs-site/zh/explanation/drive.mdx +3 -1
- package/docs-site/zh/explanation/evals.mdx +3 -1
- package/docs-site/zh/explanation/hitl.mdx +7 -7
- package/docs-site/zh/reference/builtin-agents.mdx +4 -4
- package/docs-site/zh/reference/capabilities.mdx +1 -1
- package/docs-site/zh/reference/events.mdx +10 -10
- package/docs-site/zh/reference/official-adapters.mdx +1 -1
- package/docs-site/zh/reference/results-data.mdx +6 -0
- package/docs-site/zh/tutorials/docker-in-docker.mdx +3 -0
- package/docs-site/zh/tutorials/nixos-managed-dind.mdx +160 -0
- package/docs-site/zh/tutorials/rerun-and-cache.mdx +16 -0
- package/docs-site/zh/tutorials/viewing-results.mdx +19 -1
- package/docs-site/zh/tutorials/write-send.mdx +7 -6
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compute.js","sourceRoot":"","sources":["compute.ts"],"names":[],"mappings":";;AAsGA,8CAKC;AAUD,oDAEC;AAmRD,0CAyBC;AAMD,gDAuGC;AAlgBD,2DAA4G;AAC5G,uDAA+E;AAC/E,+DAA+D;AAC/D,yDAA4G;AAoF5G,mCAAmC;AACnC,SAAgB,iBAAiB,CAAC,WAAmB,EAAE,WAAmB;IACtE,IAAI,CAAC,WAAW;QACZ,OAAO,WAAW,CAAC;IACvB,MAAM,MAAM,GAAG,GAAG,WAAW,GAAG,CAAC;IACjC,OAAO,WAAW,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC;AAC3F,CAAC;AACD,SAAS,YAAY,CAAC,MAAc,EAAE,OAAe;IACjD,OAAO,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,IAAI,OAAO,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC;AACrD,CAAC;AACD;;;;;GAKG;AACH,SAAgB,oBAAoB,CAAC,YAA+B;IAChE,OAAO,WAAW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C;QACD,IAAI,SAAS,KAAK,IAAI;YAClB,OAAO,CAAC,CAAC;QACb,IAAI,UAAU,KAAK,IAAI;YACnB,OAAO,CAAC,CAAC,CAAC;QACd,OAAO,UAAU,GAAG,SAAS,IAAI,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;IACzF,CAAC,CAAC;AACN,CAAC","sourcesContent":["// 实体列表计算函数(*Data):固定 Sample → 闭合组件数据。\n// ExperimentTable / AttemptList / FailureList 的 *Data 都住在这里。\n//\n// 共同约定见 docs/feature/reports/architecture.md 与 calculations.md:\n// - 第一参只收 Report Sample;issues 与 Evidence 留在 Analysis-owned MetricValue 里;\n// - 指标一律来自 `aggregate()` facade,判定来自公开 attempt-evidence DomainView,\n// 身份与覆盖事实来自 closed SampleSnapshot——这里不实现任何统计算法;\n// - null ≠ 0:缺数据不编数,覆盖率经 samples/total 如实暴露;\n// - 详情 href 一律经 `libraryDetailRoute()` + `attemptDetailTarget()` /\n// `experimentDetailTarget()` 建立,不自行编码 locator / experiment id 路径。\nimport type { AttemptEvidenceDomainView, CostMetricValue, JsonValue, MetricValue, PricingProfile, Sample, } from \"../../../analysis/index.ts\";\nimport type { AttemptLocator } from \"../../../attempt-locator.ts\";\nimport type { EvalId, ExperimentId } from \"../../../analysis/index.ts\";\nimport type { Verdict } from \"../../../shared/types.ts\";\nimport { aggregate, attempt, evalId, experiment, type AggregationSubject, } from \"../../model/aggregate.ts\";\nimport { costUSD, durationMs, passRate, tokens } from \"../../model/metrics.ts\";\nimport { toAttemptEvidence } from \"../../model/conversions.ts\";\nimport { attemptDetailTarget, experimentDetailTarget, libraryDetailRoute, } from \"../../library/details.ts\";\ntype UtcMillis = Sample[\"snapshot\"][\"runs\"][number][\"startedAt\"];\ntype ClosedAttemptEvidenceEntry = AttemptEvidenceDomainView[\"entries\"][number];\n/**\n * 当前 Analysis 只发布通过制读数(没有总分 Measure),题型构成恒为\n * \"pass\"。未来 Analysis 发布计分制 Measure 时,这里与 content.ts 的列集一起按\n * 同一构成判据扩展。\n */\nexport type EvaluationKindComposition = \"pass\" | \"points\" | \"mixed\";\n/** 一个层级共用的四枚 Analysis-owned 读数。 */\nexport interface ExperimentMetrics {\n readonly passRate: MetricValue<number>;\n readonly durationMs: MetricValue<number>;\n /** Present only when the owning Report declares a PricingProfile. */\n readonly costUSD?: CostMetricValue;\n readonly tokens: MetricValue<number>;\n}\n/** 一次 attempt 的闭合行。 */\nexport interface AttemptListItem {\n readonly locator: AttemptLocator;\n readonly experimentId: ExperimentId;\n readonly evalId: EvalId;\n readonly attemptOrdinal: number;\n /** 来自公开 attempt-evidence DomainView;证据读取失败时为 null(不伪造判定)。 */\n readonly verdict: Verdict | null;\n /**\n * 闭合失败摘要:errored 取 outcome 词,failed 取首条 mismatched 断言条目的\n * display 标签;closed 数据没有可读摘录时为 null(渲染成 \"—\",不发明文案)。\n */\n readonly failureSummary: string | null;\n readonly passRate: MetricValue<number>;\n readonly durationMs: MetricValue<number>;\n /** Present only when the owning Report declares a PricingProfile. */\n readonly costUSD?: CostMetricValue;\n readonly tokens: MetricValue<number>;\n /** 所属 selected Run 的 startedAt(attempt 级起点不进 closed snapshot)。 */\n readonly startedAt: UtcMillis | null;\n /** 详情 href,经 libraryDetailRoute(attemptDetailTarget(locator)) 建立。 */\n readonly href: string;\n}\n/** experiment 层级表里一道 Eval 的闭合行;attempts 是它的可见子行。 */\nexport interface ExperimentListEvalRow {\n readonly evalId: EvalId;\n readonly endToEndPassRate: MetricValue<number>;\n readonly durationMs: MetricValue<number>;\n readonly costUSD?: CostMetricValue;\n readonly tokens: MetricValue<number>;\n readonly attempts: readonly AttemptListItem[];\n}\n/** 一个 experiment 的闭合行。 */\nexport interface ExperimentListItem {\n readonly experimentId: ExperimentId;\n /** 来自实验水位 Run 的 closed context;Run context 缺席时如实为 null。 */\n readonly agent: string | null;\n readonly model: string | null;\n readonly flags: Readonly<Record<string, JsonValue>> | null;\n /** 占位默认值,见 EvaluationKindComposition 注释。 */\n readonly evaluationKind: EvaluationKindComposition;\n readonly endToEndPassRate: MetricValue<number>;\n readonly durationMs: MetricValue<number>;\n readonly costUSD?: CostMetricValue;\n readonly tokens: MetricValue<number>;\n /** 当前口径下没有 attempt 的题(active slot 为 not-recorded / core-invalid)。 */\n readonly missingEvalIds: readonly EvalId[];\n /**\n * 路径段组行的 Analysis-owned 读数,key 是完整组前缀(如 \"downshift/basic\")。\n * 组行不手写聚合:每个组前缀是 facade GroupFunction 的一个坐标,\n * 分母 / 状态 / Evidence 全部留在 Analysis。\n */\n readonly groupMetrics: ReadonlyMap<string, ExperimentMetrics>;\n readonly evalRows: readonly ExperimentListEvalRow[];\n /** 详情 href,经 libraryDetailRoute(experimentDetailTarget(id)) 建立。 */\n readonly href: string;\n}\n/** Eval 路径层级布局:叶子 / 路径段组。 */\nexport type EvalLayoutNode = {\n readonly kind: \"leaf\";\n readonly evalId: EvalId;\n} | {\n readonly kind: \"group\";\n readonly segment: string;\n readonly prefix: string;\n readonly children: readonly EvalLayoutNode[];\n};\n/** 相对已表达前缀的剩余路径;无前缀时是完整 evalId。 */\nexport function relativeEvalLabel(evalIdValue: EvalId, labelPrefix: string): string {\n if (!labelPrefix)\n return evalIdValue;\n const prefix = `${labelPrefix}/`;\n return evalIdValue.startsWith(prefix) ? evalIdValue.slice(prefix.length) : evalIdValue;\n}\nfunction joinEvalPath(prefix: string, segment: string): string {\n return prefix ? `${prefix}/${segment}` : segment;\n}\n/**\n * Eval 路径段 → 层级布局。两条收起条件在每一层兄弟之间各自判定\n * (docs/feature/reports/library.md「身份格与行数」):\n * 唯一组且无叶时剥壳前进,不插组行;组全为单成员或本层只有叶时全部放平。\n * 纯字符串投影,不读任何指标。\n */\nexport function experimentEvalLayout(evalIdValues: readonly EvalId[]): readonly EvalLayoutNode[] {\n return layoutLevel(evalIdValues, \"\");\n}\nfunction layoutLevel(members: readonly EvalId[], dirPrefix: string): readonly EvalLayoutNode[] {\n if (members.length === 0)\n return [];\n const leaves: EvalId[] = [];\n const groups = new Map<string, EvalId[]>();\n for (const member of members) {\n const remaining = relativeEvalLabel(member, dirPrefix).split(\"/\").filter(Boolean);\n if (remaining.length <= 1) {\n leaves.push(member);\n continue;\n }\n const head = remaining[0]!;\n const list = groups.get(head);\n if (list)\n list.push(member);\n else\n groups.set(head, [member]);\n }\n const collapse = groups.size === 0 ||\n (groups.size === 1 && leaves.length === 0) ||\n [...groups.values()].every((group) => group.length === 1);\n if (collapse) {\n if (groups.size === 1 && leaves.length === 0) {\n const head = [...groups.keys()][0]!;\n return layoutLevel(members, joinEvalPath(dirPrefix, head));\n }\n return [...leaves]\n .sort((left, right) => left.localeCompare(right))\n .map((member): EvalLayoutNode => ({ kind: \"leaf\", evalId: member }));\n }\n const groupNodes: EvalLayoutNode[] = [...groups.entries()]\n .sort(([left], [right]) => left.localeCompare(right))\n .map(([segment, groupMembers]) => ({\n kind: \"group\" as const,\n segment,\n prefix: joinEvalPath(dirPrefix, segment),\n children: layoutLevel(groupMembers, joinEvalPath(dirPrefix, segment)),\n }));\n const leafNodes: EvalLayoutNode[] = [...leaves]\n .sort((left, right) => left.localeCompare(right))\n .map((member): EvalLayoutNode => ({ kind: \"leaf\", evalId: member }));\n return [...groupNodes, ...leafNodes];\n}\ninterface AttemptFact {\n readonly verdict: Verdict | null;\n readonly failureSummary: string | null;\n}\ninterface SlotSelection {\n readonly locator: AttemptLocator;\n readonly experimentId: ExperimentId;\n readonly evalId: EvalId;\n readonly attemptOrdinal: number;\n readonly startedAt: UtcMillis | null;\n}\n/** 一次 attempt 的闭合失败摘要(只读公开 DomainView,不重算断言展示)。 */\nfunction closedFailureSummary(entry: ClosedAttemptEvidenceEntry | undefined): string | null {\n if (entry === undefined || entry.state !== \"available\")\n return null;\n const detail = entry.detail;\n if (detail.verdict === \"errored\")\n return detail.outcome;\n if (detail.verdict !== \"failed\")\n return null;\n for (const item of detail.entries) {\n const result = item.result;\n if (typeof result !== \"object\" || result === null || Array.isArray(result))\n continue;\n if ((result as Readonly<Record<string, unknown>>).state !== \"mismatched\")\n continue;\n const display = item.display;\n if (typeof display === \"object\" && display !== null && !Array.isArray(display)) {\n const label = (display as Readonly<Record<string, unknown>>).label;\n if (typeof label === \"string\" && label.length > 0)\n return label;\n }\n return \"assertion\";\n }\n return null;\n}\nasync function evidenceFacts(sample: Sample): Promise<ReadonlyMap<AttemptLocator, AttemptFact>> {\n const view = await toAttemptEvidence(sample);\n const facts = new Map<AttemptLocator, AttemptFact>();\n for (const entry of view.entries) {\n const locator = entry.attempt.locator;\n facts.set(locator, Object.freeze({\n verdict: entry.state === \"available\" ? (entry.detail.verdict as Verdict) : null,\n failureSummary: closedFailureSummary(entry),\n }));\n }\n return facts;\n}\nasync function attemptMetricRows(sample: Sample, pricing: PricingProfile | null): Promise<ReadonlyMap<string, ExperimentMetrics>> {\n const rows = await aggregate(sample, {\n by: { experiment, evalId, attempt },\n values: pricing === null\n ? { passRate, durationMs, tokens }\n : { passRate, durationMs, costUSD: costUSD(pricing), tokens },\n });\n const byKey = new Map<string, ExperimentMetrics>();\n for (const row of rows) {\n if (typeof row.attempt !== \"string\")\n continue;\n byKey.set(metricsKey(row.experiment as string, row.evalId as string, row.attempt), Object.freeze({\n passRate: row.passRate,\n durationMs: row.durationMs,\n ...(pricing === null ? {} : { costUSD: (row as unknown as {\n readonly costUSD: CostMetricValue;\n }).costUSD }),\n tokens: row.tokens,\n }));\n }\n return byKey;\n}\nfunction metricsKey(experimentId: string, evalIdValue: string, locator?: string): string {\n return locator === undefined\n ? `${experimentId}\\u0000${evalIdValue}`\n : `${experimentId}\\u0000${evalIdValue}\\u0000${locator}`;\n}\n/**\n * Included Analysis subjects always have an aggregate row, even when every\n * measure in that row is empty. Treat an omitted row as a broken Analysis\n * contract instead of manufacturing a Report-owned MetricValue.\n */\nfunction requireMetrics(metrics: ExperimentMetrics | undefined, subject: string): ExperimentMetrics {\n if (metrics === undefined) {\n throw new Error(`Analysis aggregate omitted the required ${subject} row.`);\n }\n return metrics;\n}\n/** 每个 experiment 每道 Eval 一行,按 evalId 升序返回(不重排 attempt 语义)。 */\nasync function evalMetricRows(sample: Sample, pricing: PricingProfile | null): Promise<ReadonlyMap<string, ExperimentMetrics>> {\n const rows = await aggregate(sample, {\n by: { experiment, evalId },\n values: pricing === null\n ? { passRate, durationMs, tokens }\n : { passRate, durationMs, costUSD: costUSD(pricing), tokens },\n });\n const byKey = new Map<string, ExperimentMetrics>();\n for (const row of rows) {\n byKey.set(metricsKey(row.experiment as string, row.evalId as string), Object.freeze({\n passRate: row.passRate,\n durationMs: row.durationMs,\n ...(pricing === null ? {} : { costUSD: (row as unknown as {\n readonly costUSD: CostMetricValue;\n }).costUSD }),\n tokens: row.tokens,\n }));\n }\n return byKey;\n}\nasync function experimentMetricRows(sample: Sample, pricing: PricingProfile | null): Promise<ReadonlyMap<ExperimentId, ExperimentMetrics>> {\n const rows = await aggregate(sample, {\n by: { experiment },\n values: pricing === null\n ? { passRate, durationMs, tokens }\n : { passRate, durationMs, costUSD: costUSD(pricing), tokens },\n });\n const byId = new Map<ExperimentId, ExperimentMetrics>();\n for (const row of rows) {\n byId.set(row.experiment as ExperimentId, Object.freeze({\n passRate: row.passRate,\n durationMs: row.durationMs,\n ...(pricing === null ? {} : { costUSD: (row as unknown as {\n readonly costUSD: CostMetricValue;\n }).costUSD }),\n tokens: row.tokens,\n }));\n }\n return byId;\n}\n/**\n * 组行读数的 facade 聚合:每个路径段组前缀是一个 GroupFunction 坐标,\n * 分母 / 状态 / Evidence 全部由 Analysis 按 logical slots 计算。\n */\nasync function groupMetricRows(sample: Sample, prefixByExperiment: ReadonlyMap<ExperimentId, ReadonlyMap<EvalId, string>>, pricing: PricingProfile | null): Promise<ReadonlyMap<string, ExperimentMetrics>> {\n const groupPrefix = (subject: AggregationSubject): string => prefixByExperiment.get(subject.experimentId)?.get(subject.evalId) ?? \"\";\n const rows = await aggregate(sample, {\n by: { experiment, prefix: groupPrefix },\n values: pricing === null\n ? { passRate, durationMs, tokens }\n : { passRate, durationMs, costUSD: costUSD(pricing), tokens },\n });\n const byKey = new Map<string, ExperimentMetrics>();\n for (const row of rows) {\n const prefix = row.prefix;\n if (typeof prefix !== \"string\" || prefix.length === 0)\n continue;\n byKey.set(metricsKey(row.experiment as string, prefix), Object.freeze({\n passRate: row.passRate,\n durationMs: row.durationMs,\n ...(pricing === null ? {} : { costUSD: (row as unknown as {\n readonly costUSD: CostMetricValue;\n }).costUSD }),\n tokens: row.tokens,\n }));\n }\n return byKey;\n}\nfunction attemptHref(locator: AttemptLocator): string {\n return libraryDetailRoute(attemptDetailTarget(locator));\n}\nfunction experimentHref(experimentId: ExperimentId): string {\n return libraryDetailRoute(experimentDetailTarget(experimentId));\n}\n/** SampleSnapshot → 每个 experiment 的身份水位(最新 startedAt 的 Run)。 */\nfunction watermarksByExperiment(sample: Sample): ReadonlyMap<ExperimentId, {\n readonly startedAt: UtcMillis;\n readonly agent: string | null;\n readonly model: string | null;\n readonly flags: Readonly<Record<string, JsonValue>> | null;\n}> {\n const runsByExperiment = new Map<ExperimentId, typeof sample.snapshot.runs[number][]>();\n for (const run of sample.snapshot.runs) {\n const list = runsByExperiment.get(run.experimentId);\n if (list)\n list.push(run);\n else\n runsByExperiment.set(run.experimentId, [run]);\n }\n const byExperiment = new Map<ExperimentId, {\n readonly startedAt: UtcMillis;\n readonly agent: string | null;\n readonly model: string | null;\n readonly flags: Readonly<Record<string, JsonValue>> | null;\n }>();\n for (const [experimentId, runs] of runsByExperiment) {\n const newest = runs.reduce((best, run) => run.startedAt > best.startedAt ? run : best, runs[0]!);\n const context = newest.context;\n byExperiment.set(experimentId, Object.freeze({\n startedAt: newest.startedAt,\n agent: context?.execution.agentId ?? null,\n model: context?.execution.model ?? null,\n flags: context ? Object.freeze({ ...context.execution.flags }) : null,\n }));\n }\n return byExperiment;\n}\nfunction runStartedAtByRunId(sample: Sample): ReadonlyMap<string, UtcMillis> {\n const byRunId = new Map<string, UtcMillis>();\n for (const run of sample.snapshot.runs)\n byRunId.set(run.runId, run.startedAt);\n return byRunId;\n}\n/**\n * 按 locator 去重的 included slot 选择:同一 locator 出现多份(跨 Run 携带)时\n * 取 startedAt 最新的一份作展示行。Member 的 action / relation 是 Run provenance,\n * 不在质量列表里折成额外的时效状态。\n */\nfunction selectedSlots(sample: Sample): readonly SlotSelection[] {\n const runStartedAt = runStartedAtByRunId(sample);\n const byLocator = new Map<AttemptLocator, SlotSelection>();\n for (const slot of sample.snapshot.slots) {\n if (slot.state !== \"included\")\n continue;\n const locator = slot.attempt.locator;\n const startedAt = runStartedAt.get(slot.runId) ?? null;\n const existing = byLocator.get(locator);\n if (existing === undefined ||\n (startedAt !== null && (existing.startedAt === null || startedAt > existing.startedAt))) {\n byLocator.set(locator, Object.freeze({\n locator,\n experimentId: slot.experimentId,\n evalId: slot.evalId,\n attemptOrdinal: slot.attemptOrdinal,\n startedAt,\n }));\n }\n }\n return Object.freeze([...byLocator.values()]);\n}\n/**\n * `attemptListData(sample)`:每个 included attempt 一项,顺序取自 Sample 展平顺序\n * (按 locator 去重后保持首次出现序,不重排)。\n */\nexport async function attemptListData(sample: Sample, pricing: PricingProfile | null = null): Promise<readonly AttemptListItem[]> {\n const [facts, metrics] = await Promise.all([\n evidenceFacts(sample),\n attemptMetricRows(sample, pricing),\n ]);\n const selections = selectedSlots(sample);\n return Object.freeze(selections.map((selection): AttemptListItem => {\n const fact = facts.get(selection.locator) ?? Object.freeze({ verdict: null, failureSummary: null });\n const metric = requireMetrics(metrics.get(metricsKey(selection.experimentId, selection.evalId, selection.locator)), `attempt ${JSON.stringify(selection.locator)}`);\n const item: AttemptListItem = Object.freeze({\n locator: selection.locator,\n experimentId: selection.experimentId,\n evalId: selection.evalId,\n attemptOrdinal: selection.attemptOrdinal,\n verdict: fact.verdict,\n failureSummary: fact.failureSummary,\n passRate: metric.passRate,\n durationMs: metric.durationMs,\n ...(metric.costUSD === undefined ? {} : { costUSD: metric.costUSD }),\n tokens: metric.tokens,\n startedAt: selection.startedAt,\n href: attemptHref(selection.locator),\n });\n return item;\n }));\n}\n/**\n * `experimentListData(sample)`:每个 experiment 一项,展开到每道 Eval;初始排序按\n * 这份列表自身的题型构成选择主读数——当前 facade 只有通过制读数,恒为\n * endToEndPassRate 降序(缺数据沉底,同值按 experimentId 字典序收口)。\n */\nexport async function experimentListData(sample: Sample, pricing: PricingProfile | null = null): Promise<readonly ExperimentListItem[]> {\n const snapshot = sample.snapshot;\n const attempts = await attemptListData(sample, pricing);\n const [experimentMetrics, evalMetrics] = await Promise.all([\n experimentMetricRows(sample, pricing),\n evalMetricRows(sample, pricing),\n ]);\n const attemptsByEval = new Map<string, AttemptListItem[]>();\n for (const item of attempts) {\n const key = metricsKey(item.experimentId, item.evalId);\n const list = attemptsByEval.get(key);\n if (list)\n list.push(item);\n else\n attemptsByEval.set(key, [item]);\n }\n const activeSlots = snapshot.slots.filter((slot) => slot.state !== \"excluded\");\n const experiments = new Map<ExperimentId, {\n evalIds: Set<EvalId>;\n included: Set<EvalId>;\n }>();\n for (const slot of activeSlots) {\n const entry = experiments.get(slot.experimentId);\n if (entry === undefined) {\n experiments.set(slot.experimentId, {\n evalIds: new Set([slot.evalId]),\n included: slot.state === \"included\" ? new Set([slot.evalId]) : new Set(),\n });\n continue;\n }\n entry.evalIds.add(slot.evalId);\n if (slot.state === \"included\")\n entry.included.add(slot.evalId);\n }\n // 组前缀布局(纯字符串)与 facade GroupFunction 坐标先于指标聚合固定。\n const prefixByExperiment = new Map<ExperimentId, ReadonlyMap<EvalId, string>>();\n for (const [experimentId, entry] of experiments) {\n const layout = experimentEvalLayout([...entry.evalIds]);\n const prefixFor = new Map<EvalId, string>();\n const walk = (nodes: readonly EvalLayoutNode[]): void => {\n for (const node of nodes) {\n if (node.kind === \"leaf\")\n continue;\n for (const evalIdValue of evalIdsUnder(node))\n prefixFor.set(evalIdValue, node.prefix);\n walk(node.children);\n }\n };\n walk(layout);\n prefixByExperiment.set(experimentId, prefixFor);\n }\n const hasGroups = [...prefixByExperiment.values()].some((prefixFor) => prefixFor.size > 0);\n const groupMetrics = hasGroups\n ? await groupMetricRows(sample, prefixByExperiment, pricing)\n : new Map<string, ExperimentMetrics>();\n const watermarks = watermarksByExperiment(sample);\n const items: ExperimentListItem[] = [];\n for (const [experimentId, entry] of experiments) {\n const evalIds = [...entry.evalIds];\n const missing = [...evalIds].filter((evalIdValue) => !entry.included.has(evalIdValue));\n const evalRows: ExperimentListEvalRow[] = [];\n for (const evalIdValue of evalIds) {\n if (!entry.included.has(evalIdValue))\n continue;\n const list = attemptsByEval.get(metricsKey(experimentId, evalIdValue)) ?? [];\n const sorted = [...list].sort((left, right) => left.attemptOrdinal - right.attemptOrdinal || left.locator.localeCompare(right.locator));\n const metrics = requireMetrics(evalMetrics.get(metricsKey(experimentId, evalIdValue)), `experiment/eval ${JSON.stringify(experimentId)}/${JSON.stringify(evalIdValue)}`);\n evalRows.push(Object.freeze({\n evalId: evalIdValue,\n endToEndPassRate: metrics.passRate,\n durationMs: metrics.durationMs,\n ...(metrics.costUSD === undefined ? {} : { costUSD: metrics.costUSD }),\n tokens: metrics.tokens,\n attempts: Object.freeze(sorted),\n }));\n }\n const watermark = watermarks.get(experimentId);\n const experimentMetric = requireMetrics(experimentMetrics.get(experimentId), `experiment ${JSON.stringify(experimentId)}`);\n const groupMetricsForItem = new Map<string, ExperimentMetrics>();\n const prefixes = [...new Set(prefixByExperiment.get(experimentId)?.values() ?? [])];\n for (const prefix of prefixes) {\n const metric = groupMetrics.get(metricsKey(experimentId, prefix));\n if (metric !== undefined)\n groupMetricsForItem.set(prefix, metric);\n }\n items.push(Object.freeze({\n experimentId,\n agent: watermark?.agent ?? null,\n model: watermark?.model ?? null,\n flags: watermark?.flags ?? null,\n evaluationKind: \"pass\",\n endToEndPassRate: experimentMetric.passRate,\n durationMs: experimentMetric.durationMs,\n ...(experimentMetric.costUSD === undefined ? {} : { costUSD: experimentMetric.costUSD }),\n tokens: experimentMetric.tokens,\n missingEvalIds: Object.freeze(missing.sort((left, right) => left.localeCompare(right))),\n groupMetrics: groupMetricsForItem,\n evalRows: Object.freeze(evalRows),\n href: experimentHref(experimentId),\n }));\n }\n items.sort(byMetricDescThenId((item) => item.endToEndPassRate.value));\n return Object.freeze(items);\n}\nfunction evalIdsUnder(node: EvalLayoutNode): readonly EvalId[] {\n if (node.kind === \"leaf\")\n return [node.evalId];\n return node.children.flatMap(evalIdsUnder);\n}\nfunction byMetricDescThenId(valueOf: (item: ExperimentListItem) => number | null): (left: ExperimentListItem, right: ExperimentListItem) => number {\n return (left, right) => {\n const leftValue = valueOf(left);\n const rightValue = valueOf(right);\n if (leftValue === null && rightValue === null) {\n return left.experimentId.localeCompare(right.experimentId);\n }\n if (leftValue === null)\n return 1;\n if (rightValue === null)\n return -1;\n return rightValue - leftValue || left.experimentId.localeCompare(right.experimentId);\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"compute.js","sourceRoot":"","sources":["compute.ts"],"names":[],"mappings":";;AAyGA,8CAKC;AAUD,oDAEC;AAiSD,0CA+BC;AAMD,gDAyHC;AA3iBD,2DAA4G;AAC5G,uDAA+E;AAC/E,+DAA+D;AAC/D,yDAA4G;AAC5G,6DAAoE;AAsFpE,mCAAmC;AACnC,SAAgB,iBAAiB,CAAC,WAAmB,EAAE,WAAmB;IACtE,IAAI,CAAC,WAAW;QACZ,OAAO,WAAW,CAAC;IACvB,MAAM,MAAM,GAAG,GAAG,WAAW,GAAG,CAAC;IACjC,OAAO,WAAW,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC;AAC3F,CAAC;AACD,SAAS,YAAY,CAAC,MAAc,EAAE,OAAe;IACjD,OAAO,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,IAAI,OAAO,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC;AACrD,CAAC;AACD;;;;;GA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,CAAC;AAChC,CAAC;AACD,SAAS,YAAY,CAAC,IAAoB;IACtC,IAAI,IAAI,CAAC,IAAI,KAAK,MAAM;QACpB,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACzB,OAAO,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;AAC/C,CAAC;AACD,SAAS,kBAAkB,CAAC,OAAoD;IAC5E,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;QACnB,MAAM,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;QAChC,MAAM,UAAU,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;QAClC,IAAI,SAAS,KAAK,IAAI,IAAI,UAAU,KAAK,IAAI,EAAE,CAAC;YAC5C,OAAO,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;QAC/D,CAAC;QACD,IAAI,SAAS,KAAK,IAAI;YAClB,OAAO,CAAC,CAAC;QACb,IAAI,UAAU,KAAK,IAAI;YACnB,OAAO,CAAC,CAAC,CAAC;QACd,OAAO,UAAU,GAAG,SAAS,IAAI,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;IACzF,CAAC,CAAC;AACN,CAAC","sourcesContent":["// 实体列表计算函数(*Data):固定 Sample → 闭合组件数据。\n// ExperimentTable / AttemptList / FailureList 的 *Data 都住在这里。\n//\n// 共同约定见 docs/feature/reports/architecture.md 与 calculations.md:\n// - 第一参只收 Report Sample;issues 与 Evidence 留在 Analysis-owned MetricValue 里;\n// - 指标一律来自 `aggregate()` facade,判定来自公开 attempt-evidence DomainView,\n// 身份与覆盖事实来自 closed SampleSnapshot——这里不实现任何统计算法;\n// - null ≠ 0:缺数据不编数,覆盖率经 samples/total 如实暴露;\n// - 详情 href 一律经 `libraryDetailRoute()` + `attemptDetailTarget()` /\n// `experimentDetailTarget()` 建立,不自行编码 locator / experiment id 路径。\nimport type { AttemptEvidenceDomainView, CostMetricValue, JsonValue, MetricValue, PricingProfile, Sample, } from \"../../../analysis/index.ts\";\nimport type { AttemptLocator } from \"../../../attempt-locator.ts\";\nimport type { EvalId, ExperimentId } from \"../../../analysis/index.ts\";\nimport type { Verdict } from \"../../../shared/types.ts\";\nimport { aggregate, attempt, evalId, experiment, type AggregationSubject, } from \"../../model/aggregate.ts\";\nimport { costUSD, durationMs, passRate, tokens } from \"../../model/metrics.ts\";\nimport { toAttemptEvidence } from \"../../model/conversions.ts\";\nimport { attemptDetailTarget, experimentDetailTarget, libraryDetailRoute, } from \"../../library/details.ts\";\nimport { assertionEntryViewOf } from \"../attempt-detail/compute.ts\";\ntype UtcMillis = Sample[\"snapshot\"][\"runs\"][number][\"startedAt\"];\ntype ClosedAttemptEvidenceEntry = AttemptEvidenceDomainView[\"entries\"][number];\nexport type EvaluationKindComposition = \"pass\" | \"points\" | \"mixed\";\n/** 一个层级共用的四枚 Analysis-owned 读数。 */\nexport interface ExperimentMetrics {\n readonly passRate: MetricValue<number>;\n readonly durationMs: MetricValue<number>;\n /** Present only when the owning Report declares a PricingProfile. */\n readonly costUSD?: CostMetricValue;\n readonly tokens: MetricValue<number>;\n}\n/** 一次 attempt 的闭合行。 */\nexport interface AttemptListItem {\n readonly locator: AttemptLocator;\n readonly experimentId: ExperimentId;\n readonly evalId: EvalId;\n readonly attemptOrdinal: number;\n /** 来自公开 attempt-evidence DomainView;证据读取失败时为 null(不伪造判定)。 */\n readonly verdict: Verdict | null;\n /**\n * 闭合失败摘要:errored 取 outcome 词,failed 取首条 mismatched 断言条目的\n * display 标签;closed 数据没有可读摘录时为 null(渲染成 \"—\",不发明文案)。\n */\n readonly failureSummary: string | null;\n readonly evaluationKind: \"pass\" | \"points\";\n /** Complete earned score for this Attempt; absent for pass or incomplete score evidence. */\n readonly totalScore?: number;\n readonly passRate: MetricValue<number>;\n readonly durationMs: MetricValue<number>;\n /** Present only when the owning Report declares a PricingProfile. */\n readonly costUSD?: CostMetricValue;\n readonly tokens: MetricValue<number>;\n /** 所属 selected Run 的 startedAt(attempt 级起点不进 closed snapshot)。 */\n readonly startedAt: UtcMillis | null;\n /** 详情 href,经 libraryDetailRoute(attemptDetailTarget(locator)) 建立。 */\n readonly href: string;\n}\n/** experiment 层级表里一道 Eval 的闭合行;attempts 是它的可见子行。 */\nexport interface ExperimentListEvalRow {\n readonly evalId: EvalId;\n readonly evaluationKind: \"pass\" | \"points\";\n /** Mean of complete Attempt scores for this Eval. */\n readonly totalScore?: number;\n readonly endToEndPassRate: MetricValue<number>;\n readonly durationMs: MetricValue<number>;\n readonly costUSD?: CostMetricValue;\n readonly tokens: MetricValue<number>;\n readonly attempts: readonly AttemptListItem[];\n}\n/** 一个 experiment 的闭合行。 */\nexport interface ExperimentListItem {\n readonly experimentId: ExperimentId;\n /** 来自实验水位 Run 的 closed context;Run context 缺席时如实为 null。 */\n readonly agent: string | null;\n readonly model: string | null;\n readonly flags: Readonly<Record<string, JsonValue>> | null;\n readonly evaluationKind: EvaluationKindComposition;\n /** Sum of the visible per-Eval score cells; absent when no complete Score Eval exists. */\n readonly totalScore?: number;\n readonly endToEndPassRate: MetricValue<number>;\n readonly durationMs: MetricValue<number>;\n readonly costUSD?: CostMetricValue;\n readonly tokens: MetricValue<number>;\n /** 当前口径下没有 attempt 的题(active slot 为 not-recorded / core-invalid)。 */\n readonly missingEvalIds: readonly EvalId[];\n /**\n * 路径段组行的 Analysis-owned 读数,key 是完整组前缀(如 \"downshift/basic\")。\n * 组行不手写聚合:每个组前缀是 facade GroupFunction 的一个坐标,\n * 分母 / 状态 / Evidence 全部留在 Analysis。\n */\n readonly groupMetrics: ReadonlyMap<string, ExperimentMetrics>;\n readonly evalRows: readonly ExperimentListEvalRow[];\n /** 详情 href,经 libraryDetailRoute(experimentDetailTarget(id)) 建立。 */\n readonly href: string;\n}\n/** Eval 路径层级布局:叶子 / 路径段组。 */\nexport type EvalLayoutNode = {\n readonly kind: \"leaf\";\n readonly evalId: EvalId;\n} | {\n readonly kind: \"group\";\n readonly segment: string;\n readonly prefix: string;\n readonly children: readonly EvalLayoutNode[];\n};\n/** 相对已表达前缀的剩余路径;无前缀时是完整 evalId。 */\nexport function relativeEvalLabel(evalIdValue: EvalId, labelPrefix: string): string {\n if (!labelPrefix)\n return evalIdValue;\n const prefix = `${labelPrefix}/`;\n return evalIdValue.startsWith(prefix) ? evalIdValue.slice(prefix.length) : evalIdValue;\n}\nfunction joinEvalPath(prefix: string, segment: string): string {\n return prefix ? `${prefix}/${segment}` : segment;\n}\n/**\n * Eval 路径段 → 层级布局。两条收起条件在每一层兄弟之间各自判定\n * (docs/feature/reports/library.md「身份格与行数」):\n * 唯一组且无叶时剥壳前进,不插组行;组全为单成员或本层只有叶时全部放平。\n * 纯字符串投影,不读任何指标。\n */\nexport function experimentEvalLayout(evalIdValues: readonly EvalId[]): readonly EvalLayoutNode[] {\n return layoutLevel(evalIdValues, \"\");\n}\nfunction layoutLevel(members: readonly EvalId[], dirPrefix: string): readonly EvalLayoutNode[] {\n if (members.length === 0)\n return [];\n const leaves: EvalId[] = [];\n const groups = new Map<string, EvalId[]>();\n for (const member of members) {\n const remaining = relativeEvalLabel(member, dirPrefix).split(\"/\").filter(Boolean);\n if (remaining.length <= 1) {\n leaves.push(member);\n continue;\n }\n const head = remaining[0]!;\n const list = groups.get(head);\n if (list)\n list.push(member);\n else\n groups.set(head, [member]);\n }\n const collapse = groups.size === 0 ||\n (groups.size === 1 && leaves.length === 0) ||\n [...groups.values()].every((group) => group.length === 1);\n if (collapse) {\n if (groups.size === 1 && leaves.length === 0) {\n const head = [...groups.keys()][0]!;\n return layoutLevel(members, joinEvalPath(dirPrefix, head));\n }\n return [...leaves]\n .sort((left, right) => left.localeCompare(right))\n .map((member): EvalLayoutNode => ({ kind: \"leaf\", evalId: member }));\n }\n const groupNodes: EvalLayoutNode[] = [...groups.entries()]\n .sort(([left], [right]) => left.localeCompare(right))\n .map(([segment, groupMembers]) => ({\n kind: \"group\" as const,\n segment,\n prefix: joinEvalPath(dirPrefix, segment),\n children: layoutLevel(groupMembers, joinEvalPath(dirPrefix, segment)),\n }));\n const leafNodes: EvalLayoutNode[] = [...leaves]\n .sort((left, right) => left.localeCompare(right))\n .map((member): EvalLayoutNode => ({ kind: \"leaf\", evalId: member }));\n return [...groupNodes, ...leafNodes];\n}\ninterface AttemptFact {\n readonly verdict: Verdict | null;\n readonly failureSummary: string | null;\n readonly evaluationKind: \"pass\" | \"points\";\n readonly totalScore?: number;\n}\ninterface SlotSelection {\n readonly locator: AttemptLocator;\n readonly experimentId: ExperimentId;\n readonly evalId: EvalId;\n readonly attemptOrdinal: number;\n readonly startedAt: UtcMillis | null;\n}\n/** 一次 attempt 的闭合失败摘要(只读公开 DomainView,不重算断言展示)。 */\nfunction closedFailureSummary(entry: ClosedAttemptEvidenceEntry | undefined): string | null {\n if (entry === undefined || entry.state !== \"available\")\n return null;\n const detail = entry.detail;\n if (detail.verdict === \"errored\")\n return detail.outcome;\n if (detail.verdict !== \"failed\")\n return null;\n for (const item of detail.entries) {\n const result = item.result;\n if (typeof result !== \"object\" || result === null || Array.isArray(result))\n continue;\n if ((result as Readonly<Record<string, unknown>>).state !== \"mismatched\")\n continue;\n const display = item.display;\n if (typeof display === \"object\" && display !== null && !Array.isArray(display)) {\n const label = (display as Readonly<Record<string, unknown>>).label;\n if (typeof label === \"string\" && label.length > 0)\n return label;\n }\n return \"assertion\";\n }\n return null;\n}\nasync function evidenceFacts(sample: Sample): Promise<ReadonlyMap<AttemptLocator, AttemptFact>> {\n const view = await toAttemptEvidence(sample);\n const facts = new Map<AttemptLocator, AttemptFact>();\n for (const entry of view.entries) {\n const locator = entry.attempt.locator;\n const assertions = entry.state === \"available\"\n ? entry.detail.entries.map(assertionEntryViewOf).filter((item) => item !== undefined)\n : [];\n const scoreContributions = assertions\n .map((item) => item.result.score)\n .filter((score) => score.state !== \"not-scored\");\n const completeScore = scoreContributions.length > 0 &&\n scoreContributions.every((score) => score.state === \"earned\" && score.earned !== undefined)\n ? scoreContributions.reduce((sum, score) => sum + (score.earned ?? 0), 0)\n : undefined;\n facts.set(locator, Object.freeze({\n verdict: entry.state === \"available\" ? (entry.detail.verdict as Verdict) : null,\n failureSummary: closedFailureSummary(entry),\n evaluationKind: scoreContributions.length > 0 ? \"points\" : \"pass\",\n ...(completeScore === undefined ? {} : { totalScore: completeScore }),\n }));\n }\n return facts;\n}\nasync function attemptMetricRows(sample: Sample, pricing: PricingProfile | null): Promise<ReadonlyMap<string, ExperimentMetrics>> {\n const rows = await aggregate(sample, {\n by: { experiment, evalId, attempt },\n values: pricing === null\n ? { passRate, durationMs, tokens }\n : { passRate, durationMs, costUSD: costUSD(pricing), tokens },\n });\n const byKey = new Map<string, ExperimentMetrics>();\n for (const row of rows) {\n if (typeof row.attempt !== \"string\")\n continue;\n byKey.set(metricsKey(row.experiment as string, row.evalId as string, row.attempt), Object.freeze({\n passRate: row.passRate,\n durationMs: row.durationMs,\n ...(pricing === null ? {} : { costUSD: (row as unknown as {\n readonly costUSD: CostMetricValue;\n }).costUSD }),\n tokens: row.tokens,\n }));\n }\n return byKey;\n}\nfunction metricsKey(experimentId: string, evalIdValue: string, locator?: string): string {\n return locator === undefined\n ? `${experimentId}\\u0000${evalIdValue}`\n : `${experimentId}\\u0000${evalIdValue}\\u0000${locator}`;\n}\n/**\n * Included Analysis subjects always have an aggregate row, even when every\n * measure in that row is empty. Treat an omitted row as a broken Analysis\n * contract instead of manufacturing a Report-owned MetricValue.\n */\nfunction requireMetrics(metrics: ExperimentMetrics | undefined, subject: string): ExperimentMetrics {\n if (metrics === undefined) {\n throw new Error(`Analysis aggregate omitted the required ${subject} row.`);\n }\n return metrics;\n}\n/** 每个 experiment 每道 Eval 一行,按 evalId 升序返回(不重排 attempt 语义)。 */\nasync function evalMetricRows(sample: Sample, pricing: PricingProfile | null): Promise<ReadonlyMap<string, ExperimentMetrics>> {\n const rows = await aggregate(sample, {\n by: { experiment, evalId },\n values: pricing === null\n ? { passRate, durationMs, tokens }\n : { passRate, durationMs, costUSD: costUSD(pricing), tokens },\n });\n const byKey = new Map<string, ExperimentMetrics>();\n for (const row of rows) {\n byKey.set(metricsKey(row.experiment as string, row.evalId as string), Object.freeze({\n passRate: row.passRate,\n durationMs: row.durationMs,\n ...(pricing === null ? {} : { costUSD: (row as unknown as {\n readonly costUSD: CostMetricValue;\n }).costUSD }),\n tokens: row.tokens,\n }));\n }\n return byKey;\n}\nasync function experimentMetricRows(sample: Sample, pricing: PricingProfile | null): Promise<ReadonlyMap<ExperimentId, ExperimentMetrics>> {\n const rows = await aggregate(sample, {\n by: { experiment },\n values: pricing === null\n ? { passRate, durationMs, tokens }\n : { passRate, durationMs, costUSD: costUSD(pricing), tokens },\n });\n const byId = new Map<ExperimentId, ExperimentMetrics>();\n for (const row of rows) {\n byId.set(row.experiment as ExperimentId, Object.freeze({\n passRate: row.passRate,\n durationMs: row.durationMs,\n ...(pricing === null ? {} : { costUSD: (row as unknown as {\n readonly costUSD: CostMetricValue;\n }).costUSD }),\n tokens: row.tokens,\n }));\n }\n return byId;\n}\n/**\n * 组行读数的 facade 聚合:每个路径段组前缀是一个 GroupFunction 坐标,\n * 分母 / 状态 / Evidence 全部由 Analysis 按 logical slots 计算。\n */\nasync function groupMetricRows(sample: Sample, prefixByExperiment: ReadonlyMap<ExperimentId, ReadonlyMap<EvalId, string>>, pricing: PricingProfile | null): Promise<ReadonlyMap<string, ExperimentMetrics>> {\n const groupPrefix = (subject: AggregationSubject): string => prefixByExperiment.get(subject.experimentId)?.get(subject.evalId) ?? \"\";\n const rows = await aggregate(sample, {\n by: { experiment, prefix: groupPrefix },\n values: pricing === null\n ? { passRate, durationMs, tokens }\n : { passRate, durationMs, costUSD: costUSD(pricing), tokens },\n });\n const byKey = new Map<string, ExperimentMetrics>();\n for (const row of rows) {\n const prefix = row.prefix;\n if (typeof prefix !== \"string\" || prefix.length === 0)\n continue;\n byKey.set(metricsKey(row.experiment as string, prefix), Object.freeze({\n passRate: row.passRate,\n durationMs: row.durationMs,\n ...(pricing === null ? {} : { costUSD: (row as unknown as {\n readonly costUSD: CostMetricValue;\n }).costUSD }),\n tokens: row.tokens,\n }));\n }\n return byKey;\n}\nfunction attemptHref(locator: AttemptLocator): string {\n return libraryDetailRoute(attemptDetailTarget(locator));\n}\nfunction experimentHref(experimentId: ExperimentId): string {\n return libraryDetailRoute(experimentDetailTarget(experimentId));\n}\n/** SampleSnapshot → 每个 experiment 的身份水位(最新 startedAt 的 Run)。 */\nfunction watermarksByExperiment(sample: Sample): ReadonlyMap<ExperimentId, {\n readonly startedAt: UtcMillis;\n readonly agent: string | null;\n readonly model: string | null;\n readonly flags: Readonly<Record<string, JsonValue>> | null;\n}> {\n const runsByExperiment = new Map<ExperimentId, typeof sample.snapshot.runs[number][]>();\n for (const run of sample.snapshot.runs) {\n const list = runsByExperiment.get(run.experimentId);\n if (list)\n list.push(run);\n else\n runsByExperiment.set(run.experimentId, [run]);\n }\n const byExperiment = new Map<ExperimentId, {\n readonly startedAt: UtcMillis;\n readonly agent: string | null;\n readonly model: string | null;\n readonly flags: Readonly<Record<string, JsonValue>> | null;\n }>();\n for (const [experimentId, runs] of runsByExperiment) {\n const newest = runs.reduce((best, run) => run.startedAt > best.startedAt ? run : best, runs[0]!);\n const context = newest.context;\n byExperiment.set(experimentId, Object.freeze({\n startedAt: newest.startedAt,\n agent: context?.execution.agentId ?? null,\n model: context?.execution.model ?? null,\n flags: context ? Object.freeze({ ...context.execution.flags }) : null,\n }));\n }\n return byExperiment;\n}\nfunction runStartedAtByRunId(sample: Sample): ReadonlyMap<string, UtcMillis> {\n const byRunId = new Map<string, UtcMillis>();\n for (const run of sample.snapshot.runs)\n byRunId.set(run.runId, run.startedAt);\n return byRunId;\n}\n/**\n * 按 locator 去重的 included slot 选择:同一 locator 出现多份(跨 Run 携带)时\n * 取 startedAt 最新的一份作展示行。Member 的 action / relation 是 Run provenance,\n * 不在质量列表里折成额外的时效状态。\n */\nfunction selectedSlots(sample: Sample): readonly SlotSelection[] {\n const runStartedAt = runStartedAtByRunId(sample);\n const byLocator = new Map<AttemptLocator, SlotSelection>();\n for (const slot of sample.snapshot.slots) {\n if (slot.state !== \"included\")\n continue;\n const locator = slot.attempt.locator;\n const startedAt = runStartedAt.get(slot.runId) ?? null;\n const existing = byLocator.get(locator);\n if (existing === undefined ||\n (startedAt !== null && (existing.startedAt === null || startedAt > existing.startedAt))) {\n byLocator.set(locator, Object.freeze({\n locator,\n experimentId: slot.experimentId,\n evalId: slot.evalId,\n attemptOrdinal: slot.attemptOrdinal,\n startedAt,\n }));\n }\n }\n return Object.freeze([...byLocator.values()]);\n}\n/**\n * `attemptListData(sample)`:每个 included attempt 一项,顺序取自 Sample 展平顺序\n * (按 locator 去重后保持首次出现序,不重排)。\n */\nexport async function attemptListData(sample: Sample, pricing: PricingProfile | null = null): Promise<readonly AttemptListItem[]> {\n const [facts, metrics] = await Promise.all([\n evidenceFacts(sample),\n attemptMetricRows(sample, pricing),\n ]);\n const selections = selectedSlots(sample);\n return Object.freeze(selections.map((selection): AttemptListItem => {\n const fact: AttemptFact = facts.get(selection.locator) ?? Object.freeze({\n verdict: null,\n failureSummary: null,\n evaluationKind: \"pass\" as const,\n });\n const metric = requireMetrics(metrics.get(metricsKey(selection.experimentId, selection.evalId, selection.locator)), `attempt ${JSON.stringify(selection.locator)}`);\n const item: AttemptListItem = Object.freeze({\n locator: selection.locator,\n experimentId: selection.experimentId,\n evalId: selection.evalId,\n attemptOrdinal: selection.attemptOrdinal,\n verdict: fact.verdict,\n failureSummary: fact.failureSummary,\n evaluationKind: fact.evaluationKind,\n ...(fact.totalScore === undefined ? {} : { totalScore: fact.totalScore }),\n passRate: metric.passRate,\n durationMs: metric.durationMs,\n ...(metric.costUSD === undefined ? {} : { costUSD: metric.costUSD }),\n tokens: metric.tokens,\n startedAt: selection.startedAt,\n href: attemptHref(selection.locator),\n });\n return item;\n }));\n}\n/**\n * `experimentListData(sample)`:每个 experiment 一项,展开到每道 Eval;初始排序按\n * 这份列表自身的题型构成选择主读数——当前 facade 只有通过制读数,恒为\n * endToEndPassRate 降序(缺数据沉底,同值按 experimentId 字典序收口)。\n */\nexport async function experimentListData(sample: Sample, pricing: PricingProfile | null = null): Promise<readonly ExperimentListItem[]> {\n const snapshot = sample.snapshot;\n const attempts = await attemptListData(sample, pricing);\n const [experimentMetrics, evalMetrics] = await Promise.all([\n experimentMetricRows(sample, pricing),\n evalMetricRows(sample, pricing),\n ]);\n const attemptsByEval = new Map<string, AttemptListItem[]>();\n for (const item of attempts) {\n const key = metricsKey(item.experimentId, item.evalId);\n const list = attemptsByEval.get(key);\n if (list)\n list.push(item);\n else\n attemptsByEval.set(key, [item]);\n }\n const activeSlots = snapshot.slots.filter((slot) => slot.state !== \"excluded\");\n const experiments = new Map<ExperimentId, {\n evalIds: Set<EvalId>;\n included: Set<EvalId>;\n }>();\n for (const slot of activeSlots) {\n const entry = experiments.get(slot.experimentId);\n if (entry === undefined) {\n experiments.set(slot.experimentId, {\n evalIds: new Set([slot.evalId]),\n included: slot.state === \"included\" ? new Set([slot.evalId]) : new Set(),\n });\n continue;\n }\n entry.evalIds.add(slot.evalId);\n if (slot.state === \"included\")\n entry.included.add(slot.evalId);\n }\n // 组前缀布局(纯字符串)与 facade GroupFunction 坐标先于指标聚合固定。\n const prefixByExperiment = new Map<ExperimentId, ReadonlyMap<EvalId, string>>();\n for (const [experimentId, entry] of experiments) {\n const layout = experimentEvalLayout([...entry.evalIds]);\n const prefixFor = new Map<EvalId, string>();\n const walk = (nodes: readonly EvalLayoutNode[]): void => {\n for (const node of nodes) {\n if (node.kind === \"leaf\")\n continue;\n for (const evalIdValue of evalIdsUnder(node))\n prefixFor.set(evalIdValue, node.prefix);\n walk(node.children);\n }\n };\n walk(layout);\n prefixByExperiment.set(experimentId, prefixFor);\n }\n const hasGroups = [...prefixByExperiment.values()].some((prefixFor) => prefixFor.size > 0);\n const groupMetrics = hasGroups\n ? await groupMetricRows(sample, prefixByExperiment, pricing)\n : new Map<string, ExperimentMetrics>();\n const watermarks = watermarksByExperiment(sample);\n const items: ExperimentListItem[] = [];\n for (const [experimentId, entry] of experiments) {\n const evalIds = [...entry.evalIds];\n const missing = [...evalIds].filter((evalIdValue) => !entry.included.has(evalIdValue));\n const evalRows: ExperimentListEvalRow[] = [];\n for (const evalIdValue of evalIds) {\n if (!entry.included.has(evalIdValue))\n continue;\n const list = attemptsByEval.get(metricsKey(experimentId, evalIdValue)) ?? [];\n const sorted = [...list].sort((left, right) => left.attemptOrdinal - right.attemptOrdinal || left.locator.localeCompare(right.locator));\n const metrics = requireMetrics(evalMetrics.get(metricsKey(experimentId, evalIdValue)), `experiment/eval ${JSON.stringify(experimentId)}/${JSON.stringify(evalIdValue)}`);\n const evaluationKind = sorted.some((attempt) => attempt.evaluationKind === \"points\") ? \"points\" : \"pass\";\n const completeScores = sorted.flatMap((attempt) => attempt.totalScore === undefined ? [] : [attempt.totalScore]);\n evalRows.push(Object.freeze({\n evalId: evalIdValue,\n evaluationKind,\n ...(completeScores.length === 0\n ? {}\n : { totalScore: completeScores.reduce((sum, score) => sum + score, 0) / completeScores.length }),\n endToEndPassRate: metrics.passRate,\n durationMs: metrics.durationMs,\n ...(metrics.costUSD === undefined ? {} : { costUSD: metrics.costUSD }),\n tokens: metrics.tokens,\n attempts: Object.freeze(sorted),\n }));\n }\n const watermark = watermarks.get(experimentId);\n const experimentMetric = requireMetrics(experimentMetrics.get(experimentId), `experiment ${JSON.stringify(experimentId)}`);\n const groupMetricsForItem = new Map<string, ExperimentMetrics>();\n const prefixes = [...new Set(prefixByExperiment.get(experimentId)?.values() ?? [])];\n for (const prefix of prefixes) {\n const metric = groupMetrics.get(metricsKey(experimentId, prefix));\n if (metric !== undefined)\n groupMetricsForItem.set(prefix, metric);\n }\n const evaluationKind = evalRows.some((row) => row.evaluationKind === \"points\")\n ? evalRows.some((row) => row.evaluationKind === \"pass\") ? \"mixed\" : \"points\"\n : \"pass\";\n const completeEvalScores = evalRows.flatMap((row) => row.totalScore === undefined ? [] : [row.totalScore]);\n items.push(Object.freeze({\n experimentId,\n agent: watermark?.agent ?? null,\n model: watermark?.model ?? null,\n flags: watermark?.flags ?? null,\n evaluationKind,\n ...(completeEvalScores.length === 0\n ? {}\n : { totalScore: completeEvalScores.reduce((sum, score) => sum + score, 0) }),\n endToEndPassRate: experimentMetric.passRate,\n durationMs: experimentMetric.durationMs,\n ...(experimentMetric.costUSD === undefined ? {} : { costUSD: experimentMetric.costUSD }),\n tokens: experimentMetric.tokens,\n missingEvalIds: Object.freeze(missing.sort((left, right) => left.localeCompare(right))),\n groupMetrics: groupMetricsForItem,\n evalRows: Object.freeze(evalRows),\n href: experimentHref(experimentId),\n }));\n }\n const composition = items.some((item) => item.evaluationKind !== \"pass\")\n ? items.some((item) => item.evaluationKind !== \"points\") ? \"mixed\" : \"points\"\n : \"pass\";\n items.sort(byMetricDescThenId((item) => composition !== \"pass\"\n ? item.totalScore ?? null\n : item.endToEndPassRate.value));\n return Object.freeze(items);\n}\nfunction evalIdsUnder(node: EvalLayoutNode): readonly EvalId[] {\n if (node.kind === \"leaf\")\n return [node.evalId];\n return node.children.flatMap(evalIdsUnder);\n}\nfunction byMetricDescThenId(valueOf: (item: ExperimentListItem) => number | null): (left: ExperimentListItem, right: ExperimentListItem) => number {\n return (left, right) => {\n const leftValue = valueOf(left);\n const rightValue = valueOf(right);\n if (leftValue === null && rightValue === null) {\n return left.experimentId.localeCompare(right.experimentId);\n }\n if (leftValue === null)\n return 1;\n if (rightValue === null)\n return -1;\n return rightValue - leftValue || left.experimentId.localeCompare(right.experimentId);\n };\n}\n"]}
|
|
@@ -3,11 +3,6 @@ import type { AttemptLocator } from "../../../attempt-locator.cjs";
|
|
|
3
3
|
import type { EvalId, ExperimentId } from "../../../analysis/index.cjs";
|
|
4
4
|
import type { Verdict } from "../../../shared/types.cjs";
|
|
5
5
|
type UtcMillis = Sample["snapshot"]["runs"][number]["startedAt"];
|
|
6
|
-
/**
|
|
7
|
-
* 当前 Analysis 只发布通过制读数(没有总分 Measure),题型构成恒为
|
|
8
|
-
* "pass"。未来 Analysis 发布计分制 Measure 时,这里与 content.ts 的列集一起按
|
|
9
|
-
* 同一构成判据扩展。
|
|
10
|
-
*/
|
|
11
6
|
export type EvaluationKindComposition = "pass" | "points" | "mixed";
|
|
12
7
|
/** 一个层级共用的四枚 Analysis-owned 读数。 */
|
|
13
8
|
export interface ExperimentMetrics {
|
|
@@ -30,6 +25,9 @@ export interface AttemptListItem {
|
|
|
30
25
|
* display 标签;closed 数据没有可读摘录时为 null(渲染成 "—",不发明文案)。
|
|
31
26
|
*/
|
|
32
27
|
readonly failureSummary: string | null;
|
|
28
|
+
readonly evaluationKind: "pass" | "points";
|
|
29
|
+
/** Complete earned score for this Attempt; absent for pass or incomplete score evidence. */
|
|
30
|
+
readonly totalScore?: number;
|
|
33
31
|
readonly passRate: MetricValue<number>;
|
|
34
32
|
readonly durationMs: MetricValue<number>;
|
|
35
33
|
/** Present only when the owning Report declares a PricingProfile. */
|
|
@@ -43,6 +41,9 @@ export interface AttemptListItem {
|
|
|
43
41
|
/** experiment 层级表里一道 Eval 的闭合行;attempts 是它的可见子行。 */
|
|
44
42
|
export interface ExperimentListEvalRow {
|
|
45
43
|
readonly evalId: EvalId;
|
|
44
|
+
readonly evaluationKind: "pass" | "points";
|
|
45
|
+
/** Mean of complete Attempt scores for this Eval. */
|
|
46
|
+
readonly totalScore?: number;
|
|
46
47
|
readonly endToEndPassRate: MetricValue<number>;
|
|
47
48
|
readonly durationMs: MetricValue<number>;
|
|
48
49
|
readonly costUSD?: CostMetricValue;
|
|
@@ -56,8 +57,9 @@ export interface ExperimentListItem {
|
|
|
56
57
|
readonly agent: string | null;
|
|
57
58
|
readonly model: string | null;
|
|
58
59
|
readonly flags: Readonly<Record<string, JsonValue>> | null;
|
|
59
|
-
/** 占位默认值,见 EvaluationKindComposition 注释。 */
|
|
60
60
|
readonly evaluationKind: EvaluationKindComposition;
|
|
61
|
+
/** Sum of the visible per-Eval score cells; absent when no complete Score Eval exists. */
|
|
62
|
+
readonly totalScore?: number;
|
|
61
63
|
readonly endToEndPassRate: MetricValue<number>;
|
|
62
64
|
readonly durationMs: MetricValue<number>;
|
|
63
65
|
readonly costUSD?: CostMetricValue;
|
|
@@ -3,11 +3,6 @@ import type { AttemptLocator } from "../../../attempt-locator.mjs";
|
|
|
3
3
|
import type { EvalId, ExperimentId } from "../../../analysis/index.mjs";
|
|
4
4
|
import type { Verdict } from "../../../shared/types.mjs";
|
|
5
5
|
type UtcMillis = Sample["snapshot"]["runs"][number]["startedAt"];
|
|
6
|
-
/**
|
|
7
|
-
* 当前 Analysis 只发布通过制读数(没有总分 Measure),题型构成恒为
|
|
8
|
-
* "pass"。未来 Analysis 发布计分制 Measure 时,这里与 content.ts 的列集一起按
|
|
9
|
-
* 同一构成判据扩展。
|
|
10
|
-
*/
|
|
11
6
|
export type EvaluationKindComposition = "pass" | "points" | "mixed";
|
|
12
7
|
/** 一个层级共用的四枚 Analysis-owned 读数。 */
|
|
13
8
|
export interface ExperimentMetrics {
|
|
@@ -30,6 +25,9 @@ export interface AttemptListItem {
|
|
|
30
25
|
* display 标签;closed 数据没有可读摘录时为 null(渲染成 "—",不发明文案)。
|
|
31
26
|
*/
|
|
32
27
|
readonly failureSummary: string | null;
|
|
28
|
+
readonly evaluationKind: "pass" | "points";
|
|
29
|
+
/** Complete earned score for this Attempt; absent for pass or incomplete score evidence. */
|
|
30
|
+
readonly totalScore?: number;
|
|
33
31
|
readonly passRate: MetricValue<number>;
|
|
34
32
|
readonly durationMs: MetricValue<number>;
|
|
35
33
|
/** Present only when the owning Report declares a PricingProfile. */
|
|
@@ -43,6 +41,9 @@ export interface AttemptListItem {
|
|
|
43
41
|
/** experiment 层级表里一道 Eval 的闭合行;attempts 是它的可见子行。 */
|
|
44
42
|
export interface ExperimentListEvalRow {
|
|
45
43
|
readonly evalId: EvalId;
|
|
44
|
+
readonly evaluationKind: "pass" | "points";
|
|
45
|
+
/** Mean of complete Attempt scores for this Eval. */
|
|
46
|
+
readonly totalScore?: number;
|
|
46
47
|
readonly endToEndPassRate: MetricValue<number>;
|
|
47
48
|
readonly durationMs: MetricValue<number>;
|
|
48
49
|
readonly costUSD?: CostMetricValue;
|
|
@@ -56,8 +57,9 @@ export interface ExperimentListItem {
|
|
|
56
57
|
readonly agent: string | null;
|
|
57
58
|
readonly model: string | null;
|
|
58
59
|
readonly flags: Readonly<Record<string, JsonValue>> | null;
|
|
59
|
-
/** 占位默认值,见 EvaluationKindComposition 注释。 */
|
|
60
60
|
readonly evaluationKind: EvaluationKindComposition;
|
|
61
|
+
/** Sum of the visible per-Eval score cells; absent when no complete Score Eval exists. */
|
|
62
|
+
readonly totalScore?: number;
|
|
61
63
|
readonly endToEndPassRate: MetricValue<number>;
|
|
62
64
|
readonly durationMs: MetricValue<number>;
|
|
63
65
|
readonly costUSD?: CostMetricValue;
|
|
@@ -3,11 +3,6 @@ import type { AttemptLocator } from "../../../attempt-locator.js";
|
|
|
3
3
|
import type { EvalId, ExperimentId } from "../../../analysis/index.js";
|
|
4
4
|
import type { Verdict } from "../../../shared/types.js";
|
|
5
5
|
type UtcMillis = Sample["snapshot"]["runs"][number]["startedAt"];
|
|
6
|
-
/**
|
|
7
|
-
* 当前 Analysis 只发布通过制读数(没有总分 Measure),题型构成恒为
|
|
8
|
-
* "pass"。未来 Analysis 发布计分制 Measure 时,这里与 content.ts 的列集一起按
|
|
9
|
-
* 同一构成判据扩展。
|
|
10
|
-
*/
|
|
11
6
|
export type EvaluationKindComposition = "pass" | "points" | "mixed";
|
|
12
7
|
/** 一个层级共用的四枚 Analysis-owned 读数。 */
|
|
13
8
|
export interface ExperimentMetrics {
|
|
@@ -30,6 +25,9 @@ export interface AttemptListItem {
|
|
|
30
25
|
* display 标签;closed 数据没有可读摘录时为 null(渲染成 "—",不发明文案)。
|
|
31
26
|
*/
|
|
32
27
|
readonly failureSummary: string | null;
|
|
28
|
+
readonly evaluationKind: "pass" | "points";
|
|
29
|
+
/** Complete earned score for this Attempt; absent for pass or incomplete score evidence. */
|
|
30
|
+
readonly totalScore?: number;
|
|
33
31
|
readonly passRate: MetricValue<number>;
|
|
34
32
|
readonly durationMs: MetricValue<number>;
|
|
35
33
|
/** Present only when the owning Report declares a PricingProfile. */
|
|
@@ -43,6 +41,9 @@ export interface AttemptListItem {
|
|
|
43
41
|
/** experiment 层级表里一道 Eval 的闭合行;attempts 是它的可见子行。 */
|
|
44
42
|
export interface ExperimentListEvalRow {
|
|
45
43
|
readonly evalId: EvalId;
|
|
44
|
+
readonly evaluationKind: "pass" | "points";
|
|
45
|
+
/** Mean of complete Attempt scores for this Eval. */
|
|
46
|
+
readonly totalScore?: number;
|
|
46
47
|
readonly endToEndPassRate: MetricValue<number>;
|
|
47
48
|
readonly durationMs: MetricValue<number>;
|
|
48
49
|
readonly costUSD?: CostMetricValue;
|
|
@@ -56,8 +57,9 @@ export interface ExperimentListItem {
|
|
|
56
57
|
readonly agent: string | null;
|
|
57
58
|
readonly model: string | null;
|
|
58
59
|
readonly flags: Readonly<Record<string, JsonValue>> | null;
|
|
59
|
-
/** 占位默认值,见 EvaluationKindComposition 注释。 */
|
|
60
60
|
readonly evaluationKind: EvaluationKindComposition;
|
|
61
|
+
/** Sum of the visible per-Eval score cells; absent when no complete Score Eval exists. */
|
|
62
|
+
readonly totalScore?: number;
|
|
61
63
|
readonly endToEndPassRate: MetricValue<number>;
|
|
62
64
|
readonly durationMs: MetricValue<number>;
|
|
63
65
|
readonly costUSD?: CostMetricValue;
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.experimentListContent = experimentListContent;
|
|
4
4
|
exports.attemptListContent = attemptListContent;
|
|
5
5
|
const locale_ts_1 = require("../../model/locale.cjs");
|
|
6
|
+
const format_ts_1 = require("../../model/format.cjs");
|
|
6
7
|
const compute_ts_1 = require("./compute.cjs");
|
|
7
8
|
/** 覆盖缺口占位行共用的原因码;missingText(code) 经 locale 键给出文案。 */
|
|
8
9
|
const NO_CURRENT_RESULT = "noCurrentResult";
|
|
@@ -15,6 +16,7 @@ const HEADER = {
|
|
|
15
16
|
agent: (0, locale_ts_1.localizedMessage)("table.agent"),
|
|
16
17
|
durationMs: (0, locale_ts_1.localizedMessage)("experimentList.avgDuration"),
|
|
17
18
|
passRate: (0, locale_ts_1.localizedMessage)("experimentList.passRate"),
|
|
19
|
+
totalScore: (0, locale_ts_1.localizedMessage)("experimentList.totalScore"),
|
|
18
20
|
tokens: (0, locale_ts_1.localizedMessage)("experimentList.tokens"),
|
|
19
21
|
costUSD: (0, locale_ts_1.localizedMessage)("experimentList.cost"),
|
|
20
22
|
record: (0, locale_ts_1.localizedMessage)("experimentList.result"),
|
|
@@ -78,19 +80,29 @@ function attemptCells(attempt) {
|
|
|
78
80
|
// 层级表的判定构成列:该次判定,与 verdict 格同值。
|
|
79
81
|
record: verdictCell(attempt.verdict),
|
|
80
82
|
durationMs: measureCell(attempt.durationMs),
|
|
83
|
+
...(attempt.totalScore === undefined ? {} : { totalScore: { kind: "score", earned: attempt.totalScore } }),
|
|
81
84
|
...(attempt.costUSD === undefined ? {} : { costUSD: measureCell(attempt.costUSD) }),
|
|
82
85
|
};
|
|
83
86
|
}
|
|
84
|
-
|
|
85
|
-
const HIERARCHY_COLUMNS = [
|
|
87
|
+
const HIERARCHY_COLUMNS_PREFIX = [
|
|
86
88
|
{ key: "entity", header: HEADER.entity },
|
|
87
89
|
{ key: "model", header: HEADER.model },
|
|
88
90
|
{ key: "agent", header: HEADER.agent },
|
|
89
91
|
{ key: "durationMs", better: "lower", header: HEADER.durationMs },
|
|
90
|
-
|
|
92
|
+
];
|
|
93
|
+
const HIERARCHY_COLUMNS_SUFFIX = [
|
|
91
94
|
{ key: "tokens", better: "lower", header: HEADER.tokens },
|
|
92
95
|
{ key: "record", header: HEADER.record },
|
|
93
96
|
];
|
|
97
|
+
function hierarchyColumns(items) {
|
|
98
|
+
const composition = (0, format_ts_1.experimentListEvaluationKindComposition)(items.map((item) => ({ evaluationKind: item.evaluationKind, attempts: item.evalRows.length })));
|
|
99
|
+
const primary = [];
|
|
100
|
+
if (composition !== "points")
|
|
101
|
+
primary.push({ key: "passRate", better: "higher", header: HEADER.passRate });
|
|
102
|
+
if (composition !== "pass")
|
|
103
|
+
primary.push({ key: "totalScore", better: "higher", header: HEADER.totalScore });
|
|
104
|
+
return [...HIERARCHY_COLUMNS_PREFIX, ...primary, ...HIERARCHY_COLUMNS_SUFFIX];
|
|
105
|
+
}
|
|
94
106
|
const COST_COLUMN = { key: "costUSD", better: "lower", header: HEADER.costUSD };
|
|
95
107
|
/** Attempt 平铺表的列集(AttemptList / FailureList 同一份)。 */
|
|
96
108
|
const FLAT_ENTITY_COLUMNS = [
|
|
@@ -151,6 +163,8 @@ function evalRow(row, label, view) {
|
|
|
151
163
|
// 判定构成列:该题 attempts 的计票,与 experiment 行计票同一形态。
|
|
152
164
|
record: verdictCountsCell(row.attempts),
|
|
153
165
|
durationMs: measureCell(row.durationMs),
|
|
166
|
+
...(row.evaluationKind === "pass" ? { passRate: measureCell(row.endToEndPassRate) } : {}),
|
|
167
|
+
...(row.totalScore === undefined ? {} : { totalScore: { kind: "score", earned: row.totalScore } }),
|
|
154
168
|
...(row.costUSD === undefined ? {} : { costUSD: measureCell(row.costUSD) }),
|
|
155
169
|
};
|
|
156
170
|
return {
|
|
@@ -201,7 +215,17 @@ function groupTableRow(node, item, view) {
|
|
|
201
215
|
const bag = {
|
|
202
216
|
entity: identityCell(node.segment, groupEntityDetail(evals, knownEvals)),
|
|
203
217
|
durationMs: groupMetricValue(metrics, "durationMs"),
|
|
204
|
-
|
|
218
|
+
...(evalRows.every((row) => row.evaluationKind === "pass")
|
|
219
|
+
? { passRate: groupMetricValue(metrics, "passRate") }
|
|
220
|
+
: {}),
|
|
221
|
+
...(evalRows.some((row) => row.totalScore !== undefined)
|
|
222
|
+
? {
|
|
223
|
+
totalScore: {
|
|
224
|
+
kind: "score",
|
|
225
|
+
earned: evalRows.reduce((sum, row) => sum + (row.totalScore ?? 0), 0),
|
|
226
|
+
},
|
|
227
|
+
}
|
|
228
|
+
: {}),
|
|
205
229
|
tokens: groupMetricValue(metrics, "tokens"),
|
|
206
230
|
...(metrics?.costUSD === undefined ? {} : { costUSD: measureCell(metrics.costUSD) }),
|
|
207
231
|
record: evals === 0
|
|
@@ -246,7 +270,8 @@ function experimentRow(item, view) {
|
|
|
246
270
|
model: item.model === null ? { kind: "notApplicable" } : textCell(item.model),
|
|
247
271
|
agent: item.agent === null ? { kind: "notApplicable" } : textCell(item.agent),
|
|
248
272
|
durationMs: measureCell(item.durationMs),
|
|
249
|
-
passRate: measureCell(item.endToEndPassRate),
|
|
273
|
+
...(item.evaluationKind === "pass" ? { passRate: measureCell(item.endToEndPassRate) } : {}),
|
|
274
|
+
...(item.totalScore === undefined ? {} : { totalScore: { kind: "score", earned: item.totalScore } }),
|
|
250
275
|
tokens: measureCell(item.tokens),
|
|
251
276
|
...(item.costUSD === undefined ? {} : { costUSD: measureCell(item.costUSD) }),
|
|
252
277
|
record: verdictCountsCell(attempts),
|
|
@@ -258,7 +283,7 @@ function experimentRow(item, view) {
|
|
|
258
283
|
};
|
|
259
284
|
}
|
|
260
285
|
function experimentListContent(items) {
|
|
261
|
-
const columns = columnsWithCost(
|
|
286
|
+
const columns = columnsWithCost(hierarchyColumns(items), items.some((item) => item.costUSD !== undefined));
|
|
262
287
|
return {
|
|
263
288
|
columns,
|
|
264
289
|
rows: items.map((item) => experimentRow(item, { columns, item, labelPrefix: "" })),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content.js","sourceRoot":"","sources":["content.ts"],"names":[],"mappings":";;AA6RA,sDAMC;AACD,gDAOC;AAvSD,qDAAyD;AAGzD,6CAAgM;AAChM,sDAAsD;AACtD,MAAM,iBAAiB,GAAG,iBAAiB,CAAC;AAC5C,uBAAuB;AACvB,MAAM,gBAAgB,GA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K,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC;IACrG,OAAO;QACH,OAAO;QACP,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,aAAa,CAAC,IAAI,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,CAAC;KACrF,CAAC;AACN,CAAC;AACD,SAAgB,kBAAkB,CAAC,KAAiC;IAChE,MAAM,OAAO,GAAG,eAAe,CAAC,mBAAmB,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC;IACvG,OAAO;QACH,OAAO;QACP,oCAAoC;QACpC,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;KACvD,CAAC;AACN,CAAC","sourcesContent":["// 实体列表 Table Content 投影(docs/feature/reports/library.md)。\n// Experiment 层级在这里从闭合 ExperimentListItem + 组读数投影成 TableContent.subRows;\n// 组件本体是中立 Table 原语,不知道 experiment / Eval / Attempt 语义。\nimport type { Cell, ColumnSpec, TableContent, TableContentRow, } from \"../../definition/cell.ts\";\nimport { localizedMessage } from \"../../model/locale.ts\";\nimport type { Verdict } from \"../../../shared/types.ts\";\nimport type { MetricValue } from \"../../../analysis/index.ts\";\nimport { experimentEvalLayout, relativeEvalLabel, type AttemptListItem, type ExperimentListEvalRow, type ExperimentListItem, type ExperimentMetrics, type EvalLayoutNode, } from \"./compute.ts\";\n/** 覆盖缺口占位行共用的原因码;missingText(code) 经 locale 键给出文案。 */\nconst NO_CURRENT_RESULT = \"noCurrentResult\";\n/** 组内零样本读数格的结构化原因码。 */\nconst GROUP_NO_SAMPLES = \"noSamples\";\n/** 三张实体表共用的列表头。文案单源在 locale 字典,这里只烤成随列走的 LocalizedText。 */\nconst HEADER = {\n entity: localizedMessage(\"experimentList.experiment\"),\n model: localizedMessage(\"table.model\"),\n agent: localizedMessage(\"table.agent\"),\n durationMs: localizedMessage(\"experimentList.avgDuration\"),\n passRate: localizedMessage(\"experimentList.passRate\"),\n tokens: localizedMessage(\"experimentList.tokens\"),\n costUSD: localizedMessage(\"experimentList.cost\"),\n record: localizedMessage(\"experimentList.result\"),\n verdict: localizedMessage(\"experimentList.status\"),\n result: localizedMessage(\"experimentList.result\"),\n};\n/**\n * 一行的「格子原料」:这一行自己算得出的全部格子,与任何列集无关。\n * 原料裁成行由 `projectCells` 做——列集外的原料丢掉,原料没覆盖的列显式填\n * notApplicable,不靠缺格回落成 \"—\"(memory/cell-key-must-match-column-set.md)。\n */\ntype CellBag = Readonly<globalThis.Record<string, Cell>>;\nfunction projectCells(bag: CellBag, columns: readonly ColumnSpec[]): globalThis.Record<string, Cell> {\n const cells: globalThis.Record<string, Cell> = {};\n for (const column of columns) {\n cells[column.key] = bag[column.key] ?? { kind: \"notApplicable\" };\n }\n return cells;\n}\nfunction measureCell(value: MetricValue): Cell {\n return { kind: \"metric\", metric: value };\n}\n/** 一组判定 → 计票。experiment / 组行数题、Eval 行数 attempt,同一形态同一构造。 */\nfunction tallyVerdicts(attempts: readonly AttemptListItem[]): {\n readonly passed: number;\n readonly failed: number;\n readonly errored: number;\n readonly skipped: number;\n} {\n const counts = { passed: 0, failed: 0, errored: 0, skipped: 0 };\n for (const attempt of attempts) {\n if (attempt.verdict === null)\n continue;\n counts[attempt.verdict] += 1;\n }\n return counts;\n}\nfunction verdictCountsCell(attempts: readonly AttemptListItem[]): Cell {\n return { kind: \"verdict\", counts: tallyVerdicts(attempts) };\n}\nfunction verdictCell(verdict: Verdict | null): Cell {\n if (verdict === null)\n return { kind: \"notApplicable\" };\n return { kind: \"verdict\", verdict };\n}\nfunction locatorCell(attempt: AttemptListItem): Cell {\n return {\n kind: \"locator\",\n locator: attempt.locator,\n ...(attempt.verdict === null ? {} : { verdict: attempt.verdict }),\n };\n}\nfunction textCell(text: string, detail?: string): Cell {\n return detail ? { kind: \"text\", text, detail } : { kind: \"text\", text };\n}\n/** 失败摘要格:closed 摘录缺失时如实显示 \"—\",不发明文案。 */\nfunction resultCell(attempt: AttemptListItem): Cell {\n return attempt.failureSummary === null\n ? { kind: \"text\", text: \"—\" }\n : { kind: \"summary\", text: attempt.failureSummary };\n}\n/**\n * attempt 行的格子原料。层级表取 entity / record / durationMs / costUSD,\n * 平铺表取 entity / verdict / result / durationMs / costUSD;\n * 两张表各自裁自这一份,不各写一份构造。\n */\nfunction attemptCells(attempt: AttemptListItem): CellBag {\n return {\n entity: locatorCell(attempt),\n verdict: verdictCell(attempt.verdict),\n result: resultCell(attempt),\n // 层级表的判定构成列:该次判定,与 verdict 格同值。\n record: verdictCell(attempt.verdict),\n durationMs: measureCell(attempt.durationMs),\n ...(attempt.costUSD === undefined ? {} : { costUSD: measureCell(attempt.costUSD) }),\n };\n}\n/** 层级表列集:主读数列随题型构成在场,其余固定。当前 facade 只有通过制读数。 */\nconst HIERARCHY_COLUMNS: readonly ColumnSpec[] = [\n { key: \"entity\", header: HEADER.entity },\n { key: \"model\", header: HEADER.model },\n { key: \"agent\", header: HEADER.agent },\n { key: \"durationMs\", better: \"lower\", header: HEADER.durationMs },\n { key: \"passRate\", better: \"higher\", header: HEADER.passRate },\n { key: \"tokens\", better: \"lower\", header: HEADER.tokens },\n { key: \"record\", header: HEADER.record },\n];\nconst COST_COLUMN: ColumnSpec = { key: \"costUSD\", better: \"lower\", header: HEADER.costUSD };\n/** Attempt 平铺表的列集(AttemptList / FailureList 同一份)。 */\nconst FLAT_ENTITY_COLUMNS: readonly ColumnSpec[] = [\n { key: \"entity\", header: HEADER.entity },\n { key: \"verdict\", header: HEADER.verdict },\n { key: \"result\", header: HEADER.result },\n { key: \"durationMs\", better: \"lower\", header: HEADER.durationMs },\n];\nfunction columnsWithCost(columns: readonly ColumnSpec[], includeCost: boolean): readonly ColumnSpec[] {\n if (!includeCost)\n return columns;\n const recordIndex = columns.findIndex((column) => column.key === \"record\");\n if (recordIndex < 0)\n return [...columns, COST_COLUMN];\n return [...columns.slice(0, recordIndex), COST_COLUMN, ...columns.slice(recordIndex)];\n}\n/** 层级实体的计数属于身份说明,必须留在同一个首格而不是渲染成续行。 */\nfunction identityCell(name: string, metadata: string): Cell {\n return textCell(`${name} (${metadata})`);\n}\n/** 组内题数与已知题数:\"3/4 evals\" 只在有缺口时出现。 */\nfunction groupEntityDetail(evals: number, knownEvals: number): string {\n return knownEvals > evals ? `${evals}/${knownEvals} evals` : `${evals} evals`;\n}\n/**\n * 组行读数格:直接用 Analysis-owned 组 MetricValue;组前缀聚合缺失时才是\n * missing(本该有却没跑到),不是 \"—\"(对这一行没有意义)。\n */\nfunction groupMetricValue(metrics: ExperimentMetrics | undefined, key: keyof ExperimentMetrics): Cell {\n const metric = metrics?.[key];\n return metric === undefined ? { kind: \"missing\", code: GROUP_NO_SAMPLES } : measureCell(metric);\n}\n/** 覆盖缺口占位行:code 与补跑命令同行——都是「当前配置下没有结果」这一个事实。 */\nfunction placeholderRow(experimentId: string, evalId: string, label: string, columns: readonly ColumnSpec[]): TableContentRow {\n const bag: CellBag = {\n entity: textCell(label),\n record: {\n kind: \"missing\",\n code: NO_CURRENT_RESULT,\n detail: `niceeval exp ${experimentId}`,\n },\n };\n return {\n key: `${experimentId}:${evalId}:missing`,\n variant: \"placeholder\",\n cells: projectCells(bag, columns),\n };\n}\ninterface HierarchyView {\n readonly columns: readonly ColumnSpec[];\n readonly item: ExperimentListItem;\n readonly labelPrefix: string;\n}\nfunction attemptRow(attempt: AttemptListItem, columns: readonly ColumnSpec[]): TableContentRow {\n return {\n key: attempt.locator,\n cells: projectCells(attemptCells(attempt), columns),\n };\n}\nfunction evalRow(row: ExperimentListEvalRow, label: string, view: HierarchyView): TableContentRow {\n const bag: CellBag = {\n entity: textCell(label),\n // 判定构成列:该题 attempts 的计票,与 experiment 行计票同一形态。\n record: verdictCountsCell(row.attempts),\n durationMs: measureCell(row.durationMs),\n ...(row.costUSD === undefined ? {} : { costUSD: measureCell(row.costUSD) }),\n };\n return {\n key: row.evalId,\n cells: projectCells(bag, view.columns),\n subRows: row.attempts.map((attempt) => attemptRow(attempt, view.columns)),\n };\n}\nfunction leafTableRow(node: Extract<EvalLayoutNode, {\n readonly kind: \"leaf\";\n}>, view: HierarchyView): TableContentRow {\n const label = relativeEvalLabel(node.evalId, view.labelPrefix);\n const row = view.item.evalRows.find((candidate) => candidate.evalId === node.evalId);\n return row === undefined\n ? placeholderRow(view.item.experimentId, node.evalId, label, view.columns)\n : evalRow(row, label, view);\n}\n/** 组行的成员 attempt 列表(用于判定计票)。 */\nfunction attemptsUnder(node: EvalLayoutNode, evalRows: readonly ExperimentListEvalRow[]): readonly AttemptListItem[] {\n const members = new Set<string>();\n const collect = (list: readonly EvalLayoutNode[]): void => {\n for (const entry of list) {\n if (entry.kind === \"leaf\")\n members.add(entry.evalId);\n else\n collect(entry.children);\n }\n };\n collect([node]);\n return evalRows\n .filter((row) => members.has(row.evalId))\n .flatMap((row) => row.attempts);\n}\nfunction groupTableRow(node: Extract<EvalLayoutNode, {\n readonly kind: \"group\";\n}>, item: ExperimentListItem, view: HierarchyView): TableContentRow {\n const evalIds = new Set<string>();\n const collect = (list: readonly EvalLayoutNode[]): void => {\n for (const entry of list) {\n if (entry.kind === \"leaf\")\n evalIds.add(entry.evalId);\n else\n collect(entry.children);\n }\n };\n collect([node]);\n const evalRows = item.evalRows.filter((row) => evalIds.has(row.evalId));\n const knownEvals = evalIds.size;\n const evals = evalRows.length;\n const metrics = item.groupMetrics.get(node.prefix);\n const attempts = attemptsUnder(node, item.evalRows);\n const bag: CellBag = {\n entity: identityCell(node.segment, groupEntityDetail(evals, knownEvals)),\n durationMs: groupMetricValue(metrics, \"durationMs\"),\n passRate: groupMetricValue(metrics, \"passRate\"),\n tokens: groupMetricValue(metrics, \"tokens\"),\n ...(metrics?.costUSD === undefined ? {} : { costUSD: measureCell(metrics.costUSD) }),\n record: evals === 0\n ? { kind: \"missing\", code: GROUP_NO_SAMPLES }\n : verdictCountsCell(attempts),\n };\n return {\n key: `group:${node.prefix}`,\n variant: \"group\",\n cells: projectCells(bag, view.columns),\n subRows: groupChildren(node.children, { ...view, labelPrefix: node.prefix }),\n };\n}\n/** 同一层的组行按主读数降序(缺数据沉底,同值按段名收口),叶子恒在组行之后。 */\nfunction groupChildren(nodes: readonly EvalLayoutNode[], view: HierarchyView): TableContentRow[] {\n const groups = nodes\n .filter((node): node is Extract<EvalLayoutNode, {\n readonly kind: \"group\";\n }> => node.kind === \"group\")\n .slice()\n .sort((left, right) => {\n const leftPrimary = view.item.groupMetrics.get(left.prefix)?.passRate.value ?? null;\n const rightPrimary = view.item.groupMetrics.get(right.prefix)?.passRate.value ?? null;\n if (leftPrimary === null && rightPrimary === null)\n return left.segment.localeCompare(right.segment);\n if (leftPrimary === null)\n return 1;\n if (rightPrimary === null)\n return -1;\n return rightPrimary - leftPrimary || left.segment.localeCompare(right.segment);\n });\n const leaves = nodes.filter((node): node is Extract<EvalLayoutNode, {\n readonly kind: \"leaf\";\n }> => node.kind === \"leaf\");\n return [\n ...groups.map((node) => groupTableRow(node, view.item, view)),\n ...leaves.map((node) => leafTableRow(node, view)),\n ];\n}\nfunction experimentRow(item: ExperimentListItem, view: HierarchyView): TableContentRow {\n const evalIds = new Set(item.evalRows.map((row) => row.evalId));\n const members: readonly EvalLayoutNode[] = experimentEvalLayout([...new Set([...evalIds, ...item.missingEvalIds])]);\n const attempts = item.evalRows.flatMap((row) => row.attempts);\n const bag: CellBag = {\n entity: textCell(item.experimentId),\n model: item.model === null ? { kind: \"notApplicable\" } : textCell(item.model),\n agent: item.agent === null ? { kind: \"notApplicable\" } : textCell(item.agent),\n durationMs: measureCell(item.durationMs),\n passRate: measureCell(item.endToEndPassRate),\n tokens: measureCell(item.tokens),\n ...(item.costUSD === undefined ? {} : { costUSD: measureCell(item.costUSD) }),\n record: verdictCountsCell(attempts),\n };\n return {\n key: item.experimentId,\n cells: projectCells(bag, view.columns),\n subRows: members.length > 0 ? groupChildren(members, view) : [],\n };\n}\nexport function experimentListContent(items: readonly ExperimentListItem[]): TableContent {\n const columns = columnsWithCost(HIERARCHY_COLUMNS, items.some((item) => item.costUSD !== undefined));\n return {\n columns,\n rows: items.map((item) => experimentRow(item, { columns, item, labelPrefix: \"\" })),\n };\n}\nexport function attemptListContent(items: readonly AttemptListItem[]): TableContent {\n const columns = columnsWithCost(FLAT_ENTITY_COLUMNS, items.some((item) => item.costUSD !== undefined));\n return {\n columns,\n // 与层级表里的 attempt 行同一份格子原料,只是裁到平铺列集。\n rows: items.map((item) => attemptRow(item, columns)),\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"content.js","sourceRoot":"","sources":["content.ts"],"names":[],"mappings":";;AAsTA,sDAMC;AACD,gDAOC;AAhUD,qDAAyD;AAGzD,qDAAgF;AAChF,6CAAgM;AAChM,sDAAsD;AACtD,MAAM,iBAAiB,GAAG,iBAAiB,CAAC;AAC5C,uBAAuB;AACvB,MAAM,gBAAgB,GAAG,WAAW,CAAC;AACrC,2DAA2D;AAC3D,MAAM,MAAM,GAAG;IACX,MAAM,EAAE,IAAA,4BAAgB,EAAC,2BAA2B,CAAC;IACrD,KAAK,EAAE,IAAA,4BAAgB,EAAC,aAAa,CAAC;IACtC,KAAK,EAAE,IAAA,4BAAgB,EAAC,aAAa,CAAC;IACtC,UAAU,EAAE,IAAA,4BAAgB,EAAC,4BAA4B,CAAC;IAC1D,QAAQ,EAAE,IAAA,4BAAgB,EAAC,yBAAyB,CAAC;IACrD,UAAU,EAAE,IAAA,4BAAgB,EAAC,2BAA2B,CAAC;IACzD,MAAM,EAAE,IAAA,4BAAgB,EAAC,uBAAuB,CAAC;IACjD,OAAO,EAAE,IAAA,4BAAgB,EAAC,qBAAqB,CAAC;IAChD,MAAM,EAAE,IAAA,4BAA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C,YAAY;QACtB,KAAK,EAAE,YAAY,CAAC,GAAG,EAAE,IAAI,CAAC,OAAO,CAAC;QACtC,OAAO,EAAE,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE;KAClE,CAAC;AACN,CAAC;AACD,SAAgB,qBAAqB,CAAC,KAAoC;IACtE,MAAM,OAAO,GAAG,eAAe,CAAC,gBAAgB,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC;IAC3G,OAAO;QACH,OAAO;QACP,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,aAAa,CAAC,IAAI,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,CAAC;KACrF,CAAC;AACN,CAAC;AACD,SAAgB,kBAAkB,CAAC,KAAiC;IAChE,MAAM,OAAO,GAAG,eAAe,CAAC,mBAAmB,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC;IACvG,OAAO;QACH,OAAO;QACP,oCAAoC;QACpC,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;KACvD,CAAC;AACN,CAAC","sourcesContent":["// 实体列表 Table Content 投影(docs/feature/reports/library.md)。\n// Experiment 层级在这里从闭合 ExperimentListItem + 组读数投影成 TableContent.subRows;\n// 组件本体是中立 Table 原语,不知道 experiment / Eval / Attempt 语义。\nimport type { Cell, ColumnSpec, TableContent, TableContentRow, } from \"../../definition/cell.ts\";\nimport { localizedMessage } from \"../../model/locale.ts\";\nimport type { Verdict } from \"../../../shared/types.ts\";\nimport type { MetricValue } from \"../../../analysis/index.ts\";\nimport { experimentListEvaluationKindComposition } from \"../../model/format.ts\";\nimport { experimentEvalLayout, relativeEvalLabel, type AttemptListItem, type ExperimentListEvalRow, type ExperimentListItem, type ExperimentMetrics, type EvalLayoutNode, } from \"./compute.ts\";\n/** 覆盖缺口占位行共用的原因码;missingText(code) 经 locale 键给出文案。 */\nconst NO_CURRENT_RESULT = \"noCurrentResult\";\n/** 组内零样本读数格的结构化原因码。 */\nconst GROUP_NO_SAMPLES = \"noSamples\";\n/** 三张实体表共用的列表头。文案单源在 locale 字典,这里只烤成随列走的 LocalizedText。 */\nconst HEADER = {\n entity: localizedMessage(\"experimentList.experiment\"),\n model: localizedMessage(\"table.model\"),\n agent: localizedMessage(\"table.agent\"),\n durationMs: localizedMessage(\"experimentList.avgDuration\"),\n passRate: localizedMessage(\"experimentList.passRate\"),\n totalScore: localizedMessage(\"experimentList.totalScore\"),\n tokens: localizedMessage(\"experimentList.tokens\"),\n costUSD: localizedMessage(\"experimentList.cost\"),\n record: localizedMessage(\"experimentList.result\"),\n verdict: localizedMessage(\"experimentList.status\"),\n result: localizedMessage(\"experimentList.result\"),\n};\n/**\n * 一行的「格子原料」:这一行自己算得出的全部格子,与任何列集无关。\n * 原料裁成行由 `projectCells` 做——列集外的原料丢掉,原料没覆盖的列显式填\n * notApplicable,不靠缺格回落成 \"—\"(memory/cell-key-must-match-column-set.md)。\n */\ntype CellBag = Readonly<globalThis.Record<string, Cell>>;\nfunction projectCells(bag: CellBag, columns: readonly ColumnSpec[]): globalThis.Record<string, Cell> {\n const cells: globalThis.Record<string, Cell> = {};\n for (const column of columns) {\n cells[column.key] = bag[column.key] ?? { kind: \"notApplicable\" };\n }\n return cells;\n}\nfunction measureCell(value: MetricValue): Cell {\n return { kind: \"metric\", metric: value };\n}\n/** 一组判定 → 计票。experiment / 组行数题、Eval 行数 attempt,同一形态同一构造。 */\nfunction tallyVerdicts(attempts: readonly AttemptListItem[]): {\n readonly passed: number;\n readonly failed: number;\n readonly errored: number;\n readonly skipped: number;\n} {\n const counts = { passed: 0, failed: 0, errored: 0, skipped: 0 };\n for (const attempt of attempts) {\n if (attempt.verdict === null)\n continue;\n counts[attempt.verdict] += 1;\n }\n return counts;\n}\nfunction verdictCountsCell(attempts: readonly AttemptListItem[]): Cell {\n return { kind: \"verdict\", counts: tallyVerdicts(attempts) };\n}\nfunction verdictCell(verdict: Verdict | null): Cell {\n if (verdict === null)\n return { kind: \"notApplicable\" };\n return { kind: \"verdict\", verdict };\n}\nfunction locatorCell(attempt: AttemptListItem): Cell {\n return {\n kind: \"locator\",\n locator: attempt.locator,\n ...(attempt.verdict === null ? {} : { verdict: attempt.verdict }),\n };\n}\nfunction textCell(text: string, detail?: string): Cell {\n return detail ? { kind: \"text\", text, detail } : { kind: \"text\", text };\n}\n/** 失败摘要格:closed 摘录缺失时如实显示 \"—\",不发明文案。 */\nfunction resultCell(attempt: AttemptListItem): Cell {\n return attempt.failureSummary === null\n ? { kind: \"text\", text: \"—\" }\n : { kind: \"summary\", text: attempt.failureSummary };\n}\n/**\n * attempt 行的格子原料。层级表取 entity / record / durationMs / costUSD,\n * 平铺表取 entity / verdict / result / durationMs / costUSD;\n * 两张表各自裁自这一份,不各写一份构造。\n */\nfunction attemptCells(attempt: AttemptListItem): CellBag {\n return {\n entity: locatorCell(attempt),\n verdict: verdictCell(attempt.verdict),\n result: resultCell(attempt),\n // 层级表的判定构成列:该次判定,与 verdict 格同值。\n record: verdictCell(attempt.verdict),\n durationMs: measureCell(attempt.durationMs),\n ...(attempt.totalScore === undefined ? {} : { totalScore: { kind: \"score\", earned: attempt.totalScore } as const }),\n ...(attempt.costUSD === undefined ? {} : { costUSD: measureCell(attempt.costUSD) }),\n };\n}\nconst HIERARCHY_COLUMNS_PREFIX: readonly ColumnSpec[] = [\n { key: \"entity\", header: HEADER.entity },\n { key: \"model\", header: HEADER.model },\n { key: \"agent\", header: HEADER.agent },\n { key: \"durationMs\", better: \"lower\", header: HEADER.durationMs },\n];\nconst HIERARCHY_COLUMNS_SUFFIX: readonly ColumnSpec[] = [\n { key: \"tokens\", better: \"lower\", header: HEADER.tokens },\n { key: \"record\", header: HEADER.record },\n];\nfunction hierarchyColumns(items: readonly ExperimentListItem[]): readonly ColumnSpec[] {\n const composition = experimentListEvaluationKindComposition(items.map((item) => ({ evaluationKind: item.evaluationKind, attempts: item.evalRows.length })));\n const primary: ColumnSpec[] = [];\n if (composition !== \"points\")\n primary.push({ key: \"passRate\", better: \"higher\", header: HEADER.passRate });\n if (composition !== \"pass\")\n primary.push({ key: \"totalScore\", better: \"higher\", header: HEADER.totalScore });\n return [...HIERARCHY_COLUMNS_PREFIX, ...primary, ...HIERARCHY_COLUMNS_SUFFIX];\n}\nconst COST_COLUMN: ColumnSpec = { key: \"costUSD\", better: \"lower\", header: HEADER.costUSD };\n/** Attempt 平铺表的列集(AttemptList / FailureList 同一份)。 */\nconst FLAT_ENTITY_COLUMNS: readonly ColumnSpec[] = [\n { key: \"entity\", header: HEADER.entity },\n { key: \"verdict\", header: HEADER.verdict },\n { key: \"result\", header: HEADER.result },\n { key: \"durationMs\", better: \"lower\", header: HEADER.durationMs },\n];\nfunction columnsWithCost(columns: readonly ColumnSpec[], includeCost: boolean): readonly ColumnSpec[] {\n if (!includeCost)\n return columns;\n const recordIndex = columns.findIndex((column) => column.key === \"record\");\n if (recordIndex < 0)\n return [...columns, COST_COLUMN];\n return [...columns.slice(0, recordIndex), COST_COLUMN, ...columns.slice(recordIndex)];\n}\n/** 层级实体的计数属于身份说明,必须留在同一个首格而不是渲染成续行。 */\nfunction identityCell(name: string, metadata: string): Cell {\n return textCell(`${name} (${metadata})`);\n}\n/** 组内题数与已知题数:\"3/4 evals\" 只在有缺口时出现。 */\nfunction groupEntityDetail(evals: number, knownEvals: number): string {\n return knownEvals > evals ? `${evals}/${knownEvals} evals` : `${evals} evals`;\n}\n/**\n * 组行读数格:直接用 Analysis-owned 组 MetricValue;组前缀聚合缺失时才是\n * missing(本该有却没跑到),不是 \"—\"(对这一行没有意义)。\n */\nfunction groupMetricValue(metrics: ExperimentMetrics | undefined, key: keyof ExperimentMetrics): Cell {\n const metric = metrics?.[key];\n return metric === undefined ? { kind: \"missing\", code: GROUP_NO_SAMPLES } : measureCell(metric);\n}\n/** 覆盖缺口占位行:code 与补跑命令同行——都是「当前配置下没有结果」这一个事实。 */\nfunction placeholderRow(experimentId: string, evalId: string, label: string, columns: readonly ColumnSpec[]): TableContentRow {\n const bag: CellBag = {\n entity: textCell(label),\n record: {\n kind: \"missing\",\n code: NO_CURRENT_RESULT,\n detail: `niceeval exp ${experimentId}`,\n },\n };\n return {\n key: `${experimentId}:${evalId}:missing`,\n variant: \"placeholder\",\n cells: projectCells(bag, columns),\n };\n}\ninterface HierarchyView {\n readonly columns: readonly ColumnSpec[];\n readonly item: ExperimentListItem;\n readonly labelPrefix: string;\n}\nfunction attemptRow(attempt: AttemptListItem, columns: readonly ColumnSpec[]): TableContentRow {\n return {\n key: attempt.locator,\n cells: projectCells(attemptCells(attempt), columns),\n };\n}\nfunction evalRow(row: ExperimentListEvalRow, label: string, view: HierarchyView): TableContentRow {\n const bag: CellBag = {\n entity: textCell(label),\n // 判定构成列:该题 attempts 的计票,与 experiment 行计票同一形态。\n record: verdictCountsCell(row.attempts),\n durationMs: measureCell(row.durationMs),\n ...(row.evaluationKind === \"pass\" ? { passRate: measureCell(row.endToEndPassRate) } : {}),\n ...(row.totalScore === undefined ? {} : { totalScore: { kind: \"score\", earned: row.totalScore } as const }),\n ...(row.costUSD === undefined ? {} : { costUSD: measureCell(row.costUSD) }),\n };\n return {\n key: row.evalId,\n cells: projectCells(bag, view.columns),\n subRows: row.attempts.map((attempt) => attemptRow(attempt, view.columns)),\n };\n}\nfunction leafTableRow(node: Extract<EvalLayoutNode, {\n readonly kind: \"leaf\";\n}>, view: HierarchyView): TableContentRow {\n const label = relativeEvalLabel(node.evalId, view.labelPrefix);\n const row = view.item.evalRows.find((candidate) => candidate.evalId === node.evalId);\n return row === undefined\n ? placeholderRow(view.item.experimentId, node.evalId, label, view.columns)\n : evalRow(row, label, view);\n}\n/** 组行的成员 attempt 列表(用于判定计票)。 */\nfunction attemptsUnder(node: EvalLayoutNode, evalRows: readonly ExperimentListEvalRow[]): readonly AttemptListItem[] {\n const members = new Set<string>();\n const collect = (list: readonly EvalLayoutNode[]): void => {\n for (const entry of list) {\n if (entry.kind === \"leaf\")\n members.add(entry.evalId);\n else\n collect(entry.children);\n }\n };\n collect([node]);\n return evalRows\n .filter((row) => members.has(row.evalId))\n .flatMap((row) => row.attempts);\n}\nfunction groupTableRow(node: Extract<EvalLayoutNode, {\n readonly kind: \"group\";\n}>, item: ExperimentListItem, view: HierarchyView): TableContentRow {\n const evalIds = new Set<string>();\n const collect = (list: readonly EvalLayoutNode[]): void => {\n for (const entry of list) {\n if (entry.kind === \"leaf\")\n evalIds.add(entry.evalId);\n else\n collect(entry.children);\n }\n };\n collect([node]);\n const evalRows = item.evalRows.filter((row) => evalIds.has(row.evalId));\n const knownEvals = evalIds.size;\n const evals = evalRows.length;\n const metrics = item.groupMetrics.get(node.prefix);\n const attempts = attemptsUnder(node, item.evalRows);\n const bag: CellBag = {\n entity: identityCell(node.segment, groupEntityDetail(evals, knownEvals)),\n durationMs: groupMetricValue(metrics, \"durationMs\"),\n ...(evalRows.every((row) => row.evaluationKind === \"pass\")\n ? { passRate: groupMetricValue(metrics, \"passRate\") }\n : {}),\n ...(evalRows.some((row) => row.totalScore !== undefined)\n ? {\n totalScore: {\n kind: \"score\",\n earned: evalRows.reduce((sum, row) => sum + (row.totalScore ?? 0), 0),\n } as const,\n }\n : {}),\n tokens: groupMetricValue(metrics, \"tokens\"),\n ...(metrics?.costUSD === undefined ? {} : { costUSD: measureCell(metrics.costUSD) }),\n record: evals === 0\n ? { kind: \"missing\", code: GROUP_NO_SAMPLES }\n : verdictCountsCell(attempts),\n };\n return {\n key: `group:${node.prefix}`,\n variant: \"group\",\n cells: projectCells(bag, view.columns),\n subRows: groupChildren(node.children, { ...view, labelPrefix: node.prefix }),\n };\n}\n/** 同一层的组行按主读数降序(缺数据沉底,同值按段名收口),叶子恒在组行之后。 */\nfunction groupChildren(nodes: readonly EvalLayoutNode[], view: HierarchyView): TableContentRow[] {\n const groups = nodes\n .filter((node): node is Extract<EvalLayoutNode, {\n readonly kind: \"group\";\n }> => node.kind === \"group\")\n .slice()\n .sort((left, right) => {\n const leftPrimary = view.item.groupMetrics.get(left.prefix)?.passRate.value ?? null;\n const rightPrimary = view.item.groupMetrics.get(right.prefix)?.passRate.value ?? null;\n if (leftPrimary === null && rightPrimary === null)\n return left.segment.localeCompare(right.segment);\n if (leftPrimary === null)\n return 1;\n if (rightPrimary === null)\n return -1;\n return rightPrimary - leftPrimary || left.segment.localeCompare(right.segment);\n });\n const leaves = nodes.filter((node): node is Extract<EvalLayoutNode, {\n readonly kind: \"leaf\";\n }> => node.kind === \"leaf\");\n return [\n ...groups.map((node) => groupTableRow(node, view.item, view)),\n ...leaves.map((node) => leafTableRow(node, view)),\n ];\n}\nfunction experimentRow(item: ExperimentListItem, view: HierarchyView): TableContentRow {\n const evalIds = new Set(item.evalRows.map((row) => row.evalId));\n const members: readonly EvalLayoutNode[] = experimentEvalLayout([...new Set([...evalIds, ...item.missingEvalIds])]);\n const attempts = item.evalRows.flatMap((row) => row.attempts);\n const bag: CellBag = {\n entity: textCell(item.experimentId),\n model: item.model === null ? { kind: \"notApplicable\" } : textCell(item.model),\n agent: item.agent === null ? { kind: \"notApplicable\" } : textCell(item.agent),\n durationMs: measureCell(item.durationMs),\n ...(item.evaluationKind === \"pass\" ? { passRate: measureCell(item.endToEndPassRate) } : {}),\n ...(item.totalScore === undefined ? {} : { totalScore: { kind: \"score\", earned: item.totalScore } as const }),\n tokens: measureCell(item.tokens),\n ...(item.costUSD === undefined ? {} : { costUSD: measureCell(item.costUSD) }),\n record: verdictCountsCell(attempts),\n };\n return {\n key: item.experimentId,\n cells: projectCells(bag, view.columns),\n subRows: members.length > 0 ? groupChildren(members, view) : [],\n };\n}\nexport function experimentListContent(items: readonly ExperimentListItem[]): TableContent {\n const columns = columnsWithCost(hierarchyColumns(items), items.some((item) => item.costUSD !== undefined));\n return {\n columns,\n rows: items.map((item) => experimentRow(item, { columns, item, labelPrefix: \"\" })),\n };\n}\nexport function attemptListContent(items: readonly AttemptListItem[]): TableContent {\n const columns = columnsWithCost(FLAT_ENTITY_COLUMNS, items.some((item) => item.costUSD !== undefined));\n return {\n columns,\n // 与层级表里的 attempt 行同一份格子原料,只是裁到平铺列集。\n rows: items.map((item) => attemptRow(item, columns)),\n };\n}\n"]}
|
|
@@ -6,6 +6,7 @@ const tree_ts_1 = require("../../definition/tree.cjs");
|
|
|
6
6
|
const primitives_tsx_1 = require("../../definition/primitives.cjs");
|
|
7
7
|
const compute_ts_1 = require("./compute.cjs");
|
|
8
8
|
const content_ts_1 = require("./content.cjs");
|
|
9
|
+
const format_ts_1 = require("../../model/format.cjs");
|
|
9
10
|
var compute_ts_2 = require("./compute.cjs");
|
|
10
11
|
Object.defineProperty(exports, "attemptListData", { enumerable: true, get: function () { return compute_ts_2.attemptListData; } });
|
|
11
12
|
Object.defineProperty(exports, "experimentListData", { enumerable: true, get: function () { return compute_ts_2.experimentListData; } });
|
|
@@ -40,8 +41,8 @@ exports.AttemptList.displayName = "AttemptList";
|
|
|
40
41
|
exports.ExperimentTable = (0, tree_ts_1.defineComponent)(async (props, ctx) => {
|
|
41
42
|
const sample = props.input ?? ctx.scope;
|
|
42
43
|
const rows = props.rows ?? await (0, compute_ts_1.experimentListData)(sample, ctx.report.pricing);
|
|
43
|
-
|
|
44
|
-
const defaultSort = "passRate";
|
|
44
|
+
const composition = (0, format_ts_1.experimentListEvaluationKindComposition)(rows.map((row) => ({ evaluationKind: row.evaluationKind, attempts: row.evalRows.length })));
|
|
45
|
+
const defaultSort = composition === "pass" ? "passRate" : "totalScore";
|
|
45
46
|
return (0, jsx_runtime_1.jsx)(primitives_tsx_1.TableContentView, { data: (0, content_ts_1.experimentListContent)(rows), sort: props.sort ?? defaultSort, searchable: props.searchable ?? true, locale: props.locale, className: props.className });
|
|
46
47
|
});
|
|
47
48
|
exports.ExperimentTable.displayName = "ExperimentTable";
|