@openpond/evals 0.8.0 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/README.md +36 -0
  2. package/dist/index.js +1 -0
  3. package/dist/learning/contracts.js +10 -0
  4. package/dist/metric-policy.js +50 -0
  5. package/dist/metrics-node.js +16 -0
  6. package/dist/metrics.js +105 -0
  7. package/dist/runs.js +12 -0
  8. package/dist/tasksets.js +5 -0
  9. package/dist/types/builtin-benchmarks/harness-refiner.d.ts +14 -0
  10. package/dist/types/builtin-benchmarks/harness-refiner.d.ts.map +1 -1
  11. package/dist/types/conformance.d.ts +28 -0
  12. package/dist/types/conformance.d.ts.map +1 -1
  13. package/dist/types/evidence/conformance.d.ts +4 -4
  14. package/dist/types/evidence/contracts.d.ts +8 -8
  15. package/dist/types/index.d.ts +1 -0
  16. package/dist/types/index.d.ts.map +1 -1
  17. package/dist/types/javascript-isolate.d.ts +1 -1
  18. package/dist/types/javascript-isolate.d.ts.map +1 -1
  19. package/dist/types/learning/admission.d.ts +3 -3
  20. package/dist/types/learning/contracts.d.ts +81 -3
  21. package/dist/types/learning/contracts.d.ts.map +1 -1
  22. package/dist/types/learning/operations.d.ts +88 -12
  23. package/dist/types/learning/operations.d.ts.map +1 -1
  24. package/dist/types/learning/repository.d.ts +45 -4
  25. package/dist/types/learning/repository.d.ts.map +1 -1
  26. package/dist/types/learning/transport.d.ts +90 -11
  27. package/dist/types/learning/transport.d.ts.map +1 -1
  28. package/dist/types/metric-policy.d.ts +112 -0
  29. package/dist/types/metric-policy.d.ts.map +1 -0
  30. package/dist/types/metrics-node.d.ts +8 -0
  31. package/dist/types/metrics-node.d.ts.map +1 -0
  32. package/dist/types/metrics.d.ts +37 -0
  33. package/dist/types/metrics.d.ts.map +1 -0
  34. package/dist/types/preferences.d.ts +3 -3
  35. package/dist/types/rewards.d.ts +9 -9
  36. package/dist/types/runs.d.ts +88 -0
  37. package/dist/types/runs.d.ts.map +1 -1
  38. package/dist/types/tasksets.d.ts +44 -0
  39. package/dist/types/tasksets.d.ts.map +1 -1
  40. package/package.json +9 -1
  41. package/schemas/learning/v1/command-request.schema.json +77 -46
  42. package/schemas/learning/v1/package.schema.json +108 -0
  43. package/schemas/learning/v1/source.schema.json +64 -33
