niceeval 0.9.1 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/INDEX.md +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 +6 -0
- package/dist/report/components/attempt-detail/AttemptConversation.js +34 -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 +27 -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 +254 -0
- package/dist/report/components/attempt-detail/faces.d.ts +14 -0
- package/dist/report/components/attempt-detail/faces.js +235 -0
- package/dist/report/components/attempt-detail/index.d.ts +38 -0
- package/dist/report/components/attempt-detail/index.js +527 -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 +3 -3
- package/dist/report/{react → components/entity-lists}/ExperimentList.js +10 -10
- 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 +174 -0
- package/dist/report/components/entity-lists/index.d.ts +51 -0
- package/dist/report/components/entity-lists/index.js +165 -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 +26 -23
- 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} +11 -5
- package/dist/report/{format.js → model/format.js} +48 -4
- 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} +140 -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 +149 -23
- package/dist/sandbox/docker.d.ts +6 -0
- 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 +1 -1
- 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 +11 -11
- 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 +35 -32
- 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 +193 -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 +103 -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 +49 -49
- package/docs-site/zh/tutorials/write-experiment.mdx +355 -0
- package/docs-site/zh/{how-to → tutorials}/write-send.mdx +40 -40
- package/package.json +8 -4
- 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 +71 -57
- 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/report/{react → assets}/colors.ts +22 -0
- package/src/report/{react → assets}/enhance.js +1 -33
- package/src/report/{react → assets}/styles.css +124 -106
- 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 +110 -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 +80 -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 +680 -0
- package/src/report/components/attempt-detail/compute.ts +287 -0
- package/src/report/components/attempt-detail/faces.ts +257 -0
- package/src/report/components/attempt-detail/index.tsx +583 -0
- package/src/report/components/attempt-detail/validate.test.ts +235 -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 +23 -20
- package/src/report/components/entity-lists/compute.ts +196 -0
- package/src/report/components/entity-lists/faces.ts +207 -0
- package/src/report/components/entity-lists/index.tsx +241 -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 +41 -33
- 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 +47 -17
- 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 +126 -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} +59 -5
- 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} +143 -22
- package/src/report/react/index.tsx +52 -26
- package/src/report/{dual-render.test.tsx → runtime/dual-render.test.tsx} +564 -49
- 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 +158 -23
- package/src/sandbox/docker.ts +7 -0
- package/src/sandbox/e2b.ts +12 -13
- 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 +141 -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/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
|
@@ -2,15 +2,14 @@
|
|
|
2
2
|
// "%" → 87% "ms" → 1.2s "$" → $0.31 其余 → 1.2k 缩写(带 unit 后缀)
|
|
3
3
|
// metric.display 可整体覆盖;这里只负责默认。
|
|
4
4
|
|
|
5
|
-
import type { Verdict } from "
|
|
5
|
+
import type { Verdict } from "../../types.ts";
|
|
6
6
|
import { DISPLAY_LOCALES, type LocalizedText, type ReportLocale } from "./locale.ts";
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* experiment 行的显示名:给了父路径 `relativeTo` 且它确是前缀,就去掉 `relativeTo + "/"`,
|
|
10
|
-
* 只留 id
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* 完整 id 仍是排序 / 着色 / 折叠的键,调用方不要拿这个显示名当身份用。
|
|
10
|
+
* 只留 id 末段——供自定义报告在已知父路径的上下文里显式调用,避免每行重复文件夹名。默认
|
|
11
|
+
* `ExperimentComparison` 不传 `relativeTo`,完整 id 始终可见。不给 `relativeTo`、或它不是
|
|
12
|
+
* 前缀时原样返回完整 id。完整 id 仍是排序 / 着色 / 折叠的键,调用方不要拿这个显示名当身份用。
|
|
14
13
|
*/
|
|
15
14
|
export function experimentDisplayName(experimentId: string, relativeTo?: string): string {
|
|
16
15
|
if (relativeTo && experimentId.startsWith(`${relativeTo}/`)) {
|
|
@@ -104,6 +103,61 @@ export function formatPercent(ratio: number): string {
|
|
|
104
103
|
return `${Math.round(ratio * 100)}%`;
|
|
105
104
|
}
|
|
106
105
|
|
|
106
|
+
type ReportDateTimeOptions = Intl.DateTimeFormatOptions;
|
|
107
|
+
|
|
108
|
+
function formatReportDate(date: Date, locale: ReportLocale, options: ReportDateTimeOptions): string {
|
|
109
|
+
try {
|
|
110
|
+
return new Intl.DateTimeFormat(locale, options).format(date);
|
|
111
|
+
} catch {
|
|
112
|
+
return new Intl.DateTimeFormat("en", options).format(date);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
const FULL_REPORT_DATE_TIME: ReportDateTimeOptions = {
|
|
117
|
+
year: "numeric",
|
|
118
|
+
month: "short",
|
|
119
|
+
day: "numeric",
|
|
120
|
+
hour: "2-digit",
|
|
121
|
+
minute: "2-digit",
|
|
122
|
+
hourCycle: "h23",
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
/** ISO 时间 → 本地化到分钟的短日期时间;不可解析时原样返回。 */
|
|
126
|
+
export function formatReportDateTime(iso: string, locale: ReportLocale): string {
|
|
127
|
+
const date = new Date(iso);
|
|
128
|
+
return Number.isNaN(date.valueOf()) ? iso : formatReportDate(date, locale, FULL_REPORT_DATE_TIME);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/** 时间范围的两端;同日省略右侧日期,同年省略右侧年份,减少卡片中的重复噪音。 */
|
|
132
|
+
export function formatReportDateTimeRange(
|
|
133
|
+
fromIso: string,
|
|
134
|
+
toIso: string,
|
|
135
|
+
locale: ReportLocale,
|
|
136
|
+
): { from: string; to: string } {
|
|
137
|
+
const fromDate = new Date(fromIso);
|
|
138
|
+
const toDate = new Date(toIso);
|
|
139
|
+
if (Number.isNaN(fromDate.valueOf()) || Number.isNaN(toDate.valueOf())) {
|
|
140
|
+
return { from: formatReportDateTime(fromIso, locale), to: formatReportDateTime(toIso, locale) };
|
|
141
|
+
}
|
|
142
|
+
const sameYear = fromDate.getFullYear() === toDate.getFullYear();
|
|
143
|
+
const sameDay =
|
|
144
|
+
sameYear && fromDate.getMonth() === toDate.getMonth() && fromDate.getDate() === toDate.getDate();
|
|
145
|
+
const toOptions: ReportDateTimeOptions = sameDay
|
|
146
|
+
? { hour: "2-digit", minute: "2-digit", hourCycle: "h23" }
|
|
147
|
+
: {
|
|
148
|
+
month: "short",
|
|
149
|
+
day: "numeric",
|
|
150
|
+
hour: "2-digit",
|
|
151
|
+
minute: "2-digit",
|
|
152
|
+
hourCycle: "h23",
|
|
153
|
+
...(!sameYear && { year: "numeric" }),
|
|
154
|
+
};
|
|
155
|
+
return {
|
|
156
|
+
from: formatReportDate(fromDate, locale, FULL_REPORT_DATE_TIME),
|
|
157
|
+
to: formatReportDate(toDate, locale, toOptions),
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
|
|
107
161
|
// ── 实体列表(ExperimentList / EvalList / AttemptList)共用的判定符 ──
|
|
108
162
|
|
|
109
163
|
/** passed / failed / errored / skipped 的判定符。 */
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// 维度键、warnings 的 message 不经这里。
|
|
6
6
|
// 刻意不 import src/i18n/(CLI 专用字典,locale 来源与 key 面完全不同)。
|
|
7
7
|
|
|
8
|
-
import type { LocalizedText } from "
|
|
8
|
+
import type { LocalizedText } from "../../types.ts";
|
|
9
9
|
|
|
10
10
|
export type { LocalizedText };
|
|
11
11
|
|
|
@@ -52,6 +52,9 @@ const en = {
|
|
|
52
52
|
"verdict.errored": "errored",
|
|
53
53
|
"verdict.skipped": "skipped",
|
|
54
54
|
|
|
55
|
+
/** AttemptSummary 的重试序号(0 起的 identity.attempt 显示前 +1)。 */
|
|
56
|
+
"attemptSummary.attempt": "attempt {n}",
|
|
57
|
+
|
|
55
58
|
/** 全 null / 无样本的统一文案,绝不画 0。 */
|
|
56
59
|
"cell.missing": "no data",
|
|
57
60
|
"cell.measuredTitle": "{samples}/{total} attempts measured",
|
|
@@ -71,11 +74,12 @@ const en = {
|
|
|
71
74
|
/** <Table> 的 locator 列表头(行带 locator 时自动追加)。 */
|
|
72
75
|
"table.attempt": "attempt",
|
|
73
76
|
"experimentList.experiment": "Experiment",
|
|
74
|
-
"experimentList.avgDuration": "Avg
|
|
75
|
-
"experimentList.passRate": "
|
|
77
|
+
"experimentList.avgDuration": "Avg. time",
|
|
78
|
+
"experimentList.passRate": "Pass rate",
|
|
79
|
+
"experimentList.passRateDescription": "End-to-end pass rate: passed = 1; failed and errored = 0",
|
|
76
80
|
"experimentList.tokens": "Tokens",
|
|
77
81
|
"experimentList.cost": "Cost",
|
|
78
|
-
"experimentList.result": "
|
|
82
|
+
"experimentList.result": "Results",
|
|
79
83
|
"experimentList.status": "Status",
|
|
80
84
|
"experimentList.evalAttempt": "Eval / Attempt",
|
|
81
85
|
"experimentList.duration": "Duration",
|
|
@@ -92,32 +96,28 @@ const en = {
|
|
|
92
96
|
/** ScopeSummary 的 KPI 标签。 */
|
|
93
97
|
"scopeSummary.experiments": "Experiments",
|
|
94
98
|
"scopeSummary.evals": "Evals",
|
|
95
|
-
"scopeSummary.attempts": "
|
|
96
|
-
"scopeSummary.passRate": "
|
|
99
|
+
"scopeSummary.attempts": "Attempts",
|
|
100
|
+
"scopeSummary.passRate": "Pass rate",
|
|
97
101
|
"scopeSummary.totalCost": "Total cost",
|
|
98
|
-
"scopeSummary.
|
|
99
|
-
"scopeSummary.
|
|
100
|
-
"scopeSummary.
|
|
102
|
+
"scopeSummary.lastRun": "Last run · {time}",
|
|
103
|
+
"scopeSummary.runRange": "Run range · {from} – {to}",
|
|
104
|
+
"scopeSummary.costCoverage": "Cost available for {samples}/{total} attempts",
|
|
105
|
+
"scopeSummary.votesEval": "Eval results",
|
|
106
|
+
"scopeSummary.votesAttempt": "Attempt results",
|
|
101
107
|
"overview.experiments.one": "{n} experiment",
|
|
102
108
|
"overview.experiments.other": "{n} experiments",
|
|
103
109
|
"overview.evalsCount": "{n} evals",
|
|
104
110
|
"overview.attemptsCount": "{n} attempts",
|
|
105
111
|
"overview.evals": "Evals",
|
|
106
|
-
"overview.passRate": "
|
|
112
|
+
"overview.passRate": "Pass rate",
|
|
107
113
|
"overview.totalCost": "Cost",
|
|
108
114
|
|
|
109
|
-
"experimentComparison.groups": "Experiment groups",
|
|
110
|
-
"experimentComparison.group": "Experiment group",
|
|
111
|
-
"experimentComparison.results": "Eval results",
|
|
112
|
-
"experimentComparison.lastRun": "Last run",
|
|
113
|
-
"experimentComparison.selectGroup": "Select experiment group {group}",
|
|
114
|
-
"experimentComparison.commandsHead": "Group details:",
|
|
115
|
-
"experimentComparison.empty": "No experiment groups",
|
|
116
|
-
|
|
117
115
|
/** 方向提示唯一文案:轴向已随 better 反正,「更好」恒指向右上(两轴都声明 better 时才显示)。 */
|
|
118
116
|
"scatter.betterUpperRight": "better → upper right",
|
|
119
117
|
/** 0 个可画点:x/y 指标没有可用数据。 */
|
|
120
118
|
"scatter.noData": "No data to plot {x} × {y}",
|
|
119
|
+
/** 标题行尾的归类维度标注(series 维度存在时显示)。 */
|
|
120
|
+
"scatter.groupedBy": "grouped by {dim}",
|
|
121
121
|
"pointsMissing.one": "{n} point missing data",
|
|
122
122
|
"pointsMissing.other": "{n} points missing data",
|
|
123
123
|
|
|
@@ -200,6 +200,8 @@ const zhCN: Record<ReportMessageKey, string> = {
|
|
|
200
200
|
"verdict.errored": "错误",
|
|
201
201
|
"verdict.skipped": "跳过",
|
|
202
202
|
|
|
203
|
+
"attemptSummary.attempt": "第 {n} 次",
|
|
204
|
+
|
|
203
205
|
"cell.missing": "无数据",
|
|
204
206
|
"cell.measuredTitle": "{samples}/{total} 次 attempt 测得",
|
|
205
207
|
"cell.noneMeasurableTitle": "0/{total} 次 attempt 可测",
|
|
@@ -218,7 +220,8 @@ const zhCN: Record<ReportMessageKey, string> = {
|
|
|
218
220
|
"table.attempt": "Attempt",
|
|
219
221
|
"experimentList.experiment": "实验",
|
|
220
222
|
"experimentList.avgDuration": "平均耗时",
|
|
221
|
-
"experimentList.passRate": "
|
|
223
|
+
"experimentList.passRate": "通过率",
|
|
224
|
+
"experimentList.passRateDescription": "端到端通过率:passed = 1;failed 和 errored = 0",
|
|
222
225
|
"experimentList.tokens": "Tokens",
|
|
223
226
|
"experimentList.cost": "成本",
|
|
224
227
|
"experimentList.result": "结果",
|
|
@@ -234,32 +237,27 @@ const zhCN: Record<ReportMessageKey, string> = {
|
|
|
234
237
|
"table.columnsHidden.one": "(还有 {n} 列未列出)",
|
|
235
238
|
"table.columnsHidden.other": "(还有 {n} 列未列出)",
|
|
236
239
|
|
|
237
|
-
"scopeSummary.experiments": "
|
|
238
|
-
"scopeSummary.evals": "
|
|
239
|
-
"scopeSummary.attempts": "
|
|
240
|
-
"scopeSummary.passRate": "
|
|
240
|
+
"scopeSummary.experiments": "实验",
|
|
241
|
+
"scopeSummary.evals": "Eval",
|
|
242
|
+
"scopeSummary.attempts": "Attempt",
|
|
243
|
+
"scopeSummary.passRate": "通过率",
|
|
241
244
|
"scopeSummary.totalCost": "总成本",
|
|
242
|
-
"scopeSummary.
|
|
243
|
-
"scopeSummary.
|
|
244
|
-
"scopeSummary.
|
|
245
|
+
"scopeSummary.lastRun": "最近运行 · {time}",
|
|
246
|
+
"scopeSummary.runRange": "运行范围 · {from} – {to}",
|
|
247
|
+
"scopeSummary.costCoverage": "{samples}/{total} 次有成本数据",
|
|
248
|
+
"scopeSummary.votesEval": "Eval 结果",
|
|
249
|
+
"scopeSummary.votesAttempt": "Attempt 结果",
|
|
245
250
|
"overview.experiments.one": "{n} 个实验",
|
|
246
251
|
"overview.experiments.other": "{n} 个实验",
|
|
247
|
-
"overview.evalsCount": "{n}
|
|
252
|
+
"overview.evalsCount": "{n} 个 Eval",
|
|
248
253
|
"overview.attemptsCount": "{n} 次 attempt",
|
|
249
254
|
"overview.evals": "Eval",
|
|
250
|
-
"overview.passRate": "
|
|
255
|
+
"overview.passRate": "通过率",
|
|
251
256
|
"overview.totalCost": "成本",
|
|
252
257
|
|
|
253
|
-
"experimentComparison.groups": "实验组",
|
|
254
|
-
"experimentComparison.group": "实验组",
|
|
255
|
-
"experimentComparison.results": "Eval 结果",
|
|
256
|
-
"experimentComparison.lastRun": "最后运行",
|
|
257
|
-
"experimentComparison.selectGroup": "选择实验组 {group}",
|
|
258
|
-
"experimentComparison.commandsHead": "查看组内详情:",
|
|
259
|
-
"experimentComparison.empty": "没有实验组",
|
|
260
|
-
|
|
261
258
|
"scatter.betterUpperRight": "越靠右上越好",
|
|
262
259
|
"scatter.noData": "{x} × {y} 没有可绘制的数据",
|
|
260
|
+
"scatter.groupedBy": "按 {dim} 归类",
|
|
263
261
|
"pointsMissing.one": "{n} 个点缺数据",
|
|
264
262
|
"pointsMissing.other": "{n} 个点缺数据",
|
|
265
263
|
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
// 后两个读 attempt.o11y()(懒加载 artifact),发布时若 o11y 没随行就诚实渲染缺数据「—」,
|
|
22
22
|
// 不算 0——报告作者自己摆时心里要有这根弦,内置报告不用它们。
|
|
23
23
|
|
|
24
|
-
import type { EvalResult } from "
|
|
24
|
+
import type { EvalResult } from "../../types.ts";
|
|
25
25
|
import type { Metric } from "./types.ts";
|
|
26
26
|
|
|
27
27
|
/**
|
|
@@ -46,7 +46,7 @@ export function attemptCostUSD(result: EvalResult): number | null {
|
|
|
46
46
|
|
|
47
47
|
/**
|
|
48
48
|
* 条件答题质量:passed = 1,failed = 0,errored 记 null 不进分母。
|
|
49
|
-
*
|
|
49
|
+
* 这是「已形成可信判定」条件下的诊断指标,不能简称默认通过率
|
|
50
50
|
* (docs/feature/reports/library.md「内置指标」)。
|
|
51
51
|
*/
|
|
52
52
|
export const taskPassRate = defineMetric({
|
|
@@ -94,7 +94,7 @@ export const executionReliability = defineMetric({
|
|
|
94
94
|
*/
|
|
95
95
|
export const endToEndPassRate = defineMetric({
|
|
96
96
|
name: "end-to-end-pass-rate",
|
|
97
|
-
label: { en: "
|
|
97
|
+
label: { en: "Pass rate", "zh-CN": "通过率" },
|
|
98
98
|
description: "End-to-end composite: passed = 1, failed / errored = 0. Split blame with taskPassRate and executionReliability.",
|
|
99
99
|
better: "higher",
|
|
100
100
|
unit: "%",
|
|
@@ -3,9 +3,24 @@
|
|
|
3
3
|
// 这些不是持久化格式,没有 format / schemaVersion 信封,兼容性跟随 npm 版本
|
|
4
4
|
// (组件消费 data 时校验结构,不符按完整用户反馈报错并提示版本漂移)。
|
|
5
5
|
|
|
6
|
-
import type { AttemptHandle, Scope, ScopeWarning, Snapshot } from "
|
|
7
|
-
import type { AttemptLocator } from "
|
|
8
|
-
import type {
|
|
6
|
+
import type { AttemptHandle, Scope, ScopeWarning, Snapshot } from "../../results/types.ts";
|
|
7
|
+
import type { AttemptIdentity, AttemptLocator } from "../../results/locator.ts";
|
|
8
|
+
import type { AttemptEvidenceCapabilities } from "../../results/attempt-evidence.ts";
|
|
9
|
+
import type { AnnotatedEvalSourceSummary, AnnotatedSourceLine } from "../../results/annotated-source.ts";
|
|
10
|
+
import type {
|
|
11
|
+
AssertionResult,
|
|
12
|
+
AttemptError,
|
|
13
|
+
DiagnosticRecord,
|
|
14
|
+
ExperimentRunInfo,
|
|
15
|
+
InputRequest,
|
|
16
|
+
JsonValue,
|
|
17
|
+
PhaseTiming,
|
|
18
|
+
SourceLoc,
|
|
19
|
+
ToolName,
|
|
20
|
+
TraceSpan,
|
|
21
|
+
Usage,
|
|
22
|
+
Verdict,
|
|
23
|
+
} from "../../types.ts";
|
|
9
24
|
import type { LocalizedText, ReportLocale } from "./locale.ts";
|
|
10
25
|
|
|
11
26
|
export type { ScopeWarning };
|
|
@@ -74,20 +89,27 @@ export interface CustomDimension {
|
|
|
74
89
|
}
|
|
75
90
|
|
|
76
91
|
/**
|
|
77
|
-
* flag() / runConfig() 的产物:把 experiment 声明的 flag
|
|
78
|
-
*
|
|
79
|
-
* `(missing)`,不同原始值撞出同一显示键时计算报错并要求改用 CustomDimension。
|
|
92
|
+
* flag() / label() / runConfig() 的产物:把 experiment 声明的 flag、报告标注 label 或
|
|
93
|
+
* 顶层运行配置当分组维度。读取的落盘值可能是任意形状,分组显示键按稳定 JSON 规则生成;
|
|
94
|
+
* 缺失值显示内置文案 `(missing)`,不同原始值撞出同一显示键时计算报错并要求改用 CustomDimension。
|
|
80
95
|
*/
|
|
81
96
|
export interface DimensionRef {
|
|
82
|
-
readonly kind: "flag" | "runConfig";
|
|
97
|
+
readonly kind: "flag" | "runConfig" | "label";
|
|
83
98
|
readonly name: string;
|
|
84
99
|
readonly label?: LocalizedText;
|
|
85
100
|
readonly unit?: string;
|
|
86
101
|
}
|
|
87
102
|
|
|
88
|
-
/** 维度槽的输入:内置维度、自定义维度,或 flag() / runConfig() 的产物。 */
|
|
103
|
+
/** 维度槽的输入:内置维度、自定义维度,或 flag() / label() / runConfig() 的产物。 */
|
|
89
104
|
export type DimensionInput = BuiltInDimension | CustomDimension | DimensionRef;
|
|
90
105
|
|
|
106
|
+
/**
|
|
107
|
+
* series 类选项(MetricScatter / MetricLine / ExperimentComparison)的输入:单维度,或
|
|
108
|
+
* 非空数组解析为复合维度——name 依声明顺序以 ` × ` 连接,每个 attempt 的值为各成员显示键
|
|
109
|
+
* 以 ` · ` 连接,任一成员缺失沿用 `(missing)` 显示键参与连接(docs/feature/reports/library/metrics.md)。
|
|
110
|
+
*/
|
|
111
|
+
export type SeriesInput = DimensionInput | readonly [DimensionInput, ...DimensionInput[]];
|
|
112
|
+
|
|
91
113
|
/** MetricLine 的 x 轴:必须是数值;字符串配置显式映射,组件不猜 low < medium < high。 */
|
|
92
114
|
export interface NumericAxis {
|
|
93
115
|
name: string;
|
|
@@ -278,7 +300,7 @@ export interface VerdictTally {
|
|
|
278
300
|
}
|
|
279
301
|
|
|
280
302
|
/**
|
|
281
|
-
* 一个范围的摘要:快照时间窗、experiment / eval / attempt
|
|
303
|
+
* 一个范围的摘要:快照时间窗、experiment / eval / attempt 数、两级判定计票、端到端通过率
|
|
282
304
|
* 和总成本。eval 的身份键是 experimentId + evalId;data 恒携带两级计票,渲染面显示哪一级
|
|
283
305
|
* 由呈现 prop `votes` 决定,不改变 data(docs/feature/reports/library/summaries.md)。
|
|
284
306
|
*/
|
|
@@ -350,19 +372,6 @@ export interface TraceWaterfallRow {
|
|
|
350
372
|
spans: readonly TraceSpanSummary[];
|
|
351
373
|
}
|
|
352
374
|
|
|
353
|
-
/** 一个可比组的数据;三个子块都只消费本组快照,不能含其它父目录的引用。 */
|
|
354
|
-
export interface ExperimentComparisonGroupData {
|
|
355
|
-
/** experiment id 的完整父路径;根目录 experiment 使用完整 id。 */
|
|
356
|
-
key: string;
|
|
357
|
-
summary: ScopeSummaryData;
|
|
358
|
-
scatter: ScatterData;
|
|
359
|
-
experiments: ExperimentListItem[];
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
export interface ExperimentComparisonData {
|
|
363
|
-
groups: ExperimentComparisonGroupData[];
|
|
364
|
-
}
|
|
365
|
-
|
|
366
375
|
// ───────────────────────── 实体列表(ExperimentList / EvalList / AttemptList)─────────────────────────
|
|
367
376
|
//
|
|
368
377
|
// 三个组件按「experiment → experimentId × eval → attempt」逐级下钻,固定展示实体事实,
|
|
@@ -445,3 +454,115 @@ export interface ExperimentListItem {
|
|
|
445
454
|
lastRunAt: string;
|
|
446
455
|
evalRows: ExperimentListEvalRow[];
|
|
447
456
|
}
|
|
457
|
+
|
|
458
|
+
// ───────────────────────── Attempt 详情组件族 ─────────────────────────
|
|
459
|
+
//
|
|
460
|
+
// 11 个叶子组件的 data 契约(docs/feature/reports/library/attempt-detail.md)。每个都由
|
|
461
|
+
// 同名 `attempt*Data(evidence: AttemptEvidence)` 同步派生,不读文件、不 fetch——
|
|
462
|
+
// loadAttemptEvidence 已经一次性装配好全部证据。`AttemptSummary` 恒非空;其余在对应
|
|
463
|
+
// 能力位为空时函数返回 null,两面渲染为空输出。
|
|
464
|
+
|
|
465
|
+
/** `AttemptSummary` 的 data:身份、verdict、时间与成本——恒非空。 */
|
|
466
|
+
export interface AttemptSummaryData {
|
|
467
|
+
locator: AttemptLocator;
|
|
468
|
+
identity: AttemptIdentity;
|
|
469
|
+
verdict: Verdict;
|
|
470
|
+
startedAt?: string;
|
|
471
|
+
durationMs: number;
|
|
472
|
+
costUSD: number | null;
|
|
473
|
+
capabilities: AttemptEvidenceCapabilities;
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
/** `AttemptError` 的 data:结构化 error 一层原因 + cause + stack;没有 error 时 null。 */
|
|
477
|
+
export type AttemptErrorData = AttemptError;
|
|
478
|
+
|
|
479
|
+
/** `AttemptAssertions` 的 data:非 passed 条目默认展开,passed 按 group 折叠计数;没有 assertion 时 null。 */
|
|
480
|
+
export interface AttemptAssertionsData {
|
|
481
|
+
/** failed / unavailable / soft 全部非 passed 条目,按原始声明顺序。 */
|
|
482
|
+
attention: AssertionResult[];
|
|
483
|
+
/** passed 条目按 groupPath.join(" > ") 分组(无分组键为 ""),组内保持原始顺序。 */
|
|
484
|
+
passedGroups: { group: string; items: AssertionResult[] }[];
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
/** `AttemptSource` 的 data:AnnotatedEvalSource 的展示投影;没有 source 时 null。 */
|
|
488
|
+
export interface AttemptSourceData {
|
|
489
|
+
/** text 面拼 `niceeval show <locator> --source` 下钻命令用;web 面不需要。 */
|
|
490
|
+
locator: AttemptLocator;
|
|
491
|
+
sourcePath: string;
|
|
492
|
+
lines: AnnotatedSourceLine[];
|
|
493
|
+
unmapped: AssertionResult[];
|
|
494
|
+
summary: AnnotatedEvalSourceSummary;
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
/** `AttemptFixPrompt` 的 data:单条 attempt 的复制修复 prompt;passed/skipped 或无可操作失败时 null。 */
|
|
498
|
+
export interface AttemptFixPromptData {
|
|
499
|
+
prompt: string;
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
/** `AttemptTimeline` 的 data:runner 阶段主链 + 收尾段,以及可选的 trace(供 turn 节点按 traceId 关联 span);没有 phase 时 null。 */
|
|
503
|
+
export interface AttemptTimelineData {
|
|
504
|
+
/** text 面拼 `niceeval show <locator> --timing` 下钻命令用;web 面不需要。 */
|
|
505
|
+
locator: AttemptLocator;
|
|
506
|
+
phases: PhaseTiming[];
|
|
507
|
+
trace: TraceSpan[] | null;
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
/** `AttemptConversation` 一轮:由带 `loc` 的 user 消息开启;`loc` 缺省表示流首无位置信息的兜底轮(旧 artifact)。 */
|
|
511
|
+
export interface AttemptConversationRound {
|
|
512
|
+
loc?: SourceLoc;
|
|
513
|
+
sentText: string;
|
|
514
|
+
replies: AttemptConversationReply[];
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
/** 一轮内的回复条目;`raw` 是未识别事件类型的原样兜底,不吞没其余事件。 */
|
|
518
|
+
export type AttemptConversationReply =
|
|
519
|
+
| { kind: "assistant" | "user" | "thinking" | "error"; text: string }
|
|
520
|
+
| { kind: "tool"; callId: string; name: string; tool?: ToolName; input: JsonValue; output?: JsonValue; status?: "completed" | "failed" | "rejected" }
|
|
521
|
+
| { kind: "skill"; skill: string }
|
|
522
|
+
| { kind: "subagent"; callId: string; name: string; remoteUrl?: string; output?: JsonValue; status?: "completed" | "failed" }
|
|
523
|
+
| { kind: "input"; request: InputRequest }
|
|
524
|
+
| { kind: "compaction"; reason?: string }
|
|
525
|
+
| { kind: "raw"; raw: JsonValue };
|
|
526
|
+
|
|
527
|
+
/** `AttemptConversation` 的 data:标准事件流按 loc 分轮;没有 events 时 null。 */
|
|
528
|
+
export interface AttemptConversationData {
|
|
529
|
+
/** text 面拼 `niceeval show <locator> --execution` 下钻命令用;web 面不需要。 */
|
|
530
|
+
locator: AttemptLocator;
|
|
531
|
+
rounds: AttemptConversationRound[];
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
/** `AttemptDiagnostics` 的 data:按 lifecycle phase 分组;没有 diagnostics 时 null。 */
|
|
535
|
+
export interface AttemptDiagnosticsData {
|
|
536
|
+
groups: { phase: string; items: DiagnosticRecord[] }[];
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
/** `AttemptUsage` 的 data:token / cache token / provider usage 明细;没有 usage 时 null。 */
|
|
540
|
+
export interface AttemptUsageData {
|
|
541
|
+
usage: Usage;
|
|
542
|
+
costUSD: number | null;
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
/** `AttemptTrace` 的 data:不与 runner 节点合并的原始 OTel span 列表;没有 trace 时 null。 */
|
|
546
|
+
export interface AttemptTraceData {
|
|
547
|
+
/** text 面拼 `niceeval show <locator> --timing` 下钻命令用;web 面不需要。 */
|
|
548
|
+
locator: AttemptLocator;
|
|
549
|
+
spans: TraceSpan[];
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
/** `AttemptDiff` 一个文件的摘要:`net` 恒 !== "none"(净无变化的触碰不进这份列表)。 */
|
|
553
|
+
export interface AttemptDiffFileEntry {
|
|
554
|
+
path: string;
|
|
555
|
+
net: "added" | "modified" | "deleted";
|
|
556
|
+
/** 净行数变化(公共前后缀修剪后的近似上界,与 `niceeval show --diff` 同一算法)。 */
|
|
557
|
+
lines: { added: number; deleted: number };
|
|
558
|
+
binary?: true;
|
|
559
|
+
/** 触碰过该文件的窗口标签,按时序;供 text 面引用 `--diff` 深挖同一批窗口。 */
|
|
560
|
+
windows: string[];
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
/** `AttemptDiff` 的 data:generated / modified / deleted 的文件级摘要;没有变更时 null。 */
|
|
564
|
+
export interface AttemptDiffData {
|
|
565
|
+
/** text 面拼 `niceeval show <locator> --diff` 下钻命令用;web 面不需要。 */
|
|
566
|
+
locator: AttemptLocator;
|
|
567
|
+
files: AttemptDiffFileEntry[];
|
|
568
|
+
}
|
|
@@ -6,37 +6,62 @@
|
|
|
6
6
|
// - 组件只认「算好的可序列化数据」:零 hooks、零数据操作;
|
|
7
7
|
// - 样式随包发布:配套 ./styles.css(nre-* 稳定类名),使用者在其后加载覆盖即可;
|
|
8
8
|
// - 渐进增强脚本 ./enhance.js 可选加载,初始静态 HTML 无 JS 完整可读;
|
|
9
|
-
// - 跨块配色一致:维度键 → 稳定散列 → 固定调色板下标(colors.ts)。
|
|
9
|
+
// - 跨块配色一致:维度键 → 稳定散列 → 固定调色板下标(../assets/colors.ts)。
|
|
10
10
|
|
|
11
|
-
export { AttemptList } from "
|
|
12
|
-
export { EvalList } from "
|
|
13
|
-
export { ExperimentList } from "
|
|
14
|
-
export { ScopeSummary } from "
|
|
15
|
-
export {
|
|
16
|
-
export {
|
|
17
|
-
export {
|
|
18
|
-
export {
|
|
19
|
-
export {
|
|
20
|
-
export {
|
|
21
|
-
export {
|
|
22
|
-
export { Scoreboard } from "./Scoreboard.tsx";
|
|
11
|
+
export { AttemptList } from "../components/entity-lists/AttemptList.tsx";
|
|
12
|
+
export { EvalList } from "../components/entity-lists/EvalList.tsx";
|
|
13
|
+
export { ExperimentList } from "../components/entity-lists/ExperimentList.tsx";
|
|
14
|
+
export { ScopeSummary } from "../components/summaries/ScopeSummary.tsx";
|
|
15
|
+
export { MetricTable } from "../components/metric-views/MetricTable.tsx";
|
|
16
|
+
export { MetricMatrix } from "../components/metric-views/MetricMatrix.tsx";
|
|
17
|
+
export { MetricBars } from "../components/metric-views/MetricBars.tsx";
|
|
18
|
+
export { MetricScatter } from "../components/metric-views/MetricScatter.tsx";
|
|
19
|
+
export { MetricLine } from "../components/metric-views/MetricLine.tsx";
|
|
20
|
+
export { DeltaTable } from "../components/metric-views/DeltaTable.tsx";
|
|
21
|
+
export { Scoreboard } from "../components/metric-views/Scoreboard.tsx";
|
|
23
22
|
|
|
24
23
|
// 站点组件的纯 web 面(data 形态;Hero 是组合组件,只住 niceeval/report)
|
|
25
|
-
export { HeroCard } from "
|
|
26
|
-
export { PoweredBy } from "
|
|
27
|
-
export { ScopeWarnings } from "
|
|
28
|
-
export { CopyFixPrompt } from "
|
|
29
|
-
export { TraceWaterfall } from "
|
|
24
|
+
export { HeroCard } from "../components/site-components/HeroCard.tsx";
|
|
25
|
+
export { PoweredBy } from "../components/site-components/PoweredBy.tsx";
|
|
26
|
+
export { ScopeWarnings } from "../components/site-components/ScopeWarnings.tsx";
|
|
27
|
+
export { CopyFixPrompt } from "../components/site-components/CopyFixPrompt.tsx";
|
|
28
|
+
export { TraceWaterfall } from "../components/site-components/TraceWaterfall.tsx";
|
|
30
29
|
|
|
31
|
-
//
|
|
30
|
+
// Attempt 详情组件族的纯 web 面(data 形态;AttemptAssessment / AttemptDetail 是组合组件,
|
|
31
|
+
// 不产生新渲染面,只住 niceeval/report)
|
|
32
|
+
export { AttemptSummary } from "../components/attempt-detail/AttemptSummary.tsx";
|
|
33
|
+
export { AttemptError } from "../components/attempt-detail/AttemptError.tsx";
|
|
34
|
+
export { AttemptAssertions } from "../components/attempt-detail/AttemptAssertions.tsx";
|
|
35
|
+
export { AttemptSource } from "../components/attempt-detail/AttemptSource.tsx";
|
|
36
|
+
export { AttemptFixPrompt } from "../components/attempt-detail/AttemptFixPrompt.tsx";
|
|
37
|
+
export { AttemptTimeline } from "../components/attempt-detail/AttemptTimeline.tsx";
|
|
38
|
+
export { AttemptConversation } from "../components/attempt-detail/AttemptConversation.tsx";
|
|
39
|
+
export { AttemptDiagnostics } from "../components/attempt-detail/AttemptDiagnostics.tsx";
|
|
40
|
+
export { AttemptUsage } from "../components/attempt-detail/AttemptUsage.tsx";
|
|
41
|
+
export { AttemptTrace } from "../components/attempt-detail/AttemptTrace.tsx";
|
|
42
|
+
export { AttemptDiff } from "../components/attempt-detail/AttemptDiff.tsx";
|
|
43
|
+
|
|
44
|
+
// 数据契约类型(家在 ../model/types.ts,「算」与「画」两侧共用同一份)
|
|
32
45
|
export type {
|
|
46
|
+
AttemptAssertionsData,
|
|
47
|
+
AttemptConversationData,
|
|
48
|
+
AttemptConversationReply,
|
|
49
|
+
AttemptConversationRound,
|
|
50
|
+
AttemptDiagnosticsData,
|
|
51
|
+
AttemptDiffData,
|
|
52
|
+
AttemptDiffFileEntry,
|
|
53
|
+
AttemptErrorData,
|
|
54
|
+
AttemptFixPromptData,
|
|
33
55
|
AttemptListItem,
|
|
34
56
|
AttemptLocator,
|
|
57
|
+
AttemptSourceData,
|
|
58
|
+
AttemptSummaryData,
|
|
59
|
+
AttemptTimelineData,
|
|
60
|
+
AttemptTraceData,
|
|
61
|
+
AttemptUsageData,
|
|
35
62
|
CopyFixPromptData,
|
|
36
63
|
DeltaData,
|
|
37
64
|
EvalListItem,
|
|
38
|
-
ExperimentComparisonData,
|
|
39
|
-
ExperimentComparisonGroupData,
|
|
40
65
|
ExperimentListEvalRow,
|
|
41
66
|
ExperimentListItem,
|
|
42
67
|
HeroData,
|
|
@@ -52,11 +77,12 @@ export type {
|
|
|
52
77
|
TraceSpanSummary,
|
|
53
78
|
TraceWaterfallRow,
|
|
54
79
|
VerdictTally,
|
|
55
|
-
} from "../types.ts";
|
|
80
|
+
} from "../model/types.ts";
|
|
81
|
+
export type { AttemptEvidence, AttemptEvidenceCapabilities } from "../../results/attempt-evidence.ts";
|
|
56
82
|
|
|
57
|
-
// locale(官方组件 chrome
|
|
58
|
-
export { DEFAULT_REPORT_LOCALE, resolveLocalizedText, resolveMetricLabel } from "../locale.ts";
|
|
59
|
-
export type { LocalizedText, ReportLocale } from "../locale.ts";
|
|
83
|
+
// locale(官方组件 chrome 文案的语言;LocalizedText 的按 locale 解析也用它)
|
|
84
|
+
export { DEFAULT_REPORT_LOCALE, resolveLocalizedText, resolveMetricLabel } from "../model/locale.ts";
|
|
85
|
+
export type { LocalizedText, ReportLocale } from "../model/locale.ts";
|
|
60
86
|
|
|
61
87
|
// 稳定配色(自定义组件想与官方组件同键同色时用;seriesClassForKey 配 CSS 的 --nre-series)
|
|
62
|
-
export { NRE_PALETTE, colorClassForKey, colorHexForKey, colorIndexForKey, seriesClassForKey } from "
|
|
88
|
+
export { NRE_PALETTE, colorClassForKey, colorHexForKey, colorIndexForKey, seriesClassForKey } from "../assets/colors.ts";
|