niceeval 0.13.1 → 0.13.2-canary.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (134) hide show
  1. package/INDEX.md +1 -0
  2. package/README.md +9 -10
  3. package/README.zh.md +9 -10
  4. package/dist/agents/ai-sdk.cjs.map +1 -1
  5. package/dist/agents/ai-sdk.d.cts +1 -1
  6. package/dist/agents/ai-sdk.d.mts +1 -1
  7. package/dist/agents/ai-sdk.d.ts +1 -1
  8. package/dist/agents/coding-cli-versions.cjs +10 -1
  9. package/dist/agents/coding-cli-versions.cjs.map +1 -1
  10. package/dist/agents/coding-cli-versions.d.cts +8 -3
  11. package/dist/agents/coding-cli-versions.d.mts +8 -3
  12. package/dist/agents/coding-cli-versions.d.ts +8 -3
  13. package/dist/agents/coding-cli-versions.js +18 -12
  14. package/dist/agents/deepseek-harness.cjs +103 -0
  15. package/dist/agents/deepseek-harness.cjs.map +1 -0
  16. package/dist/agents/deepseek-harness.d.cts +12 -0
  17. package/dist/agents/deepseek-harness.d.mts +12 -0
  18. package/dist/agents/deepseek-harness.d.ts +12 -0
  19. package/dist/agents/deepseek-harness.js +7 -0
  20. package/dist/agents/deepseek-harness.js.map +1 -0
  21. package/dist/agents/index.cjs +5 -1
  22. package/dist/agents/index.cjs.map +1 -1
  23. package/dist/agents/index.d.cts +4 -0
  24. package/dist/agents/index.d.mts +4 -0
  25. package/dist/agents/index.d.ts +4 -0
  26. package/dist/agents/index.js +54 -50
  27. package/dist/agents/index.mjs +54 -50
  28. package/dist/agents/omp.cjs +170 -0
  29. package/dist/agents/omp.cjs.map +1 -0
  30. package/dist/agents/omp.d.cts +14 -0
  31. package/dist/agents/omp.d.mts +14 -0
  32. package/dist/agents/omp.d.ts +14 -0
  33. package/dist/agents/omp.js +7 -0
  34. package/dist/agents/omp.js.map +1 -0
  35. package/dist/agents/types.cjs.map +1 -1
  36. package/dist/agents/types.d.cts +2 -2
  37. package/dist/agents/types.d.mts +2 -2
  38. package/dist/agents/types.d.ts +2 -2
  39. package/dist/analysis/api.cjs +9 -1
  40. package/dist/analysis/api.cjs.map +1 -1
  41. package/dist/analysis/api.d.cts +21 -0
  42. package/dist/analysis/api.d.mts +21 -0
  43. package/dist/analysis/api.d.ts +21 -0
  44. package/dist/analysis/api.js +8 -6
  45. package/dist/i18n/en.cjs +7 -2
  46. package/dist/i18n/en.cjs.map +1 -1
  47. package/dist/i18n/en.d.cts +7 -2
  48. package/dist/i18n/en.d.mts +7 -2
  49. package/dist/i18n/en.d.ts +7 -2
  50. package/dist/o11y/parsers/hermes.cjs +1 -1
  51. package/dist/o11y/parsers/hermes.cjs.map +1 -1
  52. package/dist/report/built-in/analysis-values.cjs +21 -5
  53. package/dist/report/built-in/analysis-values.cjs.map +1 -1
  54. package/dist/report/built-in/analysis-values.d.cts +11 -9
  55. package/dist/report/built-in/analysis-values.d.mts +11 -9
  56. package/dist/report/built-in/analysis-values.d.ts +11 -9
  57. package/dist/report/built-in/overview.cjs +1 -0
  58. package/dist/report/built-in/overview.cjs.map +1 -1
  59. package/dist/report/built-in/result-components.cjs +58 -12
  60. package/dist/report/built-in/result-components.cjs.map +1 -1
  61. package/dist/report/built-in/result-components.d.cts +15 -0
  62. package/dist/report/built-in/result-components.d.mts +15 -0
  63. package/dist/report/built-in/result-components.d.ts +15 -0
  64. package/dist/report/built-in/run-membership-overview.cjs +100 -4
  65. package/dist/report/built-in/run-membership-overview.cjs.map +1 -1
  66. package/dist/report/built-in/standard.cjs +1 -0
  67. package/dist/report/built-in/standard.cjs.map +1 -1
  68. package/dist/report/built-in/standard.d.cts +1 -0
  69. package/dist/report/built-in/standard.d.mts +1 -0
  70. package/dist/report/built-in/standard.d.ts +1 -0
  71. package/dist/report/components/entity-lists/compute.cjs +40 -3
  72. package/dist/report/components/entity-lists/compute.cjs.map +1 -1
  73. package/dist/report/components/entity-lists/compute.d.cts +8 -6
  74. package/dist/report/components/entity-lists/compute.d.mts +8 -6
  75. package/dist/report/components/entity-lists/compute.d.ts +8 -6
  76. package/dist/report/components/entity-lists/content.cjs +31 -6
  77. package/dist/report/components/entity-lists/content.cjs.map +1 -1
  78. package/dist/report/components/entity-lists/index.cjs +3 -2
  79. package/dist/report/components/entity-lists/index.cjs.map +1 -1
  80. package/dist/report/components/entity-lists/index.d.cts +1 -1
  81. package/dist/report/components/entity-lists/index.d.mts +1 -1
  82. package/dist/report/components/entity-lists/index.d.ts +1 -1
  83. package/dist/report/definition/cell.cjs +3 -0
  84. package/dist/report/definition/cell.cjs.map +1 -1
  85. package/dist/report/definition/cell.d.cts +2 -0
  86. package/dist/report/definition/cell.d.mts +2 -0
  87. package/dist/report/definition/cell.d.ts +2 -0
  88. package/dist/report/definition/primitives.cjs +9 -2
  89. package/dist/report/definition/primitives.cjs.map +1 -1
  90. package/dist/runner/feedback/human.cjs +180 -16
  91. package/dist/runner/feedback/human.cjs.map +1 -1
  92. package/dist/runner/run.cjs +43 -0
  93. package/dist/runner/run.cjs.map +1 -1
  94. package/dist/sample/capability.cjs +93 -0
  95. package/dist/sample/capability.cjs.map +1 -1
  96. package/dist/sample/capability.d.cts +3 -1
  97. package/dist/sample/capability.d.mts +3 -1
  98. package/dist/sample/capability.d.ts +3 -1
  99. package/dist/sample/capability.js +8 -6
  100. package/dist/sandbox/docker-agent-image.cjs +5 -1
  101. package/dist/sandbox/docker-agent-image.cjs.map +1 -1
  102. package/dist/sandbox/docker-agent-image.d.cts +2 -0
  103. package/dist/sandbox/docker-agent-image.d.mts +2 -0
  104. package/dist/sandbox/docker-agent-image.d.ts +2 -0
  105. package/dist/sandbox/docker-agent-image.js +14 -10
  106. package/dist/sandbox/index.cjs +4 -2
  107. package/dist/sandbox/index.cjs.map +1 -1
  108. package/dist/sandbox/index.d.cts +1 -1
  109. package/dist/sandbox/index.d.mts +1 -1
  110. package/dist/sandbox/index.d.ts +1 -1
  111. package/dist/sandbox/index.js +120 -116
  112. package/dist/sandbox/index.mjs +120 -116
  113. package/docs-site/images/hitl-handshake-zh.svg +3 -3
  114. package/docs-site/zh/examples/integrations/ai-sdk-v7.mdx +3 -3
  115. package/docs-site/zh/examples/integrations/claude-sdk.mdx +3 -3
  116. package/docs-site/zh/examples/integrations/codex-sdk.mdx +5 -5
  117. package/docs-site/zh/examples/integrations/langgraph.mdx +3 -3
  118. package/docs-site/zh/examples/integrations/pi-sdk.mdx +5 -5
  119. package/docs-site/zh/explanation/adapter.mdx +5 -5
  120. package/docs-site/zh/explanation/assert.mdx +1 -1
  121. package/docs-site/zh/explanation/drive.mdx +3 -1
  122. package/docs-site/zh/explanation/evals.mdx +3 -1
  123. package/docs-site/zh/explanation/hitl.mdx +7 -7
  124. package/docs-site/zh/reference/builtin-agents.mdx +4 -4
  125. package/docs-site/zh/reference/capabilities.mdx +1 -1
  126. package/docs-site/zh/reference/events.mdx +10 -10
  127. package/docs-site/zh/reference/official-adapters.mdx +1 -1
  128. package/docs-site/zh/reference/results-data.mdx +6 -0
  129. package/docs-site/zh/tutorials/docker-in-docker.mdx +3 -0
  130. package/docs-site/zh/tutorials/nixos-managed-dind.mdx +160 -0
  131. package/docs-site/zh/tutorials/rerun-and-cache.mdx +16 -0
  132. package/docs-site/zh/tutorials/viewing-results.mdx +19 -1
  133. package/docs-site/zh/tutorials/write-send.mdx +7 -6
  134. package/package.json +1 -1
