niceeval 0.9.0 → 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 +15 -7
- 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} +44 -12
- package/dist/report/{tree.js → definition/tree.js} +10 -12
- 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 +12 -2
- 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 +15 -1
- package/dist/shared/aggregate.js +32 -1
- 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 +43 -19
- 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 +11 -5
- 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 +59 -50
- 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 +77 -64
- package/src/context/types.ts +21 -21
- package/src/define.ts +13 -0
- package/src/i18n/en.ts +30 -15
- package/src/i18n/zh-CN.ts +30 -15
- 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 +136 -112
- 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} +58 -22
- 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 +54 -3
- package/src/results/select.ts +30 -6
- 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 +30 -1
- 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 +58 -22
- package/src/show/render.ts +16 -240
- package/src/show/show.test.ts +128 -35
- package/src/view/app/App.test.tsx +8 -7
- package/src/view/app/App.tsx +135 -51
- 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 +122 -89
- package/src/view/index.ts +3 -13
- package/src/view/server.ts +36 -6
- 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 +18 -806
- package/src/view/view-report.test.ts +182 -34
- 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
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
// cases: docs/engineering/unit-tests/reports/cases.md
|
|
2
|
+
// "validate*Data 递归覆盖到嵌套字段" 行:attempt-detail 十一个叶子的 validate*Data 表驱动字段突变覆盖,重点是 AttemptConversationData
|
|
3
|
+
// 的 AttemptConversationReply 判别联合(每个 kind 分支各自的必填字段)与其余嵌套结构
|
|
4
|
+
// (AttemptIdentity / AssertionResult 判别联合 / TraceSpan / AttemptDiffFileEntry 的 net 枚举)。
|
|
5
|
+
|
|
6
|
+
import { describe, expect, it } from "vitest";
|
|
7
|
+
import {
|
|
8
|
+
validateAssertionsData,
|
|
9
|
+
validateConversationData,
|
|
10
|
+
validateDiagnosticsData,
|
|
11
|
+
validateDiffData,
|
|
12
|
+
validateErrorData,
|
|
13
|
+
validateSourceData,
|
|
14
|
+
validateSummaryData,
|
|
15
|
+
validateTimelineData,
|
|
16
|
+
validateTraceData,
|
|
17
|
+
validateUsageData,
|
|
18
|
+
} from "./index.tsx";
|
|
19
|
+
|
|
20
|
+
const validIdentity = { experimentId: "compare/codex", snapshotStartedAt: "2026-07-01T00:00:00Z", evalId: "q1", attempt: 0 };
|
|
21
|
+
const validCapabilities = { source: true, execution: true, timing: false, diff: false };
|
|
22
|
+
|
|
23
|
+
describe("validateSummaryData", () => {
|
|
24
|
+
const valid = {
|
|
25
|
+
locator: "@1abcdef2",
|
|
26
|
+
identity: validIdentity,
|
|
27
|
+
verdict: "passed",
|
|
28
|
+
durationMs: 1000,
|
|
29
|
+
costUSD: 0.01,
|
|
30
|
+
capabilities: validCapabilities,
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
it("合规 literal 通过", () => {
|
|
34
|
+
expect(validateSummaryData(valid)).toBeNull();
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
it("costUSD 为 null 合法(缺失不冒充 0)", () => {
|
|
38
|
+
expect(validateSummaryData({ ...valid, costUSD: null })).toBeNull();
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
it("identity 缺 snapshotStartedAt 报错定位到嵌套字段", () => {
|
|
42
|
+
const bad = { ...valid, identity: { experimentId: "compare/codex", evalId: "q1", attempt: 0 } };
|
|
43
|
+
expect(validateSummaryData(bad)).toMatch(/"identity\.snapshotStartedAt"/);
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
it("capabilities.timing 非布尔报错", () => {
|
|
47
|
+
const bad = { ...valid, capabilities: { ...validCapabilities, timing: "false" } };
|
|
48
|
+
expect(validateSummaryData(bad)).toMatch(/"capabilities\.timing"/);
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
describe("validateErrorData", () => {
|
|
53
|
+
const valid = { code: "unexpected-error", message: "boom", phase: "eval.run" };
|
|
54
|
+
|
|
55
|
+
it("合规 literal 通过", () => {
|
|
56
|
+
expect(validateErrorData(valid)).toBeNull();
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
it("缺 phase 报错", () => {
|
|
60
|
+
expect(validateErrorData({ code: "x", message: "boom" })).toMatch(/"phase"/);
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
describe("validateAssertionsData", () => {
|
|
65
|
+
const passed = { name: "eq", severity: "gate", outcome: "passed", score: 1 };
|
|
66
|
+
const unavailable = { name: "judge", severity: "soft", outcome: "unavailable", reason: "judge-model-unresolved" };
|
|
67
|
+
|
|
68
|
+
it("合规 literal 通过(含 unavailable 分支)", () => {
|
|
69
|
+
const valid = { attention: [unavailable], passedGroups: [{ group: "", items: [passed] }] };
|
|
70
|
+
expect(validateAssertionsData(valid)).toBeNull();
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
it("passed/failed 分支缺 score 报错", () => {
|
|
74
|
+
const bad = { attention: [{ name: "eq", severity: "gate", outcome: "passed" }], passedGroups: [] };
|
|
75
|
+
expect(validateAssertionsData(bad)).toMatch(/"attention\[0\]\.score"/);
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
it("unavailable 分支缺 reason 报错", () => {
|
|
79
|
+
const bad = { attention: [{ name: "judge", severity: "soft", outcome: "unavailable" }], passedGroups: [] };
|
|
80
|
+
expect(validateAssertionsData(bad)).toMatch(/"attention\[0\]\.reason"/);
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
it("outcome 不在判别集合内报错", () => {
|
|
84
|
+
const bad = { attention: [{ name: "eq", severity: "gate", outcome: "flaky", score: 1 }], passedGroups: [] };
|
|
85
|
+
expect(validateAssertionsData(bad)).toMatch(/"attention\[0\]\.outcome"/);
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
it("passedGroups[i].items 嵌套断言报错定位到分组内下标", () => {
|
|
89
|
+
const bad = { attention: [], passedGroups: [{ group: "setup", items: [{ name: "eq", severity: "gate" }] }] };
|
|
90
|
+
expect(validateAssertionsData(bad)).toMatch(/"passedGroups\[0\]\.items\[0\]\.outcome"/);
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
describe("validateSourceData", () => {
|
|
95
|
+
const validSummary = {
|
|
96
|
+
totalAssertions: 1,
|
|
97
|
+
mappedAssertions: 1,
|
|
98
|
+
unmappedAssertions: 0,
|
|
99
|
+
passed: 1,
|
|
100
|
+
failed: 0,
|
|
101
|
+
gate: 1,
|
|
102
|
+
soft: 0,
|
|
103
|
+
totalLines: 10,
|
|
104
|
+
annotatedLines: 1,
|
|
105
|
+
};
|
|
106
|
+
const valid = {
|
|
107
|
+
locator: "@1abcdef2",
|
|
108
|
+
sourcePath: "eval.ts",
|
|
109
|
+
lines: [{ line: 1, text: "t.send(...)", assertions: [], sends: [] }],
|
|
110
|
+
unmapped: [],
|
|
111
|
+
summary: validSummary,
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
it("合规 literal 通过", () => {
|
|
115
|
+
expect(validateSourceData(valid)).toBeNull();
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
it("summary 缺 totalLines 报错", () => {
|
|
119
|
+
const bad = { ...valid, summary: { ...validSummary, totalLines: undefined } };
|
|
120
|
+
expect(validateSourceData(bad)).toMatch(/"summary\.totalLines"/);
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
it("summary 缺 annotatedLines 报错", () => {
|
|
124
|
+
const bad = { ...valid, summary: { ...validSummary, annotatedLines: undefined } };
|
|
125
|
+
expect(validateSourceData(bad)).toMatch(/"summary\.annotatedLines"/);
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
it("lines[i].assertions 嵌套断言结构错误报错", () => {
|
|
129
|
+
const bad = { ...valid, lines: [{ line: 1, text: "x", assertions: [{ name: "eq" }], sends: [] }] };
|
|
130
|
+
expect(validateSourceData(bad)).toMatch(/"lines\[0\]\.assertions\[0\]\.severity"/);
|
|
131
|
+
});
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
describe("validateTimelineData", () => {
|
|
135
|
+
const valid = { locator: "@1abcdef2", phases: [{ name: "eval.run", durationMs: 500 }], trace: null };
|
|
136
|
+
|
|
137
|
+
it("合规 literal 通过(trace 为 null)", () => {
|
|
138
|
+
expect(validateTimelineData(valid)).toBeNull();
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
it("trace 为数组时逐项校验 TraceSpan", () => {
|
|
142
|
+
const bad = { ...valid, trace: [{ traceId: "t1", spanId: "s1", name: "turn", startMs: 0 }] };
|
|
143
|
+
expect(validateTimelineData(bad)).toMatch(/"trace\[0\]\.endMs"/);
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
it("phases[i] 缺 durationMs 报错", () => {
|
|
147
|
+
const bad = { ...valid, phases: [{ name: "eval.run" }] };
|
|
148
|
+
expect(validateTimelineData(bad)).toMatch(/"phases\[0\]\.durationMs"/);
|
|
149
|
+
});
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
describe("validateConversationData — AttemptConversationReply 判别联合", () => {
|
|
153
|
+
const valid = {
|
|
154
|
+
locator: "@1abcdef2",
|
|
155
|
+
rounds: [{ sentText: "go", replies: [{ kind: "assistant", text: "ok" }] }],
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
it("合规 literal 通过", () => {
|
|
159
|
+
expect(validateConversationData(valid)).toBeNull();
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
it.each([
|
|
163
|
+
["assistant", { kind: "assistant" }, /"rounds\[0\]\.replies\[0\]\.text"/],
|
|
164
|
+
["tool 缺 callId", { kind: "tool", name: "shell", input: "ls" }, /"rounds\[0\]\.replies\[0\]\.callId"/],
|
|
165
|
+
["tool 缺 input", { kind: "tool", callId: "c1", name: "shell" }, /"rounds\[0\]\.replies\[0\]\.input"/],
|
|
166
|
+
["skill 缺 skill", { kind: "skill" }, /"rounds\[0\]\.replies\[0\]\.skill"/],
|
|
167
|
+
["subagent 缺 name", { kind: "subagent", callId: "c1" }, /"rounds\[0\]\.replies\[0\]\.name"/],
|
|
168
|
+
["input 缺 request", { kind: "input" }, /"rounds\[0\]\.replies\[0\]\.request"/],
|
|
169
|
+
["raw 缺 raw", { kind: "raw" }, /"rounds\[0\]\.replies\[0\]\.raw"/],
|
|
170
|
+
["未知 kind", { kind: "unknown-future-kind" }, /"rounds\[0\]\.replies\[0\]\.kind"/],
|
|
171
|
+
])("%s 报错定位到具体缺失字段", (_label, reply, expected) => {
|
|
172
|
+
const bad = { locator: "@1abcdef2", rounds: [{ sentText: "go", replies: [reply] }] };
|
|
173
|
+
expect(validateConversationData(bad)).toMatch(expected);
|
|
174
|
+
});
|
|
175
|
+
|
|
176
|
+
it("compaction 分支无必填字段,裸 { kind: 'compaction' } 合法", () => {
|
|
177
|
+
const ok = { locator: "@1abcdef2", rounds: [{ sentText: "go", replies: [{ kind: "compaction" }] }] };
|
|
178
|
+
expect(validateConversationData(ok)).toBeNull();
|
|
179
|
+
});
|
|
180
|
+
|
|
181
|
+
it("round.loc 存在时校验 SourceLoc 结构;省略 loc 合法(流首无位置信息的兜底轮)", () => {
|
|
182
|
+
expect(validateConversationData(valid)).toBeNull();
|
|
183
|
+
const withLoc = { locator: "@1abcdef2", rounds: [{ loc: { file: "eval.ts", line: 3 }, sentText: "go", replies: [] }] };
|
|
184
|
+
expect(validateConversationData(withLoc)).toBeNull();
|
|
185
|
+
const badLoc = { locator: "@1abcdef2", rounds: [{ loc: { file: "eval.ts" }, sentText: "go", replies: [] }] };
|
|
186
|
+
expect(validateConversationData(badLoc)).toMatch(/"rounds\[0\]\.loc\.line"/);
|
|
187
|
+
});
|
|
188
|
+
});
|
|
189
|
+
|
|
190
|
+
describe("validateDiagnosticsData", () => {
|
|
191
|
+
it("合规 literal 通过", () => {
|
|
192
|
+
const valid = { groups: [{ phase: "eval.run", items: [{ code: "x", level: "warning", message: "m", phase: "eval.run" }] }] };
|
|
193
|
+
expect(validateDiagnosticsData(valid)).toBeNull();
|
|
194
|
+
});
|
|
195
|
+
|
|
196
|
+
it("level 不在 warning/error 内报错", () => {
|
|
197
|
+
const bad = { groups: [{ phase: "eval.run", items: [{ code: "x", level: "info", message: "m", phase: "eval.run" }] }] };
|
|
198
|
+
expect(validateDiagnosticsData(bad)).toMatch(/"groups\[0\]\.items\[0\]\.level"/);
|
|
199
|
+
});
|
|
200
|
+
});
|
|
201
|
+
|
|
202
|
+
describe("validateUsageData", () => {
|
|
203
|
+
it("合规 literal 通过,costUSD 为 null 合法", () => {
|
|
204
|
+
expect(validateUsageData({ usage: { inputTokens: 1, outputTokens: 2 }, costUSD: null })).toBeNull();
|
|
205
|
+
});
|
|
206
|
+
|
|
207
|
+
it("usage 缺 outputTokens 报错", () => {
|
|
208
|
+
expect(validateUsageData({ usage: { inputTokens: 1 }, costUSD: null })).toMatch(/"usage\.outputTokens"/);
|
|
209
|
+
});
|
|
210
|
+
});
|
|
211
|
+
|
|
212
|
+
describe("validateTraceData", () => {
|
|
213
|
+
it("spans[i] 缺 spanId 报错", () => {
|
|
214
|
+
const bad = { locator: "@1abcdef2", spans: [{ traceId: "t1", name: "turn", startMs: 0, endMs: 1 }] };
|
|
215
|
+
expect(validateTraceData(bad)).toMatch(/"spans\[0\]\.spanId"/);
|
|
216
|
+
});
|
|
217
|
+
});
|
|
218
|
+
|
|
219
|
+
describe("validateDiffData", () => {
|
|
220
|
+
const valid = { locator: "@1abcdef2", files: [{ path: "a.ts", net: "modified", lines: { added: 1, deleted: 0 }, windows: ["s1/t1"] }] };
|
|
221
|
+
|
|
222
|
+
it("合规 literal 通过", () => {
|
|
223
|
+
expect(validateDiffData(valid)).toBeNull();
|
|
224
|
+
});
|
|
225
|
+
|
|
226
|
+
it("net 不在三态枚举内报错", () => {
|
|
227
|
+
const bad = { ...valid, files: [{ ...valid.files[0], net: "none" }] };
|
|
228
|
+
expect(validateDiffData(bad)).toMatch(/"files\[0\]\.net"/);
|
|
229
|
+
});
|
|
230
|
+
|
|
231
|
+
it("lines 结构错误报错", () => {
|
|
232
|
+
const bad = { ...valid, files: [{ ...valid.files[0], lines: { added: 1 } }] };
|
|
233
|
+
expect(validateDiffData(bad)).toMatch(/"files\[0\]\.lines"/);
|
|
234
|
+
});
|
|
235
|
+
});
|
|
@@ -3,18 +3,21 @@
|
|
|
3
3
|
// 纯渲染、零 hooks;交互只有普通 <a>(下钻由使用者的 attemptHref 决定去处)。
|
|
4
4
|
|
|
5
5
|
import type { ReactElement } from "react";
|
|
6
|
-
import type { MetricCell } from "../types.ts";
|
|
6
|
+
import type { MetricCell } from "../model/types.ts";
|
|
7
7
|
import type { AttemptLocator } from "../../results/locator.ts";
|
|
8
|
-
import { DEFAULT_REPORT_LOCALE, localeText, resolveLocalizedText, type ReportLocale } from "../locale.ts";
|
|
8
|
+
import { DEFAULT_REPORT_LOCALE, localeText, resolveLocalizedText, type ReportLocale } from "../model/locale.ts";
|
|
9
9
|
|
|
10
10
|
export function MetricCellView({
|
|
11
11
|
cell,
|
|
12
12
|
attemptHref,
|
|
13
13
|
locale = DEFAULT_REPORT_LOCALE,
|
|
14
|
+
showCoverage = true,
|
|
14
15
|
}: {
|
|
15
16
|
cell: MetricCell;
|
|
16
17
|
attemptHref?: (locator: AttemptLocator) => string;
|
|
17
18
|
locale?: ReportLocale;
|
|
19
|
+
/** 默认用紧凑角标显示覆盖率;已有展开说明的摘要卡可关闭角标。 */
|
|
20
|
+
showCoverage?: boolean;
|
|
18
21
|
}): ReactElement {
|
|
19
22
|
// 全 null(没有任何有效样本)→ 缺数据文案,绝不画 0;total 仍如实入 title
|
|
20
23
|
if (cell.value === null) {
|
|
@@ -35,7 +38,7 @@ export function MetricCellView({
|
|
|
35
38
|
{resolveLocalizedText(cell.display, locale)}
|
|
36
39
|
</span>
|
|
37
40
|
{/* samples < total:有 attempt 测不了这个指标,覆盖率角标如实标出 */}
|
|
38
|
-
{cell.samples < cell.total && (
|
|
41
|
+
{showCoverage && cell.samples < cell.total && (
|
|
39
42
|
<sup
|
|
40
43
|
className="nre-coverage"
|
|
41
44
|
title={localeText(locale, "cell.coverageTitle", { samples: cell.samples, total: cell.total })}
|