niceeval 0.13.0 → 0.13.2-canary.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/INDEX.md +1 -0
- package/README.md +9 -10
- package/README.zh.md +9 -10
- package/dist/agents/ai-sdk.cjs.map +1 -1
- package/dist/agents/ai-sdk.d.cts +1 -1
- package/dist/agents/ai-sdk.d.mts +1 -1
- package/dist/agents/ai-sdk.d.ts +1 -1
- package/dist/agents/coding-cli-versions.cjs +10 -1
- package/dist/agents/coding-cli-versions.cjs.map +1 -1
- package/dist/agents/coding-cli-versions.d.cts +8 -3
- package/dist/agents/coding-cli-versions.d.mts +8 -3
- package/dist/agents/coding-cli-versions.d.ts +8 -3
- package/dist/agents/coding-cli-versions.js +18 -12
- package/dist/agents/deepseek-harness.cjs +103 -0
- package/dist/agents/deepseek-harness.cjs.map +1 -0
- package/dist/agents/deepseek-harness.d.cts +12 -0
- package/dist/agents/deepseek-harness.d.mts +12 -0
- package/dist/agents/deepseek-harness.d.ts +12 -0
- package/dist/agents/deepseek-harness.js +7 -0
- package/dist/agents/deepseek-harness.js.map +1 -0
- package/dist/agents/index.cjs +5 -1
- package/dist/agents/index.cjs.map +1 -1
- package/dist/agents/index.d.cts +4 -0
- package/dist/agents/index.d.mts +4 -0
- package/dist/agents/index.d.ts +4 -0
- package/dist/agents/index.js +54 -50
- package/dist/agents/index.mjs +54 -50
- package/dist/agents/omp.cjs +170 -0
- package/dist/agents/omp.cjs.map +1 -0
- package/dist/agents/omp.d.cts +14 -0
- package/dist/agents/omp.d.mts +14 -0
- package/dist/agents/omp.d.ts +14 -0
- package/dist/agents/omp.js +7 -0
- package/dist/agents/omp.js.map +1 -0
- package/dist/agents/types.cjs.map +1 -1
- package/dist/agents/types.d.cts +2 -2
- package/dist/agents/types.d.mts +2 -2
- package/dist/agents/types.d.ts +2 -2
- package/dist/analysis/api.cjs +9 -1
- package/dist/analysis/api.cjs.map +1 -1
- package/dist/analysis/api.d.cts +21 -0
- package/dist/analysis/api.d.mts +21 -0
- package/dist/analysis/api.d.ts +21 -0
- package/dist/analysis/api.js +8 -6
- package/dist/cli.cjs +10 -1
- package/dist/cli.cjs.map +1 -1
- package/dist/i18n/en.cjs +7 -2
- package/dist/i18n/en.cjs.map +1 -1
- package/dist/i18n/en.d.cts +7 -2
- package/dist/i18n/en.d.mts +7 -2
- package/dist/i18n/en.d.ts +7 -2
- package/dist/o11y/parsers/hermes.cjs +1 -1
- package/dist/o11y/parsers/hermes.cjs.map +1 -1
- package/dist/report/built-in/analysis-values.cjs +21 -5
- package/dist/report/built-in/analysis-values.cjs.map +1 -1
- package/dist/report/built-in/analysis-values.d.cts +11 -9
- package/dist/report/built-in/analysis-values.d.mts +11 -9
- package/dist/report/built-in/analysis-values.d.ts +11 -9
- package/dist/report/built-in/overview.cjs +1 -0
- package/dist/report/built-in/overview.cjs.map +1 -1
- package/dist/report/built-in/result-components.cjs +58 -12
- package/dist/report/built-in/result-components.cjs.map +1 -1
- package/dist/report/built-in/result-components.d.cts +15 -0
- package/dist/report/built-in/result-components.d.mts +15 -0
- package/dist/report/built-in/result-components.d.ts +15 -0
- package/dist/report/built-in/run-membership-overview.cjs +100 -4
- package/dist/report/built-in/run-membership-overview.cjs.map +1 -1
- package/dist/report/built-in/standard.cjs +1 -0
- package/dist/report/built-in/standard.cjs.map +1 -1
- package/dist/report/built-in/standard.d.cts +1 -0
- package/dist/report/built-in/standard.d.mts +1 -0
- package/dist/report/built-in/standard.d.ts +1 -0
- package/dist/report/components/entity-lists/compute.cjs +40 -3
- package/dist/report/components/entity-lists/compute.cjs.map +1 -1
- package/dist/report/components/entity-lists/compute.d.cts +8 -6
- package/dist/report/components/entity-lists/compute.d.mts +8 -6
- package/dist/report/components/entity-lists/compute.d.ts +8 -6
- package/dist/report/components/entity-lists/content.cjs +31 -6
- package/dist/report/components/entity-lists/content.cjs.map +1 -1
- package/dist/report/components/entity-lists/index.cjs +3 -2
- package/dist/report/components/entity-lists/index.cjs.map +1 -1
- package/dist/report/components/entity-lists/index.d.cts +1 -1
- package/dist/report/components/entity-lists/index.d.mts +1 -1
- package/dist/report/components/entity-lists/index.d.ts +1 -1
- package/dist/report/definition/cell.cjs +3 -0
- package/dist/report/definition/cell.cjs.map +1 -1
- package/dist/report/definition/cell.d.cts +2 -0
- package/dist/report/definition/cell.d.mts +2 -0
- package/dist/report/definition/cell.d.ts +2 -0
- package/dist/report/definition/primitives.cjs +9 -2
- package/dist/report/definition/primitives.cjs.map +1 -1
- package/dist/report/execution/machine.cjs +1 -1
- package/dist/report/execution/machine.cjs.map +1 -1
- package/dist/report/host/execute.cjs +14 -4
- package/dist/report/host/execute.cjs.map +1 -1
- package/dist/report/host/execute.d.cts +5 -0
- package/dist/report/host/execute.d.mts +5 -0
- package/dist/report/host/execute.d.ts +5 -0
- package/dist/report/host/from-record.cjs +6 -1
- package/dist/report/host/from-record.cjs.map +1 -1
- package/dist/report/host/from-record.d.cts +5 -0
- package/dist/report/host/from-record.d.mts +5 -0
- package/dist/report/host/from-record.d.ts +5 -0
- package/dist/report/runtime/resolved-page.cjs +16 -6
- package/dist/report/runtime/resolved-page.cjs.map +1 -1
- package/dist/report/runtime/resolved-page.d.cts +3 -0
- package/dist/report/runtime/resolved-page.d.mts +3 -0
- package/dist/report/runtime/resolved-page.d.ts +3 -0
- package/dist/report/runtime/text.cjs +1 -0
- package/dist/report/runtime/text.cjs.map +1 -1
- package/dist/report/runtime/text.d.cts +4 -0
- package/dist/report/runtime/text.d.mts +4 -0
- package/dist/report/runtime/text.d.ts +4 -0
- package/dist/runner/feedback/human.cjs +180 -16
- package/dist/runner/feedback/human.cjs.map +1 -1
- package/dist/runner/run.cjs +43 -0
- package/dist/runner/run.cjs.map +1 -1
- package/dist/sample/capability.cjs +93 -0
- package/dist/sample/capability.cjs.map +1 -1
- package/dist/sample/capability.d.cts +3 -1
- package/dist/sample/capability.d.mts +3 -1
- package/dist/sample/capability.d.ts +3 -1
- package/dist/sample/capability.js +8 -6
- package/dist/sandbox/docker-agent-image.cjs +5 -1
- package/dist/sandbox/docker-agent-image.cjs.map +1 -1
- package/dist/sandbox/docker-agent-image.d.cts +2 -0
- package/dist/sandbox/docker-agent-image.d.mts +2 -0
- package/dist/sandbox/docker-agent-image.d.ts +2 -0
- package/dist/sandbox/docker-agent-image.js +14 -10
- package/dist/sandbox/index.cjs +4 -2
- package/dist/sandbox/index.cjs.map +1 -1
- package/dist/sandbox/index.d.cts +1 -1
- package/dist/sandbox/index.d.mts +1 -1
- package/dist/sandbox/index.d.ts +1 -1
- package/dist/sandbox/index.js +120 -116
- package/dist/sandbox/index.mjs +120 -116
- package/docs-site/images/hitl-handshake-zh.svg +3 -3
- package/docs-site/zh/examples/integrations/ai-sdk-v7.mdx +3 -3
- package/docs-site/zh/examples/integrations/claude-sdk.mdx +3 -3
- package/docs-site/zh/examples/integrations/codex-sdk.mdx +5 -5
- package/docs-site/zh/examples/integrations/langgraph.mdx +3 -3
- package/docs-site/zh/examples/integrations/pi-sdk.mdx +5 -5
- package/docs-site/zh/explanation/adapter.mdx +5 -5
- package/docs-site/zh/explanation/assert.mdx +1 -1
- package/docs-site/zh/explanation/drive.mdx +3 -1
- package/docs-site/zh/explanation/evals.mdx +3 -1
- package/docs-site/zh/explanation/hitl.mdx +7 -7
- package/docs-site/zh/explanation/runner.mdx +2 -2
- package/docs-site/zh/index.mdx +2 -2
- package/docs-site/zh/reference/builtin-agents.mdx +4 -4
- package/docs-site/zh/reference/capabilities.mdx +1 -1
- package/docs-site/zh/reference/cli.mdx +14 -14
- package/docs-site/zh/reference/events.mdx +11 -11
- package/docs-site/zh/reference/official-adapters.mdx +1 -1
- package/docs-site/zh/reference/results-data.mdx +6 -0
- package/docs-site/zh/troubleshooting/debugging.mdx +2 -2
- package/docs-site/zh/tutorials/agent-feedback-loop.mdx +2 -2
- package/docs-site/zh/tutorials/ci-integration.mdx +1 -1
- package/docs-site/zh/tutorials/connect-your-agent.mdx +2 -2
- package/docs-site/zh/tutorials/custom-reports.mdx +4 -4
- package/docs-site/zh/tutorials/deploy-report-site.mdx +3 -3
- package/docs-site/zh/tutorials/docker-in-docker.mdx +3 -0
- package/docs-site/zh/tutorials/experiments.mdx +2 -2
- package/docs-site/zh/tutorials/handle-execution-failures.mdx +1 -1
- package/docs-site/zh/tutorials/install-custom-sandbox-agent.mdx +1 -1
- package/docs-site/zh/tutorials/nixos-managed-dind.mdx +160 -0
- package/docs-site/zh/tutorials/publish-report.mdx +4 -4
- package/docs-site/zh/tutorials/reporters.mdx +1 -1
- package/docs-site/zh/tutorials/rerun-and-cache.mdx +16 -0
- package/docs-site/zh/tutorials/viewing-results.mdx +28 -10
- package/docs-site/zh/tutorials/write-send.mdx +7 -6
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standard.js","sourceRoot":"","sources":["standard.tsx"],"names":[],"mappings":";;;;AASA,gEAAmD;AACnD,qEAAwE;AACxE,sEAA8E;AAC9E,4DAAiE;AACjE,sDAA6G;AAE7G,6DAAgM;AAChM,kEAAgK;AAChK,6CAA+E;AA4B/E,SAAS,QAAQ,CAAC,QAAwB;IACtC,MAAM,MAAM,GAAG,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAgB,CAAC,OAAO,EAAE,GAAG,EAAE,EAAE,CAAC,OAAO,KAAK,IAAI,IAAI,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IAClK,OAAO,MAAM,CAAC,MAAM,CAAC;QACjB,eAAe,EAAE,MAAM,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE;QACxE,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC,MAAM;KAC7B,CAAC,CAAC;AACP,CA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C,uBAAC,kDAA0B,OAAK,KAAK,GAAG;CACvB,CAAC;AACtE,qEAAqE;AACxD,QAAA,QAAQ,GAAG,IAAA,gCAAmB,EAAC,sCAAyB,CAAC,QAAQ,EAAE;IAC5E,KAAK,EAAE,0BAA0B;IACjC,KAAK,EAAE;QACH,4BAAoB;QACpB,4BAAoB;QACpB,0BAAkB;QAClB,2BAAmB;QACnB,8BAAsB;KACzB;CACJ,CAAC,CAAC;AACH,kBAAe,gBAAQ,CAAC","sourcesContent":["/**\n * The standard information architecture.\n *\n * Detail Pages are deliberately listed here. `defineReport()` receives no\n * library page collection, so a consumer's arbitrary custom Report never\n * gains attempt or experiment routes as an implicit side effect.\n */\nimport type { ExperimentId, Sample, SampleSnapshot, } from \"../../analysis/index.ts\";\nimport type { Page, PageEvidence, } from \"../definition/report.ts\";\nimport { Col } from \"../definition/primitives.tsx\";\nimport { AttemptDetails } from \"../components/attempt-detail/index.tsx\";\nimport { Hero, type HeroData } from \"../components/site-components/index.tsx\";\nimport { toAttemptObservability } from \"../model/conversions.ts\";\nimport { attemptDetailParams, experimentDetailParams, experimentDetailTarget, } from \"../library/details.ts\";\nimport type { AttemptDetailTarget, ExperimentDetailTarget, } from \"../library/details.ts\";\nimport { loadBuiltInAttemptRows, loadBuiltInExperimentRows, loadBuiltInSummaryRows, type BuiltInAttemptRows, type BuiltInExperimentRows, type BuiltInSummaryRows, } from \"./analysis-values.ts\";\nimport { AttemptTrace, ExperimentDetailResultView, StandardAttemptsResultView, StandardOverviewResultView, type MembershipRow, } from \"./result-components.tsx\";\nimport { builtInMachineProducerIds, defineBuiltInReport, } from \"./machine.ts\";\ninterface StandardOverviewPageInput {\n readonly hero: HeroData;\n readonly summary: BuiltInSummaryRows;\n readonly experiments: BuiltInExperimentRows;\n readonly counts: {\n readonly experiments: number;\n readonly attempts: number;\n };\n}\ninterface StandardAttemptsPageInput {\n readonly hero: HeroData;\n readonly attempts: BuiltInAttemptRows;\n}\ninterface StandardTracesPageInput {\n readonly hero: HeroData;\n readonly observability: Awaited<ReturnType<typeof toAttemptObservability>>;\n}\ninterface StandardAttemptPageInput {\n readonly target: AttemptDetailTarget;\n readonly evidence: PageEvidence;\n}\ninterface StandardExperimentPageInput {\n readonly hero: HeroData;\n readonly experiment: string;\n readonly rows: BuiltInExperimentRows;\n readonly members: readonly MembershipRow[];\n}\nfunction heroData(snapshot: SampleSnapshot): HeroData {\n const latest = snapshot.runs.reduce<number | null>((current, run) => current === null || Number(run.startedAt) > current ? Number(run.startedAt) : current, null);\n return Object.freeze({\n latestStartedAt: latest === null ? null : new Date(latest).toISOString(),\n runs: snapshot.runs.length,\n });\n}\nfunction membershipRows(snapshot: SampleSnapshot, filter: {\n readonly locator?: AttemptDetailTarget[\"locator\"];\n readonly experiment?: string;\n} = {}): readonly MembershipRow[] {\n return Object.freeze(snapshot.slots\n .filter((slot) => filter.experiment === undefined || String(slot.experimentId) === filter.experiment)\n .filter((slot) => filter.locator === undefined || (slot.state === \"included\" && slot.attempt.locator === filter.locator))\n .map((slot) => Object.freeze({\n key: `${slot.runId}:${slot.slotId}`,\n experiment: String(slot.experimentId),\n eval: String(slot.evalId),\n attempt: slot.attemptOrdinal,\n selectedRun: String(slot.runId),\n slot: String(slot.slotId),\n state: slot.state,\n relation: slot.state === \"included\" ? slot.relation : null,\n locator: slot.state === \"included\" ? slot.attempt.locator : null,\n })));\n}\nfunction includedAttemptCount(snapshot: SampleSnapshot): number {\n return snapshot.slots.filter((slot) => slot.state === \"included\").length;\n}\n/** The default top-level report Page. */\nexport const standardOverviewPage = {\n id: \"report\",\n title: { en: \"Report\", \"zh-CN\": \"报告\" },\n load: async (sample: Sample): Promise<StandardOverviewPageInput> => {\n const [summary, experiments] = await Promise.all([\n loadBuiltInSummaryRows(sample),\n loadBuiltInExperimentRows(sample),\n ]);\n return Object.freeze({\n hero: heroData(sample.snapshot),\n summary,\n experiments,\n counts: Object.freeze({\n experiments: experiments.length,\n attempts: includedAttemptCount(sample.snapshot),\n }),\n });\n },\n render: (input: StandardOverviewPageInput) => <StandardOverviewResultView {...input}/>,\n} satisfies Page<void, StandardOverviewPageInput>;\n/** The standard attempt list does one aggregation and never queries detail views. */\nexport const standardAttemptsPage = {\n id: \"attempts\",\n title: \"Attempts\",\n load: async (sample: Sample): Promise<StandardAttemptsPageInput> => Object.freeze({\n hero: heroData(sample.snapshot),\n attempts: await loadBuiltInAttemptRows(sample),\n }),\n render: (input: StandardAttemptsPageInput) => <StandardAttemptsResultView {...input}/>,\n} satisfies Page<void, StandardAttemptsPageInput>;\n/** Trace navigation reads only the observability DomainView needed by this Page. */\nexport const standardTracesPage = {\n id: \"traces\",\n title: { en: \"Traces\", \"zh-CN\": \"追踪\" },\n load: async (sample: Sample): Promise<StandardTracesPageInput> => Object.freeze({\n hero: heroData(sample.snapshot),\n observability: await toAttemptObservability(sample),\n }),\n render: (input: StandardTracesPageInput) => (<Col>\n <Hero data={input.hero}/>\n <AttemptTrace view={input.observability} mode=\"execution\" timingMode=\"full\"/>\n </Col>),\n} satisfies Page<void, StandardTracesPageInput>;\n/** One standard detail Page for one already-selected Attempt. */\nexport const standardAttemptPage = {\n id: \"attempt\",\n path: \"/attempt\",\n title: \"Attempt\",\n navigation: false,\n params: attemptDetailParams,\n load: async (_sample: Sample, params: AttemptDetailTarget, context): Promise<StandardAttemptPageInput> => Object.freeze({\n target: params,\n evidence: await context.evidence(params.locator),\n }),\n render: (input: StandardAttemptPageInput) => <AttemptDetails attempt={input}/>,\n} satisfies Page<AttemptDetailTarget, StandardAttemptPageInput>;\nfunction experimentForTarget(sample: Sample, target: ExperimentDetailTarget): ExperimentId {\n const candidates = new Map<string, ExperimentId>();\n for (const run of sample.snapshot.runs)\n candidates.set(String(run.experimentId), run.experimentId);\n for (const slot of sample.snapshot.slots)\n candidates.set(String(slot.experimentId), slot.experimentId);\n for (const candidate of candidates.values()) {\n if (experimentDetailTarget(candidate).key === target.key)\n return candidate;\n }\n throw new TypeError(\"Experiment Page target does not belong to this Sample\");\n}\n/** One standard detail Page for one fixed-Sample Experiment identity. */\nexport const standardExperimentPage = {\n id: \"experiment\",\n path: \"/experiment\",\n title: \"Experiment\",\n navigation: false,\n params: experimentDetailParams,\n load: async (sample: Sample, params: ExperimentDetailTarget): Promise<StandardExperimentPageInput> => {\n const experiment = experimentForTarget(sample, params);\n return Object.freeze({\n hero: heroData(sample.snapshot),\n experiment: String(experiment),\n rows: await loadBuiltInExperimentRows(sample),\n members: membershipRows(sample.snapshot, { experiment: String(experiment) }),\n });\n },\n render: (input: StandardExperimentPageInput) => <ExperimentDetailResultView {...input}/>,\n} satisfies Page<ExperimentDetailTarget, StandardExperimentPageInput>;\n/** Explicit composition only: standard owns its two detail Pages. */\nexport const standard = defineBuiltInReport(builtInMachineProducerIds.standard, {\n title: \"NiceEval standard report\",\n pages: [\n standardOverviewPage,\n standardAttemptsPage,\n standardTracesPage,\n standardAttemptPage,\n standardExperimentPage,\n ],\n});\nexport default standard;\n"]}
|
|
1
|
+
{"version":3,"file":"standard.js","sourceRoot":"","sources":["standard.tsx"],"names":[],"mappings":";;;;AASA,gEAAmD;AACnD,qEAAwE;AACxE,sEAA8E;AAC9E,4DAAiE;AACjE,sDAA6G;AAE7G,6DAAgM;AAChM,kEAAgK;AAChK,6CAA+E;AA6B/E,SAAS,QAAQ,CAAC,QAAwB;IACtC,MAAM,MAAM,GAAG,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAgB,CAAC,OAAO,EAAE,GAAG,EAAE,EAAE,CAAC,OAAO,KAAK,IAAI,IAAI,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IAClK,OAAO,MAAM,CAAC,MAAM,CAAC;QACjB,eAAe,EAAE,MAAM,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,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AAU,CAAC;YAC9B,IAAI,EAAE,MAAM,IAAA,8CAAyB,EAAC,MAAM,CAAC;YAC7C,OAAO,EAAE,cAAc,CAAC,MAAM,CAAC,QAAQ,EAAE,EAAE,UAAU,EAAE,MAAM,CAAC,UAAU,CAAC,EAAE,CAAC;SAC/E,CAAC,CAAC;IACP,CAAC;IACD,MAAM,EAAE,CAAC,KAAkC,EAAE,EAAE,CAAC,uBAAC,kDAA0B,OAAK,KAAK,GAAG;CACvB,CAAC;AACtE,qEAAqE;AACxD,QAAA,QAAQ,GAAG,IAAA,gCAAmB,EAAC,sCAAyB,CAAC,QAAQ,EAAE;IAC5E,KAAK,EAAE,0BAA0B;IACjC,KAAK,EAAE;QACH,4BAAoB;QACpB,4BAAoB;QACpB,0BAAkB;QAClB,2BAAmB;QACnB,8BAAsB;KACzB;CACJ,CAAC,CAAC;AACH,kBAAe,gBAAQ,CAAC","sourcesContent":["/**\n * The standard information architecture.\n *\n * Detail Pages are deliberately listed here. `defineReport()` receives no\n * library page collection, so a consumer's arbitrary custom Report never\n * gains attempt or experiment routes as an implicit side effect.\n */\nimport type { ExperimentId, Sample, SampleSnapshot, } from \"../../analysis/index.ts\";\nimport type { Page, PageEvidence, } from \"../definition/report.ts\";\nimport { Col } from \"../definition/primitives.tsx\";\nimport { AttemptDetails } from \"../components/attempt-detail/index.tsx\";\nimport { Hero, type HeroData } from \"../components/site-components/index.tsx\";\nimport { toAttemptObservability } from \"../model/conversions.ts\";\nimport { attemptDetailParams, experimentDetailParams, experimentDetailTarget, } from \"../library/details.ts\";\nimport type { AttemptDetailTarget, ExperimentDetailTarget, } from \"../library/details.ts\";\nimport { loadBuiltInAttemptRows, loadBuiltInExperimentRows, loadBuiltInSummaryRows, type BuiltInAttemptRows, type BuiltInExperimentRows, type BuiltInSummaryRows, } from \"./analysis-values.ts\";\nimport { AttemptTrace, ExperimentDetailResultView, StandardAttemptsResultView, StandardOverviewResultView, type MembershipRow, } from \"./result-components.tsx\";\nimport { builtInMachineProducerIds, defineBuiltInReport, } from \"./machine.ts\";\ninterface StandardOverviewPageInput {\n readonly hero: HeroData;\n readonly summary: BuiltInSummaryRows;\n readonly experiments: BuiltInExperimentRows;\n readonly counts: {\n readonly experiments: number;\n readonly attempts: number;\n readonly expectedResults: number;\n };\n}\ninterface StandardAttemptsPageInput {\n readonly hero: HeroData;\n readonly attempts: BuiltInAttemptRows;\n}\ninterface StandardTracesPageInput {\n readonly hero: HeroData;\n readonly observability: Awaited<ReturnType<typeof toAttemptObservability>>;\n}\ninterface StandardAttemptPageInput {\n readonly target: AttemptDetailTarget;\n readonly evidence: PageEvidence;\n}\ninterface StandardExperimentPageInput {\n readonly hero: HeroData;\n readonly experiment: string;\n readonly rows: BuiltInExperimentRows;\n readonly members: readonly MembershipRow[];\n}\nfunction heroData(snapshot: SampleSnapshot): HeroData {\n const latest = snapshot.runs.reduce<number | null>((current, run) => current === null || Number(run.startedAt) > current ? Number(run.startedAt) : current, null);\n return Object.freeze({\n latestStartedAt: latest === null ? null : new Date(latest).toISOString(),\n runs: snapshot.runs.length,\n });\n}\nfunction membershipRows(snapshot: SampleSnapshot, filter: {\n readonly locator?: AttemptDetailTarget[\"locator\"];\n readonly experiment?: string;\n} = {}): readonly MembershipRow[] {\n return Object.freeze(snapshot.slots\n .filter((slot) => filter.experiment === undefined || String(slot.experimentId) === filter.experiment)\n .filter((slot) => filter.locator === undefined || (slot.state === \"included\" && slot.attempt.locator === filter.locator))\n .map((slot) => Object.freeze({\n key: `${slot.runId}:${slot.slotId}`,\n experiment: String(slot.experimentId),\n eval: String(slot.evalId),\n attempt: slot.attemptOrdinal,\n selectedRun: String(slot.runId),\n slot: String(slot.slotId),\n state: slot.state,\n relation: slot.state === \"included\" ? slot.relation : null,\n locator: slot.state === \"included\" ? slot.attempt.locator : null,\n })));\n}\nfunction includedAttemptCount(snapshot: SampleSnapshot): number {\n return snapshot.slots.filter((slot) => slot.state === \"included\").length;\n}\n/** The default top-level report Page. */\nexport const standardOverviewPage = {\n id: \"report\",\n title: { en: \"Report\", \"zh-CN\": \"报告\" },\n load: async (sample: Sample): Promise<StandardOverviewPageInput> => {\n const [summary, experiments] = await Promise.all([\n loadBuiltInSummaryRows(sample),\n loadBuiltInExperimentRows(sample),\n ]);\n return Object.freeze({\n hero: heroData(sample.snapshot),\n summary,\n experiments,\n counts: Object.freeze({\n experiments: experiments.length,\n attempts: includedAttemptCount(sample.snapshot),\n expectedResults: sample.snapshot.slots.filter((slot) => slot.state !== \"excluded\").length,\n }),\n });\n },\n render: (input: StandardOverviewPageInput) => <StandardOverviewResultView {...input}/>,\n} satisfies Page<void, StandardOverviewPageInput>;\n/** The standard attempt list does one aggregation and never queries detail views. */\nexport const standardAttemptsPage = {\n id: \"attempts\",\n title: \"Attempts\",\n load: async (sample: Sample): Promise<StandardAttemptsPageInput> => Object.freeze({\n hero: heroData(sample.snapshot),\n attempts: await loadBuiltInAttemptRows(sample),\n }),\n render: (input: StandardAttemptsPageInput) => <StandardAttemptsResultView {...input}/>,\n} satisfies Page<void, StandardAttemptsPageInput>;\n/** Trace navigation reads only the observability DomainView needed by this Page. */\nexport const standardTracesPage = {\n id: \"traces\",\n title: { en: \"Traces\", \"zh-CN\": \"追踪\" },\n load: async (sample: Sample): Promise<StandardTracesPageInput> => Object.freeze({\n hero: heroData(sample.snapshot),\n observability: await toAttemptObservability(sample),\n }),\n render: (input: StandardTracesPageInput) => (<Col>\n <Hero data={input.hero}/>\n <AttemptTrace view={input.observability} mode=\"execution\" timingMode=\"full\"/>\n </Col>),\n} satisfies Page<void, StandardTracesPageInput>;\n/** One standard detail Page for one already-selected Attempt. */\nexport const standardAttemptPage = {\n id: \"attempt\",\n path: \"/attempt\",\n title: \"Attempt\",\n navigation: false,\n params: attemptDetailParams,\n load: async (_sample: Sample, params: AttemptDetailTarget, context): Promise<StandardAttemptPageInput> => Object.freeze({\n target: params,\n evidence: await context.evidence(params.locator),\n }),\n render: (input: StandardAttemptPageInput) => <AttemptDetails attempt={input}/>,\n} satisfies Page<AttemptDetailTarget, StandardAttemptPageInput>;\nfunction experimentForTarget(sample: Sample, target: ExperimentDetailTarget): ExperimentId {\n const candidates = new Map<string, ExperimentId>();\n for (const run of sample.snapshot.runs)\n candidates.set(String(run.experimentId), run.experimentId);\n for (const slot of sample.snapshot.slots)\n candidates.set(String(slot.experimentId), slot.experimentId);\n for (const candidate of candidates.values()) {\n if (experimentDetailTarget(candidate).key === target.key)\n return candidate;\n }\n throw new TypeError(\"Experiment Page target does not belong to this Sample\");\n}\n/** One standard detail Page for one fixed-Sample Experiment identity. */\nexport const standardExperimentPage = {\n id: \"experiment\",\n path: \"/experiment\",\n title: \"Experiment\",\n navigation: false,\n params: experimentDetailParams,\n load: async (sample: Sample, params: ExperimentDetailTarget): Promise<StandardExperimentPageInput> => {\n const experiment = experimentForTarget(sample, params);\n return Object.freeze({\n hero: heroData(sample.snapshot),\n experiment: String(experiment),\n rows: await loadBuiltInExperimentRows(sample),\n members: membershipRows(sample.snapshot, { experiment: String(experiment) }),\n });\n },\n render: (input: StandardExperimentPageInput) => <ExperimentDetailResultView {...input}/>,\n} satisfies Page<ExperimentDetailTarget, StandardExperimentPageInput>;\n/** Explicit composition only: standard owns its two detail Pages. */\nexport const standard = defineBuiltInReport(builtInMachineProducerIds.standard, {\n title: \"NiceEval standard report\",\n pages: [\n standardOverviewPage,\n standardAttemptsPage,\n standardTracesPage,\n standardAttemptPage,\n standardExperimentPage,\n ],\n});\nexport default standard;\n"]}
|
|
@@ -8,6 +8,7 @@ const aggregate_ts_1 = require("../../model/aggregate.cjs");
|
|
|
8
8
|
const metrics_ts_1 = require("../../model/metrics.cjs");
|
|
9
9
|
const conversions_ts_1 = require("../../model/conversions.cjs");
|
|
10
10
|
const details_ts_1 = require("../../library/details.cjs");
|
|
11
|
+
const compute_ts_1 = require("../attempt-detail/compute.cjs");
|
|
11
12
|
/** 相对已表达前缀的剩余路径;无前缀时是完整 evalId。 */
|
|
12
13
|
function relativeEvalLabel(evalIdValue, labelPrefix) {
|
|
13
14
|
if (!labelPrefix)
|
|
@@ -100,9 +101,21 @@ async function evidenceFacts(sample) {
|
|
|
100
101
|
const facts = new Map();
|
|
101
102
|
for (const entry of view.entries) {
|
|
102
103
|
const locator = entry.attempt.locator;
|
|
104
|
+
const assertions = entry.state === "available"
|
|
105
|
+
? entry.detail.entries.map(compute_ts_1.assertionEntryViewOf).filter((item) => item !== undefined)
|
|
106
|
+
: [];
|
|
107
|
+
const scoreContributions = assertions
|
|
108
|
+
.map((item) => item.result.score)
|
|
109
|
+
.filter((score) => score.state !== "not-scored");
|
|
110
|
+
const completeScore = scoreContributions.length > 0 &&
|
|
111
|
+
scoreContributions.every((score) => score.state === "earned" && score.earned !== undefined)
|
|
112
|
+
? scoreContributions.reduce((sum, score) => sum + (score.earned ?? 0), 0)
|
|
113
|
+
: undefined;
|
|
103
114
|
facts.set(locator, Object.freeze({
|
|
104
115
|
verdict: entry.state === "available" ? entry.detail.verdict : null,
|
|
105
116
|
failureSummary: closedFailureSummary(entry),
|
|
117
|
+
evaluationKind: scoreContributions.length > 0 ? "points" : "pass",
|
|
118
|
+
...(completeScore === undefined ? {} : { totalScore: completeScore }),
|
|
106
119
|
}));
|
|
107
120
|
}
|
|
108
121
|
return facts;
|
|
@@ -279,7 +292,11 @@ async function attemptListData(sample, pricing = null) {
|
|
|
279
292
|
]);
|
|
280
293
|
const selections = selectedSlots(sample);
|
|
281
294
|
return Object.freeze(selections.map((selection) => {
|
|
282
|
-
const fact = facts.get(selection.locator) ?? Object.freeze({
|
|
295
|
+
const fact = facts.get(selection.locator) ?? Object.freeze({
|
|
296
|
+
verdict: null,
|
|
297
|
+
failureSummary: null,
|
|
298
|
+
evaluationKind: "pass",
|
|
299
|
+
});
|
|
283
300
|
const metric = requireMetrics(metrics.get(metricsKey(selection.experimentId, selection.evalId, selection.locator)), `attempt ${JSON.stringify(selection.locator)}`);
|
|
284
301
|
const item = Object.freeze({
|
|
285
302
|
locator: selection.locator,
|
|
@@ -288,6 +305,8 @@ async function attemptListData(sample, pricing = null) {
|
|
|
288
305
|
attemptOrdinal: selection.attemptOrdinal,
|
|
289
306
|
verdict: fact.verdict,
|
|
290
307
|
failureSummary: fact.failureSummary,
|
|
308
|
+
evaluationKind: fact.evaluationKind,
|
|
309
|
+
...(fact.totalScore === undefined ? {} : { totalScore: fact.totalScore }),
|
|
291
310
|
passRate: metric.passRate,
|
|
292
311
|
durationMs: metric.durationMs,
|
|
293
312
|
...(metric.costUSD === undefined ? {} : { costUSD: metric.costUSD }),
|
|
@@ -367,8 +386,14 @@ async function experimentListData(sample, pricing = null) {
|
|
|
367
386
|
const list = attemptsByEval.get(metricsKey(experimentId, evalIdValue)) ?? [];
|
|
368
387
|
const sorted = [...list].sort((left, right) => left.attemptOrdinal - right.attemptOrdinal || left.locator.localeCompare(right.locator));
|
|
369
388
|
const metrics = requireMetrics(evalMetrics.get(metricsKey(experimentId, evalIdValue)), `experiment/eval ${JSON.stringify(experimentId)}/${JSON.stringify(evalIdValue)}`);
|
|
389
|
+
const evaluationKind = sorted.some((attempt) => attempt.evaluationKind === "points") ? "points" : "pass";
|
|
390
|
+
const completeScores = sorted.flatMap((attempt) => attempt.totalScore === undefined ? [] : [attempt.totalScore]);
|
|
370
391
|
evalRows.push(Object.freeze({
|
|
371
392
|
evalId: evalIdValue,
|
|
393
|
+
evaluationKind,
|
|
394
|
+
...(completeScores.length === 0
|
|
395
|
+
? {}
|
|
396
|
+
: { totalScore: completeScores.reduce((sum, score) => sum + score, 0) / completeScores.length }),
|
|
372
397
|
endToEndPassRate: metrics.passRate,
|
|
373
398
|
durationMs: metrics.durationMs,
|
|
374
399
|
...(metrics.costUSD === undefined ? {} : { costUSD: metrics.costUSD }),
|
|
@@ -385,12 +410,19 @@ async function experimentListData(sample, pricing = null) {
|
|
|
385
410
|
if (metric !== undefined)
|
|
386
411
|
groupMetricsForItem.set(prefix, metric);
|
|
387
412
|
}
|
|
413
|
+
const evaluationKind = evalRows.some((row) => row.evaluationKind === "points")
|
|
414
|
+
? evalRows.some((row) => row.evaluationKind === "pass") ? "mixed" : "points"
|
|
415
|
+
: "pass";
|
|
416
|
+
const completeEvalScores = evalRows.flatMap((row) => row.totalScore === undefined ? [] : [row.totalScore]);
|
|
388
417
|
items.push(Object.freeze({
|
|
389
418
|
experimentId,
|
|
390
419
|
agent: watermark?.agent ?? null,
|
|
391
420
|
model: watermark?.model ?? null,
|
|
392
421
|
flags: watermark?.flags ?? null,
|
|
393
|
-
evaluationKind
|
|
422
|
+
evaluationKind,
|
|
423
|
+
...(completeEvalScores.length === 0
|
|
424
|
+
? {}
|
|
425
|
+
: { totalScore: completeEvalScores.reduce((sum, score) => sum + score, 0) }),
|
|
394
426
|
endToEndPassRate: experimentMetric.passRate,
|
|
395
427
|
durationMs: experimentMetric.durationMs,
|
|
396
428
|
...(experimentMetric.costUSD === undefined ? {} : { costUSD: experimentMetric.costUSD }),
|
|
@@ -401,7 +433,12 @@ async function experimentListData(sample, pricing = null) {
|
|
|
401
433
|
href: experimentHref(experimentId),
|
|
402
434
|
}));
|
|
403
435
|
}
|
|
404
|
-
items.
|
|
436
|
+
const composition = items.some((item) => item.evaluationKind !== "pass")
|
|
437
|
+
? items.some((item) => item.evaluationKind !== "points") ? "mixed" : "points"
|
|
438
|
+
: "pass";
|
|
439
|
+
items.sort(byMetricDescThenId((item) => composition !== "pass"
|
|
440
|
+
? item.totalScore ?? null
|
|
441
|
+
: item.endToEndPassRate.value));
|
|
405
442
|
return Object.freeze(items);
|
|
406
443
|
}
|
|
407
444
|
function evalIdsUnder(node) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compute.js","sourceRoot":"","sources":["compute.ts"],"names":[],"mappings":";;AAsGA,8CAKC;AAUD,oDAEC;AAmRD,0CAyBC;AAMD,gDAuGC;AAlgBD,2DAA4G;AAC5G,uDAA+E;AAC/E,+DAA+D;AAC/D,yDAA4G;AAoF5G,mCAAmC;AACnC,SAAgB,iBAAiB,CAA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AAI,KAAK,MAAM;QACpB,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACzB,OAAO,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;AAC/C,CAAC;AACD,SAAS,kBAAkB,CAAC,OAAoD;IAC5E,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;QACnB,MAAM,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;QAChC,MAAM,UAAU,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;QAClC,IAAI,SAAS,KAAK,IAAI,IAAI,UAAU,KAAK,IAAI,EAAE,CAAC;YAC5C,OAAO,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;QAC/D,CAAC;QACD,IAAI,SAAS,KAAK,IAAI;YAClB,OAAO,CAAC,CAAC;QACb,IAAI,UAAU,KAAK,IAAI;YACnB,OAAO,CAAC,CAAC,CAAC;QACd,OAAO,UAAU,GAAG,SAAS,IAAI,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;IACzF,CAAC,CAAC;AACN,CAAC","sourcesContent":["// 实体列表计算函数(*Data):固定 Sample → 闭合组件数据。\n// ExperimentTable / AttemptList / FailureList 的 *Data 都住在这里。\n//\n// 共同约定见 docs/feature/reports/architecture.md 与 calculations.md:\n// - 第一参只收 Report Sample;issues 与 Evidence 留在 Analysis-owned MetricValue 里;\n// - 指标一律来自 `aggregate()` facade,判定来自公开 attempt-evidence DomainView,\n// 身份与覆盖事实来自 closed SampleSnapshot——这里不实现任何统计算法;\n// - null ≠ 0:缺数据不编数,覆盖率经 samples/total 如实暴露;\n// - 详情 href 一律经 `libraryDetailRoute()` + `attemptDetailTarget()` /\n// `experimentDetailTarget()` 建立,不自行编码 locator / experiment id 路径。\nimport type { AttemptEvidenceDomainView, CostMetricValue, JsonValue, MetricValue, PricingProfile, Sample, } from \"../../../analysis/index.ts\";\nimport type { AttemptLocator } from \"../../../attempt-locator.ts\";\nimport type { EvalId, ExperimentId } from \"../../../analysis/index.ts\";\nimport type { Verdict } from \"../../../shared/types.ts\";\nimport { aggregate, attempt, evalId, experiment, type AggregationSubject, } from \"../../model/aggregate.ts\";\nimport { costUSD, durationMs, passRate, tokens } from \"../../model/metrics.ts\";\nimport { toAttemptEvidence } from \"../../model/conversions.ts\";\nimport { attemptDetailTarget, experimentDetailTarget, libraryDetailRoute, } from \"../../library/details.ts\";\ntype UtcMillis = Sample[\"snapshot\"][\"runs\"][number][\"startedAt\"];\ntype ClosedAttemptEvidenceEntry = AttemptEvidenceDomainView[\"entries\"][number];\n/**\n * 当前 Analysis 只发布通过制读数(没有总分 Measure),题型构成恒为\n * \"pass\"。未来 Analysis 发布计分制 Measure 时,这里与 content.ts 的列集一起按\n * 同一构成判据扩展。\n */\nexport type EvaluationKindComposition = \"pass\" | \"points\" | \"mixed\";\n/** 一个层级共用的四枚 Analysis-owned 读数。 */\nexport interface ExperimentMetrics {\n readonly passRate: MetricValue<number>;\n readonly durationMs: MetricValue<number>;\n /** Present only when the owning Report declares a PricingProfile. */\n readonly costUSD?: CostMetricValue;\n readonly tokens: MetricValue<number>;\n}\n/** 一次 attempt 的闭合行。 */\nexport interface AttemptListItem {\n readonly locator: AttemptLocator;\n readonly experimentId: ExperimentId;\n readonly evalId: EvalId;\n readonly attemptOrdinal: number;\n /** 来自公开 attempt-evidence DomainView;证据读取失败时为 null(不伪造判定)。 */\n readonly verdict: Verdict | null;\n /**\n * 闭合失败摘要:errored 取 outcome 词,failed 取首条 mismatched 断言条目的\n * display 标签;closed 数据没有可读摘录时为 null(渲染成 \"—\",不发明文案)。\n */\n readonly failureSummary: string | null;\n readonly passRate: MetricValue<number>;\n readonly durationMs: MetricValue<number>;\n /** Present only when the owning Report declares a PricingProfile. */\n readonly costUSD?: CostMetricValue;\n readonly tokens: MetricValue<number>;\n /** 所属 selected Run 的 startedAt(attempt 级起点不进 closed snapshot)。 */\n readonly startedAt: UtcMillis | null;\n /** 详情 href,经 libraryDetailRoute(attemptDetailTarget(locator)) 建立。 */\n readonly href: string;\n}\n/** experiment 层级表里一道 Eval 的闭合行;attempts 是它的可见子行。 */\nexport interface ExperimentListEvalRow {\n readonly evalId: EvalId;\n readonly endToEndPassRate: MetricValue<number>;\n readonly durationMs: MetricValue<number>;\n readonly costUSD?: CostMetricValue;\n readonly tokens: MetricValue<number>;\n readonly attempts: readonly AttemptListItem[];\n}\n/** 一个 experiment 的闭合行。 */\nexport interface ExperimentListItem {\n readonly experimentId: ExperimentId;\n /** 来自实验水位 Run 的 closed context;Run context 缺席时如实为 null。 */\n readonly agent: string | null;\n readonly model: string | null;\n readonly flags: Readonly<Record<string, JsonValue>> | null;\n /** 占位默认值,见 EvaluationKindComposition 注释。 */\n readonly evaluationKind: EvaluationKindComposition;\n readonly endToEndPassRate: MetricValue<number>;\n readonly durationMs: MetricValue<number>;\n readonly costUSD?: CostMetricValue;\n readonly tokens: MetricValue<number>;\n /** 当前口径下没有 attempt 的题(active slot 为 not-recorded / core-invalid)。 */\n readonly missingEvalIds: readonly EvalId[];\n /**\n * 路径段组行的 Analysis-owned 读数,key 是完整组前缀(如 \"downshift/basic\")。\n * 组行不手写聚合:每个组前缀是 facade GroupFunction 的一个坐标,\n * 分母 / 状态 / Evidence 全部留在 Analysis。\n */\n readonly groupMetrics: ReadonlyMap<string, ExperimentMetrics>;\n readonly evalRows: readonly ExperimentListEvalRow[];\n /** 详情 href,经 libraryDetailRoute(experimentDetailTarget(id)) 建立。 */\n readonly href: string;\n}\n/** Eval 路径层级布局:叶子 / 路径段组。 */\nexport type EvalLayoutNode = {\n readonly kind: \"leaf\";\n readonly evalId: EvalId;\n} | {\n readonly kind: \"group\";\n readonly segment: string;\n readonly prefix: string;\n readonly children: readonly EvalLayoutNode[];\n};\n/** 相对已表达前缀的剩余路径;无前缀时是完整 evalId。 */\nexport function relativeEvalLabel(evalIdValue: EvalId, labelPrefix: string): string {\n if (!labelPrefix)\n return evalIdValue;\n const prefix = `${labelPrefix}/`;\n return evalIdValue.startsWith(prefix) ? evalIdValue.slice(prefix.length) : evalIdValue;\n}\nfunction joinEvalPath(prefix: string, segment: string): string {\n return prefix ? `${prefix}/${segment}` : segment;\n}\n/**\n * Eval 路径段 → 层级布局。两条收起条件在每一层兄弟之间各自判定\n * (docs/feature/reports/library.md「身份格与行数」):\n * 唯一组且无叶时剥壳前进,不插组行;组全为单成员或本层只有叶时全部放平。\n * 纯字符串投影,不读任何指标。\n */\nexport function experimentEvalLayout(evalIdValues: readonly EvalId[]): readonly EvalLayoutNode[] {\n return layoutLevel(evalIdValues, \"\");\n}\nfunction layoutLevel(members: readonly EvalId[], dirPrefix: string): readonly EvalLayoutNode[] {\n if (members.length === 0)\n return [];\n const leaves: EvalId[] = [];\n const groups = new Map<string, EvalId[]>();\n for (const member of members) {\n const remaining = relativeEvalLabel(member, dirPrefix).split(\"/\").filter(Boolean);\n if (remaining.length <= 1) {\n leaves.push(member);\n continue;\n }\n const head = remaining[0]!;\n const list = groups.get(head);\n if (list)\n list.push(member);\n else\n groups.set(head, [member]);\n }\n const collapse = groups.size === 0 ||\n (groups.size === 1 && leaves.length === 0) ||\n [...groups.values()].every((group) => group.length === 1);\n if (collapse) {\n if (groups.size === 1 && leaves.length === 0) {\n const head = [...groups.keys()][0]!;\n return layoutLevel(members, joinEvalPath(dirPrefix, head));\n }\n return [...leaves]\n .sort((left, right) => left.localeCompare(right))\n .map((member): EvalLayoutNode => ({ kind: \"leaf\", evalId: member }));\n }\n const groupNodes: EvalLayoutNode[] = [...groups.entries()]\n .sort(([left], [right]) => left.localeCompare(right))\n .map(([segment, groupMembers]) => ({\n kind: \"group\" as const,\n segment,\n prefix: joinEvalPath(dirPrefix, segment),\n children: layoutLevel(groupMembers, joinEvalPath(dirPrefix, segment)),\n }));\n const leafNodes: EvalLayoutNode[] = [...leaves]\n .sort((left, right) => left.localeCompare(right))\n .map((member): EvalLayoutNode => ({ kind: \"leaf\", evalId: member }));\n return [...groupNodes, ...leafNodes];\n}\ninterface AttemptFact {\n readonly verdict: Verdict | null;\n readonly failureSummary: string | null;\n}\ninterface SlotSelection {\n readonly locator: AttemptLocator;\n readonly experimentId: ExperimentId;\n readonly evalId: EvalId;\n readonly attemptOrdinal: number;\n readonly startedAt: UtcMillis | null;\n}\n/** 一次 attempt 的闭合失败摘要(只读公开 DomainView,不重算断言展示)。 */\nfunction closedFailureSummary(entry: ClosedAttemptEvidenceEntry | undefined): string | null {\n if (entry === undefined || entry.state !== \"available\")\n return null;\n const detail = entry.detail;\n if (detail.verdict === \"errored\")\n return detail.outcome;\n if (detail.verdict !== \"failed\")\n return null;\n for (const item of detail.entries) {\n const result = item.result;\n if (typeof result !== \"object\" || result === null || Array.isArray(result))\n continue;\n if ((result as Readonly<Record<string, unknown>>).state !== \"mismatched\")\n continue;\n const display = item.display;\n if (typeof display === \"object\" && display !== null && !Array.isArray(display)) {\n const label = (display as Readonly<Record<string, unknown>>).label;\n if (typeof label === \"string\" && label.length > 0)\n return label;\n }\n return \"assertion\";\n }\n return null;\n}\nasync function evidenceFacts(sample: Sample): Promise<ReadonlyMap<AttemptLocator, AttemptFact>> {\n const view = await toAttemptEvidence(sample);\n const facts = new Map<AttemptLocator, AttemptFact>();\n for (const entry of view.entries) {\n const locator = entry.attempt.locator;\n facts.set(locator, Object.freeze({\n verdict: entry.state === \"available\" ? (entry.detail.verdict as Verdict) : null,\n failureSummary: closedFailureSummary(entry),\n }));\n }\n return facts;\n}\nasync function attemptMetricRows(sample: Sample, pricing: PricingProfile | null): Promise<ReadonlyMap<string, ExperimentMetrics>> {\n const rows = await aggregate(sample, {\n by: { experiment, evalId, attempt },\n values: pricing === null\n ? { passRate, durationMs, tokens }\n : { passRate, durationMs, costUSD: costUSD(pricing), tokens },\n });\n const byKey = new Map<string, ExperimentMetrics>();\n for (const row of rows) {\n if (typeof row.attempt !== \"string\")\n continue;\n byKey.set(metricsKey(row.experiment as string, row.evalId as string, row.attempt), Object.freeze({\n passRate: row.passRate,\n durationMs: row.durationMs,\n ...(pricing === null ? {} : { costUSD: (row as unknown as {\n readonly costUSD: CostMetricValue;\n }).costUSD }),\n tokens: row.tokens,\n }));\n }\n return byKey;\n}\nfunction metricsKey(experimentId: string, evalIdValue: string, locator?: string): string {\n return locator === undefined\n ? `${experimentId}\\u0000${evalIdValue}`\n : `${experimentId}\\u0000${evalIdValue}\\u0000${locator}`;\n}\n/**\n * Included Analysis subjects always have an aggregate row, even when every\n * measure in that row is empty. Treat an omitted row as a broken Analysis\n * contract instead of manufacturing a Report-owned MetricValue.\n */\nfunction requireMetrics(metrics: ExperimentMetrics | undefined, subject: string): ExperimentMetrics {\n if (metrics === undefined) {\n throw new Error(`Analysis aggregate omitted the required ${subject} row.`);\n }\n return metrics;\n}\n/** 每个 experiment 每道 Eval 一行,按 evalId 升序返回(不重排 attempt 语义)。 */\nasync function evalMetricRows(sample: Sample, pricing: PricingProfile | null): Promise<ReadonlyMap<string, ExperimentMetrics>> {\n const rows = await aggregate(sample, {\n by: { experiment, evalId },\n values: pricing === null\n ? { passRate, durationMs, tokens }\n : { passRate, durationMs, costUSD: costUSD(pricing), tokens },\n });\n const byKey = new Map<string, ExperimentMetrics>();\n for (const row of rows) {\n byKey.set(metricsKey(row.experiment as string, row.evalId as string), Object.freeze({\n passRate: row.passRate,\n durationMs: row.durationMs,\n ...(pricing === null ? {} : { costUSD: (row as unknown as {\n readonly costUSD: CostMetricValue;\n }).costUSD }),\n tokens: row.tokens,\n }));\n }\n return byKey;\n}\nasync function experimentMetricRows(sample: Sample, pricing: PricingProfile | null): Promise<ReadonlyMap<ExperimentId, ExperimentMetrics>> {\n const rows = await aggregate(sample, {\n by: { experiment },\n values: pricing === null\n ? { passRate, durationMs, tokens }\n : { passRate, durationMs, costUSD: costUSD(pricing), tokens },\n });\n const byId = new Map<ExperimentId, ExperimentMetrics>();\n for (const row of rows) {\n byId.set(row.experiment as ExperimentId, Object.freeze({\n passRate: row.passRate,\n durationMs: row.durationMs,\n ...(pricing === null ? {} : { costUSD: (row as unknown as {\n readonly costUSD: CostMetricValue;\n }).costUSD }),\n tokens: row.tokens,\n }));\n }\n return byId;\n}\n/**\n * 组行读数的 facade 聚合:每个路径段组前缀是一个 GroupFunction 坐标,\n * 分母 / 状态 / Evidence 全部由 Analysis 按 logical slots 计算。\n */\nasync function groupMetricRows(sample: Sample, prefixByExperiment: ReadonlyMap<ExperimentId, ReadonlyMap<EvalId, string>>, pricing: PricingProfile | null): Promise<ReadonlyMap<string, ExperimentMetrics>> {\n const groupPrefix = (subject: AggregationSubject): string => prefixByExperiment.get(subject.experimentId)?.get(subject.evalId) ?? \"\";\n const rows = await aggregate(sample, {\n by: { experiment, prefix: groupPrefix },\n values: pricing === null\n ? { passRate, durationMs, tokens }\n : { passRate, durationMs, costUSD: costUSD(pricing), tokens },\n });\n const byKey = new Map<string, ExperimentMetrics>();\n for (const row of rows) {\n const prefix = row.prefix;\n if (typeof prefix !== \"string\" || prefix.length === 0)\n continue;\n byKey.set(metricsKey(row.experiment as string, prefix), Object.freeze({\n passRate: row.passRate,\n durationMs: row.durationMs,\n ...(pricing === null ? {} : { costUSD: (row as unknown as {\n readonly costUSD: CostMetricValue;\n }).costUSD }),\n tokens: row.tokens,\n }));\n }\n return byKey;\n}\nfunction attemptHref(locator: AttemptLocator): string {\n return libraryDetailRoute(attemptDetailTarget(locator));\n}\nfunction experimentHref(experimentId: ExperimentId): string {\n return libraryDetailRoute(experimentDetailTarget(experimentId));\n}\n/** SampleSnapshot → 每个 experiment 的身份水位(最新 startedAt 的 Run)。 */\nfunction watermarksByExperiment(sample: Sample): ReadonlyMap<ExperimentId, {\n readonly startedAt: UtcMillis;\n readonly agent: string | null;\n readonly model: string | null;\n readonly flags: Readonly<Record<string, JsonValue>> | null;\n}> {\n const runsByExperiment = new Map<ExperimentId, typeof sample.snapshot.runs[number][]>();\n for (const run of sample.snapshot.runs) {\n const list = runsByExperiment.get(run.experimentId);\n if (list)\n list.push(run);\n else\n runsByExperiment.set(run.experimentId, [run]);\n }\n const byExperiment = new Map<ExperimentId, {\n readonly startedAt: UtcMillis;\n readonly agent: string | null;\n readonly model: string | null;\n readonly flags: Readonly<Record<string, JsonValue>> | null;\n }>();\n for (const [experimentId, runs] of runsByExperiment) {\n const newest = runs.reduce((best, run) => run.startedAt > best.startedAt ? run : best, runs[0]!);\n const context = newest.context;\n byExperiment.set(experimentId, Object.freeze({\n startedAt: newest.startedAt,\n agent: context?.execution.agentId ?? null,\n model: context?.execution.model ?? null,\n flags: context ? Object.freeze({ ...context.execution.flags }) : null,\n }));\n }\n return byExperiment;\n}\nfunction runStartedAtByRunId(sample: Sample): ReadonlyMap<string, UtcMillis> {\n const byRunId = new Map<string, UtcMillis>();\n for (const run of sample.snapshot.runs)\n byRunId.set(run.runId, run.startedAt);\n return byRunId;\n}\n/**\n * 按 locator 去重的 included slot 选择:同一 locator 出现多份(跨 Run 携带)时\n * 取 startedAt 最新的一份作展示行。Member 的 action / relation 是 Run provenance,\n * 不在质量列表里折成额外的时效状态。\n */\nfunction selectedSlots(sample: Sample): readonly SlotSelection[] {\n const runStartedAt = runStartedAtByRunId(sample);\n const byLocator = new Map<AttemptLocator, SlotSelection>();\n for (const slot of sample.snapshot.slots) {\n if (slot.state !== \"included\")\n continue;\n const locator = slot.attempt.locator;\n const startedAt = runStartedAt.get(slot.runId) ?? null;\n const existing = byLocator.get(locator);\n if (existing === undefined ||\n (startedAt !== null && (existing.startedAt === null || startedAt > existing.startedAt))) {\n byLocator.set(locator, Object.freeze({\n locator,\n experimentId: slot.experimentId,\n evalId: slot.evalId,\n attemptOrdinal: slot.attemptOrdinal,\n startedAt,\n }));\n }\n }\n return Object.freeze([...byLocator.values()]);\n}\n/**\n * `attemptListData(sample)`:每个 included attempt 一项,顺序取自 Sample 展平顺序\n * (按 locator 去重后保持首次出现序,不重排)。\n */\nexport async function attemptListData(sample: Sample, pricing: PricingProfile | null = null): Promise<readonly AttemptListItem[]> {\n const [facts, metrics] = await Promise.all([\n evidenceFacts(sample),\n attemptMetricRows(sample, pricing),\n ]);\n const selections = selectedSlots(sample);\n return Object.freeze(selections.map((selection): AttemptListItem => {\n const fact = facts.get(selection.locator) ?? Object.freeze({ verdict: null, failureSummary: null });\n const metric = requireMetrics(metrics.get(metricsKey(selection.experimentId, selection.evalId, selection.locator)), `attempt ${JSON.stringify(selection.locator)}`);\n const item: AttemptListItem = Object.freeze({\n locator: selection.locator,\n experimentId: selection.experimentId,\n evalId: selection.evalId,\n attemptOrdinal: selection.attemptOrdinal,\n verdict: fact.verdict,\n failureSummary: fact.failureSummary,\n passRate: metric.passRate,\n durationMs: metric.durationMs,\n ...(metric.costUSD === undefined ? {} : { costUSD: metric.costUSD }),\n tokens: metric.tokens,\n startedAt: selection.startedAt,\n href: attemptHref(selection.locator),\n });\n return item;\n }));\n}\n/**\n * `experimentListData(sample)`:每个 experiment 一项,展开到每道 Eval;初始排序按\n * 这份列表自身的题型构成选择主读数——当前 facade 只有通过制读数,恒为\n * endToEndPassRate 降序(缺数据沉底,同值按 experimentId 字典序收口)。\n */\nexport async function experimentListData(sample: Sample, pricing: PricingProfile | null = null): Promise<readonly ExperimentListItem[]> {\n const snapshot = sample.snapshot;\n const attempts = await attemptListData(sample, pricing);\n const [experimentMetrics, evalMetrics] = await Promise.all([\n experimentMetricRows(sample, pricing),\n evalMetricRows(sample, pricing),\n ]);\n const attemptsByEval = new Map<string, AttemptListItem[]>();\n for (const item of attempts) {\n const key = metricsKey(item.experimentId, item.evalId);\n const list = attemptsByEval.get(key);\n if (list)\n list.push(item);\n else\n attemptsByEval.set(key, [item]);\n }\n const activeSlots = snapshot.slots.filter((slot) => slot.state !== \"excluded\");\n const experiments = new Map<ExperimentId, {\n evalIds: Set<EvalId>;\n included: Set<EvalId>;\n }>();\n for (const slot of activeSlots) {\n const entry = experiments.get(slot.experimentId);\n if (entry === undefined) {\n experiments.set(slot.experimentId, {\n evalIds: new Set([slot.evalId]),\n included: slot.state === \"included\" ? new Set([slot.evalId]) : new Set(),\n });\n continue;\n }\n entry.evalIds.add(slot.evalId);\n if (slot.state === \"included\")\n entry.included.add(slot.evalId);\n }\n // 组前缀布局(纯字符串)与 facade GroupFunction 坐标先于指标聚合固定。\n const prefixByExperiment = new Map<ExperimentId, ReadonlyMap<EvalId, string>>();\n for (const [experimentId, entry] of experiments) {\n const layout = experimentEvalLayout([...entry.evalIds]);\n const prefixFor = new Map<EvalId, string>();\n const walk = (nodes: readonly EvalLayoutNode[]): void => {\n for (const node of nodes) {\n if (node.kind === \"leaf\")\n continue;\n for (const evalIdValue of evalIdsUnder(node))\n prefixFor.set(evalIdValue, node.prefix);\n walk(node.children);\n }\n };\n walk(layout);\n prefixByExperiment.set(experimentId, prefixFor);\n }\n const hasGroups = [...prefixByExperiment.values()].some((prefixFor) => prefixFor.size > 0);\n const groupMetrics = hasGroups\n ? await groupMetricRows(sample, prefixByExperiment, pricing)\n : new Map<string, ExperimentMetrics>();\n const watermarks = watermarksByExperiment(sample);\n const items: ExperimentListItem[] = [];\n for (const [experimentId, entry] of experiments) {\n const evalIds = [...entry.evalIds];\n const missing = [...evalIds].filter((evalIdValue) => !entry.included.has(evalIdValue));\n const evalRows: ExperimentListEvalRow[] = [];\n for (const evalIdValue of evalIds) {\n if (!entry.included.has(evalIdValue))\n continue;\n const list = attemptsByEval.get(metricsKey(experimentId, evalIdValue)) ?? [];\n const sorted = [...list].sort((left, right) => left.attemptOrdinal - right.attemptOrdinal || left.locator.localeCompare(right.locator));\n const metrics = requireMetrics(evalMetrics.get(metricsKey(experimentId, evalIdValue)), `experiment/eval ${JSON.stringify(experimentId)}/${JSON.stringify(evalIdValue)}`);\n evalRows.push(Object.freeze({\n evalId: evalIdValue,\n endToEndPassRate: metrics.passRate,\n durationMs: metrics.durationMs,\n ...(metrics.costUSD === undefined ? {} : { costUSD: metrics.costUSD }),\n tokens: metrics.tokens,\n attempts: Object.freeze(sorted),\n }));\n }\n const watermark = watermarks.get(experimentId);\n const experimentMetric = requireMetrics(experimentMetrics.get(experimentId), `experiment ${JSON.stringify(experimentId)}`);\n const groupMetricsForItem = new Map<string, ExperimentMetrics>();\n const prefixes = [...new Set(prefixByExperiment.get(experimentId)?.values() ?? [])];\n for (const prefix of prefixes) {\n const metric = groupMetrics.get(metricsKey(experimentId, prefix));\n if (metric !== undefined)\n groupMetricsForItem.set(prefix, metric);\n }\n items.push(Object.freeze({\n experimentId,\n agent: watermark?.agent ?? null,\n model: watermark?.model ?? null,\n flags: watermark?.flags ?? null,\n evaluationKind: \"pass\",\n endToEndPassRate: experimentMetric.passRate,\n durationMs: experimentMetric.durationMs,\n ...(experimentMetric.costUSD === undefined ? {} : { costUSD: experimentMetric.costUSD }),\n tokens: experimentMetric.tokens,\n missingEvalIds: Object.freeze(missing.sort((left, right) => left.localeCompare(right))),\n groupMetrics: groupMetricsForItem,\n evalRows: Object.freeze(evalRows),\n href: experimentHref(experimentId),\n }));\n }\n items.sort(byMetricDescThenId((item) => item.endToEndPassRate.value));\n return Object.freeze(items);\n}\nfunction evalIdsUnder(node: EvalLayoutNode): readonly EvalId[] {\n if (node.kind === \"leaf\")\n return [node.evalId];\n return node.children.flatMap(evalIdsUnder);\n}\nfunction byMetricDescThenId(valueOf: (item: ExperimentListItem) => number | null): (left: ExperimentListItem, right: ExperimentListItem) => number {\n return (left, right) => {\n const leftValue = valueOf(left);\n const rightValue = valueOf(right);\n if (leftValue === null && rightValue === null) {\n return left.experimentId.localeCompare(right.experimentId);\n }\n if (leftValue === null)\n return 1;\n if (rightValue === null)\n return -1;\n return rightValue - leftValue || left.experimentId.localeCompare(right.experimentId);\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"compute.js","sourceRoot":"","sources":["compute.ts"],"names":[],"mappings":";;AAyGA,8CAKC;AAUD,oDAEC;AAiSD,0CA+BC;AAMD,gDAyHC;AA3iBD,2DAA4G;AAC5G,uDAA+E;AAC/E,+DAA+D;AAC/D,yDAA4G;AAC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aAAa,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;IACzF,CAAC,CAAC;AACN,CAAC","sourcesContent":["// 实体列表计算函数(*Data):固定 Sample → 闭合组件数据。\n// ExperimentTable / AttemptList / FailureList 的 *Data 都住在这里。\n//\n// 共同约定见 docs/feature/reports/architecture.md 与 calculations.md:\n// - 第一参只收 Report Sample;issues 与 Evidence 留在 Analysis-owned MetricValue 里;\n// - 指标一律来自 `aggregate()` facade,判定来自公开 attempt-evidence DomainView,\n// 身份与覆盖事实来自 closed SampleSnapshot——这里不实现任何统计算法;\n// - null ≠ 0:缺数据不编数,覆盖率经 samples/total 如实暴露;\n// - 详情 href 一律经 `libraryDetailRoute()` + `attemptDetailTarget()` /\n// `experimentDetailTarget()` 建立,不自行编码 locator / experiment id 路径。\nimport type { AttemptEvidenceDomainView, CostMetricValue, JsonValue, MetricValue, PricingProfile, Sample, } from \"../../../analysis/index.ts\";\nimport type { AttemptLocator } from \"../../../attempt-locator.ts\";\nimport type { EvalId, ExperimentId } from \"../../../analysis/index.ts\";\nimport type { Verdict } from \"../../../shared/types.ts\";\nimport { aggregate, attempt, evalId, experiment, type AggregationSubject, } from \"../../model/aggregate.ts\";\nimport { costUSD, durationMs, passRate, tokens } from \"../../model/metrics.ts\";\nimport { toAttemptEvidence } from \"../../model/conversions.ts\";\nimport { attemptDetailTarget, experimentDetailTarget, libraryDetailRoute, } from \"../../library/details.ts\";\nimport { assertionEntryViewOf } from \"../attempt-detail/compute.ts\";\ntype UtcMillis = Sample[\"snapshot\"][\"runs\"][number][\"startedAt\"];\ntype ClosedAttemptEvidenceEntry = AttemptEvidenceDomainView[\"entries\"][number];\nexport type EvaluationKindComposition = \"pass\" | \"points\" | \"mixed\";\n/** 一个层级共用的四枚 Analysis-owned 读数。 */\nexport interface ExperimentMetrics {\n readonly passRate: MetricValue<number>;\n readonly durationMs: MetricValue<number>;\n /** Present only when the owning Report declares a PricingProfile. */\n readonly costUSD?: CostMetricValue;\n readonly tokens: MetricValue<number>;\n}\n/** 一次 attempt 的闭合行。 */\nexport interface AttemptListItem {\n readonly locator: AttemptLocator;\n readonly experimentId: ExperimentId;\n readonly evalId: EvalId;\n readonly attemptOrdinal: number;\n /** 来自公开 attempt-evidence DomainView;证据读取失败时为 null(不伪造判定)。 */\n readonly verdict: Verdict | null;\n /**\n * 闭合失败摘要:errored 取 outcome 词,failed 取首条 mismatched 断言条目的\n * display 标签;closed 数据没有可读摘录时为 null(渲染成 \"—\",不发明文案)。\n */\n readonly failureSummary: string | null;\n readonly evaluationKind: \"pass\" | \"points\";\n /** Complete earned score for this Attempt; absent for pass or incomplete score evidence. */\n readonly totalScore?: number;\n readonly passRate: MetricValue<number>;\n readonly durationMs: MetricValue<number>;\n /** Present only when the owning Report declares a PricingProfile. */\n readonly costUSD?: CostMetricValue;\n readonly tokens: MetricValue<number>;\n /** 所属 selected Run 的 startedAt(attempt 级起点不进 closed snapshot)。 */\n readonly startedAt: UtcMillis | null;\n /** 详情 href,经 libraryDetailRoute(attemptDetailTarget(locator)) 建立。 */\n readonly href: string;\n}\n/** experiment 层级表里一道 Eval 的闭合行;attempts 是它的可见子行。 */\nexport interface ExperimentListEvalRow {\n readonly evalId: EvalId;\n readonly evaluationKind: \"pass\" | \"points\";\n /** Mean of complete Attempt scores for this Eval. */\n readonly totalScore?: number;\n readonly endToEndPassRate: MetricValue<number>;\n readonly durationMs: MetricValue<number>;\n readonly costUSD?: CostMetricValue;\n readonly tokens: MetricValue<number>;\n readonly attempts: readonly AttemptListItem[];\n}\n/** 一个 experiment 的闭合行。 */\nexport interface ExperimentListItem {\n readonly experimentId: ExperimentId;\n /** 来自实验水位 Run 的 closed context;Run context 缺席时如实为 null。 */\n readonly agent: string | null;\n readonly model: string | null;\n readonly flags: Readonly<Record<string, JsonValue>> | null;\n readonly evaluationKind: EvaluationKindComposition;\n /** Sum of the visible per-Eval score cells; absent when no complete Score Eval exists. */\n readonly totalScore?: number;\n readonly endToEndPassRate: MetricValue<number>;\n readonly durationMs: MetricValue<number>;\n readonly costUSD?: CostMetricValue;\n readonly tokens: MetricValue<number>;\n /** 当前口径下没有 attempt 的题(active slot 为 not-recorded / core-invalid)。 */\n readonly missingEvalIds: readonly EvalId[];\n /**\n * 路径段组行的 Analysis-owned 读数,key 是完整组前缀(如 \"downshift/basic\")。\n * 组行不手写聚合:每个组前缀是 facade GroupFunction 的一个坐标,\n * 分母 / 状态 / Evidence 全部留在 Analysis。\n */\n readonly groupMetrics: ReadonlyMap<string, ExperimentMetrics>;\n readonly evalRows: readonly ExperimentListEvalRow[];\n /** 详情 href,经 libraryDetailRoute(experimentDetailTarget(id)) 建立。 */\n readonly href: string;\n}\n/** Eval 路径层级布局:叶子 / 路径段组。 */\nexport type EvalLayoutNode = {\n readonly kind: \"leaf\";\n readonly evalId: EvalId;\n} | {\n readonly kind: \"group\";\n readonly segment: string;\n readonly prefix: string;\n readonly children: readonly EvalLayoutNode[];\n};\n/** 相对已表达前缀的剩余路径;无前缀时是完整 evalId。 */\nexport function relativeEvalLabel(evalIdValue: EvalId, labelPrefix: string): string {\n if (!labelPrefix)\n return evalIdValue;\n const prefix = `${labelPrefix}/`;\n return evalIdValue.startsWith(prefix) ? evalIdValue.slice(prefix.length) : evalIdValue;\n}\nfunction joinEvalPath(prefix: string, segment: string): string {\n return prefix ? `${prefix}/${segment}` : segment;\n}\n/**\n * Eval 路径段 → 层级布局。两条收起条件在每一层兄弟之间各自判定\n * (docs/feature/reports/library.md「身份格与行数」):\n * 唯一组且无叶时剥壳前进,不插组行;组全为单成员或本层只有叶时全部放平。\n * 纯字符串投影,不读任何指标。\n */\nexport function experimentEvalLayout(evalIdValues: readonly EvalId[]): readonly EvalLayoutNode[] {\n return layoutLevel(evalIdValues, \"\");\n}\nfunction layoutLevel(members: readonly EvalId[], dirPrefix: string): readonly EvalLayoutNode[] {\n if (members.length === 0)\n return [];\n const leaves: EvalId[] = [];\n const groups = new Map<string, EvalId[]>();\n for (const member of members) {\n const remaining = relativeEvalLabel(member, dirPrefix).split(\"/\").filter(Boolean);\n if (remaining.length <= 1) {\n leaves.push(member);\n continue;\n }\n const head = remaining[0]!;\n const list = groups.get(head);\n if (list)\n list.push(member);\n else\n groups.set(head, [member]);\n }\n const collapse = groups.size === 0 ||\n (groups.size === 1 && leaves.length === 0) ||\n [...groups.values()].every((group) => group.length === 1);\n if (collapse) {\n if (groups.size === 1 && leaves.length === 0) {\n const head = [...groups.keys()][0]!;\n return layoutLevel(members, joinEvalPath(dirPrefix, head));\n }\n return [...leaves]\n .sort((left, right) => left.localeCompare(right))\n .map((member): EvalLayoutNode => ({ kind: \"leaf\", evalId: member }));\n }\n const groupNodes: EvalLayoutNode[] = [...groups.entries()]\n .sort(([left], [right]) => left.localeCompare(right))\n .map(([segment, groupMembers]) => ({\n kind: \"group\" as const,\n segment,\n prefix: joinEvalPath(dirPrefix, segment),\n children: layoutLevel(groupMembers, joinEvalPath(dirPrefix, segment)),\n }));\n const leafNodes: EvalLayoutNode[] = [...leaves]\n .sort((left, right) => left.localeCompare(right))\n .map((member): EvalLayoutNode => ({ kind: \"leaf\", evalId: member }));\n return [...groupNodes, ...leafNodes];\n}\ninterface AttemptFact {\n readonly verdict: Verdict | null;\n readonly failureSummary: string | null;\n readonly evaluationKind: \"pass\" | \"points\";\n readonly totalScore?: number;\n}\ninterface SlotSelection {\n readonly locator: AttemptLocator;\n readonly experimentId: ExperimentId;\n readonly evalId: EvalId;\n readonly attemptOrdinal: number;\n readonly startedAt: UtcMillis | null;\n}\n/** 一次 attempt 的闭合失败摘要(只读公开 DomainView,不重算断言展示)。 */\nfunction closedFailureSummary(entry: ClosedAttemptEvidenceEntry | undefined): string | null {\n if (entry === undefined || entry.state !== \"available\")\n return null;\n const detail = entry.detail;\n if (detail.verdict === \"errored\")\n return detail.outcome;\n if (detail.verdict !== \"failed\")\n return null;\n for (const item of detail.entries) {\n const result = item.result;\n if (typeof result !== \"object\" || result === null || Array.isArray(result))\n continue;\n if ((result as Readonly<Record<string, unknown>>).state !== \"mismatched\")\n continue;\n const display = item.display;\n if (typeof display === \"object\" && display !== null && !Array.isArray(display)) {\n const label = (display as Readonly<Record<string, unknown>>).label;\n if (typeof label === \"string\" && label.length > 0)\n return label;\n }\n return \"assertion\";\n }\n return null;\n}\nasync function evidenceFacts(sample: Sample): Promise<ReadonlyMap<AttemptLocator, AttemptFact>> {\n const view = await toAttemptEvidence(sample);\n const facts = new Map<AttemptLocator, AttemptFact>();\n for (const entry of view.entries) {\n const locator = entry.attempt.locator;\n const assertions = entry.state === \"available\"\n ? entry.detail.entries.map(assertionEntryViewOf).filter((item) => item !== undefined)\n : [];\n const scoreContributions = assertions\n .map((item) => item.result.score)\n .filter((score) => score.state !== \"not-scored\");\n const completeScore = scoreContributions.length > 0 &&\n scoreContributions.every((score) => score.state === \"earned\" && score.earned !== undefined)\n ? scoreContributions.reduce((sum, score) => sum + (score.earned ?? 0), 0)\n : undefined;\n facts.set(locator, Object.freeze({\n verdict: entry.state === \"available\" ? (entry.detail.verdict as Verdict) : null,\n failureSummary: closedFailureSummary(entry),\n evaluationKind: scoreContributions.length > 0 ? \"points\" : \"pass\",\n ...(completeScore === undefined ? {} : { totalScore: completeScore }),\n }));\n }\n return facts;\n}\nasync function attemptMetricRows(sample: Sample, pricing: PricingProfile | null): Promise<ReadonlyMap<string, ExperimentMetrics>> {\n const rows = await aggregate(sample, {\n by: { experiment, evalId, attempt },\n values: pricing === null\n ? { passRate, durationMs, tokens }\n : { passRate, durationMs, costUSD: costUSD(pricing), tokens },\n });\n const byKey = new Map<string, ExperimentMetrics>();\n for (const row of rows) {\n if (typeof row.attempt !== \"string\")\n continue;\n byKey.set(metricsKey(row.experiment as string, row.evalId as string, row.attempt), Object.freeze({\n passRate: row.passRate,\n durationMs: row.durationMs,\n ...(pricing === null ? {} : { costUSD: (row as unknown as {\n readonly costUSD: CostMetricValue;\n }).costUSD }),\n tokens: row.tokens,\n }));\n }\n return byKey;\n}\nfunction metricsKey(experimentId: string, evalIdValue: string, locator?: string): string {\n return locator === undefined\n ? `${experimentId}\\u0000${evalIdValue}`\n : `${experimentId}\\u0000${evalIdValue}\\u0000${locator}`;\n}\n/**\n * Included Analysis subjects always have an aggregate row, even when every\n * measure in that row is empty. Treat an omitted row as a broken Analysis\n * contract instead of manufacturing a Report-owned MetricValue.\n */\nfunction requireMetrics(metrics: ExperimentMetrics | undefined, subject: string): ExperimentMetrics {\n if (metrics === undefined) {\n throw new Error(`Analysis aggregate omitted the required ${subject} row.`);\n }\n return metrics;\n}\n/** 每个 experiment 每道 Eval 一行,按 evalId 升序返回(不重排 attempt 语义)。 */\nasync function evalMetricRows(sample: Sample, pricing: PricingProfile | null): Promise<ReadonlyMap<string, ExperimentMetrics>> {\n const rows = await aggregate(sample, {\n by: { experiment, evalId },\n values: pricing === null\n ? { passRate, durationMs, tokens }\n : { passRate, durationMs, costUSD: costUSD(pricing), tokens },\n });\n const byKey = new Map<string, ExperimentMetrics>();\n for (const row of rows) {\n byKey.set(metricsKey(row.experiment as string, row.evalId as string), Object.freeze({\n passRate: row.passRate,\n durationMs: row.durationMs,\n ...(pricing === null ? {} : { costUSD: (row as unknown as {\n readonly costUSD: CostMetricValue;\n }).costUSD }),\n tokens: row.tokens,\n }));\n }\n return byKey;\n}\nasync function experimentMetricRows(sample: Sample, pricing: PricingProfile | null): Promise<ReadonlyMap<ExperimentId, ExperimentMetrics>> {\n const rows = await aggregate(sample, {\n by: { experiment },\n values: pricing === null\n ? { passRate, durationMs, tokens }\n : { passRate, durationMs, costUSD: costUSD(pricing), tokens },\n });\n const byId = new Map<ExperimentId, ExperimentMetrics>();\n for (const row of rows) {\n byId.set(row.experiment as ExperimentId, Object.freeze({\n passRate: row.passRate,\n durationMs: row.durationMs,\n ...(pricing === null ? {} : { costUSD: (row as unknown as {\n readonly costUSD: CostMetricValue;\n }).costUSD }),\n tokens: row.tokens,\n }));\n }\n return byId;\n}\n/**\n * 组行读数的 facade 聚合:每个路径段组前缀是一个 GroupFunction 坐标,\n * 分母 / 状态 / Evidence 全部由 Analysis 按 logical slots 计算。\n */\nasync function groupMetricRows(sample: Sample, prefixByExperiment: ReadonlyMap<ExperimentId, ReadonlyMap<EvalId, string>>, pricing: PricingProfile | null): Promise<ReadonlyMap<string, ExperimentMetrics>> {\n const groupPrefix = (subject: AggregationSubject): string => prefixByExperiment.get(subject.experimentId)?.get(subject.evalId) ?? \"\";\n const rows = await aggregate(sample, {\n by: { experiment, prefix: groupPrefix },\n values: pricing === null\n ? { passRate, durationMs, tokens }\n : { passRate, durationMs, costUSD: costUSD(pricing), tokens },\n });\n const byKey = new Map<string, ExperimentMetrics>();\n for (const row of rows) {\n const prefix = row.prefix;\n if (typeof prefix !== \"string\" || prefix.length === 0)\n continue;\n byKey.set(metricsKey(row.experiment as string, prefix), Object.freeze({\n passRate: row.passRate,\n durationMs: row.durationMs,\n ...(pricing === null ? {} : { costUSD: (row as unknown as {\n readonly costUSD: CostMetricValue;\n }).costUSD }),\n tokens: row.tokens,\n }));\n }\n return byKey;\n}\nfunction attemptHref(locator: AttemptLocator): string {\n return libraryDetailRoute(attemptDetailTarget(locator));\n}\nfunction experimentHref(experimentId: ExperimentId): string {\n return libraryDetailRoute(experimentDetailTarget(experimentId));\n}\n/** SampleSnapshot → 每个 experiment 的身份水位(最新 startedAt 的 Run)。 */\nfunction watermarksByExperiment(sample: Sample): ReadonlyMap<ExperimentId, {\n readonly startedAt: UtcMillis;\n readonly agent: string | null;\n readonly model: string | null;\n readonly flags: Readonly<Record<string, JsonValue>> | null;\n}> {\n const runsByExperiment = new Map<ExperimentId, typeof sample.snapshot.runs[number][]>();\n for (const run of sample.snapshot.runs) {\n const list = runsByExperiment.get(run.experimentId);\n if (list)\n list.push(run);\n else\n runsByExperiment.set(run.experimentId, [run]);\n }\n const byExperiment = new Map<ExperimentId, {\n readonly startedAt: UtcMillis;\n readonly agent: string | null;\n readonly model: string | null;\n readonly flags: Readonly<Record<string, JsonValue>> | null;\n }>();\n for (const [experimentId, runs] of runsByExperiment) {\n const newest = runs.reduce((best, run) => run.startedAt > best.startedAt ? run : best, runs[0]!);\n const context = newest.context;\n byExperiment.set(experimentId, Object.freeze({\n startedAt: newest.startedAt,\n agent: context?.execution.agentId ?? null,\n model: context?.execution.model ?? null,\n flags: context ? Object.freeze({ ...context.execution.flags }) : null,\n }));\n }\n return byExperiment;\n}\nfunction runStartedAtByRunId(sample: Sample): ReadonlyMap<string, UtcMillis> {\n const byRunId = new Map<string, UtcMillis>();\n for (const run of sample.snapshot.runs)\n byRunId.set(run.runId, run.startedAt);\n return byRunId;\n}\n/**\n * 按 locator 去重的 included slot 选择:同一 locator 出现多份(跨 Run 携带)时\n * 取 startedAt 最新的一份作展示行。Member 的 action / relation 是 Run provenance,\n * 不在质量列表里折成额外的时效状态。\n */\nfunction selectedSlots(sample: Sample): readonly SlotSelection[] {\n const runStartedAt = runStartedAtByRunId(sample);\n const byLocator = new Map<AttemptLocator, SlotSelection>();\n for (const slot of sample.snapshot.slots) {\n if (slot.state !== \"included\")\n continue;\n const locator = slot.attempt.locator;\n const startedAt = runStartedAt.get(slot.runId) ?? null;\n const existing = byLocator.get(locator);\n if (existing === undefined ||\n (startedAt !== null && (existing.startedAt === null || startedAt > existing.startedAt))) {\n byLocator.set(locator, Object.freeze({\n locator,\n experimentId: slot.experimentId,\n evalId: slot.evalId,\n attemptOrdinal: slot.attemptOrdinal,\n startedAt,\n }));\n }\n }\n return Object.freeze([...byLocator.values()]);\n}\n/**\n * `attemptListData(sample)`:每个 included attempt 一项,顺序取自 Sample 展平顺序\n * (按 locator 去重后保持首次出现序,不重排)。\n */\nexport async function attemptListData(sample: Sample, pricing: PricingProfile | null = null): Promise<readonly AttemptListItem[]> {\n const [facts, metrics] = await Promise.all([\n evidenceFacts(sample),\n attemptMetricRows(sample, pricing),\n ]);\n const selections = selectedSlots(sample);\n return Object.freeze(selections.map((selection): AttemptListItem => {\n const fact: AttemptFact = facts.get(selection.locator) ?? Object.freeze({\n verdict: null,\n failureSummary: null,\n evaluationKind: \"pass\" as const,\n });\n const metric = requireMetrics(metrics.get(metricsKey(selection.experimentId, selection.evalId, selection.locator)), `attempt ${JSON.stringify(selection.locator)}`);\n const item: AttemptListItem = Object.freeze({\n locator: selection.locator,\n experimentId: selection.experimentId,\n evalId: selection.evalId,\n attemptOrdinal: selection.attemptOrdinal,\n verdict: fact.verdict,\n failureSummary: fact.failureSummary,\n evaluationKind: fact.evaluationKind,\n ...(fact.totalScore === undefined ? {} : { totalScore: fact.totalScore }),\n passRate: metric.passRate,\n durationMs: metric.durationMs,\n ...(metric.costUSD === undefined ? {} : { costUSD: metric.costUSD }),\n tokens: metric.tokens,\n startedAt: selection.startedAt,\n href: attemptHref(selection.locator),\n });\n return item;\n }));\n}\n/**\n * `experimentListData(sample)`:每个 experiment 一项,展开到每道 Eval;初始排序按\n * 这份列表自身的题型构成选择主读数——当前 facade 只有通过制读数,恒为\n * endToEndPassRate 降序(缺数据沉底,同值按 experimentId 字典序收口)。\n */\nexport async function experimentListData(sample: Sample, pricing: PricingProfile | null = null): Promise<readonly ExperimentListItem[]> {\n const snapshot = sample.snapshot;\n const attempts = await attemptListData(sample, pricing);\n const [experimentMetrics, evalMetrics] = await Promise.all([\n experimentMetricRows(sample, pricing),\n evalMetricRows(sample, pricing),\n ]);\n const attemptsByEval = new Map<string, AttemptListItem[]>();\n for (const item of attempts) {\n const key = metricsKey(item.experimentId, item.evalId);\n const list = attemptsByEval.get(key);\n if (list)\n list.push(item);\n else\n attemptsByEval.set(key, [item]);\n }\n const activeSlots = snapshot.slots.filter((slot) => slot.state !== \"excluded\");\n const experiments = new Map<ExperimentId, {\n evalIds: Set<EvalId>;\n included: Set<EvalId>;\n }>();\n for (const slot of activeSlots) {\n const entry = experiments.get(slot.experimentId);\n if (entry === undefined) {\n experiments.set(slot.experimentId, {\n evalIds: new Set([slot.evalId]),\n included: slot.state === \"included\" ? new Set([slot.evalId]) : new Set(),\n });\n continue;\n }\n entry.evalIds.add(slot.evalId);\n if (slot.state === \"included\")\n entry.included.add(slot.evalId);\n }\n // 组前缀布局(纯字符串)与 facade GroupFunction 坐标先于指标聚合固定。\n const prefixByExperiment = new Map<ExperimentId, ReadonlyMap<EvalId, string>>();\n for (const [experimentId, entry] of experiments) {\n const layout = experimentEvalLayout([...entry.evalIds]);\n const prefixFor = new Map<EvalId, string>();\n const walk = (nodes: readonly EvalLayoutNode[]): void => {\n for (const node of nodes) {\n if (node.kind === \"leaf\")\n continue;\n for (const evalIdValue of evalIdsUnder(node))\n prefixFor.set(evalIdValue, node.prefix);\n walk(node.children);\n }\n };\n walk(layout);\n prefixByExperiment.set(experimentId, prefixFor);\n }\n const hasGroups = [...prefixByExperiment.values()].some((prefixFor) => prefixFor.size > 0);\n const groupMetrics = hasGroups\n ? await groupMetricRows(sample, prefixByExperiment, pricing)\n : new Map<string, ExperimentMetrics>();\n const watermarks = watermarksByExperiment(sample);\n const items: ExperimentListItem[] = [];\n for (const [experimentId, entry] of experiments) {\n const evalIds = [...entry.evalIds];\n const missing = [...evalIds].filter((evalIdValue) => !entry.included.has(evalIdValue));\n const evalRows: ExperimentListEvalRow[] = [];\n for (const evalIdValue of evalIds) {\n if (!entry.included.has(evalIdValue))\n continue;\n const list = attemptsByEval.get(metricsKey(experimentId, evalIdValue)) ?? [];\n const sorted = [...list].sort((left, right) => left.attemptOrdinal - right.attemptOrdinal || left.locator.localeCompare(right.locator));\n const metrics = requireMetrics(evalMetrics.get(metricsKey(experimentId, evalIdValue)), `experiment/eval ${JSON.stringify(experimentId)}/${JSON.stringify(evalIdValue)}`);\n const evaluationKind = sorted.some((attempt) => attempt.evaluationKind === \"points\") ? \"points\" : \"pass\";\n const completeScores = sorted.flatMap((attempt) => attempt.totalScore === undefined ? [] : [attempt.totalScore]);\n evalRows.push(Object.freeze({\n evalId: evalIdValue,\n evaluationKind,\n ...(completeScores.length === 0\n ? {}\n : { totalScore: completeScores.reduce((sum, score) => sum + score, 0) / completeScores.length }),\n endToEndPassRate: metrics.passRate,\n durationMs: metrics.durationMs,\n ...(metrics.costUSD === undefined ? {} : { costUSD: metrics.costUSD }),\n tokens: metrics.tokens,\n attempts: Object.freeze(sorted),\n }));\n }\n const watermark = watermarks.get(experimentId);\n const experimentMetric = requireMetrics(experimentMetrics.get(experimentId), `experiment ${JSON.stringify(experimentId)}`);\n const groupMetricsForItem = new Map<string, ExperimentMetrics>();\n const prefixes = [...new Set(prefixByExperiment.get(experimentId)?.values() ?? [])];\n for (const prefix of prefixes) {\n const metric = groupMetrics.get(metricsKey(experimentId, prefix));\n if (metric !== undefined)\n groupMetricsForItem.set(prefix, metric);\n }\n const evaluationKind = evalRows.some((row) => row.evaluationKind === \"points\")\n ? evalRows.some((row) => row.evaluationKind === \"pass\") ? \"mixed\" : \"points\"\n : \"pass\";\n const completeEvalScores = evalRows.flatMap((row) => row.totalScore === undefined ? [] : [row.totalScore]);\n items.push(Object.freeze({\n experimentId,\n agent: watermark?.agent ?? null,\n model: watermark?.model ?? null,\n flags: watermark?.flags ?? null,\n evaluationKind,\n ...(completeEvalScores.length === 0\n ? {}\n : { totalScore: completeEvalScores.reduce((sum, score) => sum + score, 0) }),\n endToEndPassRate: experimentMetric.passRate,\n durationMs: experimentMetric.durationMs,\n ...(experimentMetric.costUSD === undefined ? {} : { costUSD: experimentMetric.costUSD }),\n tokens: experimentMetric.tokens,\n missingEvalIds: Object.freeze(missing.sort((left, right) => left.localeCompare(right))),\n groupMetrics: groupMetricsForItem,\n evalRows: Object.freeze(evalRows),\n href: experimentHref(experimentId),\n }));\n }\n const composition = items.some((item) => item.evaluationKind !== \"pass\")\n ? items.some((item) => item.evaluationKind !== \"points\") ? \"mixed\" : \"points\"\n : \"pass\";\n items.sort(byMetricDescThenId((item) => composition !== \"pass\"\n ? item.totalScore ?? null\n : item.endToEndPassRate.value));\n return Object.freeze(items);\n}\nfunction evalIdsUnder(node: EvalLayoutNode): readonly EvalId[] {\n if (node.kind === \"leaf\")\n return [node.evalId];\n return node.children.flatMap(evalIdsUnder);\n}\nfunction byMetricDescThenId(valueOf: (item: ExperimentListItem) => number | null): (left: ExperimentListItem, right: ExperimentListItem) => number {\n return (left, right) => {\n const leftValue = valueOf(left);\n const rightValue = valueOf(right);\n if (leftValue === null && rightValue === null) {\n return left.experimentId.localeCompare(right.experimentId);\n }\n if (leftValue === null)\n return 1;\n if (rightValue === null)\n return -1;\n return rightValue - leftValue || left.experimentId.localeCompare(right.experimentId);\n };\n}\n"]}
|
|
@@ -3,11 +3,6 @@ import type { AttemptLocator } from "../../../attempt-locator.cjs";
|
|
|
3
3
|
import type { EvalId, ExperimentId } from "../../../analysis/index.cjs";
|
|
4
4
|
import type { Verdict } from "../../../shared/types.cjs";
|
|
5
5
|
type UtcMillis = Sample["snapshot"]["runs"][number]["startedAt"];
|
|
6
|
-
/**
|
|
7
|
-
* 当前 Analysis 只发布通过制读数(没有总分 Measure),题型构成恒为
|
|
8
|
-
* "pass"。未来 Analysis 发布计分制 Measure 时,这里与 content.ts 的列集一起按
|
|
9
|
-
* 同一构成判据扩展。
|
|
10
|
-
*/
|
|
11
6
|
export type EvaluationKindComposition = "pass" | "points" | "mixed";
|
|
12
7
|
/** 一个层级共用的四枚 Analysis-owned 读数。 */
|
|
13
8
|
export interface ExperimentMetrics {
|
|
@@ -30,6 +25,9 @@ export interface AttemptListItem {
|
|
|
30
25
|
* display 标签;closed 数据没有可读摘录时为 null(渲染成 "—",不发明文案)。
|
|
31
26
|
*/
|
|
32
27
|
readonly failureSummary: string | null;
|
|
28
|
+
readonly evaluationKind: "pass" | "points";
|
|
29
|
+
/** Complete earned score for this Attempt; absent for pass or incomplete score evidence. */
|
|
30
|
+
readonly totalScore?: number;
|
|
33
31
|
readonly passRate: MetricValue<number>;
|
|
34
32
|
readonly durationMs: MetricValue<number>;
|
|
35
33
|
/** Present only when the owning Report declares a PricingProfile. */
|
|
@@ -43,6 +41,9 @@ export interface AttemptListItem {
|
|
|
43
41
|
/** experiment 层级表里一道 Eval 的闭合行;attempts 是它的可见子行。 */
|
|
44
42
|
export interface ExperimentListEvalRow {
|
|
45
43
|
readonly evalId: EvalId;
|
|
44
|
+
readonly evaluationKind: "pass" | "points";
|
|
45
|
+
/** Mean of complete Attempt scores for this Eval. */
|
|
46
|
+
readonly totalScore?: number;
|
|
46
47
|
readonly endToEndPassRate: MetricValue<number>;
|
|
47
48
|
readonly durationMs: MetricValue<number>;
|
|
48
49
|
readonly costUSD?: CostMetricValue;
|
|
@@ -56,8 +57,9 @@ export interface ExperimentListItem {
|
|
|
56
57
|
readonly agent: string | null;
|
|
57
58
|
readonly model: string | null;
|
|
58
59
|
readonly flags: Readonly<Record<string, JsonValue>> | null;
|
|
59
|
-
/** 占位默认值,见 EvaluationKindComposition 注释。 */
|
|
60
60
|
readonly evaluationKind: EvaluationKindComposition;
|
|
61
|
+
/** Sum of the visible per-Eval score cells; absent when no complete Score Eval exists. */
|
|
62
|
+
readonly totalScore?: number;
|
|
61
63
|
readonly endToEndPassRate: MetricValue<number>;
|
|
62
64
|
readonly durationMs: MetricValue<number>;
|
|
63
65
|
readonly costUSD?: CostMetricValue;
|
|
@@ -3,11 +3,6 @@ import type { AttemptLocator } from "../../../attempt-locator.mjs";
|
|
|
3
3
|
import type { EvalId, ExperimentId } from "../../../analysis/index.mjs";
|
|
4
4
|
import type { Verdict } from "../../../shared/types.mjs";
|
|
5
5
|
type UtcMillis = Sample["snapshot"]["runs"][number]["startedAt"];
|
|
6
|
-
/**
|
|
7
|
-
* 当前 Analysis 只发布通过制读数(没有总分 Measure),题型构成恒为
|
|
8
|
-
* "pass"。未来 Analysis 发布计分制 Measure 时,这里与 content.ts 的列集一起按
|
|
9
|
-
* 同一构成判据扩展。
|
|
10
|
-
*/
|
|
11
6
|
export type EvaluationKindComposition = "pass" | "points" | "mixed";
|
|
12
7
|
/** 一个层级共用的四枚 Analysis-owned 读数。 */
|
|
13
8
|
export interface ExperimentMetrics {
|
|
@@ -30,6 +25,9 @@ export interface AttemptListItem {
|
|
|
30
25
|
* display 标签;closed 数据没有可读摘录时为 null(渲染成 "—",不发明文案)。
|
|
31
26
|
*/
|
|
32
27
|
readonly failureSummary: string | null;
|
|
28
|
+
readonly evaluationKind: "pass" | "points";
|
|
29
|
+
/** Complete earned score for this Attempt; absent for pass or incomplete score evidence. */
|
|
30
|
+
readonly totalScore?: number;
|
|
33
31
|
readonly passRate: MetricValue<number>;
|
|
34
32
|
readonly durationMs: MetricValue<number>;
|
|
35
33
|
/** Present only when the owning Report declares a PricingProfile. */
|
|
@@ -43,6 +41,9 @@ export interface AttemptListItem {
|
|
|
43
41
|
/** experiment 层级表里一道 Eval 的闭合行;attempts 是它的可见子行。 */
|
|
44
42
|
export interface ExperimentListEvalRow {
|
|
45
43
|
readonly evalId: EvalId;
|
|
44
|
+
readonly evaluationKind: "pass" | "points";
|
|
45
|
+
/** Mean of complete Attempt scores for this Eval. */
|
|
46
|
+
readonly totalScore?: number;
|
|
46
47
|
readonly endToEndPassRate: MetricValue<number>;
|
|
47
48
|
readonly durationMs: MetricValue<number>;
|
|
48
49
|
readonly costUSD?: CostMetricValue;
|
|
@@ -56,8 +57,9 @@ export interface ExperimentListItem {
|
|
|
56
57
|
readonly agent: string | null;
|
|
57
58
|
readonly model: string | null;
|
|
58
59
|
readonly flags: Readonly<Record<string, JsonValue>> | null;
|
|
59
|
-
/** 占位默认值,见 EvaluationKindComposition 注释。 */
|
|
60
60
|
readonly evaluationKind: EvaluationKindComposition;
|
|
61
|
+
/** Sum of the visible per-Eval score cells; absent when no complete Score Eval exists. */
|
|
62
|
+
readonly totalScore?: number;
|
|
61
63
|
readonly endToEndPassRate: MetricValue<number>;
|
|
62
64
|
readonly durationMs: MetricValue<number>;
|
|
63
65
|
readonly costUSD?: CostMetricValue;
|
|
@@ -3,11 +3,6 @@ import type { AttemptLocator } from "../../../attempt-locator.js";
|
|
|
3
3
|
import type { EvalId, ExperimentId } from "../../../analysis/index.js";
|
|
4
4
|
import type { Verdict } from "../../../shared/types.js";
|
|
5
5
|
type UtcMillis = Sample["snapshot"]["runs"][number]["startedAt"];
|
|
6
|
-
/**
|
|
7
|
-
* 当前 Analysis 只发布通过制读数(没有总分 Measure),题型构成恒为
|
|
8
|
-
* "pass"。未来 Analysis 发布计分制 Measure 时,这里与 content.ts 的列集一起按
|
|
9
|
-
* 同一构成判据扩展。
|
|
10
|
-
*/
|
|
11
6
|
export type EvaluationKindComposition = "pass" | "points" | "mixed";
|
|
12
7
|
/** 一个层级共用的四枚 Analysis-owned 读数。 */
|
|
13
8
|
export interface ExperimentMetrics {
|
|
@@ -30,6 +25,9 @@ export interface AttemptListItem {
|
|
|
30
25
|
* display 标签;closed 数据没有可读摘录时为 null(渲染成 "—",不发明文案)。
|
|
31
26
|
*/
|
|
32
27
|
readonly failureSummary: string | null;
|
|
28
|
+
readonly evaluationKind: "pass" | "points";
|
|
29
|
+
/** Complete earned score for this Attempt; absent for pass or incomplete score evidence. */
|
|
30
|
+
readonly totalScore?: number;
|
|
33
31
|
readonly passRate: MetricValue<number>;
|
|
34
32
|
readonly durationMs: MetricValue<number>;
|
|
35
33
|
/** Present only when the owning Report declares a PricingProfile. */
|
|
@@ -43,6 +41,9 @@ export interface AttemptListItem {
|
|
|
43
41
|
/** experiment 层级表里一道 Eval 的闭合行;attempts 是它的可见子行。 */
|
|
44
42
|
export interface ExperimentListEvalRow {
|
|
45
43
|
readonly evalId: EvalId;
|
|
44
|
+
readonly evaluationKind: "pass" | "points";
|
|
45
|
+
/** Mean of complete Attempt scores for this Eval. */
|
|
46
|
+
readonly totalScore?: number;
|
|
46
47
|
readonly endToEndPassRate: MetricValue<number>;
|
|
47
48
|
readonly durationMs: MetricValue<number>;
|
|
48
49
|
readonly costUSD?: CostMetricValue;
|
|
@@ -56,8 +57,9 @@ export interface ExperimentListItem {
|
|
|
56
57
|
readonly agent: string | null;
|
|
57
58
|
readonly model: string | null;
|
|
58
59
|
readonly flags: Readonly<Record<string, JsonValue>> | null;
|
|
59
|
-
/** 占位默认值,见 EvaluationKindComposition 注释。 */
|
|
60
60
|
readonly evaluationKind: EvaluationKindComposition;
|
|
61
|
+
/** Sum of the visible per-Eval score cells; absent when no complete Score Eval exists. */
|
|
62
|
+
readonly totalScore?: number;
|
|
61
63
|
readonly endToEndPassRate: MetricValue<number>;
|
|
62
64
|
readonly durationMs: MetricValue<number>;
|
|
63
65
|
readonly costUSD?: CostMetricValue;
|