@@ -12,6 +12,7 @@ import type { BuiltInAttemptRows, BuiltInExperimentRows, BuiltInSummaryRows } fr
12
12
  export interface OverviewCounts {
13
13
  readonly experiments: number;
14
14
  readonly attempts: number;
15
+ readonly expectedResults: number;
15
16
  }
16
17
  /** Display-safe membership facts prepared by the Page loader from Snapshot. */
17
18
  export interface MembershipRow {
@@ -24,6 +25,19 @@ export interface MembershipRow {
24
25
  readonly state: string;
25
26
  readonly relation: string | null;
26
27
  readonly locator: string | null;
28
+ readonly outcome?: string | null;
29
+ readonly phase?: string | null;
30
+ readonly error?: string | null;
31
+ readonly sharedFailure?: string | null;
32
+ }
33
+ export interface RunErrorRow {
34
+ readonly key: string;
35
+ readonly failure: string;
36
+ readonly phase: string;
37
+ readonly affected: string;
38
+ readonly error: string;
39
+ readonly message: string;
40
+ readonly fix: string | null;
27
41
  }
28
42
  export interface StandardOverviewResult {
29
43
  readonly hero: HeroData;
@@ -55,6 +69,7 @@ export interface RunMembershipResult {
55
69
  readonly hero: HeroData;
56
70
  readonly summary: BuiltInSummaryRows;
57
71
  readonly members: readonly MembershipRow[];
72
+ readonly errors: readonly RunErrorRow[];
58
73
  readonly evidence: AttemptEvidenceDomainView;
59
74
  }
60
75
  export interface AttemptTraceProps {
@@ -12,6 +12,7 @@ import type { BuiltInAttemptRows, BuiltInExperimentRows, BuiltInSummaryRows } fr
12
12
  export interface OverviewCounts {
13
13
  readonly experiments: number;
14
14
  readonly attempts: number;
15
+ readonly expectedResults: number;
15
16
  }
16
17
  /** Display-safe membership facts prepared by the Page loader from Snapshot. */
17
18
  export interface MembershipRow {
@@ -24,6 +25,19 @@ export interface MembershipRow {
24
25
  readonly state: string;
25
26
  readonly relation: string | null;
26
27
  readonly locator: string | null;
28
+ readonly outcome?: string | null;
29
+ readonly phase?: string | null;
30
+ readonly error?: string | null;
31
+ readonly sharedFailure?: string | null;
32
+ }
33
+ export interface RunErrorRow {
34
+ readonly key: string;
35
+ readonly failure: string;
36
+ readonly phase: string;
37
+ readonly affected: string;
38
+ readonly error: string;
39
+ readonly message: string;
40
+ readonly fix: string | null;
27
41
  }
28
42
  export interface StandardOverviewResult {
29
43
  readonly hero: HeroData;
@@ -55,6 +69,7 @@ export interface RunMembershipResult {
55
69
  readonly hero: HeroData;
56
70
  readonly summary: BuiltInSummaryRows;
57
71
  readonly members: readonly MembershipRow[];
72
+ readonly errors: readonly RunErrorRow[];
58
73
  readonly evidence: AttemptEvidenceDomainView;
59
74
  }
60
75
  export interface AttemptTraceProps {
@@ -12,6 +12,7 @@ import type { BuiltInAttemptRows, BuiltInExperimentRows, BuiltInSummaryRows } fr
12
12
  export interface OverviewCounts {
13
13
  readonly experiments: number;
14
14
  readonly attempts: number;
15
+ readonly expectedResults: number;
15
16
  }
16
17
  /** Display-safe membership facts prepared by the Page loader from Snapshot. */
17
18
  export interface MembershipRow {
@@ -24,6 +25,19 @@ export interface MembershipRow {
24
25
  readonly state: string;
25
26
  readonly relation: string | null;
26
27
  readonly locator: string | null;
28
+ readonly outcome?: string | null;
29
+ readonly phase?: string | null;
30
+ readonly error?: string | null;
31
+ readonly sharedFailure?: string | null;
32
+ }
33
+ export interface RunErrorRow {
34
+ readonly key: string;
35
+ readonly failure: string;
36
+ readonly phase: string;
37
+ readonly affected: string;
38
+ readonly error: string;
39
+ readonly message: string;
40
+ readonly fix: string | null;
27
41
  }
28
42
  export interface StandardOverviewResult {
29
43
  readonly hero: HeroData;
@@ -55,6 +69,7 @@ export interface RunMembershipResult {
55
69
  readonly hero: HeroData;
56
70
  readonly summary: BuiltInSummaryRows;
57
71
  readonly members: readonly MembershipRow[];
72
+ readonly errors: readonly RunErrorRow[];
58
73
  readonly evidence: AttemptEvidenceDomainView;
59
74
  }
60
75
  export interface AttemptTraceProps {
@@ -2,6 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.defaultRunMembershipOverviewReport = void 0;
4
4
  exports.runMembershipOverviewReport = runMembershipOverviewReport;
5
+ const index_ts_1 = require("../../analysis/index.cjs");
6
+ const api_ts_1 = require("../../analysis/api.cjs");
5
7
  const jsx_runtime_1 = require("react/jsx-runtime");
6
8
  const conversions_ts_1 = require("../model/conversions.cjs");
7
9
  const analysis_values_ts_1 = require("./analysis-values.cjs");
@@ -14,7 +16,86 @@ function heroData(snapshot) {
14
16
  runs: snapshot.runs.length,
15
17
  });
16
18
  }
17
- function membershipRows(snapshot) {
19
+ function sharedBuildFailure(summary) {
20
+ let value;
21
+ try {
22
+ value = JSON.parse(summary);
23
+ }
24
+ catch {
25
+ return undefined;
26
+ }
27
+ if (typeof value !== "object" || value === null)
28
+ return undefined;
29
+ const item = value;
30
+ return item.schema === "niceeval.shared-build-failure/v1"
31
+ && typeof item.failureId === "string"
32
+ && typeof item.evalId === "string"
33
+ && Number.isSafeInteger(item.attemptOrdinal)
34
+ && item.phase === "sandbox.image.build"
35
+ && typeof item.errorCode === "string"
36
+ && typeof item.message === "string"
37
+ && (item.remediation === undefined || item.remediation === "pnpm-allow-builds")
38
+ ? item
39
+ : undefined;
40
+ }
41
+ function failureBySlot(view) {
42
+ const failures = new Map();
43
+ for (const entry of view.entries) {
44
+ if (entry.state !== "available")
45
+ continue;
46
+ for (const diagnostic of entry.detail.diagnostics) {
47
+ if (diagnostic.code !== "sandbox-build-failed")
48
+ continue;
49
+ const failure = sharedBuildFailure(diagnostic.summary);
50
+ if (failure !== undefined) {
51
+ failures.set(`${entry.runId}\u0000${failure.evalId}\u0000${failure.attemptOrdinal}`, failure);
52
+ }
53
+ }
54
+ }
55
+ return failures;
56
+ }
57
+ function runErrorRows(view) {
58
+ const groups = new Map();
59
+ for (const entry of view.entries) {
60
+ if (entry.state !== "available")
61
+ continue;
62
+ for (const diagnostic of entry.detail.diagnostics) {
63
+ if (diagnostic.code !== "sandbox-build-failed")
64
+ continue;
65
+ const failure = sharedBuildFailure(diagnostic.summary);
66
+ if (failure === undefined)
67
+ continue;
68
+ const key = `${entry.runId}\u0000${failure.failureId}`;
69
+ const group = groups.get(key);
70
+ const affected = `${failure.evalId}#${failure.attemptOrdinal + 1}`;
71
+ if (group === undefined) {
72
+ groups.set(key, {
73
+ runId: entry.runId,
74
+ experimentId: entry.experimentId,
75
+ failure,
76
+ affected: [affected],
77
+ });
78
+ }
79
+ else {
80
+ group.affected.push(affected);
81
+ }
82
+ }
83
+ }
84
+ return Object.freeze([...groups.entries()].map(([key, group]) => Object.freeze({
85
+ key,
86
+ failure: group.failure.failureId,
87
+ phase: group.failure.phase,
88
+ affected: `${group.experimentId} · ${group.affected.join(", ")}`,
89
+ error: group.failure.errorCode,
90
+ message: group.failure.message,
91
+ fix: group.failure.remediation === "pnpm-allow-builds"
92
+ ? "Review these dependencies and configure pnpm allowBuilds."
93
+ : null,
94
+ })));
95
+ }
96
+ function membershipRows(snapshot, diagnostics, evidence) {
97
+ const failures = failureBySlot(diagnostics);
98
+ const outcomes = new Map(evidence.entries.flatMap((entry) => entry.state === "available" ? [[entry.attempt.locator, entry.detail.outcome]] : []));
18
99
  return Object.freeze(snapshot.slots.map((slot) => Object.freeze({
19
100
  key: `${slot.runId}:${slot.slotId}`,
20
101
  experiment: String(slot.experimentId),
@@ -22,9 +103,22 @@ function membershipRows(snapshot) {
22
103
  attempt: slot.attemptOrdinal,
23
104
  selectedRun: String(slot.runId),
24
105
  slot: String(slot.slotId),
25
- state: slot.state,
106
+ state: slot.state === "included" ? slot.action : slot.state === "not-recorded" ? slot.action ?? slot.state : slot.state,
26
107
  relation: slot.state === "included" ? slot.relation : null,
27
108
  locator: slot.state === "included" ? slot.attempt.locator : null,
109
+ outcome: slot.state === "included" ? outcomes.get(slot.attempt.locator) ?? null : null,
110
+ phase: null,
111
+ error: null,
112
+ sharedFailure: null,
113
+ ...(() => {
114
+ const failure = failures.get(`${slot.runId}\u0000${slot.evalId}\u0000${slot.attemptOrdinal}`);
115
+ return failure === undefined ? {} : {
116
+ outcome: "errored",
117
+ phase: failure.phase,
118
+ error: failure.errorCode,
119
+ sharedFailure: failure.failureId,
120
+ };
121
+ })(),
28
122
  })));
29
123
  }
30
124
  const runMembershipPage = {
@@ -32,14 +126,16 @@ const runMembershipPage = {
32
126
  path: "/",
33
127
  title: "Run membership overview",
34
128
  load: async (sample) => {
35
- const [summary, evidence] = await Promise.all([
129
+ const [summary, evidence, diagnostics] = await Promise.all([
36
130
  (0, analysis_values_ts_1.loadBuiltInSummaryRows)(sample),
37
131
  (0, conversions_ts_1.toAttemptEvidence)(sample),
132
+ (0, index_ts_1.query)(sample, { kind: "domain-view", view: api_ts_1.runDiagnosticsView }),
38
133
  ]);
39
134
  return Object.freeze({
40
135
  hero: heroData(sample.snapshot),
41
136
  summary,
42
- members: membershipRows(sample.snapshot),
137
+ members: membershipRows(sample.snapshot, diagnostics, evidence),
138
+ errors: runErrorRows(diagnostics),
43
139
  evidence,
44
140
  });
45
141
  },
@@ -1 +1 @@
1
- {"version":3,"file":"run-membership-overview.js","sourceRoot":"","sources":["run-membership-overview.ts"],"names":[],"mappings":";;;AAsDA,kEAKC;AAzDD,mDAAwC;AAGxC,4DAA4D;AAC5D,6DAAwF;AACxF,kEAAuF;AACvF,6CAA+E;AAO/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,CAAC;AACD,SAAS,cAAc,CAAC,QAAwB;IAC5C,OAAO,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC;QAC5D,GAAG,EAAE,GAAG,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,MAAM,EAAE;QACnC,UAAU,EAAE,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC;QACrC,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC;QACzB,OAAO,EAAE,IAAI,CAAC,cAAc;QAC5B,WAAW,E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C;AACD,yEAAyE;AAC5D,QAAA,kCAAkC,GAAG,2BAA2B,EAAE,CAAC;AAChF,kBAAe,0CAAkC,CAAC","sourcesContent":["/** The stable explicit-Run membership selector. */\nimport type { Sample, SampleSnapshot, } from \"../../analysis/index.ts\";\nimport { jsx } from \"react/jsx-runtime\";\nimport type { Page } from \"../definition/report.ts\";\nimport { type HeroData } from \"../components/site-components/index.tsx\";\nimport { toAttemptEvidence } from \"../model/conversions.ts\";\nimport { loadBuiltInSummaryRows, type BuiltInSummaryRows, } from \"./analysis-values.ts\";\nimport { RunMembershipResultView, type MembershipRow, } from \"./result-components.tsx\";\nimport { builtInMachineProducerIds, defineBuiltInReport, } from \"./machine.ts\";\ninterface RunMembershipPageInput {\n readonly hero: HeroData;\n readonly summary: BuiltInSummaryRows;\n readonly members: readonly MembershipRow[];\n readonly evidence: Awaited<ReturnType<typeof toAttemptEvidence>>;\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): readonly MembershipRow[] {\n return Object.freeze(snapshot.slots.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}\nconst runMembershipPage = {\n id: \"run-membership\",\n path: \"/\",\n title: \"Run membership overview\",\n load: async (sample: Sample): Promise<RunMembershipPageInput> => {\n const [summary, evidence] = await Promise.all([\n loadBuiltInSummaryRows(sample),\n toAttemptEvidence(sample),\n ]);\n return Object.freeze({\n hero: heroData(sample.snapshot),\n summary,\n members: membershipRows(sample.snapshot),\n evidence,\n });\n },\n render: (input: RunMembershipPageInput) => jsx(RunMembershipResultView, input),\n} satisfies Page<void, RunMembershipPageInput>;\n/** The bounded default for explicit historical Run selectors. */\nexport function runMembershipOverviewReport() {\n return defineBuiltInReport(builtInMachineProducerIds.runMembershipOverview, {\n title: \"Run membership overview\",\n pages: [runMembershipPage],\n });\n}\n/** The CLI default Report for one or more explicit `--run` selectors. */\nexport const defaultRunMembershipOverviewReport = runMembershipOverviewReport();\nexport default defaultRunMembershipOverviewReport;\n"]}
1
+ {"version":3,"file":"run-membership-overview.js","sourceRoot":"","sources":["run-membership-overview.ts"],"names":[],"mappings":";;;AAsKA,kEAKC;AAzKD,sDAAgD;AAChD,kDAA2F;AAC3F,mDAAwC;AAGxC,4DAA4D;AAC5D,6DAAwF;AACxF,kEAAyG;AACzG,6CAA+E;AAQ/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,CAAC;AAWD,SAAS,kBAAkB,CAAC,OAAe;IACvC,IAAI,KAAc,CAAC;IACnB,IAAI,CAAC;QACD,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAChC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,EAAE;KACP,CAAC,CAAC,CAAC,CAAC;AACT,CAAC;AACD,MAAM,iBAAiB,GAAG;IACtB,EAAE,EAAE,gBAAgB;IACpB,IAAI,EAAE,GAAG;IACT,KAAK,EAAE,yBAAyB;IAChC,IAAI,EAAE,KAAK,EAAE,MAAc,EAAmC,EAAE;QAC5D,MAAM,CAAC,OAAO,EAAE,QAAQ,EAAE,WAAW,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;YACvD,IAAA,2CAAsB,EAAC,MAAM,CAAC;YAC9B,IAAA,kCAAiB,EAAC,MAAM,CAAC;YACzB,IAAA,gBAAK,EAAC,MAAM,EAAE,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,2BAAkB,EAAE,CAAC;SACnE,CAAC,CAAC;QACH,OAAO,MAAM,CAAC,MAAM,CAAC;YACjB,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC;YAC/B,OAAO;YACP,OAAO,EAAE,cAAc,CAAC,MAAM,CAAC,QAAQ,EAAE,WAAW,EAAE,QAAQ,CAAC;YAC/D,MAAM,EAAE,YAAY,CAAC,WAAW,CAAC;YACjC,QAAQ;SACX,CAAC,CAAC;IACP,CAAC;IACD,MAAM,EAAE,CAAC,KAA6B,EAAE,EAAE,CAAC,IAAA,iBAAG,EAAC,+CAAuB,EAAE,KAAK,CAAC;CACpC,CAAC;AAC/C,iEAAiE;AACjE,SAAgB,2BAA2B;IACvC,OAAO,IAAA,gCAAmB,EAAC,sCAAyB,CAAC,qBAAqB,EAAE;QACxE,KAAK,EAAE,yBAAyB;QAChC,KAAK,EAAE,CAAC,iBAAiB,CAAC;KAC7B,CAAC,CAAC;AACP,CAAC;AACD,yEAAyE;AAC5D,QAAA,kCAAkC,GAAG,2BAA2B,EAAE,CAAC;AAChF,kBAAe,0CAAkC,CAAC","sourcesContent":["/** The stable explicit-Run membership selector. */\nimport type { Sample, SampleSnapshot, } from \"../../analysis/index.ts\";\nimport { query } from \"../../analysis/index.ts\";\nimport { runDiagnosticsView, type RunDiagnosticsDomainView, } from \"../../analysis/api.ts\";\nimport { jsx } from \"react/jsx-runtime\";\nimport type { Page } from \"../definition/report.ts\";\nimport { type HeroData } from \"../components/site-components/index.tsx\";\nimport { toAttemptEvidence } from \"../model/conversions.ts\";\nimport { loadBuiltInSummaryRows, type BuiltInSummaryRows, } from \"./analysis-values.ts\";\nimport { RunMembershipResultView, type MembershipRow, type RunErrorRow, } from \"./result-components.tsx\";\nimport { builtInMachineProducerIds, defineBuiltInReport, } from \"./machine.ts\";\ninterface RunMembershipPageInput {\n readonly hero: HeroData;\n readonly summary: BuiltInSummaryRows;\n readonly members: readonly MembershipRow[];\n readonly errors: readonly RunErrorRow[];\n readonly evidence: Awaited<ReturnType<typeof toAttemptEvidence>>;\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}\ninterface SharedBuildFailureDiagnostic {\n readonly schema: \"niceeval.shared-build-failure/v1\";\n readonly failureId: string;\n readonly evalId: string;\n readonly attemptOrdinal: number;\n readonly phase: \"sandbox.image.build\";\n readonly errorCode: string;\n readonly message: string;\n readonly remediation?: \"pnpm-allow-builds\";\n}\nfunction sharedBuildFailure(summary: string): SharedBuildFailureDiagnostic | undefined {\n let value: unknown;\n try {\n value = JSON.parse(summary);\n }\n catch {\n return undefined;\n }\n if (typeof value !== \"object\" || value === null)\n return undefined;\n const item = value as Partial<SharedBuildFailureDiagnostic>;\n return item.schema === \"niceeval.shared-build-failure/v1\"\n && typeof item.failureId === \"string\"\n && typeof item.evalId === \"string\"\n && Number.isSafeInteger(item.attemptOrdinal)\n && item.phase === \"sandbox.image.build\"\n && typeof item.errorCode === \"string\"\n && typeof item.message === \"string\"\n && (item.remediation === undefined || item.remediation === \"pnpm-allow-builds\")\n ? item as SharedBuildFailureDiagnostic\n : undefined;\n}\nfunction failureBySlot(view: RunDiagnosticsDomainView): ReadonlyMap<string, SharedBuildFailureDiagnostic> {\n const failures = new Map<string, SharedBuildFailureDiagnostic>();\n for (const entry of view.entries) {\n if (entry.state !== \"available\")\n continue;\n for (const diagnostic of entry.detail.diagnostics) {\n if (diagnostic.code !== \"sandbox-build-failed\")\n continue;\n const failure = sharedBuildFailure(diagnostic.summary);\n if (failure !== undefined) {\n failures.set(`${entry.runId}\\u0000${failure.evalId}\\u0000${failure.attemptOrdinal}`, failure);\n }\n }\n }\n return failures;\n}\nfunction runErrorRows(view: RunDiagnosticsDomainView): readonly RunErrorRow[] {\n const groups = new Map<string, {\n readonly runId: string;\n readonly experimentId: string;\n readonly failure: SharedBuildFailureDiagnostic;\n readonly affected: string[];\n }>();\n for (const entry of view.entries) {\n if (entry.state !== \"available\")\n continue;\n for (const diagnostic of entry.detail.diagnostics) {\n if (diagnostic.code !== \"sandbox-build-failed\")\n continue;\n const failure = sharedBuildFailure(diagnostic.summary);\n if (failure === undefined)\n continue;\n const key = `${entry.runId}\\u0000${failure.failureId}`;\n const group = groups.get(key);\n const affected = `${failure.evalId}#${failure.attemptOrdinal + 1}`;\n if (group === undefined) {\n groups.set(key, {\n runId: entry.runId,\n experimentId: entry.experimentId,\n failure,\n affected: [affected],\n });\n }\n else {\n group.affected.push(affected);\n }\n }\n }\n return Object.freeze([...groups.entries()].map(([key, group]) => Object.freeze({\n key,\n failure: group.failure.failureId,\n phase: group.failure.phase,\n affected: `${group.experimentId} · ${group.affected.join(\", \")}`,\n error: group.failure.errorCode,\n message: group.failure.message,\n fix: group.failure.remediation === \"pnpm-allow-builds\"\n ? \"Review these dependencies and configure pnpm allowBuilds.\"\n : null,\n })));\n}\nfunction membershipRows(snapshot: SampleSnapshot, diagnostics: RunDiagnosticsDomainView, evidence: Awaited<ReturnType<typeof toAttemptEvidence>>): readonly MembershipRow[] {\n const failures = failureBySlot(diagnostics);\n const outcomes = new Map(evidence.entries.flatMap((entry) => entry.state === \"available\" ? [[entry.attempt.locator, entry.detail.outcome] as const] : []));\n return Object.freeze(snapshot.slots.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 === \"included\" ? slot.action : slot.state === \"not-recorded\" ? slot.action ?? slot.state : slot.state,\n relation: slot.state === \"included\" ? slot.relation : null,\n locator: slot.state === \"included\" ? slot.attempt.locator : null,\n outcome: slot.state === \"included\" ? outcomes.get(slot.attempt.locator) ?? null : null,\n phase: null,\n error: null,\n sharedFailure: null,\n ...(() => {\n const failure = failures.get(`${slot.runId}\\u0000${slot.evalId}\\u0000${slot.attemptOrdinal}`);\n return failure === undefined ? {} : {\n outcome: \"errored\",\n phase: failure.phase,\n error: failure.errorCode,\n sharedFailure: failure.failureId,\n };\n })(),\n })));\n}\nconst runMembershipPage = {\n id: \"run-membership\",\n path: \"/\",\n title: \"Run membership overview\",\n load: async (sample: Sample): Promise<RunMembershipPageInput> => {\n const [summary, evidence, diagnostics] = await Promise.all([\n loadBuiltInSummaryRows(sample),\n toAttemptEvidence(sample),\n query(sample, { kind: \"domain-view\", view: runDiagnosticsView }),\n ]);\n return Object.freeze({\n hero: heroData(sample.snapshot),\n summary,\n members: membershipRows(sample.snapshot, diagnostics, evidence),\n errors: runErrorRows(diagnostics),\n evidence,\n });\n },\n render: (input: RunMembershipPageInput) => jsx(RunMembershipResultView, input),\n} satisfies Page<void, RunMembershipPageInput>;\n/** The bounded default for explicit historical Run selectors. */\nexport function runMembershipOverviewReport() {\n return defineBuiltInReport(builtInMachineProducerIds.runMembershipOverview, {\n title: \"Run membership overview\",\n pages: [runMembershipPage],\n });\n}\n/** The CLI default Report for one or more explicit `--run` selectors. */\nexport const defaultRunMembershipOverviewReport = runMembershipOverviewReport();\nexport default defaultRunMembershipOverviewReport;\n"]}
@@ -52,6 +52,7 @@ exports.standardOverviewPage = {
52
52
  counts: Object.freeze({
53
53
  experiments: experiments.length,
54
54
  attempts: includedAttemptCount(sample.snapshot),
55
+ expectedResults: sample.snapshot.slots.filter((slot) => slot.state !== "excluded").length,
55
56
  }),
56
57
  });
57
58
  },
@@ -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,CAAC;AACD,SAAS,cAAc,CAAC,QAAwB,EAAE,SAG9C,EAAE;IACF,OAAO,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK;SAC9B,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,UAAU,KAAK,SAAS,IAAI,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,KAAK,MAAM,CAAC,UAAU,CAAC;SACpG,MAAM,CAAC,CAAC,IA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Ae,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,MAAM,CAAC,CAAC,WAAW,EAAE;QACxE,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC,MAAM;KAC7B,CAAC,CAAC;AACP,CAAC;AACD,SAAS,cAAc,CAAC,QAAwB,EAAE,SAG9C,EAAE;IACF,OAAO,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK;SAC9B,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,UAAU,KAAK,SAAS,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ACvB,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"]}
@@ -19,6 +19,7 @@ interface StandardOverviewPageInput {
19
19
  readonly counts: {
20
20
  readonly experiments: number;
21
21
  readonly attempts: number;
22
+ readonly expectedResults: number;
22
23
  };
23
24
  }
24
25
  interface StandardAttemptsPageInput {
@@ -19,6 +19,7 @@ interface StandardOverviewPageInput {
19
19
  readonly counts: {
20
20
  readonly experiments: number;
21
21
  readonly attempts: number;
22
+ readonly expectedResults: number;
22
23
  };
23
24
  }
24
25
  interface StandardAttemptsPageInput {
@@ -19,6 +19,7 @@ interface StandardOverviewPageInput {
19
19
  readonly counts: {
20
20
  readonly experiments: number;
21
21
  readonly attempts: number;
22
+ readonly expectedResults: number;
22
23
  };
23
24
  }
24
25
  interface StandardAttemptsPageInput {
@@ -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({ verdict: null, failureSummary: null });
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: "pass",
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.sort(byMetricDescThenId((item) => item.endToEndPassRate.value));
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) {