niceeval 0.9.1 → 0.10.2
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 +31 -33
- package/dist/agents/types.d.ts +20 -17
- package/dist/context/types.d.ts +21 -21
- package/dist/i18n/en.d.ts +10 -2
- package/dist/i18n/zh-CN.d.ts +14 -6
- package/dist/o11y/execution-tree.d.ts +103 -0
- package/dist/o11y/otlp/select.d.ts +22 -0
- package/dist/report/{react → assets}/colors.d.ts +8 -0
- package/dist/report/{react → assets}/colors.js +23 -0
- package/dist/report/built-in/index.d.ts +2 -2
- package/dist/report/built-in/index.js +2 -2
- package/dist/report/built-in/standard.d.ts +8 -1
- package/dist/report/built-in/standard.js +17 -7
- package/dist/report/components/attempt-detail/AttemptAssertions.d.ts +6 -0
- package/dist/report/components/attempt-detail/AttemptAssertions.js +17 -0
- package/dist/report/components/attempt-detail/AttemptConversation.d.ts +10 -0
- package/dist/report/components/attempt-detail/AttemptConversation.js +74 -0
- package/dist/report/components/attempt-detail/AttemptDiagnostics.d.ts +6 -0
- package/dist/report/components/attempt-detail/AttemptDiagnostics.js +7 -0
- package/dist/report/components/attempt-detail/AttemptDiff.d.ts +6 -0
- package/dist/report/components/attempt-detail/AttemptDiff.js +11 -0
- package/dist/report/components/attempt-detail/AttemptError.d.ts +6 -0
- package/dist/report/components/attempt-detail/AttemptError.js +16 -0
- package/dist/report/components/attempt-detail/AttemptFixPrompt.d.ts +6 -0
- package/dist/report/components/attempt-detail/AttemptFixPrompt.js +7 -0
- package/dist/report/components/attempt-detail/AttemptSource.d.ts +6 -0
- package/dist/report/components/attempt-detail/AttemptSource.js +97 -0
- package/dist/report/components/attempt-detail/AttemptSummary.d.ts +8 -0
- package/dist/report/components/attempt-detail/AttemptSummary.js +20 -0
- package/dist/report/components/attempt-detail/AttemptTimeline.d.ts +6 -0
- package/dist/report/components/attempt-detail/AttemptTimeline.js +28 -0
- package/dist/report/components/attempt-detail/AttemptTrace.d.ts +6 -0
- package/dist/report/components/attempt-detail/AttemptTrace.js +29 -0
- package/dist/report/components/attempt-detail/AttemptUsage.d.ts +6 -0
- package/dist/report/components/attempt-detail/AttemptUsage.js +20 -0
- package/dist/report/components/attempt-detail/compute.d.ts +24 -0
- package/dist/report/components/attempt-detail/compute.js +297 -0
- package/dist/report/components/attempt-detail/faces.d.ts +14 -0
- package/dist/report/components/attempt-detail/faces.js +239 -0
- package/dist/report/components/attempt-detail/index.d.ts +38 -0
- package/dist/report/components/attempt-detail/index.js +547 -0
- package/dist/report/{react → components}/cell.d.ts +5 -3
- package/dist/report/{react → components}/cell.js +3 -3
- package/dist/report/{react → components/entity-lists}/AttemptList.d.ts +8 -4
- package/dist/report/{react → components/entity-lists}/AttemptList.js +16 -10
- package/dist/report/{react → components/entity-lists}/EvalList.d.ts +3 -3
- package/dist/report/{react → components/entity-lists}/EvalList.js +0 -0
- package/dist/report/{react → components/entity-lists}/ExperimentList.d.ts +4 -5
- package/dist/report/{react → components/entity-lists}/ExperimentList.js +12 -11
- package/dist/report/components/entity-lists/compute.d.ts +23 -0
- package/dist/report/components/entity-lists/compute.js +171 -0
- package/dist/report/components/entity-lists/faces.d.ts +5 -0
- package/dist/report/components/entity-lists/faces.js +175 -0
- package/dist/report/components/entity-lists/index.d.ts +49 -0
- package/dist/report/components/entity-lists/index.js +169 -0
- package/dist/report/{react → components}/fixtures.d.ts +2 -2
- package/dist/report/{react → components}/fixtures.js +1 -1
- package/dist/report/{react → components/metric-views}/DeltaTable.d.ts +2 -2
- package/dist/report/{react → components/metric-views}/DeltaTable.js +4 -4
- package/dist/report/{react → components/metric-views}/MetricBars.d.ts +3 -3
- package/dist/report/{react → components/metric-views}/MetricBars.js +3 -3
- package/dist/report/{react → components/metric-views}/MetricLine.d.ts +2 -2
- package/dist/report/{react → components/metric-views}/MetricLine.js +8 -5
- package/dist/report/{react → components/metric-views}/MetricMatrix.d.ts +3 -3
- package/dist/report/{react → components/metric-views}/MetricMatrix.js +4 -4
- package/dist/report/components/metric-views/MetricScatter.d.ts +11 -0
- package/dist/report/{react → components/metric-views}/MetricScatter.js +27 -60
- package/dist/report/{react → components/metric-views}/MetricTable.d.ts +3 -3
- package/dist/report/{react → components/metric-views}/MetricTable.js +4 -4
- package/dist/report/{react → components/metric-views}/Scoreboard.d.ts +2 -2
- package/dist/report/{react → components/metric-views}/Scoreboard.js +3 -3
- package/dist/report/components/metric-views/compute.d.ts +89 -0
- package/dist/report/{compute.js → components/metric-views/compute.js} +32 -415
- package/dist/report/components/metric-views/faces.d.ts +13 -0
- package/dist/report/components/metric-views/faces.js +381 -0
- package/dist/report/components/metric-views/index.d.ts +50 -0
- package/dist/report/components/metric-views/index.js +273 -0
- package/dist/report/{text → components/metric-views}/plot.js +1 -1
- package/dist/report/components/shared-compute.d.ts +22 -0
- package/dist/report/components/shared-compute.js +47 -0
- package/dist/report/components/shared-faces.d.ts +9 -0
- package/dist/report/components/shared-faces.js +26 -0
- package/dist/report/components/shared.d.ts +68 -0
- package/dist/report/components/shared.js +125 -0
- package/dist/report/{react → components/site-components}/CopyFixPrompt.d.ts +2 -2
- package/dist/report/{react → components/site-components}/CopyFixPrompt.js +2 -2
- package/dist/report/{react → components/site-components}/HeroCard.d.ts +2 -2
- package/dist/report/{react → components/site-components}/HeroCard.js +2 -2
- package/dist/report/{react → components/site-components}/ScopeWarnings.d.ts +2 -2
- package/dist/report/{react → components/site-components}/ScopeWarnings.js +3 -3
- package/dist/report/{react → components/site-components}/TraceWaterfall.d.ts +3 -3
- package/dist/report/{react → components/site-components}/TraceWaterfall.js +5 -5
- package/dist/report/components/site-components/compute.d.ts +28 -0
- package/dist/report/components/site-components/compute.js +132 -0
- package/dist/report/components/site-components/faces.d.ts +21 -0
- package/dist/report/components/site-components/faces.js +75 -0
- package/dist/report/components/site-components/index.d.ts +74 -0
- package/dist/report/components/site-components/index.js +220 -0
- package/dist/report/{scope-warnings.d.ts → components/site-components/scope-warnings.d.ts} +2 -2
- package/dist/report/{scope-warnings.js → components/site-components/scope-warnings.js} +2 -2
- package/dist/report/{react → components/summaries}/ScopeSummary.d.ts +2 -2
- package/dist/report/{react → components/summaries}/ScopeSummary.js +17 -8
- package/dist/report/components/summaries/compute.d.ts +7 -0
- package/dist/report/components/summaries/compute.js +51 -0
- package/dist/report/components/summaries/faces.d.ts +7 -0
- package/dist/report/components/summaries/faces.js +38 -0
- package/dist/report/components/summaries/index.d.ts +27 -0
- package/dist/report/components/summaries/index.js +78 -0
- package/dist/report/definition/grid-layout.d.ts +50 -0
- package/dist/report/definition/grid-layout.js +89 -0
- package/dist/report/{primitives.d.ts → definition/primitives.d.ts} +34 -4
- package/dist/report/{primitives.js → definition/primitives.js} +101 -10
- package/dist/report/{report.d.ts → definition/report.d.ts} +36 -65
- package/dist/report/{report.js → definition/report.js} +58 -90
- package/dist/report/{text/table.d.ts → definition/table-text.d.ts} +2 -2
- package/dist/report/{text/table.js → definition/table-text.js} +2 -2
- package/dist/report/{tree.d.ts → definition/tree.d.ts} +43 -11
- package/dist/report/{tree.js → definition/tree.js} +9 -11
- package/dist/report/index.d.ts +33 -18
- package/dist/report/index.js +23 -14
- package/dist/report/{aggregate.d.ts → model/aggregate.d.ts} +12 -4
- package/dist/report/{aggregate.js → model/aggregate.js} +28 -8
- package/dist/report/{flag.d.ts → model/flag.d.ts} +14 -1
- package/dist/report/{flag.js → model/flag.js} +35 -0
- package/dist/report/{format.d.ts → model/format.d.ts} +13 -7
- package/dist/report/{format.js → model/format.js} +79 -9
- package/dist/report/{locale.d.ts → model/locale.d.ts} +17 -17
- package/dist/report/{locale.js → model/locale.js} +31 -33
- package/dist/report/{metrics.d.ts → model/metrics.d.ts} +2 -2
- package/dist/report/{metrics.js → model/metrics.js} +2 -2
- package/dist/report/{types.d.ts → model/types.d.ts} +154 -20
- package/dist/report/react/index.d.ts +32 -21
- package/dist/report/react/index.js +33 -21
- package/dist/report/{load.d.ts → runtime/load.d.ts} +1 -1
- package/dist/report/{load.js → runtime/load.js} +1 -1
- package/dist/report/runtime/text.d.ts +67 -0
- package/dist/report/runtime/text.js +114 -0
- package/dist/report/runtime/web.d.ts +35 -0
- package/dist/report/runtime/web.js +70 -0
- package/dist/results/annotated-source.d.ts +87 -0
- package/dist/results/attempt-evidence.d.ts +74 -0
- package/dist/results/attempt-source.d.ts +15 -0
- package/dist/results/select.d.ts +11 -1
- package/dist/results/select.js +27 -5
- package/dist/runner/eval-selection.d.ts +26 -0
- package/dist/runner/feedback/sink.d.ts +26 -1
- package/dist/runner/types.d.ts +151 -24
- package/dist/sandbox/docker.d.ts +6 -0
- package/dist/sandbox/e2b.d.ts +0 -1
- package/dist/sandbox/types.d.ts +23 -21
- package/dist/scoring/display.d.ts +7 -2
- package/dist/scoring/display.js +42 -4
- package/dist/scoring/types.d.ts +3 -3
- package/dist/shared/aggregate.d.ts +14 -0
- package/dist/shared/aggregate.js +31 -0
- package/dist/shared/types.d.ts +6 -1
- package/docs-site/images/logo-dark.svg +7 -0
- package/docs-site/images/logo.svg +6 -5
- package/docs-site/zh/README.md +8 -7
- package/docs-site/zh/examples/ai-agent-application.mdx +5 -5
- package/docs-site/zh/examples/coding-agent-extensions.mdx +4 -4
- package/docs-site/zh/examples/index.mdx +3 -3
- package/docs-site/zh/examples/integrations/ai-sdk-v7.mdx +6 -6
- package/docs-site/zh/examples/integrations/claude-sdk.mdx +3 -3
- package/docs-site/zh/examples/integrations/codex-sdk.mdx +3 -3
- package/docs-site/zh/examples/integrations/langgraph.mdx +3 -3
- package/docs-site/zh/examples/integrations/pi-sdk.mdx +2 -2
- package/docs-site/zh/explanation/adapter.mdx +19 -19
- package/docs-site/zh/explanation/assert.mdx +9 -9
- package/docs-site/zh/explanation/drive.mdx +4 -4
- package/docs-site/zh/explanation/evals.mdx +8 -8
- package/docs-site/zh/explanation/experiment.mdx +8 -8
- package/docs-site/zh/explanation/hitl.mdx +13 -13
- package/docs-site/zh/explanation/judge.mdx +3 -3
- package/docs-site/zh/explanation/overview.mdx +7 -7
- package/docs-site/zh/explanation/runner.mdx +17 -13
- package/docs-site/zh/explanation/tier.mdx +6 -6
- package/docs-site/zh/index.mdx +14 -14
- package/docs-site/zh/introduction.mdx +13 -16
- package/docs-site/zh/reference/builtin-agents.mdx +61 -28
- package/docs-site/zh/reference/capabilities.mdx +7 -27
- package/docs-site/zh/reference/cli.mdx +36 -33
- package/docs-site/zh/reference/define-agent.mdx +32 -31
- package/docs-site/zh/reference/define-config.mdx +6 -6
- package/docs-site/zh/reference/define-eval.mdx +33 -20
- package/docs-site/zh/reference/events.mdx +4 -4
- package/docs-site/zh/reference/expect.mdx +3 -3
- package/docs-site/zh/reference/official-adapters.mdx +17 -17
- package/docs-site/zh/reference/report-components.mdx +195 -121
- package/docs-site/zh/reference/results-data.mdx +13 -13
- package/docs-site/zh/troubleshooting/debug-sandbox.mdx +11 -11
- package/docs-site/zh/troubleshooting/debugging.mdx +40 -16
- package/docs-site/zh/{how-to → tutorials}/agent-feedback-loop.mdx +38 -38
- package/docs-site/zh/tutorials/agent-onboarding.mdx +100 -0
- package/docs-site/zh/tutorials/authoring.mdx +211 -0
- package/docs-site/zh/{how-to → tutorials}/ci-integration.mdx +8 -8
- package/docs-site/zh/{how-to → tutorials}/connect-otel.mdx +22 -22
- package/docs-site/zh/{how-to → tutorials}/connect-your-agent.mdx +58 -63
- package/docs-site/zh/tutorials/custom-reports.mdx +453 -0
- package/docs-site/zh/{how-to → tutorials}/dataset-fanout.mdx +4 -4
- package/docs-site/zh/tutorials/experiments.mdx +102 -0
- package/docs-site/zh/{how-to → tutorials}/fixtures.mdx +9 -9
- package/docs-site/zh/{how-to → tutorials}/publish-report.mdx +6 -6
- package/docs-site/zh/tutorials/quickstart.mdx +18 -18
- package/docs-site/zh/{how-to → tutorials}/reporters.mdx +6 -6
- package/docs-site/zh/{how-to → tutorials}/sandbox-agent.mdx +6 -6
- package/docs-site/zh/{how-to → tutorials}/sandbox-providers.mdx +41 -19
- package/docs-site/zh/{how-to → tutorials}/scoring-guide.mdx +4 -4
- package/docs-site/zh/{how-to → tutorials}/viewing-results.mdx +60 -57
- package/docs-site/zh/tutorials/write-experiment.mdx +353 -0
- package/docs-site/zh/{how-to → tutorials}/write-send.mdx +40 -40
- package/package.json +10 -7
- package/src/agents/bub.ts +21 -8
- package/src/agents/claude-code.ts +23 -10
- package/src/agents/codex.test.ts +22 -7
- package/src/agents/codex.ts +22 -9
- package/src/agents/index.ts +2 -2
- package/src/agents/openai-compat.ts +1 -1
- package/src/agents/post-setup.ts +45 -22
- package/src/agents/streaming.ts +1 -1
- package/src/agents/types.ts +20 -17
- package/src/agents/ui-message-stream.test.ts +10 -0
- package/src/agents/ui-message-stream.ts +12 -1
- package/src/cli.ts +75 -59
- package/src/context/types.ts +21 -21
- package/src/define.ts +13 -0
- package/src/i18n/en.ts +27 -12
- package/src/i18n/zh-CN.ts +27 -12
- package/src/index.ts +2 -0
- package/src/o11y/prices.json +176 -99
- package/src/report/{react → assets}/colors.ts +22 -0
- package/src/report/{react → assets}/enhance.js +1 -33
- package/src/report/assets/styles.css +1785 -0
- package/src/report/built-in/index.tsx +2 -2
- package/src/report/built-in/standard.tsx +18 -6
- package/src/report/components/attempt-detail/AttemptAssertions.tsx +67 -0
- package/src/report/components/attempt-detail/AttemptConversation.tsx +158 -0
- package/src/report/components/attempt-detail/AttemptDiagnostics.tsx +38 -0
- package/src/report/components/attempt-detail/AttemptDiff.tsx +35 -0
- package/src/report/components/attempt-detail/AttemptError.tsx +31 -0
- package/src/report/components/attempt-detail/AttemptFixPrompt.tsx +26 -0
- package/src/report/components/attempt-detail/AttemptSource.tsx +224 -0
- package/src/report/components/attempt-detail/AttemptSummary.tsx +74 -0
- package/src/report/components/attempt-detail/AttemptTimeline.tsx +108 -0
- package/src/report/components/attempt-detail/AttemptTrace.tsx +63 -0
- package/src/report/components/attempt-detail/AttemptUsage.tsx +29 -0
- package/src/report/components/attempt-detail/attempt-components.test.tsx +758 -0
- package/src/report/components/attempt-detail/compute.ts +336 -0
- package/src/report/components/attempt-detail/faces.ts +260 -0
- package/src/report/components/attempt-detail/index.tsx +600 -0
- package/src/report/components/attempt-detail/validate.test.ts +252 -0
- package/src/report/{react → components}/cell.tsx +6 -3
- package/src/report/{report.test.ts → components/compute.test.ts} +316 -46
- package/src/report/{react → components/entity-lists}/AttemptList.tsx +24 -16
- package/src/report/{react → components/entity-lists}/EvalList.tsx +0 -0
- package/src/report/{react → components/entity-lists}/ExperimentList.tsx +33 -27
- package/src/report/components/entity-lists/compute.ts +196 -0
- package/src/report/components/entity-lists/faces.ts +208 -0
- package/src/report/components/entity-lists/index.tsx +238 -0
- package/src/report/components/entity-lists/validate.test.ts +114 -0
- package/src/report/{react → components}/fixtures.ts +2 -2
- package/src/report/{react → components/metric-views}/DeltaTable.tsx +5 -5
- package/src/report/{react → components/metric-views}/MetricBars.tsx +5 -5
- package/src/report/{react → components/metric-views}/MetricLine.tsx +9 -6
- package/src/report/{react → components/metric-views}/MetricMatrix.tsx +6 -6
- package/src/report/{react → components/metric-views}/MetricScatter.tsx +42 -70
- package/src/report/{react → components/metric-views}/MetricTable.tsx +6 -6
- package/src/report/{react → components/metric-views}/Scoreboard.tsx +4 -4
- package/src/report/{compute.ts → components/metric-views/compute.ts} +51 -477
- package/src/report/components/metric-views/faces.ts +423 -0
- package/src/report/components/metric-views/index.tsx +352 -0
- package/src/report/{text → components/metric-views}/plot.ts +1 -1
- package/src/report/components/metric-views/validate.test.ts +211 -0
- package/src/report/{react → components}/render.test.tsx +66 -26
- package/src/report/components/shared-compute.ts +59 -0
- package/src/report/components/shared-faces.ts +30 -0
- package/src/report/components/shared.ts +192 -0
- package/src/report/{react → components/site-components}/CopyFixPrompt.tsx +3 -3
- package/src/report/{react → components/site-components}/HeroCard.tsx +3 -3
- package/src/report/{react → components/site-components}/ScopeWarnings.tsx +4 -4
- package/src/report/{react → components/site-components}/TraceWaterfall.tsx +13 -10
- package/src/report/components/site-components/compute.ts +144 -0
- package/src/report/components/site-components/faces.ts +80 -0
- package/src/report/components/site-components/index.tsx +265 -0
- package/src/report/{scope-warnings.ts → components/site-components/scope-warnings.ts} +3 -3
- package/src/report/{site-components.test.tsx → components/site-components/site-components.test.tsx} +23 -21
- package/src/report/components/site-components/validate.test.ts +89 -0
- package/src/report/{react → components/summaries}/ScopeSummary.tsx +26 -11
- package/src/report/components/summaries/compute.ts +56 -0
- package/src/report/components/summaries/faces.ts +48 -0
- package/src/report/components/summaries/index.tsx +127 -0
- package/src/report/components/summaries/validate.test.ts +49 -0
- package/src/report/definition/grid-layout.test.ts +124 -0
- package/src/report/definition/grid-layout.ts +146 -0
- package/src/report/{primitives.tsx → definition/primitives.tsx} +168 -18
- package/src/report/{report.ts → definition/report.ts} +98 -165
- package/src/report/{shell-head.test.ts → definition/shell-head.test.ts} +2 -2
- package/src/report/{text/table.ts → definition/table-text.ts} +4 -4
- package/src/report/{tree.ts → definition/tree.ts} +56 -20
- package/src/report/index.ts +128 -66
- package/src/report/{aggregate.ts → model/aggregate.ts} +31 -9
- package/src/report/{flag.ts → model/flag.ts} +39 -1
- package/src/report/{format.ts → model/format.ts} +89 -10
- package/src/report/{locale.ts → model/locale.ts} +34 -36
- package/src/report/{metrics.ts → model/metrics.ts} +3 -3
- package/src/report/{types.ts → model/types.ts} +159 -22
- package/src/report/react/index.tsx +54 -26
- package/src/report/{dual-render.test.tsx → runtime/dual-render.test.tsx} +601 -53
- package/src/report/runtime/host.test.ts +44 -0
- package/src/report/runtime/host.ts +138 -0
- package/src/report/{load.ts → runtime/load.ts} +1 -1
- package/src/report/runtime/text.ts +192 -0
- package/src/report/runtime/web.ts +106 -0
- package/src/results/attempt-evidence.ts +5 -1
- package/src/results/host-equivalence.test.ts +53 -2
- package/src/results/select.ts +29 -5
- package/src/runner/attempt.test.ts +48 -1
- package/src/runner/attempt.ts +62 -42
- package/src/runner/cleanup-timeout.test.ts +16 -0
- package/src/runner/cleanup-timeout.ts +23 -0
- package/src/runner/discover.ts +1 -2
- package/src/runner/eval-selection.test.ts +187 -0
- package/src/runner/eval-selection.ts +109 -0
- package/src/runner/experiment-cleanup-registry.test.ts +89 -0
- package/src/runner/experiment-cleanup-registry.ts +39 -0
- package/src/runner/experiment-labels.test.ts +71 -0
- package/src/runner/feedback/agent.test.ts +33 -1
- package/src/runner/feedback/agent.ts +12 -16
- package/src/runner/feedback/ci.test.ts +35 -1
- package/src/runner/feedback/ci.ts +16 -18
- package/src/runner/feedback/coordinator.ts +28 -0
- package/src/runner/feedback/human.test.ts +108 -1
- package/src/runner/feedback/human.ts +71 -21
- package/src/runner/feedback/reducer.test.ts +64 -0
- package/src/runner/feedback/reducer.ts +26 -0
- package/src/runner/feedback/sink.ts +40 -1
- package/src/runner/fingerprint.ts +2 -1
- package/src/runner/report.test.ts +14 -0
- package/src/runner/report.ts +3 -1
- package/src/runner/run.test.ts +390 -12
- package/src/runner/run.ts +259 -26
- package/src/runner/sandbox-selection.test.ts +13 -3
- package/src/runner/sandbox-selection.ts +4 -2
- package/src/runner/types.ts +160 -24
- package/src/sandbox/docker.ts +7 -0
- package/src/sandbox/e2b-reconcile.test.ts +125 -0
- package/src/sandbox/e2b.ts +47 -12
- package/src/sandbox/types.ts +23 -21
- package/src/scoring/display.test.ts +28 -2
- package/src/scoring/display.ts +38 -5
- package/src/scoring/types.ts +3 -3
- package/src/shared/aggregate.test.ts +52 -0
- package/src/shared/aggregate.ts +29 -0
- package/src/shared/types.ts +6 -1
- package/src/show/command.test.ts +34 -0
- package/src/show/command.ts +16 -0
- package/src/show/compose.ts +1 -1
- package/src/show/index.ts +56 -20
- package/src/show/render.ts +15 -239
- package/src/show/show.test.ts +127 -34
- package/src/view/app/App.test.tsx +1 -1
- package/src/view/app/App.tsx +119 -47
- package/src/view/app/i18n.ts +7 -147
- package/src/view/app/lib/attempt-dialog.test.ts +65 -0
- package/src/view/app/lib/attempt-dialog.ts +69 -0
- package/src/view/app/main.tsx +0 -1
- package/src/view/app/types.ts +3 -86
- package/src/view/artifact-serving.test.ts +22 -38
- package/src/view/client-dist/app.css +1 -1
- package/src/view/client-dist/app.js +15 -22
- package/src/view/data.test.ts +48 -36
- package/src/view/data.ts +105 -83
- package/src/view/index.ts +1 -1
- package/src/view/server.ts +32 -2
- package/src/view/shared/types.ts +6 -31
- package/src/view/site-parity.test.ts +24 -1
- package/src/view/site.ts +144 -17
- package/src/view/styles.css +0 -805
- package/src/view/view-report.test.ts +143 -22
- package/dist/report/components.d.ts +0 -179
- package/dist/report/components.js +0 -544
- package/dist/report/compute.d.ts +0 -139
- package/dist/report/react/ExperimentComparison.d.ts +0 -10
- package/dist/report/react/ExperimentComparison.js +0 -12
- package/dist/report/react/MetricScatter.d.ts +0 -9
- package/dist/report/react/format.d.ts +0 -3
- package/dist/report/react/format.js +0 -7
- package/dist/report/text/faces.d.ts +0 -45
- package/dist/report/text/faces.js +0 -671
- package/dist/report/web.d.ts +0 -32
- package/dist/report/web.js +0 -48
- package/docs-site/zh/how-to/authoring.mdx +0 -162
- package/docs-site/zh/how-to/custom-reports.mdx +0 -414
- package/docs-site/zh/how-to/experiments.mdx +0 -86
- package/docs-site/zh/how-to/write-experiment.mdx +0 -164
- package/src/report/components.tsx +0 -925
- package/src/report/react/ExperimentComparison.tsx +0 -73
- package/src/report/react/format.ts +0 -9
- package/src/report/react/styles.css +0 -945
- package/src/report/text/faces.ts +0 -767
- package/src/report/web.ts +0 -77
- package/src/show/report-host.test.ts +0 -205
- package/src/show/report-host.ts +0 -389
- package/src/view/app/components/AttemptModal.tsx +0 -496
- package/src/view/app/components/CodeView.test.tsx +0 -142
- package/src/view/app/components/CodeView.tsx +0 -310
- package/src/view/app/components/CopyControls.tsx +0 -106
- package/src/view/app/components/Trace.tsx +0 -100
- package/src/view/app/components/Transcript.tsx +0 -157
- package/src/view/app/components/ui/badge.tsx +0 -21
- package/src/view/app/lib/artifact-url.ts +0 -17
- package/src/view/app/lib/attempt-route.test.ts +0 -80
- package/src/view/app/lib/attempt-route.ts +0 -52
- package/src/view/app/lib/format.ts +0 -70
- package/src/view/app/lib/guards.test.ts +0 -108
- package/src/view/app/lib/guards.ts +0 -71
- package/src/view/app/lib/rows.ts +0 -22
- package/src/view/app/lib/transcript-data.tsx +0 -151
- package/src/view/app/lib/verdict.ts +0 -23
- package/src/view/app/shared.ts +0 -8
- /package/dist/report/{react → components/metric-views}/chart-math.d.ts +0 -0
- /package/dist/report/{react → components/metric-views}/chart-math.js +0 -0
- /package/dist/report/{text → components/metric-views}/plot.d.ts +0 -0
- /package/dist/report/{react → components/site-components}/PoweredBy.d.ts +0 -0
- /package/dist/report/{react → components/site-components}/PoweredBy.js +0 -0
- /package/dist/report/{text/layout.d.ts → model/text-layout.d.ts} +0 -0
- /package/dist/report/{text/layout.js → model/text-layout.js} +0 -0
- /package/dist/report/{types.js → model/types.js} +0 -0
- /package/src/report/{react → components/metric-views}/chart-math.test.ts +0 -0
- /package/src/report/{react → components/metric-views}/chart-math.ts +0 -0
- /package/src/report/{react → components/site-components}/PoweredBy.tsx +0 -0
- /package/src/report/{text/layout.ts → model/text-layout.ts} +0 -0
package/dist/report/index.js
CHANGED
|
@@ -3,28 +3,37 @@
|
|
|
3
3
|
//
|
|
4
4
|
// import 边界即运行时边界:计算函数(*Data)会经句柄触碰文件系统(懒加载 artifact),
|
|
5
5
|
// 只能进服务端 / 脚本;组件的渲染面纯同步零 IO。text 宿主遍历渲染不需要 react-dom
|
|
6
|
-
// (renderReportToText);web 宿主的 renderReportToStaticHtml 在 ./web.ts,只有那一侧
|
|
6
|
+
// (renderReportToText);web 宿主的 renderReportToStaticHtml 在 ./runtime/web.ts,只有那一侧
|
|
7
7
|
// import react-dom。写报告文件的项目要装 react(.tsx 编译产物 import react/jsx-runtime)。
|
|
8
8
|
// 指标与维度读取器
|
|
9
|
-
export { assistantTurns, costUSD, defineMetric, durationMs, endToEndPassRate, examScore, executionReliability, repeatedFailedCommands, taskPassRate, tokens, } from "./metrics.js";
|
|
10
|
-
export { flag, numericFlag, numericRunConfig, runConfig } from "./flag.js";
|
|
9
|
+
export { assistantTurns, costUSD, defineMetric, durationMs, endToEndPassRate, examScore, executionReliability, repeatedFailedCommands, taskPassRate, tokens, } from "./model/metrics.js";
|
|
10
|
+
export { flag, label, numericFlag, numericLabel, numericRunConfig, runConfig } from "./model/flag.js";
|
|
11
11
|
// 报告定义与组件基座
|
|
12
|
-
export { buildReportMeta, defineReport, isReportDefinition,
|
|
13
|
-
export {
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
export { buildReportMeta, defineReport, isReportDefinition, resolveReportTitle, DEFAULT_PAGE_ID, } from "./definition/report.js";
|
|
13
|
+
export { pickReportPage, renderReportToText, renderReportTreeToText, reportTitleText, ReportPageNotFoundError, ReportPageNeedsLocatorError, } from "./runtime/text.js";
|
|
14
|
+
export { defineComponent, createTextContext, renderNodeToText, resolveReportTree, validateReportTree, ResolveMemo } from "./definition/tree.js";
|
|
15
|
+
// 排版原语(十个内置双面组件)
|
|
16
|
+
export { Col, Grid, Row, Section, Stat, Style, Tab, Table, Tabs, Text } from "./definition/primitives.js";
|
|
16
17
|
// 文本排版工具箱:自定义组件的 text 面用的就是官方组件那把尺子。
|
|
17
18
|
// 表格有 <Table> 承担,这里只给表以外的形态用 —— 尤其别拿 String.prototype.padEnd 对齐:
|
|
18
19
|
// 它数 UTF-16 码元不数显示列宽,一带中文列就撕歪。renderAlignedRows 刻意不导出。
|
|
19
|
-
export { stringWidth, padDisplay as padEnd, padStartDisplay as padStart, wrapDisplay as wrapText, indentBlock as indent, textBar as bar, joinColumns as columns, } from "./text
|
|
20
|
+
export { stringWidth, padDisplay as padEnd, padStartDisplay as padStart, wrapDisplay as wrapText, indentBlock as indent, textBar as bar, joinColumns as columns, } from "./model/text-layout.js";
|
|
20
21
|
// locale:官方组件 chrome 文案的语言(内置词典覆盖 en / zh-CN,其它 locale 走回退)
|
|
21
|
-
export { DEFAULT_REPORT_LOCALE, localizedTextEquals, resolveLocalizedText, resolveMetricLabel } from "./locale.js";
|
|
22
|
+
export { DEFAULT_REPORT_LOCALE, localizedTextEquals, resolveLocalizedText, resolveMetricLabel } from "./model/locale.js";
|
|
22
23
|
// 官方双面组件(spec / data 双形态;配套 *Data 计算函数在下面成对导出)
|
|
23
24
|
// 与站点组件(Hero / HeroCard / PoweredBy / ScopeWarnings / CopyFixPrompt / TraceWaterfall)
|
|
24
|
-
export {
|
|
25
|
+
export { ScopeSummary, ExperimentComparison } from "./components/summaries/index.js";
|
|
26
|
+
export { AttemptList, EvalList, ExperimentList, FailureList } from "./components/entity-lists/index.js";
|
|
27
|
+
export { DeltaTable, MetricBars, MetricLine, MetricMatrix, MetricScatter, MetricTable, Scoreboard, } from "./components/metric-views/index.js";
|
|
28
|
+
export { CopyFixPrompt, Hero, HeroCard, PoweredBy, ScopeWarnings, TraceWaterfall, } from "./components/site-components/index.js";
|
|
29
|
+
// Attempt 详情组件族(docs/feature/reports/library/attempt-detail.md):11 个叶子 + 2 个
|
|
30
|
+
// 只装配叶子的组合组件(AttemptAssessment / AttemptDetail),都从 niceeval/report 导出。
|
|
31
|
+
export { AttemptAssertions, AttemptAssessment, AttemptConversation, AttemptDetail, AttemptDiagnostics, AttemptDiff, AttemptError, AttemptFixPrompt, AttemptSource, AttemptSummary, AttemptTimeline, AttemptTrace, AttemptUsage, } from "./components/attempt-detail/index.js";
|
|
25
32
|
// 计算函数(组件解析面的具名形式,与组件成对;spec 形态下由管线代调,data 形态与
|
|
26
33
|
// 嵌入场景下由作者手工调)
|
|
27
|
-
export {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
export {
|
|
34
|
+
export { scopeSummaryData } from "./components/summaries/compute.js";
|
|
35
|
+
export { attemptListData, evalListData, experimentListData } from "./components/entity-lists/compute.js";
|
|
36
|
+
export { deltaTableData, metricLineData, metricMatrixData, metricScatterData, metricTableData, pairsByFlag, scoreboardData, } from "./components/metric-views/compute.js";
|
|
37
|
+
export { copyFixPromptData, heroData, scopeWarningsData, traceWaterfallData, } from "./components/site-components/compute.js";
|
|
38
|
+
// Attempt 详情组件族的计算函数:输入恒为单个 AttemptEvidence,同步纯派生(不读文件、不 fetch)。
|
|
39
|
+
export { attemptAssertionsData, attemptConversationData, attemptDiagnosticsData, attemptDiffData, attemptErrorData, attemptFixPromptData, attemptSourceData, attemptSummaryData, attemptTimelineData, attemptTraceData, attemptUsageData, } from "./components/attempt-detail/compute.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { AttemptHandle, ScopeWarning, Snapshot } from "
|
|
2
|
-
import { type AttemptLocator } from "
|
|
3
|
-
import type { Aggregator, DimensionInput, Metric, MetricCell, MetricColumn, NumericAxis, ReportInput } from "./types.ts";
|
|
1
|
+
import type { AttemptHandle, ScopeWarning, Snapshot } from "../../results/types.ts";
|
|
2
|
+
import { type AttemptLocator } from "../../results/locator.ts";
|
|
3
|
+
import type { Aggregator, DimensionInput, Metric, MetricCell, MetricColumn, NumericAxis, ReportInput, SeriesInput } from "./types.ts";
|
|
4
4
|
import { type LocalizedText } from "./locale.ts";
|
|
5
|
-
import { evalPrefixPredicate } from "
|
|
5
|
+
import { evalPrefixPredicate } from "../../shared/aggregate.ts";
|
|
6
6
|
export declare function resolveInput(input: ReportInput): {
|
|
7
7
|
snapshots: readonly Snapshot[];
|
|
8
8
|
warnings: readonly ScopeWarning[];
|
|
@@ -42,6 +42,14 @@ export declare const MISSING_GROUP_KEY: string;
|
|
|
42
42
|
*/
|
|
43
43
|
export declare function refDisplayKey(value: unknown): [display: string, canonical: string];
|
|
44
44
|
export declare function dimensionKey(dimension: DimensionInput, item: Item): string;
|
|
45
|
+
/**
|
|
46
|
+
* series 类选项(SeriesInput)的复合维度解析:数组形态的维度 name 依声明顺序以 ` × ` 连接,
|
|
47
|
+
* 每个 attempt 的维度值为各成员显示键以 ` · ` 连接(缺失成员沿用 `(missing)` 显示键参与
|
|
48
|
+
* 连接,与单维度缺失同一条规则)。单维度形态与 dimensionName / dimensionKey 严格等价。
|
|
49
|
+
*/
|
|
50
|
+
export declare function seriesMembers(series: SeriesInput): readonly DimensionInput[];
|
|
51
|
+
export declare function seriesName(series: SeriesInput): string;
|
|
52
|
+
export declare function seriesKey(series: SeriesInput, item: Item): string;
|
|
45
53
|
/**
|
|
46
54
|
* 按维度分组;维度 domain 按稳定 key 字典序(Unicode)排列,不让文件扫描顺序渗进报告。
|
|
47
55
|
* flag / runConfig 维度做显示键冲突检测:不同原始值生成同一显示键时报错并要求改用
|
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
// 为什么是两级:earlyExit 默认开,失败的题天然比通过的题样本多;平铺求均值会把分数
|
|
6
6
|
// 和重试策略纠缠在一起(eval A=[1]、eval B=[0,0,0] 平铺 = 0.25,两级宏平均 = 0.5)。
|
|
7
7
|
// 自定义维度把同一道题的 attempt 分进不同组时,第一级折叠发生在各组内部。
|
|
8
|
-
import { dedupeAttempts } from "
|
|
9
|
-
import { encodeAttemptLocator } from "
|
|
10
|
-
import { flagValueOf, runConfigValueOf } from "./flag.js";
|
|
8
|
+
import { dedupeAttempts } from "../../results/select.js";
|
|
9
|
+
import { encodeAttemptLocator } from "../../results/locator.js";
|
|
10
|
+
import { flagValueOf, labelValueOf, runConfigValueOf } from "./flag.js";
|
|
11
11
|
import { formatMetricValue, localizedDisplay } from "./format.js";
|
|
12
12
|
import { localeText } from "./locale.js";
|
|
13
|
-
import { evalPrefixPredicate } from "
|
|
13
|
+
import { evalPrefixPredicate } from "../../shared/aggregate.js";
|
|
14
14
|
// 复合键分隔符:NUL 不会出现在 eval id / experimentId / ISO 时间里,拼接键不会串味
|
|
15
15
|
const KEY_SEP = "\u0000";
|
|
16
16
|
export function resolveInput(input) {
|
|
@@ -84,7 +84,9 @@ export function evalGroupOf(id) {
|
|
|
84
84
|
function isDimensionRef(dimension) {
|
|
85
85
|
return (typeof dimension === "object" &&
|
|
86
86
|
"kind" in dimension &&
|
|
87
|
-
(dimension.kind === "flag" ||
|
|
87
|
+
(dimension.kind === "flag" ||
|
|
88
|
+
dimension.kind === "runConfig" ||
|
|
89
|
+
dimension.kind === "label"));
|
|
88
90
|
}
|
|
89
91
|
/** flag / runConfig 未声明时的显示键:内置文案,en / zh-CN 同形。 */
|
|
90
92
|
export const MISSING_GROUP_KEY = localeText("en", "cell.missingValue");
|
|
@@ -110,9 +112,11 @@ export function refDisplayKey(value) {
|
|
|
110
112
|
return [canonicalJson(value), `json:${canonicalJson(value)}`];
|
|
111
113
|
}
|
|
112
114
|
function refValueOf(ref, item) {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
115
|
+
if (ref.kind === "flag")
|
|
116
|
+
return flagValueOf(item.attempt, ref.name);
|
|
117
|
+
if (ref.kind === "label")
|
|
118
|
+
return labelValueOf(item.attempt, ref.name);
|
|
119
|
+
return runConfigValueOf(item.attempt, ref.name);
|
|
116
120
|
}
|
|
117
121
|
export function dimensionKey(dimension, item) {
|
|
118
122
|
if (typeof dimension !== "string") {
|
|
@@ -141,6 +145,22 @@ export function dimensionKey(dimension, item) {
|
|
|
141
145
|
}
|
|
142
146
|
}
|
|
143
147
|
}
|
|
148
|
+
/**
|
|
149
|
+
* series 类选项(SeriesInput)的复合维度解析:数组形态的维度 name 依声明顺序以 ` × ` 连接,
|
|
150
|
+
* 每个 attempt 的维度值为各成员显示键以 ` · ` 连接(缺失成员沿用 `(missing)` 显示键参与
|
|
151
|
+
* 连接,与单维度缺失同一条规则)。单维度形态与 dimensionName / dimensionKey 严格等价。
|
|
152
|
+
*/
|
|
153
|
+
export function seriesMembers(series) {
|
|
154
|
+
return Array.isArray(series) ? series : [series];
|
|
155
|
+
}
|
|
156
|
+
export function seriesName(series) {
|
|
157
|
+
return seriesMembers(series).map(dimensionName).join(" × ");
|
|
158
|
+
}
|
|
159
|
+
export function seriesKey(series, item) {
|
|
160
|
+
return seriesMembers(series)
|
|
161
|
+
.map((member) => dimensionKey(member, item))
|
|
162
|
+
.join(" · ");
|
|
163
|
+
}
|
|
144
164
|
/**
|
|
145
165
|
* 按维度分组;维度 domain 按稳定 key 字典序(Unicode)排列,不让文件扫描顺序渗进报告。
|
|
146
166
|
* flag / runConfig 维度做显示键冲突检测:不同原始值生成同一显示键时报错并要求改用
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import type { AttemptHandle } from "
|
|
1
|
+
import type { AttemptHandle } from "../../results/types.ts";
|
|
2
2
|
import type { DimensionOptions, DimensionRef, NumericAxis, NumericAxisOptions, NumericRunConfigAxisOptions, RunConfigKey } from "./types.ts";
|
|
3
3
|
/** experiment 声明的 flags(快照级投影优先;第三方落盘只拼在条目上时回退 result.experiment)。 */
|
|
4
4
|
export declare function flagValueOf(attempt: AttemptHandle, name: string): unknown;
|
|
5
|
+
/** experiment 声明的报告归类标注 labels(同 flags 的读取回退链;值域 string | number)。 */
|
|
6
|
+
export declare function labelValueOf(attempt: AttemptHandle, name: string): unknown;
|
|
5
7
|
/**
|
|
6
8
|
* runConfig() 的取值:读快照的 `ExperimentRunInfo` 投影,外加桥接到快照顶层权威字段的
|
|
7
9
|
* `model` / `agent` 两个键(与 "model" / "agent" 内置维度同一读法,不另造第二套口径)。
|
|
@@ -14,6 +16,12 @@ export declare function runConfigValueOf(attempt: AttemptHandle, name: RunConfig
|
|
|
14
16
|
* 缺失值显示内置文案 `(missing)`;显示键冲突时计算报错并要求改用 CustomDimension。
|
|
15
17
|
*/
|
|
16
18
|
export declare function flag(name: string, options?: DimensionOptions): DimensionRef;
|
|
19
|
+
/**
|
|
20
|
+
* 把 experiment 声明的一个报告标注(`ExperimentDef.labels` 的键)当分组维度,与 {@link flag}
|
|
21
|
+
* 同一套用法。labels 是纯报告侧的归类坐标:不透传运行时、不参与可比性配置;报告不从
|
|
22
|
+
* experiment id 字符串猜语义,归类只认声明(docs/feature/experiments/library.md「labels」)。
|
|
23
|
+
*/
|
|
24
|
+
export declare function label(name: string, options?: DimensionOptions): DimensionRef;
|
|
17
25
|
/**
|
|
18
26
|
* 把一项顶层运行配置当分组维度,与 {@link flag} 同一套用法。读快照的 `ExperimentRunInfo`
|
|
19
27
|
* 投影;可用键由 RunConfigKey 在类型层穷尽(那张接口的字段全集,外加桥接到快照顶层权威
|
|
@@ -25,6 +33,11 @@ export declare function runConfig(name: RunConfigKey, options?: DimensionOptions
|
|
|
25
33
|
* (折线不绘该点并报告缺失),不猜 `low < medium < high`。
|
|
26
34
|
*/
|
|
27
35
|
export declare function numericFlag(name: string, options?: NumericAxisOptions): NumericAxis;
|
|
36
|
+
/**
|
|
37
|
+
* MetricLine 的 x 轴:只接受 number 值的 label。labels 由作者亲手声明,要数值轴就直接
|
|
38
|
+
* 声明成 number,不设 map;字符串值返回 null(折线不绘该点并报告缺失)。
|
|
39
|
+
*/
|
|
40
|
+
export declare function numericLabel(name: string, options?: NumericAxisOptions): NumericAxis;
|
|
28
41
|
/**
|
|
29
42
|
* 顶层运行配置作数值轴:数值配置直接返回该值;字符串配置必须显式给 `map`
|
|
30
43
|
* (如 { low: 1, medium: 2, high: 3 })。未声明、未投影、非数值或未命中 map 的值返回 null。
|
|
@@ -8,6 +8,11 @@ export function flagValueOf(attempt, name) {
|
|
|
8
8
|
const info = attempt.snapshot?.experiment ?? attempt.result.experiment;
|
|
9
9
|
return info?.flags?.[name];
|
|
10
10
|
}
|
|
11
|
+
/** experiment 声明的报告归类标注 labels(同 flags 的读取回退链;值域 string | number)。 */
|
|
12
|
+
export function labelValueOf(attempt, name) {
|
|
13
|
+
const info = attempt.snapshot?.experiment ?? attempt.result.experiment;
|
|
14
|
+
return info?.labels?.[name];
|
|
15
|
+
}
|
|
11
16
|
/**
|
|
12
17
|
* runConfig() 的取值:读快照的 `ExperimentRunInfo` 投影,外加桥接到快照顶层权威字段的
|
|
13
18
|
* `model` / `agent` 两个键(与 "model" / "agent" 内置维度同一读法,不另造第二套口径)。
|
|
@@ -41,6 +46,20 @@ export function flag(name, options) {
|
|
|
41
46
|
...(options?.unit !== undefined ? { unit: options.unit } : {}),
|
|
42
47
|
};
|
|
43
48
|
}
|
|
49
|
+
/**
|
|
50
|
+
* 把 experiment 声明的一个报告标注(`ExperimentDef.labels` 的键)当分组维度,与 {@link flag}
|
|
51
|
+
* 同一套用法。labels 是纯报告侧的归类坐标:不透传运行时、不参与可比性配置;报告不从
|
|
52
|
+
* experiment id 字符串猜语义,归类只认声明(docs/feature/experiments/library.md「labels」)。
|
|
53
|
+
*/
|
|
54
|
+
export function label(name, options) {
|
|
55
|
+
assertName(name, "label", "the key declared in the experiment's labels");
|
|
56
|
+
return {
|
|
57
|
+
kind: "label",
|
|
58
|
+
name,
|
|
59
|
+
...(options?.label !== undefined ? { label: options.label } : {}),
|
|
60
|
+
...(options?.unit !== undefined ? { unit: options.unit } : {}),
|
|
61
|
+
};
|
|
62
|
+
}
|
|
44
63
|
/**
|
|
45
64
|
* 把一项顶层运行配置当分组维度,与 {@link flag} 同一套用法。读快照的 `ExperimentRunInfo`
|
|
46
65
|
* 投影;可用键由 RunConfigKey 在类型层穷尽(那张接口的字段全集,外加桥接到快照顶层权威
|
|
@@ -71,6 +90,22 @@ export function numericFlag(name, options) {
|
|
|
71
90
|
},
|
|
72
91
|
};
|
|
73
92
|
}
|
|
93
|
+
/**
|
|
94
|
+
* MetricLine 的 x 轴:只接受 number 值的 label。labels 由作者亲手声明,要数值轴就直接
|
|
95
|
+
* 声明成 number,不设 map;字符串值返回 null(折线不绘该点并报告缺失)。
|
|
96
|
+
*/
|
|
97
|
+
export function numericLabel(name, options) {
|
|
98
|
+
assertName(name, "numericLabel", "the key declared in the experiment's labels");
|
|
99
|
+
return {
|
|
100
|
+
name,
|
|
101
|
+
...(options?.label !== undefined ? { label: options.label } : {}),
|
|
102
|
+
...(options?.unit !== undefined ? { unit: options.unit } : {}),
|
|
103
|
+
of(attempt) {
|
|
104
|
+
const value = labelValueOf(attempt, name);
|
|
105
|
+
return typeof value === "number" && Number.isFinite(value) ? value : null;
|
|
106
|
+
},
|
|
107
|
+
};
|
|
108
|
+
}
|
|
74
109
|
/**
|
|
75
110
|
* 顶层运行配置作数值轴:数值配置直接返回该值;字符串配置必须显式给 `map`
|
|
76
111
|
* (如 { low: 1, medium: 2, high: 3 })。未声明、未投影、非数值或未命中 map 的值返回 null。
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import type { Verdict } from "
|
|
1
|
+
import type { Verdict } from "../../types.ts";
|
|
2
2
|
import { type LocalizedText, type ReportLocale } from "./locale.ts";
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* 完整 id 仍是排序 / 着色 / 折叠的键,调用方不要拿这个显示名当身份用。
|
|
4
|
+
* 一组 id 的显示名:每个 id 缩成在这组里唯一的最短路径后缀,重名逐步加长到能区分为止
|
|
5
|
+
* (与 `MetricScatter` 点标签同一算法,两处共用本函数以保证同一份 experiment id 在散点和
|
|
6
|
+
* 列表里缩成同一个显示名)。单个 id、或所有 id 深度不同时也照常缩到各自的最短唯一后缀。
|
|
7
|
+
* 完整 id 不受影响,调用方仍用它做排序 / 过滤 / 折叠的身份键,这里只产出显示名。
|
|
9
8
|
*/
|
|
10
|
-
export declare function
|
|
9
|
+
export declare function shortestUniqueLabels(ids: readonly string[]): Map<string, string>;
|
|
11
10
|
export declare function formatMetricValue(value: number, unit?: string): string;
|
|
12
11
|
/**
|
|
13
12
|
* MetricCell.display 的生成:为官方生成面覆盖的每个 locale(DISPLAY_LOCALES)各生成一份;
|
|
@@ -25,6 +24,13 @@ export declare function formatDurationMs(ms: number): string;
|
|
|
25
24
|
export declare function formatUSD(usd: number): string;
|
|
26
25
|
/** 0..1 的比率 → 整数百分比。 */
|
|
27
26
|
export declare function formatPercent(ratio: number): string;
|
|
27
|
+
/** ISO 时间 → 本地化到分钟的短日期时间;不可解析时原样返回。 */
|
|
28
|
+
export declare function formatReportDateTime(iso: string, locale: ReportLocale): string;
|
|
29
|
+
/** 时间范围的两端;同日省略右侧日期,同年省略右侧年份,减少卡片中的重复噪音。 */
|
|
30
|
+
export declare function formatReportDateTimeRange(fromIso: string, toIso: string, locale: ReportLocale): {
|
|
31
|
+
from: string;
|
|
32
|
+
to: string;
|
|
33
|
+
};
|
|
28
34
|
/** passed / failed / errored / skipped 的判定符。 */
|
|
29
35
|
export declare function verdictMark(verdict: Verdict): string;
|
|
30
36
|
/**
|
|
@@ -3,17 +3,42 @@
|
|
|
3
3
|
// metric.display 可整体覆盖;这里只负责默认。
|
|
4
4
|
import { DISPLAY_LOCALES } from "./locale.js";
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* 完整 id 仍是排序 / 着色 / 折叠的键,调用方不要拿这个显示名当身份用。
|
|
6
|
+
* 一组 id 的显示名:每个 id 缩成在这组里唯一的最短路径后缀,重名逐步加长到能区分为止
|
|
7
|
+
* (与 `MetricScatter` 点标签同一算法,两处共用本函数以保证同一份 experiment id 在散点和
|
|
8
|
+
* 列表里缩成同一个显示名)。单个 id、或所有 id 深度不同时也照常缩到各自的最短唯一后缀。
|
|
9
|
+
* 完整 id 不受影响,调用方仍用它做排序 / 过滤 / 折叠的身份键,这里只产出显示名。
|
|
11
10
|
*/
|
|
12
|
-
export function
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
export function shortestUniqueLabels(ids) {
|
|
12
|
+
const segsOf = (id) => id.split("/").filter(Boolean);
|
|
13
|
+
const depth = new Map(ids.map((id) => [id, 1]));
|
|
14
|
+
for (;;) {
|
|
15
|
+
const byLabel = new Map();
|
|
16
|
+
for (const id of ids) {
|
|
17
|
+
const segs = segsOf(id);
|
|
18
|
+
const label = segs.slice(-Math.min(depth.get(id), segs.length)).join("/") || id;
|
|
19
|
+
byLabel.set(label, [...(byLabel.get(label) ?? []), id]);
|
|
20
|
+
}
|
|
21
|
+
let grew = false;
|
|
22
|
+
for (const group of byLabel.values()) {
|
|
23
|
+
if (group.length < 2)
|
|
24
|
+
continue;
|
|
25
|
+
for (const id of group) {
|
|
26
|
+
const segs = segsOf(id);
|
|
27
|
+
if (depth.get(id) < segs.length) {
|
|
28
|
+
depth.set(id, depth.get(id) + 1);
|
|
29
|
+
grew = true;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
if (!grew) {
|
|
34
|
+
const out = new Map();
|
|
35
|
+
for (const id of ids) {
|
|
36
|
+
const segs = segsOf(id);
|
|
37
|
+
out.set(id, segs.slice(-Math.min(depth.get(id), segs.length)).join("/") || id);
|
|
38
|
+
}
|
|
39
|
+
return out;
|
|
40
|
+
}
|
|
15
41
|
}
|
|
16
|
-
return experimentId;
|
|
17
42
|
}
|
|
18
43
|
/** 一位小数、去掉无意义的 ".0" 尾巴。 */
|
|
19
44
|
function trimmed(n) {
|
|
@@ -103,6 +128,51 @@ export function formatUSD(usd) {
|
|
|
103
128
|
export function formatPercent(ratio) {
|
|
104
129
|
return `${Math.round(ratio * 100)}%`;
|
|
105
130
|
}
|
|
131
|
+
function formatReportDate(date, locale, options) {
|
|
132
|
+
try {
|
|
133
|
+
return new Intl.DateTimeFormat(locale, options).format(date);
|
|
134
|
+
}
|
|
135
|
+
catch {
|
|
136
|
+
return new Intl.DateTimeFormat("en", options).format(date);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
const FULL_REPORT_DATE_TIME = {
|
|
140
|
+
year: "numeric",
|
|
141
|
+
month: "short",
|
|
142
|
+
day: "numeric",
|
|
143
|
+
hour: "2-digit",
|
|
144
|
+
minute: "2-digit",
|
|
145
|
+
hourCycle: "h23",
|
|
146
|
+
};
|
|
147
|
+
/** ISO 时间 → 本地化到分钟的短日期时间;不可解析时原样返回。 */
|
|
148
|
+
export function formatReportDateTime(iso, locale) {
|
|
149
|
+
const date = new Date(iso);
|
|
150
|
+
return Number.isNaN(date.valueOf()) ? iso : formatReportDate(date, locale, FULL_REPORT_DATE_TIME);
|
|
151
|
+
}
|
|
152
|
+
/** 时间范围的两端;同日省略右侧日期,同年省略右侧年份,减少卡片中的重复噪音。 */
|
|
153
|
+
export function formatReportDateTimeRange(fromIso, toIso, locale) {
|
|
154
|
+
const fromDate = new Date(fromIso);
|
|
155
|
+
const toDate = new Date(toIso);
|
|
156
|
+
if (Number.isNaN(fromDate.valueOf()) || Number.isNaN(toDate.valueOf())) {
|
|
157
|
+
return { from: formatReportDateTime(fromIso, locale), to: formatReportDateTime(toIso, locale) };
|
|
158
|
+
}
|
|
159
|
+
const sameYear = fromDate.getFullYear() === toDate.getFullYear();
|
|
160
|
+
const sameDay = sameYear && fromDate.getMonth() === toDate.getMonth() && fromDate.getDate() === toDate.getDate();
|
|
161
|
+
const toOptions = sameDay
|
|
162
|
+
? { hour: "2-digit", minute: "2-digit", hourCycle: "h23" }
|
|
163
|
+
: {
|
|
164
|
+
month: "short",
|
|
165
|
+
day: "numeric",
|
|
166
|
+
hour: "2-digit",
|
|
167
|
+
minute: "2-digit",
|
|
168
|
+
hourCycle: "h23",
|
|
169
|
+
...(!sameYear && { year: "numeric" }),
|
|
170
|
+
};
|
|
171
|
+
return {
|
|
172
|
+
from: formatReportDate(fromDate, locale, FULL_REPORT_DATE_TIME),
|
|
173
|
+
to: formatReportDate(toDate, locale, toOptions),
|
|
174
|
+
};
|
|
175
|
+
}
|
|
106
176
|
// ── 实体列表(ExperimentList / EvalList / AttemptList)共用的判定符 ──
|
|
107
177
|
/** passed / failed / errored / skipped 的判定符。 */
|
|
108
178
|
export function verdictMark(verdict) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { LocalizedText } from "
|
|
1
|
+
import type { LocalizedText } from "../../types.ts";
|
|
2
2
|
export type { LocalizedText };
|
|
3
3
|
/** 报告渲染的 locale(BCP 47 标签,开放);默认 "en"(`niceeval show` 缺省输出不变)。 */
|
|
4
4
|
export type ReportLocale = string;
|
|
@@ -18,6 +18,8 @@ declare const en: {
|
|
|
18
18
|
readonly "verdict.failed": "failed";
|
|
19
19
|
readonly "verdict.errored": "errored";
|
|
20
20
|
readonly "verdict.skipped": "skipped";
|
|
21
|
+
/** AttemptSummary 的重试序号(0 起的 identity.attempt 显示前 +1)。 */
|
|
22
|
+
readonly "attemptSummary.attempt": "attempt {n}";
|
|
21
23
|
/** 全 null / 无样本的统一文案,绝不画 0。 */
|
|
22
24
|
readonly "cell.missing": "no data";
|
|
23
25
|
readonly "cell.measuredTitle": "{samples}/{total} attempts measured";
|
|
@@ -36,11 +38,12 @@ declare const en: {
|
|
|
36
38
|
/** <Table> 的 locator 列表头(行带 locator 时自动追加)。 */
|
|
37
39
|
readonly "table.attempt": "attempt";
|
|
38
40
|
readonly "experimentList.experiment": "Experiment";
|
|
39
|
-
readonly "experimentList.avgDuration": "Avg
|
|
40
|
-
readonly "experimentList.passRate": "
|
|
41
|
+
readonly "experimentList.avgDuration": "Avg. time";
|
|
42
|
+
readonly "experimentList.passRate": "Pass rate";
|
|
43
|
+
readonly "experimentList.passRateDescription": "End-to-end pass rate: passed = 1; failed and errored = 0";
|
|
41
44
|
readonly "experimentList.tokens": "Tokens";
|
|
42
45
|
readonly "experimentList.cost": "Cost";
|
|
43
|
-
readonly "experimentList.result": "
|
|
46
|
+
readonly "experimentList.result": "Results";
|
|
44
47
|
readonly "experimentList.status": "Status";
|
|
45
48
|
readonly "experimentList.evalAttempt": "Eval / Attempt";
|
|
46
49
|
readonly "experimentList.duration": "Duration";
|
|
@@ -56,30 +59,27 @@ declare const en: {
|
|
|
56
59
|
/** ScopeSummary 的 KPI 标签。 */
|
|
57
60
|
readonly "scopeSummary.experiments": "Experiments";
|
|
58
61
|
readonly "scopeSummary.evals": "Evals";
|
|
59
|
-
readonly "scopeSummary.attempts": "
|
|
60
|
-
readonly "scopeSummary.passRate": "
|
|
62
|
+
readonly "scopeSummary.attempts": "Attempts";
|
|
63
|
+
readonly "scopeSummary.passRate": "Pass rate";
|
|
61
64
|
readonly "scopeSummary.totalCost": "Total cost";
|
|
62
|
-
readonly "scopeSummary.
|
|
63
|
-
readonly "scopeSummary.
|
|
64
|
-
readonly "scopeSummary.
|
|
65
|
+
readonly "scopeSummary.lastRun": "Last run · {time}";
|
|
66
|
+
readonly "scopeSummary.runRange": "Run range · {from} – {to}";
|
|
67
|
+
readonly "scopeSummary.costCoverage": "Cost available for {samples}/{total} attempts";
|
|
68
|
+
readonly "scopeSummary.votesEval": "Eval results";
|
|
69
|
+
readonly "scopeSummary.votesAttempt": "Attempt results";
|
|
65
70
|
readonly "overview.experiments.one": "{n} experiment";
|
|
66
71
|
readonly "overview.experiments.other": "{n} experiments";
|
|
67
72
|
readonly "overview.evalsCount": "{n} evals";
|
|
68
73
|
readonly "overview.attemptsCount": "{n} attempts";
|
|
69
74
|
readonly "overview.evals": "Evals";
|
|
70
|
-
readonly "overview.passRate": "
|
|
75
|
+
readonly "overview.passRate": "Pass rate";
|
|
71
76
|
readonly "overview.totalCost": "Cost";
|
|
72
|
-
readonly "experimentComparison.groups": "Experiment groups";
|
|
73
|
-
readonly "experimentComparison.group": "Experiment group";
|
|
74
|
-
readonly "experimentComparison.results": "Eval results";
|
|
75
|
-
readonly "experimentComparison.lastRun": "Last run";
|
|
76
|
-
readonly "experimentComparison.selectGroup": "Select experiment group {group}";
|
|
77
|
-
readonly "experimentComparison.commandsHead": "Group details:";
|
|
78
|
-
readonly "experimentComparison.empty": "No experiment groups";
|
|
79
77
|
/** 方向提示唯一文案:轴向已随 better 反正,「更好」恒指向右上(两轴都声明 better 时才显示)。 */
|
|
80
78
|
readonly "scatter.betterUpperRight": "better → upper right";
|
|
81
79
|
/** 0 个可画点:x/y 指标没有可用数据。 */
|
|
82
80
|
readonly "scatter.noData": "No data to plot {x} × {y}";
|
|
81
|
+
/** 标题行尾的归类维度标注(series 维度存在时显示)。 */
|
|
82
|
+
readonly "scatter.groupedBy": "grouped by {dim}";
|
|
83
83
|
readonly "pointsMissing.one": "{n} point missing data";
|
|
84
84
|
readonly "pointsMissing.other": "{n} points missing data";
|
|
85
85
|
readonly "attemptList.empty": "No attempts";
|
|
@@ -43,6 +43,8 @@ const en = {
|
|
|
43
43
|
"verdict.failed": "failed",
|
|
44
44
|
"verdict.errored": "errored",
|
|
45
45
|
"verdict.skipped": "skipped",
|
|
46
|
+
/** AttemptSummary 的重试序号(0 起的 identity.attempt 显示前 +1)。 */
|
|
47
|
+
"attemptSummary.attempt": "attempt {n}",
|
|
46
48
|
/** 全 null / 无样本的统一文案,绝不画 0。 */
|
|
47
49
|
"cell.missing": "no data",
|
|
48
50
|
"cell.measuredTitle": "{samples}/{total} attempts measured",
|
|
@@ -61,11 +63,12 @@ const en = {
|
|
|
61
63
|
/** <Table> 的 locator 列表头(行带 locator 时自动追加)。 */
|
|
62
64
|
"table.attempt": "attempt",
|
|
63
65
|
"experimentList.experiment": "Experiment",
|
|
64
|
-
"experimentList.avgDuration": "Avg
|
|
65
|
-
"experimentList.passRate": "
|
|
66
|
+
"experimentList.avgDuration": "Avg. time",
|
|
67
|
+
"experimentList.passRate": "Pass rate",
|
|
68
|
+
"experimentList.passRateDescription": "End-to-end pass rate: passed = 1; failed and errored = 0",
|
|
66
69
|
"experimentList.tokens": "Tokens",
|
|
67
70
|
"experimentList.cost": "Cost",
|
|
68
|
-
"experimentList.result": "
|
|
71
|
+
"experimentList.result": "Results",
|
|
69
72
|
"experimentList.status": "Status",
|
|
70
73
|
"experimentList.evalAttempt": "Eval / Attempt",
|
|
71
74
|
"experimentList.duration": "Duration",
|
|
@@ -81,30 +84,27 @@ const en = {
|
|
|
81
84
|
/** ScopeSummary 的 KPI 标签。 */
|
|
82
85
|
"scopeSummary.experiments": "Experiments",
|
|
83
86
|
"scopeSummary.evals": "Evals",
|
|
84
|
-
"scopeSummary.attempts": "
|
|
85
|
-
"scopeSummary.passRate": "
|
|
87
|
+
"scopeSummary.attempts": "Attempts",
|
|
88
|
+
"scopeSummary.passRate": "Pass rate",
|
|
86
89
|
"scopeSummary.totalCost": "Total cost",
|
|
87
|
-
"scopeSummary.
|
|
88
|
-
"scopeSummary.
|
|
89
|
-
"scopeSummary.
|
|
90
|
+
"scopeSummary.lastRun": "Last run · {time}",
|
|
91
|
+
"scopeSummary.runRange": "Run range · {from} – {to}",
|
|
92
|
+
"scopeSummary.costCoverage": "Cost available for {samples}/{total} attempts",
|
|
93
|
+
"scopeSummary.votesEval": "Eval results",
|
|
94
|
+
"scopeSummary.votesAttempt": "Attempt results",
|
|
90
95
|
"overview.experiments.one": "{n} experiment",
|
|
91
96
|
"overview.experiments.other": "{n} experiments",
|
|
92
97
|
"overview.evalsCount": "{n} evals",
|
|
93
98
|
"overview.attemptsCount": "{n} attempts",
|
|
94
99
|
"overview.evals": "Evals",
|
|
95
|
-
"overview.passRate": "
|
|
100
|
+
"overview.passRate": "Pass rate",
|
|
96
101
|
"overview.totalCost": "Cost",
|
|
97
|
-
"experimentComparison.groups": "Experiment groups",
|
|
98
|
-
"experimentComparison.group": "Experiment group",
|
|
99
|
-
"experimentComparison.results": "Eval results",
|
|
100
|
-
"experimentComparison.lastRun": "Last run",
|
|
101
|
-
"experimentComparison.selectGroup": "Select experiment group {group}",
|
|
102
|
-
"experimentComparison.commandsHead": "Group details:",
|
|
103
|
-
"experimentComparison.empty": "No experiment groups",
|
|
104
102
|
/** 方向提示唯一文案:轴向已随 better 反正,「更好」恒指向右上(两轴都声明 better 时才显示)。 */
|
|
105
103
|
"scatter.betterUpperRight": "better → upper right",
|
|
106
104
|
/** 0 个可画点:x/y 指标没有可用数据。 */
|
|
107
105
|
"scatter.noData": "No data to plot {x} × {y}",
|
|
106
|
+
/** 标题行尾的归类维度标注(series 维度存在时显示)。 */
|
|
107
|
+
"scatter.groupedBy": "grouped by {dim}",
|
|
108
108
|
"pointsMissing.one": "{n} point missing data",
|
|
109
109
|
"pointsMissing.other": "{n} points missing data",
|
|
110
110
|
"attemptList.empty": "No attempts",
|
|
@@ -174,6 +174,7 @@ const zhCN = {
|
|
|
174
174
|
"verdict.failed": "失败",
|
|
175
175
|
"verdict.errored": "错误",
|
|
176
176
|
"verdict.skipped": "跳过",
|
|
177
|
+
"attemptSummary.attempt": "第 {n} 次",
|
|
177
178
|
"cell.missing": "无数据",
|
|
178
179
|
"cell.measuredTitle": "{samples}/{total} 次 attempt 测得",
|
|
179
180
|
"cell.noneMeasurableTitle": "0/{total} 次 attempt 可测",
|
|
@@ -191,7 +192,8 @@ const zhCN = {
|
|
|
191
192
|
"table.attempt": "Attempt",
|
|
192
193
|
"experimentList.experiment": "实验",
|
|
193
194
|
"experimentList.avgDuration": "平均耗时",
|
|
194
|
-
"experimentList.passRate": "
|
|
195
|
+
"experimentList.passRate": "通过率",
|
|
196
|
+
"experimentList.passRateDescription": "端到端通过率:passed = 1;failed 和 errored = 0",
|
|
195
197
|
"experimentList.tokens": "Tokens",
|
|
196
198
|
"experimentList.cost": "成本",
|
|
197
199
|
"experimentList.result": "结果",
|
|
@@ -206,30 +208,26 @@ const zhCN = {
|
|
|
206
208
|
"entityList.moreFailures.other": "+{n} 条其它失败",
|
|
207
209
|
"table.columnsHidden.one": "(还有 {n} 列未列出)",
|
|
208
210
|
"table.columnsHidden.other": "(还有 {n} 列未列出)",
|
|
209
|
-
"scopeSummary.experiments": "
|
|
210
|
-
"scopeSummary.evals": "
|
|
211
|
-
"scopeSummary.attempts": "
|
|
212
|
-
"scopeSummary.passRate": "
|
|
211
|
+
"scopeSummary.experiments": "实验",
|
|
212
|
+
"scopeSummary.evals": "Eval",
|
|
213
|
+
"scopeSummary.attempts": "Attempt",
|
|
214
|
+
"scopeSummary.passRate": "通过率",
|
|
213
215
|
"scopeSummary.totalCost": "总成本",
|
|
214
|
-
"scopeSummary.
|
|
215
|
-
"scopeSummary.
|
|
216
|
-
"scopeSummary.
|
|
216
|
+
"scopeSummary.lastRun": "最近运行 · {time}",
|
|
217
|
+
"scopeSummary.runRange": "运行范围 · {from} – {to}",
|
|
218
|
+
"scopeSummary.costCoverage": "{samples}/{total} 次有成本数据",
|
|
219
|
+
"scopeSummary.votesEval": "Eval 结果",
|
|
220
|
+
"scopeSummary.votesAttempt": "Attempt 结果",
|
|
217
221
|
"overview.experiments.one": "{n} 个实验",
|
|
218
222
|
"overview.experiments.other": "{n} 个实验",
|
|
219
|
-
"overview.evalsCount": "{n}
|
|
223
|
+
"overview.evalsCount": "{n} 个 Eval",
|
|
220
224
|
"overview.attemptsCount": "{n} 次 attempt",
|
|
221
225
|
"overview.evals": "Eval",
|
|
222
|
-
"overview.passRate": "
|
|
226
|
+
"overview.passRate": "通过率",
|
|
223
227
|
"overview.totalCost": "成本",
|
|
224
|
-
"experimentComparison.groups": "实验组",
|
|
225
|
-
"experimentComparison.group": "实验组",
|
|
226
|
-
"experimentComparison.results": "Eval 结果",
|
|
227
|
-
"experimentComparison.lastRun": "最后运行",
|
|
228
|
-
"experimentComparison.selectGroup": "选择实验组 {group}",
|
|
229
|
-
"experimentComparison.commandsHead": "查看组内详情:",
|
|
230
|
-
"experimentComparison.empty": "没有实验组",
|
|
231
228
|
"scatter.betterUpperRight": "越靠右上越好",
|
|
232
229
|
"scatter.noData": "{x} × {y} 没有可绘制的数据",
|
|
230
|
+
"scatter.groupedBy": "按 {dim} 归类",
|
|
233
231
|
"pointsMissing.one": "{n} 个点缺数据",
|
|
234
232
|
"pointsMissing.other": "{n} 个点缺数据",
|
|
235
233
|
"attemptList.empty": "没有 attempt",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { EvalResult } from "
|
|
1
|
+
import type { EvalResult } from "../../types.ts";
|
|
2
2
|
import type { Metric } from "./types.ts";
|
|
3
3
|
/**
|
|
4
4
|
* 定义一个指标。内置指标与自定义指标是同一个类型,没有特权;
|
|
@@ -10,7 +10,7 @@ export declare function defineMetric<const Name extends string>(def: Metric<Name
|
|
|
10
10
|
export declare function attemptCostUSD(result: EvalResult): number | null;
|
|
11
11
|
/**
|
|
12
12
|
* 条件答题质量:passed = 1,failed = 0,errored 记 null 不进分母。
|
|
13
|
-
*
|
|
13
|
+
* 这是「已形成可信判定」条件下的诊断指标,不能简称默认通过率
|
|
14
14
|
* (docs/feature/reports/library.md「内置指标」)。
|
|
15
15
|
*/
|
|
16
16
|
export declare const taskPassRate: Metric<"task-pass-rate">;
|
|
@@ -40,7 +40,7 @@ export function attemptCostUSD(result) {
|
|
|
40
40
|
}
|
|
41
41
|
/**
|
|
42
42
|
* 条件答题质量:passed = 1,failed = 0,errored 记 null 不进分母。
|
|
43
|
-
*
|
|
43
|
+
* 这是「已形成可信判定」条件下的诊断指标,不能简称默认通过率
|
|
44
44
|
* (docs/feature/reports/library.md「内置指标」)。
|
|
45
45
|
*/
|
|
46
46
|
export const taskPassRate = defineMetric({
|
|
@@ -86,7 +86,7 @@ export const executionReliability = defineMetric({
|
|
|
86
86
|
*/
|
|
87
87
|
export const endToEndPassRate = defineMetric({
|
|
88
88
|
name: "end-to-end-pass-rate",
|
|
89
|
-
label: { en: "
|
|
89
|
+
label: { en: "Pass rate", "zh-CN": "通过率" },
|
|
90
90
|
description: "End-to-end composite: passed = 1, failed / errored = 0. Split blame with taskPassRate and executionReliability.",
|
|
91
91
|
better: "higher",
|
|
92
92
|
unit: "%",
|