package/README.md CHANGED
@@ -44,6 +44,42 @@ Subpath exports are available at `/harness`, `/tasksets`, `/benchmarks`, `/grade
44
44
  not a hosted client. It does not execute OpenPond Desktop or Sandbox sessions,
45
45
  resolve credentials, or persist artifacts.
46
46
 
47
+ ## Authored Taskset metrics
48
+
49
+ `@openpond/evals/metrics` exports the shared `TasksetMetricPolicySchema` and
50
+ `executeTasksetMetric`. Supply the policy from the pinned Taskset Release, its
51
+ Run Manifest, and verified attempt receipts. The result carries the policy,
52
+ policy hash, all input receipt references, population counts and a content hash.
53
+ It is separate from the evaluation's ordinary mean-score accounting.
54
+
55
+ The release's optional `metrics` field is the authoritative policy. For complete
56
+ evaluations, use `aggregateTasksetEvaluationReceipts` or the Node
57
+ `aggregateTasksetEvaluationInWorker` export. They bind the release and task IDs
58
+ to the manifest, calculate `authoredMetric`, and attach it only to the exact
59
+ receipt population. `meanScore` remains the ordinary mean. Hosts should capture
60
+ and validate custom source with `assertTasksetMetricSource` before model work,
61
+ then retain those bytes throughout the run. Complete Taskset packages require
62
+ the declared module as a private, content-matching file.
63
+
64
+ Mean score, explicit grader pass rate, weighted mean and custom aggregation use
65
+ one population rule: nonterminal attempts, infrastructure failures, timeouts and
66
+ cancellations are excluded. Other missing or ineligible rewards obey the
67
+ policy's `zero` or `exclude` setting. Pass rate requires an explicit boolean
68
+ `passed` verdict. Empty populations return `null`.
69
+
70
+ Weighted means require positive `taskWeights` keyed by task ID; each attempt
71
+ uses its task's declared weight. Missing weights are errors. Custom modules
72
+ export `aggregate(scores)` (or the declared export) and return a finite number
73
+ between zero and one. Exact UTF-8 source must match the policy's SHA-256 before
74
+ execution. Module source is limited to 512 KiB and custom inputs to 4 MiB.
75
+
76
+ Node hosts use `executeTasksetMetricInWorker` from `@openpond/evals/metrics/node`.
77
+ It strips type annotations from `.ts`, `.mts` and `.cts` modules, then executes
78
+ them in a fresh deterministic interpreter without host APIs or imports. Workers
79
+ stop before success, failure or cancellation is returned. Other hosts pass an
80
+ isolated executor to the portable function; authored source must never run in
81
+ the host JavaScript context.
82
+
47
83
  ## Benchmarks
48
84
 
49
85
  `BenchmarkDefinition` binds a named benchmark to an immutable Taskset Release,
package/dist/index.js CHANGED
@@ -8,6 +8,7 @@ export * from "./graders.js";
8
8
  export * from "./harness.js";
9
9
  export * from "./learned-preference.js";
10
10
  export * from "./runs.js";
11
+ export * from "./metrics.js";
11
12
  export * from "./model-improvement-qualification.js";
12
13
  export * from "./preferences.js";
13
14
  export * from "./review-conformance.js";
@@ -46,6 +46,15 @@ export const TaskSourceMappingSchema = z.object({
46
46
  familyKey: LearningJsonPointerSchema,
47
47
  split: TaskSplitSchema,
48
48
  }).strict();
49
+ /** An explicit Model edit starts new evidence; the original admissions remain
50
+ * in the exact parent package and are never approvals for this source. */
51
+ export const LearningReviewOriginSchema = z.object({
52
+ modelId: ReleaseIdSchema,
53
+ packageHash: ReleaseHashSchema,
54
+ taskset: LearningRevisionRefSchema,
55
+ batch: LearningRevisionRefSchema,
56
+ rewardBinding: LearningRevisionRefSchema,
57
+ }).strict();
49
58
  export const LearningSourceContentSchema = z.object({
50
59
  schemaVersion: z.literal("openpond.learningSource.v1"),
51
60
  id: ReleaseIdSchema,
@@ -57,6 +66,7 @@ export const LearningSourceContentSchema = z.object({
57
66
  allowedSplits: z.array(TaskSplitSchema).min(1).max(4),
58
67
  mapping: TaskSourceMappingSchema.nullable(),
59
68
  adapterVersion: z.string().trim().min(1).max(200).nullable(),
69
+ reviewOrigin: LearningReviewOriginSchema.optional(),
60
70
  }).strict().superRefine((source, context) => {
61
71
  if (source.kind !== "direct" && !source.mapping)
62
72
  context.addIssue({ code: "custom", path: ["mapping"], message: "Mapped sources require an explicit mapping." });
@@ -0,0 +1,50 @@
1
+ import { z } from "zod";
2
+ import { assertContentHash, contentHash, ImmutableReleaseRefSchema, ReleaseHashSchema } from "@openpond/harness";
3
+ const MetricIdSchema = z.string().trim().min(1).max(240);
4
+ const ModulePathSchema = z.string().trim().min(1).max(1_000).refine((value) => !/[\\:\0]/.test(value) && value.split("/").every((part) => part && part !== "." && part !== ".." && !part.startsWith(".env")), "Metric modules must use a safe relative path.");
5
+ export const TasksetMetricPolicySchema = z.object({
6
+ schemaVersion: z.literal("openpond.tasksetMetricPolicy.v1"),
7
+ primaryMetric: MetricIdSchema,
8
+ aggregation: z.enum(["mean_score", "pass_rate", "weighted_mean", "custom"]),
9
+ missingReward: z.enum(["zero", "exclude"]),
10
+ taskWeights: z.record(MetricIdSchema, z.number().positive().max(1_000_000)).optional(),
11
+ customAggregator: z.object({
12
+ module: ModulePathSchema,
13
+ exportName: z.string().trim().regex(/^[A-Za-z_$][A-Za-z0-9_$]*$/),
14
+ contentHash: ReleaseHashSchema,
15
+ timeoutMs: z.number().int().positive().max(300_000),
16
+ networkPolicy: z.literal("none"),
17
+ }).strict().nullable(),
18
+ }).strict().superRefine((policy, context) => {
19
+ if ((policy.aggregation === "custom") !== (policy.customAggregator !== null)) {
20
+ context.addIssue({ code: "custom", path: ["customAggregator"], message: "Only custom aggregation requires a content-hashed module." });
21
+ }
22
+ if (policy.aggregation === "weighted_mean" ? !policy.taskWeights || !Object.keys(policy.taskWeights).length : policy.taskWeights !== undefined) {
23
+ context.addIssue({ code: "custom", path: ["taskWeights"], message: "Only weighted means require explicit positive task weights." });
24
+ }
25
+ });
26
+ export const TasksetMetricResultContentSchema = z.object({
27
+ schemaVersion: z.literal("openpond.tasksetMetricResult.v1"),
28
+ runManifest: ImmutableReleaseRefSchema,
29
+ tasksetRelease: ImmutableReleaseRefSchema,
30
+ policy: TasksetMetricPolicySchema,
31
+ policyHash: ReleaseHashSchema,
32
+ receiptRefs: z.array(ImmutableReleaseRefSchema).min(1).max(1_000_000),
33
+ includedCount: z.number().int().nonnegative(),
34
+ missingRewardCount: z.number().int().nonnegative(),
35
+ excludedCount: z.number().int().nonnegative(),
36
+ value: z.number().min(0).max(1).nullable(),
37
+ }).strict();
38
+ export const TasksetMetricResultSchema = TasksetMetricResultContentSchema.extend({ contentHash: ReleaseHashSchema }).strict();
39
+ export function assertTasksetMetricResult(input) {
40
+ const result = TasksetMetricResultSchema.parse(input);
41
+ assertContentHash(result, "Taskset metric result");
42
+ if (result.policyHash !== contentHash(result.policy))
43
+ throw new Error("Taskset metric policy hash differs from its policy.");
44
+ if (result.includedCount + result.excludedCount !== result.receiptRefs.length
45
+ || (result.includedCount === 0) !== (result.value === null)
46
+ || result.missingRewardCount > (result.policy.missingReward === "zero" ? result.includedCount : result.excludedCount)
47
+ || new Set(result.receiptRefs.map(ref => ref.id)).size !== result.receiptRefs.length) {
48
+ throw new Error("Taskset metric population differs from its receipt references.");
49
+ }
50
+ }
@@ -0,0 +1,16 @@
1
+ import { stripTypeScriptTypes } from "node:module";
2
+ import { executeJavaScriptIsolateInWorker } from "./javascript-isolate-node.js";
3
+ import { aggregateTasksetEvaluationReceipts, executeTasksetMetric } from "./metrics.js";
4
+ /** Verifies original source before stripping TS, then waits for worker termination
5
+ * on success, error or cancellation. Authored imports and host APIs are unavailable. */
6
+ export function executeTasksetMetricInWorker(input) {
7
+ return executeTasksetMetric(input, executeMetric);
8
+ }
9
+ export function aggregateTasksetEvaluationInWorker(input) {
10
+ return aggregateTasksetEvaluationReceipts(input, executeMetric);
11
+ }
12
+ const executeMetric = ({ source, module, exportName, scores, timeoutMs, signal }) => executeJavaScriptIsolateInWorker({
13
+ source: /\.[cm]?ts$/.test(module) ? stripTypeScriptTypes(source, { mode: "strip" }) : source,
14
+ exportName, value: scores, timeoutMs, signal,
15
+ maxResultBytes: 1_024, deterministic: true, errorPrefix: "metric",
16
+ });
@@ -0,0 +1,105 @@
1
+ import { assertContentHash, contentHash, sha256 } from "@openpond/harness";
2
+ import { aggregateEvaluationReceipts, RunManifestSchema, verifyAttemptReceipt } from "./runs.js";
3
+ import { TasksetMetricPolicySchema, TasksetMetricResultContentSchema, TasksetMetricResultSchema } from "./metric-policy.js";
4
+ import { assertTasksetRelease } from "./tasksets.js";
5
+ export * from "./metric-policy.js";
6
+ /** Preflight the exact metric source before any model or tool execution. */
7
+ export function assertTasksetMetricSource(taskset, source) {
8
+ assertTasksetRelease(taskset);
9
+ if (taskset.metrics?.customAggregator)
10
+ assertMetricSource(taskset.metrics.customAggregator, source);
11
+ }
12
+ /** Bind the declared metric to one frozen release and population, retaining
13
+ * ordinary mean-score accounting independently of the authored calculation. */
14
+ export async function aggregateTasksetEvaluationReceipts(input, executor) {
15
+ assertTasksetMetricSource(input.taskset, input.source);
16
+ if (input.taskset.id !== input.manifest.tasksetRelease.id || input.taskset.contentHash !== input.manifest.tasksetRelease.contentHash)
17
+ throw new Error("Metric Taskset differs from the Run Manifest's pinned release.");
18
+ const taskIds = new Set(input.taskset.tasks.map(task => task.id));
19
+ if (input.receipts.some(receipt => !taskIds.has(receipt.taskId)))
20
+ throw new Error("Metric receipt names a task outside the pinned Taskset.");
21
+ const authoredMetric = input.taskset.metrics ? await executeTasksetMetric({ ...input, policy: input.taskset.metrics }, executor) : undefined;
22
+ return aggregateEvaluationReceipts({ id: input.id, manifest: input.manifest, receipts: input.receipts, metadata: input.metadata, authoredMetric });
23
+ }
24
+ /** Hosts supply the policy from the pinned Taskset, never a mutable form.
25
+ * Operational failures and nonterminal receipts are excluded for every policy.
26
+ * Missing rewards on the remaining receipts obey zero/exclude. A task's weight
27
+ * applies to each of its attempts; pass rate uses the grader's explicit verdict.
28
+ */
29
+ export async function executeTasksetMetric(input, executor) {
30
+ input.signal?.throwIfAborted();
31
+ const policy = TasksetMetricPolicySchema.parse(input.policy);
32
+ const manifest = RunManifestSchema.parse(input.manifest);
33
+ assertContentHash(manifest, "Metric Run Manifest");
34
+ if (!input.receipts.length || input.receipts.length > 1_000_000)
35
+ throw new Error("Metric execution requires 1 to 1,000,000 attempt receipts.");
36
+ const ids = new Set();
37
+ const scores = [];
38
+ const weights = [];
39
+ let missingRewardCount = 0;
40
+ for (const receipt of input.receipts) {
41
+ input.signal?.throwIfAborted();
42
+ if (!verifyAttemptReceipt(receipt))
43
+ throw new Error(`Metric receipt ${receipt.id} has an invalid content hash.`);
44
+ if (receipt.runManifest.id !== manifest.id || receipt.runManifest.contentHash !== manifest.contentHash)
45
+ throw new Error(`Metric receipt ${receipt.id} belongs to a different Run Manifest.`);
46
+ if (ids.has(receipt.id))
47
+ throw new Error(`Metric receipt ${receipt.id} is duplicated.`);
48
+ ids.add(receipt.id);
49
+ if (!receipt.terminal || ["infrastructure_failure", "timeout", "cancelled"].includes(receipt.failureClass ?? ""))
50
+ continue;
51
+ const score = receipt.metadata.score;
52
+ if (typeof score === "number" && (!Number.isFinite(score) || score < 0 || score > 1))
53
+ throw new Error(`Metric receipt ${receipt.id} has an invalid score.`);
54
+ const hasReward = receipt.metadata.rewardEligible === true && typeof score === "number"
55
+ && (policy.aggregation !== "pass_rate" || typeof receipt.metadata.passed === "boolean");
56
+ if (!hasReward) {
57
+ missingRewardCount += 1;
58
+ if (policy.missingReward === "exclude")
59
+ continue;
60
+ }
61
+ const weight = policy.aggregation === "weighted_mean" && Object.hasOwn(policy.taskWeights, receipt.taskId) ? policy.taskWeights[receipt.taskId] : undefined;
62
+ if (policy.aggregation === "weighted_mean" && weight === undefined)
63
+ throw new Error(`Metric policy has no weight for task ${receipt.taskId}.`);
64
+ scores.push(hasReward ? policy.aggregation === "pass_rate" ? Number(receipt.metadata.passed) : score : 0);
65
+ weights.push(weight ?? 1);
66
+ }
67
+ let value = null;
68
+ const receiptRefs = input.receipts.map(({ id, contentHash }) => ({ id, contentHash }));
69
+ const includedCount = scores.length;
70
+ if (policy.customAggregator) {
71
+ assertMetricSource(policy.customAggregator, input.source);
72
+ if (!executor)
73
+ throw new Error("Custom metrics require an isolated executor.");
74
+ // Empty populations remain unscorable, even if authored code would return a value.
75
+ if (scores.length) {
76
+ const result = await executor({ source: input.source, module: policy.customAggregator.module, exportName: policy.customAggregator.exportName, scores, timeoutMs: policy.customAggregator.timeoutMs, signal: input.signal });
77
+ if (typeof result !== "number" || !Number.isFinite(result) || result < 0 || result > 1)
78
+ throw new Error("Custom metric must return a finite number between 0 and 1.");
79
+ value = result;
80
+ }
81
+ }
82
+ else if (scores.length) {
83
+ const totalWeight = weights.reduce((sum, weight) => sum + weight, 0);
84
+ value = scores.reduce((sum, score, index) => sum + score * (weights[index] / totalWeight), 0);
85
+ value = Math.max(0, Math.min(1, value));
86
+ }
87
+ input.signal?.throwIfAborted();
88
+ const content = TasksetMetricResultContentSchema.parse({
89
+ schemaVersion: "openpond.tasksetMetricResult.v1",
90
+ runManifest: { id: manifest.id, contentHash: manifest.contentHash },
91
+ tasksetRelease: manifest.tasksetRelease,
92
+ policy,
93
+ policyHash: contentHash(policy),
94
+ receiptRefs,
95
+ includedCount,
96
+ missingRewardCount,
97
+ excludedCount: receiptRefs.length - includedCount,
98
+ value,
99
+ });
100
+ return TasksetMetricResultSchema.parse({ ...content, contentHash: contentHash(content) });
101
+ }
102
+ function assertMetricSource(aggregator, source) {
103
+ if (source === undefined || new TextEncoder().encode(source).byteLength > 524_288 || sha256(source) !== aggregator.contentHash)
104
+ throw new Error("Metric module bytes do not match the pinned content hash or exceed the source limit.");
105
+ }
package/dist/runs.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import { z } from "zod";
2
2
  import { FailureClassSchema, ImmutableArtifactRefSchema, ImmutableReleaseRefSchema, MetadataSchema, ModelRefSchema, ReleaseHashSchema, ReleaseIdSchema, ReleaseTimestampSchema, assertContentHash, contentHash, } from "@openpond/harness";
3
+ import { assertTasksetMetricResult, TasksetMetricResultSchema } from "./metric-policy.js";
3
4
  export const RuntimeTargetBindingSchema = z.object({
4
5
  adapterId: ReleaseIdSchema,
5
6
  placement: z.enum(["local", "remote", "colocated", "provider_native"]),
@@ -58,6 +59,7 @@ export const EvaluationResultContentSchema = z.object({
58
59
  terminalCount: z.number().int().nonnegative(),
59
60
  meanScore: z.number().min(0).max(1).nullable(),
60
61
  failureCounts: z.record(FailureClassSchema, z.number().int().nonnegative()),
62
+ authoredMetric: TasksetMetricResultSchema.optional(),
61
63
  metadata: MetadataSchema,
62
64
  }).strict();
63
65
  export const EvaluationResultSchema = EvaluationResultContentSchema.extend({ contentHash: ReleaseHashSchema }).strict();
@@ -101,6 +103,15 @@ export function aggregateEvaluationReceipts(input) {
101
103
  if (!verifyAttemptReceipt(receipt))
102
104
  throw new Error(`Attempt receipt ${receipt.id} has an invalid content hash.`);
103
105
  }
106
+ if (input.authoredMetric) {
107
+ assertTasksetMetricResult(input.authoredMetric);
108
+ const metric = input.authoredMetric;
109
+ if (metric.runManifest.id !== input.manifest.id || metric.runManifest.contentHash !== input.manifest.contentHash
110
+ || contentHash(metric.tasksetRelease) !== contentHash(input.manifest.tasksetRelease)
111
+ || contentHash(metric.receiptRefs) !== contentHash(input.receipts.map(({ id, contentHash }) => ({ id, contentHash })))) {
112
+ throw new Error("Authored metric does not describe this evaluation's exact manifest and receipts.");
113
+ }
114
+ }
104
115
  const scores = input.receipts.flatMap((receipt) => typeof receipt.metadata.score === "number" && Number.isFinite(receipt.metadata.score)
105
116
  ? [receipt.metadata.score]
106
117
  : []);
@@ -118,6 +129,7 @@ export function aggregateEvaluationReceipts(input) {
118
129
  terminalCount: input.receipts.filter((receipt) => receipt.terminal).length,
119
130
  meanScore: scores.length ? scores.reduce((total, score) => total + score, 0) / scores.length : null,
120
131
  failureCounts,
132
+ ...(input.authoredMetric ? { authoredMetric: input.authoredMetric } : {}),
121
133
  metadata: input.metadata ?? {},
122
134
  });
123
135
  return EvaluationResultSchema.parse({ ...content, contentHash: contentHash(content) });
package/dist/tasksets.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import { z } from "zod";
2
2
  import { CapabilityRequirementSchema, ImmutableAssetRefSchema, MetadataSchema, ReleaseHashSchema, ReleaseIdSchema, ToolDeclarationSchema, assertContentHash, contentHash, } from "@openpond/harness";
3
+ import { TasksetMetricPolicySchema } from "./metric-policy.js";
3
4
  export const TaskSplitSchema = z.enum(["train", "validation", "test", "frozen_eval"]);
4
5
  export const RequiredOutputContractSchema = z.object({
5
6
  path: z.string().trim().min(1).max(2_000).refine(safeRelativePath),
@@ -85,6 +86,7 @@ export const TasksetReleaseContentSchema = z.object({
85
86
  tasks: z.array(TaskRecordSchema).min(1).max(1_000_000),
86
87
  graders: z.array(GraderSpecSchema).min(1).max(1_000),
87
88
  verifierSetRelease: z.object({ id: ReleaseIdSchema, contentHash: ReleaseHashSchema }).strict().optional(),
89
+ metrics: TasksetMetricPolicySchema.optional(),
88
90
  metadata: MetadataSchema,
89
91
  }).strict();
90
92
  export const TasksetReleaseSchema = TasksetReleaseContentSchema.extend({ contentHash: ReleaseHashSchema }).strict();
@@ -115,6 +117,9 @@ export function validateTasksetRelease(input) {
115
117
  }
116
118
  const clusterSplits = new Map();
117
119
  for (const task of taskset.tasks) {
120
+ if (taskset.metrics?.aggregation === "weighted_mean" && !Object.hasOwn(taskset.metrics.taskWeights, task.id)) {
121
+ issues.push({ code: "metric_task_weight_missing", severity: "error", message: `Metric policy has no weight for task ${task.id}.`, path: "metrics.taskWeights" });
122
+ }
118
123
  const splits = clusterSplits.get(task.clusterKey) ?? new Set();
119
124
  splits.add(task.split);
120
125
  clusterSplits.set(task.clusterKey, splits);
@@ -143,6 +143,20 @@ export declare const harnessRefinerBenchmarkRelease: {
143
143
  id: string;
144
144
  contentHash: string;
145
145
  } | undefined;
146
+ metrics?: {
147
+ schemaVersion: "openpond.tasksetMetricPolicy.v1";
148
+ primaryMetric: string;
149
+ aggregation: "mean_score" | "pass_rate" | "weighted_mean" | "custom";
150
+ missingReward: "zero" | "exclude";
151
+ customAggregator: {
152
+ module: string;
153
+ exportName: string;
154
+ contentHash: string;
155
+ timeoutMs: number;
156
+ networkPolicy: "none";
157
+ } | null;
158
+ taskWeights?: Record<string, number> | undefined;
159
+ } | undefined;
146
160
  };
147
161
  export declare const harnessRefinerBenchmarkAssets: Readonly<Record<string, string>>;
148
162
  //# sourceMappingURL=harness-refiner.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"harness-refiner.d.ts","sourceRoot":"","sources":["../../../../../src/builtin-benchmarks/harness-refiner.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqqD1C,CAAC;AAEF,eAAO,MAAM,6BAA6B,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CASzE,CAAC"}
1
+ {"version":3,"file":"harness-refiner.d.ts","sourceRoot":"","sources":["../../../../../src/builtin-benchmarks/harness-refiner.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqqD1C,CAAC;AAEF,eAAO,MAAM,6BAA6B,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CASzE,CAAC"}
@@ -253,6 +253,20 @@ export declare const genericToolConformance: {
253
253
  id: string;
254
254
  contentHash: string;
255
255
  } | undefined;
256
+ metrics?: {
257
+ schemaVersion: "openpond.tasksetMetricPolicy.v1";
258
+ primaryMetric: string;
259
+ aggregation: "mean_score" | "pass_rate" | "weighted_mean" | "custom";
260
+ missingReward: "zero" | "exclude";
261
+ customAggregator: {
262
+ module: string;
263
+ exportName: string;
264
+ contentHash: string;
265
+ timeoutMs: number;
266
+ networkPolicy: "none";
267
+ } | null;
268
+ taskWeights?: Record<string, number> | undefined;
269
+ } | undefined;
256
270
  };
257
271
  manifest: {
258
272
  schemaVersion: "openpond.runManifest.v1";
@@ -549,6 +563,20 @@ export declare const marketingPortfolioConformance: {
549
563
  id: string;
550
564
  contentHash: string;
551
565
  } | undefined;
566
+ metrics?: {
567
+ schemaVersion: "openpond.tasksetMetricPolicy.v1";
568
+ primaryMetric: string;
569
+ aggregation: "mean_score" | "pass_rate" | "weighted_mean" | "custom";
570
+ missingReward: "zero" | "exclude";
571
+ customAggregator: {
572
+ module: string;
573
+ exportName: string;
574
+ contentHash: string;
575
+ timeoutMs: number;
576
+ networkPolicy: "none";
577
+ } | null;
578
+ taskWeights?: Record<string, number> | undefined;
579
+ } | undefined;
552
580
  };
553
581
  manifest: {
554
582
  schemaVersion: "openpond.runManifest.v1";
@@ -1 +1 @@
1
- {"version":3,"file":"conformance.d.ts","sourceRoot":"","sources":["../../../../src/conformance.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAEjC,CAAC;AAEH,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAGxC,CAAC"}
1
+ {"version":3,"file":"conformance.d.ts","sourceRoot":"","sources":["../../../../src/conformance.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAEjC,CAAC;AAEH,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAGxC,CAAC"}
@@ -32,7 +32,7 @@ export declare const completeWorkProcessTraceFixture: {
32
32
  durationMs: number | null;
33
33
  cpuTimeMs: number | null;
34
34
  memoryPeakBytes: number | null;
35
- errorClass: "validation" | "policy" | "unknown" | "environment" | "cancelled" | "timeout" | "infrastructure" | null;
35
+ errorClass: "unknown" | "policy" | "validation" | "environment" | "cancelled" | "timeout" | "infrastructure" | null;
36
36
  };
37
37
  }[];
38
38
  contentHash: string;
@@ -209,7 +209,7 @@ export declare const incompleteWorkProcessTraceFixture: {
209
209
  durationMs: number | null;
210
210
  cpuTimeMs: number | null;
211
211
  memoryPeakBytes: number | null;
212
- errorClass: "validation" | "policy" | "unknown" | "environment" | "cancelled" | "timeout" | "infrastructure" | null;
212
+ errorClass: "unknown" | "policy" | "validation" | "environment" | "cancelled" | "timeout" | "infrastructure" | null;
213
213
  };
214
214
  }[];
215
215
  contentHash: string;
@@ -415,7 +415,7 @@ export declare const workEvidenceConformance: {
415
415
  durationMs: number | null;
416
416
  cpuTimeMs: number | null;
417
417
  memoryPeakBytes: number | null;
418
- errorClass: "validation" | "policy" | "unknown" | "environment" | "cancelled" | "timeout" | "infrastructure" | null;
418
+ errorClass: "unknown" | "policy" | "validation" | "environment" | "cancelled" | "timeout" | "infrastructure" | null;
419
419
  };
420
420
  }[];
421
421
  contentHash: string;
@@ -648,7 +648,7 @@ export declare const workEvidenceConformance: {
648
648
  durationMs: number | null;
649
649
  cpuTimeMs: number | null;
650
650
  memoryPeakBytes: number | null;
651
- errorClass: "validation" | "policy" | "unknown" | "environment" | "cancelled" | "timeout" | "infrastructure" | null;
651
+ errorClass: "unknown" | "policy" | "validation" | "environment" | "cancelled" | "timeout" | "infrastructure" | null;
652
652
  };
653
653
  }[];
654
654
  contentHash: string;
@@ -87,9 +87,9 @@ export declare const WorkInterventionOutcomeSchema: z.ZodEnum<{
87
87
  dismissed: "dismissed";
88
88
  }>;
89
89
  export declare const WorkProcessErrorClassSchema: z.ZodEnum<{
90
- validation: "validation";
91
- policy: "policy";
92
90
  unknown: "unknown";
91
+ policy: "policy";
92
+ validation: "validation";
93
93
  environment: "environment";
94
94
  cancelled: "cancelled";
95
95
  timeout: "timeout";
@@ -197,9 +197,9 @@ export declare const WorkProcessStepSchema: z.ZodObject<{
197
197
  cpuTimeMs: z.ZodNullable<z.ZodNumber>;
198
198
  memoryPeakBytes: z.ZodNullable<z.ZodNumber>;
199
199
  errorClass: z.ZodNullable<z.ZodEnum<{
200
- validation: "validation";
201
- policy: "policy";
202
200
  unknown: "unknown";
201
+ policy: "policy";
202
+ validation: "validation";
203
203
  environment: "environment";
204
204
  cancelled: "cancelled";
205
205
  timeout: "timeout";
@@ -315,9 +315,9 @@ export declare const WorkProcessTraceContentSchema: z.ZodObject<{
315
315
  cpuTimeMs: z.ZodNullable<z.ZodNumber>;
316
316
  memoryPeakBytes: z.ZodNullable<z.ZodNumber>;
317
317
  errorClass: z.ZodNullable<z.ZodEnum<{
318
- validation: "validation";
319
- policy: "policy";
320
318
  unknown: "unknown";
319
+ policy: "policy";
320
+ validation: "validation";
321
321
  environment: "environment";
322
322
  cancelled: "cancelled";
323
323
  timeout: "timeout";
@@ -434,9 +434,9 @@ export declare const WorkProcessTraceSchema: z.ZodObject<{
434
434
  cpuTimeMs: z.ZodNullable<z.ZodNumber>;
435
435
  memoryPeakBytes: z.ZodNullable<z.ZodNumber>;
436
436
  errorClass: z.ZodNullable<z.ZodEnum<{
437
- validation: "validation";
438
- policy: "policy";
439
437
  unknown: "unknown";
438
+ policy: "policy";
439
+ validation: "validation";
440
440
  environment: "environment";
441
441
  cancelled: "cancelled";
442
442
  timeout: "timeout";
@@ -8,6 +8,7 @@ export * from "./graders.js";
8
8
  export * from "./harness.js";
9
9
  export * from "./learned-preference.js";
10
10
  export * from "./runs.js";
11
+ export * from "./metrics.js";
11
12
  export * from "./model-improvement-qualification.js";
12
13
  export * from "./preferences.js";
13
14
  export * from "./review-conformance.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,yBAAyB,CAAC;AACxC,cAAc,WAAW,CAAC;AAC1B,cAAc,sCAAsC,CAAC;AACrD,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC;AACxC,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,yBAAyB,CAAC;AACxC,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,sCAAsC,CAAC;AACrD,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC;AACxC,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC"}
@@ -6,7 +6,7 @@ export interface JavaScriptIsolateInput {
6
6
  signal?: AbortSignal;
7
7
  maxResultBytes: number;
8
8
  deterministic?: boolean;
9
- errorPrefix: "verifier" | "environment" | "candidate";
9
+ errorPrefix: "verifier" | "environment" | "candidate" | "metric";
10
10
  }
11
11
  export declare class JavaScriptIsolateExecutionError extends Error {
12
12
  constructor(message: string);
@@ -1 +1 @@
1
- {"version":3,"file":"javascript-isolate.d.ts","sourceRoot":"","sources":["../../../../src/javascript-isolate.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,OAAO,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,WAAW,EAAE,UAAU,GAAG,aAAa,GAAG,WAAW,CAAC;CACvD;AAED,qBAAa,+BAAgC,SAAQ,KAAK;gBAC5C,OAAO,EAAE,MAAM;CAC5B;AAED,kFAAkF;AAClF,wBAAsB,wBAAwB,CAAC,KAAK,EAAE,sBAAsB,GAAG,OAAO,CAAC,OAAO,CAAC,CAqC9F;AAED,wBAAgB,8BAA8B,CAAC,KAAK,EAAE,sBAAsB,GAAG,IAAI,CAKlF"}
1
+ {"version":3,"file":"javascript-isolate.d.ts","sourceRoot":"","sources":["../../../../src/javascript-isolate.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,OAAO,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,WAAW,EAAE,UAAU,GAAG,aAAa,GAAG,WAAW,GAAG,QAAQ,CAAC;CAClE;AAED,qBAAa,+BAAgC,SAAQ,KAAK;gBAC5C,OAAO,EAAE,MAAM;CAC5B;AAED,kFAAkF;AAClF,wBAAsB,wBAAwB,CAAC,KAAK,EAAE,sBAAsB,GAAG,OAAO,CAAC,OAAO,CAAC,CAqC9F;AAED,wBAAgB,8BAA8B,CAAC,KAAK,EAAE,sBAAsB,GAAG,IAAI,CAKlF"}
@@ -240,8 +240,10 @@ export declare const TaskBatchPackageMetadataSchema: z.ZodObject<{
240
240
  }, z.core.$strict>>;
241
241
  temperature: z.ZodOptional<z.ZodNumber>;
242
242
  }, z.core.$strict>, z.ZodObject<{
243
- kind: z.ZodLiteral<"custom_verifier">;
243
+ exportName: z.ZodOptional<z.ZodString>;
244
+ timeoutMs: z.ZodNumber;
244
245
  networkPolicy: z.ZodLiteral<"none">;
246
+ kind: z.ZodLiteral<"custom_verifier">;
245
247
  verifierRef: z.ZodObject<{
246
248
  id: z.ZodString;
247
249
  path: z.ZodString;
@@ -254,8 +256,6 @@ export declare const TaskBatchPackageMetadataSchema: z.ZodObject<{
254
256
  host_private: "host_private";
255
257
  }>;
256
258
  }, z.core.$strict>;
257
- exportName: z.ZodOptional<z.ZodString>;
258
- timeoutMs: z.ZodNumber;
259
259
  }, z.core.$strict>, z.ZodObject<{
260
260
  kind: z.ZodLiteral<"human">;
261
261
  rubricRef: z.ZodObject<{