@openpond/evals 0.11.16 → 0.11.18

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 (158) hide show
  1. package/dist/connected-evidence/contracts.js +72 -0
  2. package/dist/connected-evidence/imports.js +71 -0
  3. package/dist/connected-evidence/index.js +5 -0
  4. package/dist/connected-evidence/normalize.js +97 -0
  5. package/dist/connected-evidence/python-correctness.js +73 -0
  6. package/dist/connected-evidence/sources/claude-code.js +71 -0
  7. package/dist/connected-evidence/sources/codex.js +52 -0
  8. package/dist/connected-evidence/sources/history.js +86 -0
  9. package/dist/connected-evidence/sources/usage.js +15 -0
  10. package/dist/connected-evidence/usage-summary.js +52 -0
  11. package/dist/experiments.js +16 -4
  12. package/dist/graders.js +9 -6
  13. package/dist/human-review/comparison.js +161 -0
  14. package/dist/human-review/contracts.js +110 -0
  15. package/dist/human-review/execution.js +61 -0
  16. package/dist/human-review/handoff.js +18 -0
  17. package/dist/human-review/index.js +9 -0
  18. package/dist/human-review/local-publication.js +18 -0
  19. package/dist/human-review/repository.js +1 -0
  20. package/dist/human-review/results.js +18 -0
  21. package/dist/human-review/service.js +268 -0
  22. package/dist/human-review/task-proposals.js +39 -0
  23. package/dist/index.js +1 -0
  24. package/dist/javascript-verifier-contract.js +2 -2
  25. package/dist/learning/authoring.js +2 -1
  26. package/dist/learning/contracts.js +353 -81
  27. package/dist/learning/index.js +1 -0
  28. package/dist/learning/reward-authoring.js +5 -2
  29. package/dist/learning/training-handoff.js +32 -0
  30. package/dist/metrics-node.js +2 -0
  31. package/dist/profile-evaluation-target.js +7 -0
  32. package/dist/profile-evaluations.js +7 -10
  33. package/dist/profile-external-evaluation.js +35 -0
  34. package/dist/profile-source-candidate.js +5 -0
  35. package/dist/rewards.js +5 -3
  36. package/dist/taskset-run-contract.js +10 -0
  37. package/dist/tasksets.js +2 -0
  38. package/dist/types/builtin-benchmarks/harness-refiner.d.ts +75 -1
  39. package/dist/types/builtin-benchmarks/harness-refiner.d.ts.map +1 -1
  40. package/dist/types/conformance.d.ts +150 -2
  41. package/dist/types/conformance.d.ts.map +1 -1
  42. package/dist/types/connected-evidence/contracts.d.ts +317 -0
  43. package/dist/types/connected-evidence/contracts.d.ts.map +1 -0
  44. package/dist/types/connected-evidence/imports.d.ts +19 -0
  45. package/dist/types/connected-evidence/imports.d.ts.map +1 -0
  46. package/dist/types/connected-evidence/index.d.ts +6 -0
  47. package/dist/types/connected-evidence/index.d.ts.map +1 -0
  48. package/dist/types/connected-evidence/normalize.d.ts +25 -0
  49. package/dist/types/connected-evidence/normalize.d.ts.map +1 -0
  50. package/dist/types/connected-evidence/python-correctness.d.ts +196 -0
  51. package/dist/types/connected-evidence/python-correctness.d.ts.map +1 -0
  52. package/dist/types/connected-evidence/sources/claude-code.d.ts +74 -0
  53. package/dist/types/connected-evidence/sources/claude-code.d.ts.map +1 -0
  54. package/dist/types/connected-evidence/sources/codex.d.ts +74 -0
  55. package/dist/types/connected-evidence/sources/codex.d.ts.map +1 -0
  56. package/dist/types/connected-evidence/sources/history.d.ts +146 -0
  57. package/dist/types/connected-evidence/sources/history.d.ts.map +1 -0
  58. package/dist/types/connected-evidence/sources/usage.d.ts +3 -0
  59. package/dist/types/connected-evidence/sources/usage.d.ts.map +1 -0
  60. package/dist/types/connected-evidence/usage-summary.d.ts +162 -0
  61. package/dist/types/connected-evidence/usage-summary.d.ts.map +1 -0
  62. package/dist/types/evidence/conformance.d.ts +28 -28
  63. package/dist/types/evidence/contracts.d.ts +27 -27
  64. package/dist/types/execution-contracts.d.ts +159 -5
  65. package/dist/types/execution-contracts.d.ts.map +1 -1
  66. package/dist/types/experiments.d.ts +476 -7
  67. package/dist/types/experiments.d.ts.map +1 -1
  68. package/dist/types/graders.d.ts +21 -1
  69. package/dist/types/graders.d.ts.map +1 -1
  70. package/dist/types/human-review/comparison.d.ts +1959 -0
  71. package/dist/types/human-review/comparison.d.ts.map +1 -0
  72. package/dist/types/human-review/contracts.d.ts +2719 -0
  73. package/dist/types/human-review/contracts.d.ts.map +1 -0
  74. package/dist/types/human-review/execution.d.ts +298 -0
  75. package/dist/types/human-review/execution.d.ts.map +1 -0
  76. package/dist/types/human-review/handoff.d.ts +124 -0
  77. package/dist/types/human-review/handoff.d.ts.map +1 -0
  78. package/dist/types/human-review/index.d.ts +10 -0
  79. package/dist/types/human-review/index.d.ts.map +1 -0
  80. package/dist/types/human-review/local-publication.d.ts +165 -0
  81. package/dist/types/human-review/local-publication.d.ts.map +1 -0
  82. package/dist/types/human-review/repository.d.ts +43 -0
  83. package/dist/types/human-review/repository.d.ts.map +1 -0
  84. package/dist/types/human-review/results.d.ts +118 -0
  85. package/dist/types/human-review/results.d.ts.map +1 -0
  86. package/dist/types/human-review/service.d.ts +878 -0
  87. package/dist/types/human-review/service.d.ts.map +1 -0
  88. package/dist/types/human-review/task-proposals.d.ts +70 -0
  89. package/dist/types/human-review/task-proposals.d.ts.map +1 -0
  90. package/dist/types/index.d.ts +1 -0
  91. package/dist/types/index.d.ts.map +1 -1
  92. package/dist/types/javascript-environment-contract.d.ts +1 -1
  93. package/dist/types/javascript-verifier-contract.d.ts +1 -1
  94. package/dist/types/javascript-verifier-contract.d.ts.map +1 -1
  95. package/dist/types/learned-preference.d.ts +2 -2
  96. package/dist/types/learning/acceptance-group.d.ts +13 -13
  97. package/dist/types/learning/acceptance-plan.d.ts +1 -1
  98. package/dist/types/learning/admission.d.ts +78 -1
  99. package/dist/types/learning/admission.d.ts.map +1 -1
  100. package/dist/types/learning/authoring-service.d.ts +2 -0
  101. package/dist/types/learning/authoring-service.d.ts.map +1 -1
  102. package/dist/types/learning/authoring.d.ts +20 -0
  103. package/dist/types/learning/authoring.d.ts.map +1 -1
  104. package/dist/types/learning/batch-service.d.ts +76 -2
  105. package/dist/types/learning/batch-service.d.ts.map +1 -1
  106. package/dist/types/learning/contracts.d.ts +759 -24
  107. package/dist/types/learning/contracts.d.ts.map +1 -1
  108. package/dist/types/learning/index.d.ts +1 -0
  109. package/dist/types/learning/index.d.ts.map +1 -1
  110. package/dist/types/learning/iteration-candidate-decision.d.ts +2 -2
  111. package/dist/types/learning/iteration-dispatch-contracts.d.ts +2 -2
  112. package/dist/types/learning/operations.d.ts +1118 -8
  113. package/dist/types/learning/operations.d.ts.map +1 -1
  114. package/dist/types/learning/repository.d.ts +402 -15
  115. package/dist/types/learning/repository.d.ts.map +1 -1
  116. package/dist/types/learning/reward-authoring.d.ts.map +1 -1
  117. package/dist/types/learning/reward-calibration.d.ts +74 -0
  118. package/dist/types/learning/reward-calibration.d.ts.map +1 -1
  119. package/dist/types/learning/reward-checks.d.ts +14 -2
  120. package/dist/types/learning/reward-checks.d.ts.map +1 -1
  121. package/dist/types/learning/training-handoff.d.ts +201 -0
  122. package/dist/types/learning/training-handoff.d.ts.map +1 -0
  123. package/dist/types/learning/transport.d.ts +963 -21
  124. package/dist/types/learning/transport.d.ts.map +1 -1
  125. package/dist/types/metrics-node.d.ts +3 -1
  126. package/dist/types/metrics-node.d.ts.map +1 -1
  127. package/dist/types/model-improvement-qualification.d.ts +3 -3
  128. package/dist/types/native-harness-experiment-attempt.d.ts +2 -2
  129. package/dist/types/profile-evaluation-comparisons.d.ts +230 -0
  130. package/dist/types/profile-evaluation-comparisons.d.ts.map +1 -1
  131. package/dist/types/profile-evaluation-target.d.ts +14 -0
  132. package/dist/types/profile-evaluation-target.d.ts.map +1 -0
  133. package/dist/types/profile-evaluations.d.ts +117 -14
  134. package/dist/types/profile-evaluations.d.ts.map +1 -1
  135. package/dist/types/profile-external-evaluation.d.ts +404 -0
  136. package/dist/types/profile-external-evaluation.d.ts.map +1 -0
  137. package/dist/types/profile-source-candidate.d.ts +15 -0
  138. package/dist/types/profile-source-candidate.d.ts.map +1 -0
  139. package/dist/types/review-conformance.d.ts +7 -7
  140. package/dist/types/rewards.d.ts +253 -0
  141. package/dist/types/rewards.d.ts.map +1 -1
  142. package/dist/types/rollouts.d.ts +3 -3
  143. package/dist/types/taskset-run-contract.d.ts +230 -0
  144. package/dist/types/taskset-run-contract.d.ts.map +1 -1
  145. package/dist/types/tasksets.d.ts +311 -3
  146. package/dist/types/tasksets.d.ts.map +1 -1
  147. package/dist/types/telemetry-analysis.d.ts +2 -2
  148. package/dist/types/telemetry-bundle.d.ts +6 -6
  149. package/dist/types/telemetry.d.ts +3 -3
  150. package/package.json +13 -1
  151. package/schemas/learning/v1/command-request.schema.json +1745 -409
  152. package/schemas/learning/v1/decision.schema.json +11 -0
  153. package/schemas/learning/v1/draft.schema.json +11 -0
  154. package/schemas/learning/v1/grade.schema.json +11 -0
  155. package/schemas/learning/v1/package.schema.json +532 -12
  156. package/schemas/learning/v1/policy.schema.json +836 -28
  157. package/schemas/learning/v1/reward.schema.json +520 -0
  158. package/schemas/learning/v1/reward_check.schema.json +9 -0
@@ -0,0 +1,32 @@
1
+ import { z } from "zod";
2
+ import { ExperimentTargetSchema } from "../experiments.js";
3
+ const Id = z.string().trim().min(1).max(200);
4
+ const Hash = z.string().regex(/^[a-f0-9]{64}$/);
5
+ const Ref = z.object({ id: Id, contentHash: Hash }).strict();
6
+ export const TrainingHandoffOriginSchema = z
7
+ .object({
8
+ schemaVersion: z.literal("openpond.trainingHandoffOrigin.v1"),
9
+ teamId: Id,
10
+ projectId: Id.nullable(),
11
+ configurationId: Id,
12
+ source: z
13
+ .object({ executionId: Id, passId: Id.nullable(), manifestHash: Hash, resultHash: Hash })
14
+ .strict(),
15
+ dataset: z
16
+ .object({ id: Id, revision: z.number().int().positive(), contentHash: Hash })
17
+ .strict(),
18
+ target: ExperimentTargetSchema,
19
+ graders: z
20
+ .array(z
21
+ .object({
22
+ feedbackKey: Id,
23
+ evaluator: Ref,
24
+ expectedCount: z.number().int().positive(),
25
+ scoredCount: z.number().int().nonnegative(),
26
+ score: z.number().finite().nullable(),
27
+ })
28
+ .strict())
29
+ .max(100),
30
+ contentHash: Hash,
31
+ })
32
+ .strict();
@@ -31,3 +31,5 @@ const executeMetric = async ({ source, module, exportName, scores, timeoutMs, si
31
31
  };
32
32
  const executeProcessMetric = ({ source, module, exportName, scores, timeoutMs, signal }) => executeJavaScriptIsolateInProcess({ source, exportName, value: scores, timeoutMs, signal, stripTypeScript: /\.[cm]?ts$/.test(module),
33
33
  maxResultBytes: 1_024, deterministic: true, errorPrefix: "metric" });
34
+ /** Trusted host port for a frozen private metric; callers retain source and receipt ownership. */
35
+ export const executeTasksetMetricWorker = executeMetric;
@@ -0,0 +1,7 @@
1
+ import { z } from "zod";
2
+ import { ReleaseIdSchema } from "@openpond/harness";
3
+ const RelativePathSchema = z.string().min(1).max(2000).refine(value => !value.includes("\\") && !value.includes(":") && !value.startsWith("/") && value.split("/").every(part => part !== "" && part !== "." && part !== ".."), "Evaluation paths must be portable and relative.");
4
+ export const ProfileEvaluationTargetSchema = z.discriminatedUnion("kind", [
5
+ z.object({ kind: z.literal("profile") }).strict(), z.object({ kind: z.literal("workflow"), workflowId: ReleaseIdSchema }).strict(),
6
+ z.object({ kind: z.literal("skill"), skillPath: RelativePathSchema }).strict(), z.object({ kind: z.literal("agent_action"), actionId: ReleaseIdSchema }).strict()
7
+ ]);
@@ -1,16 +1,11 @@
1
1
  import { z } from "zod";
2
+ import { ProfileSourceCandidateSchema } from "./profile-source-candidate.js";
2
3
  import { ImmutableReleaseRefSchema, ReleaseHashSchema, ReleaseIdSchema, contentHash, harnessSourcePackageFiles, loadReleasedProfileWorkflowCatalogAssets, sha256, validateHarnessSourcePackage, } from "@openpond/harness";
3
4
  import { TaskSplitSchema } from "./tasksets.js";
4
- const RelativePathSchema = z.string().min(1).max(2_000).refine((value) => !value.includes("\\") && !value.includes(":") && !value.startsWith("/")
5
- && value.split("/").every((part) => part !== "" && part !== "." && part !== ".."), "evaluation paths must be portable and relative");
6
- /** Portable selection only. Taskset releases own task data and graders; run
7
- * manifests and evidence stay in the installation's evaluation store. */
8
- export const ProfileEvaluationTargetSchema = z.discriminatedUnion("kind", [
9
- z.object({ kind: z.literal("profile") }).strict(),
10
- z.object({ kind: z.literal("workflow"), workflowId: ReleaseIdSchema }).strict(),
11
- z.object({ kind: z.literal("skill"), skillPath: RelativePathSchema }).strict(),
12
- z.object({ kind: z.literal("agent_action"), actionId: ReleaseIdSchema }).strict(),
13
- ]);
5
+ import { ProfileEvaluationTargetSchema } from "./profile-evaluation-target.js";
6
+ import { ProfileExternalDatasetBindingSchema } from "./profile-external-evaluation.js";
7
+ export { ProfileEvaluationTargetSchema } from "./profile-evaluation-target.js";
8
+ export * from "./profile-external-evaluation.js";
14
9
  export const ProfileEvaluationDefinitionSchema = z.object({
15
10
  id: ReleaseIdSchema,
16
11
  label: z.string().trim().min(1).max(240),
@@ -54,6 +49,8 @@ export const ProfileEvaluationRunSourceSchema = z.object({
54
49
  definitionHash: ReleaseHashSchema,
55
50
  target: ProfileEvaluationTargetSchema,
56
51
  environmentHash: ReleaseHashSchema,
52
+ externalDatasetBinding: ProfileExternalDatasetBindingSchema.optional(),
53
+ sourceCandidate: ProfileSourceCandidateSchema.optional(),
57
54
  }).strict();
58
55
  /** Validate component and suite references against the same Profile release. */
59
56
  export function validateProfileEvaluationCatalog(input) {
@@ -0,0 +1,35 @@
1
+ import { z } from "zod";
2
+ import { ImmutableReleaseRefSchema, ReleaseHashSchema, ReleaseIdSchema, contentHash } from "@openpond/harness";
3
+ import { ProfileEvaluationTargetSchema } from "./profile-evaluation-target.js";
4
+ import { TaskSplitSchema } from "./tasksets.js";
5
+ const PopulationMemberSchema = z.object({ taskId: ReleaseIdSchema, seed: z.string().min(1).max(500), fixtureId: ReleaseIdSchema.nullable() }).strict();
6
+ const Segment = z.string().min(1).max(200).refine(value => !["__proto__", "prototype", "constructor"].includes(value), "Use an ordinary field name.");
7
+ const Slot = z.enum(["input", "output", "expectedOutput", "evaluatorContext"]);
8
+ export const ProfileExternalFieldMappingsSchema = z.array(z.object({ graderId: ReleaseIdSchema, fields: z.array(z.object({ destination: Slot, path: z.array(Segment).min(1).max(20), source: Slot, sourcePath: z.array(Segment).max(20) }).strict()).max(100) }).strict()).max(100);
9
+ const RecordedOriginSchema = z.object({ execution: ImmutableReleaseRefSchema, originalEvidence: ImmutableReleaseRefSchema, members: z.array(z.object({ caseId: ReleaseIdSchema, seed: z.string().min(1).max(500), fixtureId: ReleaseHashSchema,
10
+ sourceId: ReleaseIdSchema, snapshotHash: ReleaseHashSchema, boundaryRevisionHash: ReleaseHashSchema }).strict()).min(1).max(500) }).strict();
11
+ const MeasurementSchema = z.object({ release: ImmutableReleaseRefSchema.extend({ revision: z.union([z.number().int().positive(), z.string().min(1).max(200)]) }).strict(), feedbackKey: z.string().min(1).max(240),
12
+ configurationHash: ReleaseHashSchema, output: z.enum(["boolean", "score", "category"]), categories: z.array(z.string().min(1).max(120)).max(50) }).strict();
13
+ export const ProfileExternalDatasetBindingContentSchema = z.object({ schemaVersion: z.literal("openpond.profileExternalDatasetBinding.v1"), dataset: ImmutableReleaseRefSchema.extend({ revision: z.number().int().positive() }).strict(),
14
+ packageHash: ReleaseHashSchema, profileId: ReleaseIdSchema, target: ProfileEvaluationTargetSchema, declaredProfileCatalogHash: ReleaseHashSchema.nullable(), protectedProfileClosureHash: ReleaseHashSchema,
15
+ recordedOrigin: RecordedOriginSchema.optional(), gradingSource: z.object({ pass: ImmutableReleaseRefSchema, evidence: ImmutableReleaseRefSchema }).strict().optional(), split: TaskSplitSchema, population: z.array(PopulationMemberSchema).min(1).max(10000), evaluators: z.array(MeasurementSchema).min(1).max(100), fieldMappingsHash: ReleaseHashSchema, fieldMappings: ProfileExternalFieldMappingsSchema,
16
+ environmentHash: ReleaseHashSchema, privateDatasetClosureHash: ReleaseHashSchema, criterion: z.object({ minimumPassRate: z.number().min(0).max(1), requireComplete: z.boolean() }).strict() }).strict().superRefine((value, ctx) => {
17
+ if (value.recordedOrigin && (value.recordedOrigin.members.length !== value.population.length || value.recordedOrigin.members.some((source, index) => source.caseId !== value.population[index].taskId || source.seed !== value.population[index].seed || source.fixtureId !== source.snapshotHash || value.population[index].fixtureId !== null)))
18
+ ctx.addIssue({ code: "custom", message: "Recorded-to-rerun mapping must preserve every exact ordered cutoff and seed while admitting new target attempts." });
19
+ if (contentHash(value.fieldMappings) !== value.fieldMappingsHash)
20
+ ctx.addIssue({ code: "custom", message: "Field mappings differ from their sealed hash." });
21
+ if (new Set(value.fieldMappings.map(row => row.graderId)).size !== value.fieldMappings.length)
22
+ ctx.addIssue({ code: "custom", message: "Field mappings must name each grader once." });
23
+ if (new Set(value.population.map(row => JSON.stringify([row.taskId, row.seed, row.fixtureId]))).size !== value.population.length)
24
+ ctx.addIssue({ code: "custom", message: "External Dataset population must be unique." });
25
+ if (new Set(value.evaluators.map(row => row.feedbackKey)).size !== value.evaluators.length)
26
+ ctx.addIssue({ code: "custom", message: "External Dataset feedback keys must be unique." });
27
+ for (const grader of value.evaluators)
28
+ if ((grader.output === "category") !== (grader.categories.length > 0))
29
+ ctx.addIssue({ code: "custom", message: "Only category grading declares categories." });
30
+ });
31
+ export const ProfileExternalDatasetBindingSchema = ProfileExternalDatasetBindingContentSchema.safeExtend({ contentHash: ReleaseHashSchema }).strict();
32
+ export function verifyProfileExternalDatasetBinding(raw) { const value = ProfileExternalDatasetBindingSchema.parse(raw), { contentHash: hash, ...body } = value; if (contentHash(body) !== hash)
33
+ throw new Error("External Dataset binding integrity failed."); return value; }
34
+ export function createProfileExternalDatasetBinding(raw) { const value = ProfileExternalDatasetBindingContentSchema.parse(raw); return verifyProfileExternalDatasetBinding({ ...value, contentHash: contentHash(value) }); }
35
+ export const externalDatasetDefinitionId = (binding) => `external-dataset-${verifyProfileExternalDatasetBinding(binding).contentHash.slice(0, 40)}`;
@@ -0,0 +1,5 @@
1
+ import { z } from "zod";
2
+ import { ImmutableReleaseRefSchema } from "@openpond/harness";
3
+ /** An identity to resolve through the actual private hosted source owner. It is
4
+ * never itself an authorization or a model-artifact declaration. */
5
+ export const ProfileSourceCandidateSchema = z.object({ candidateId: z.string().min(1).max(240), frozenRevision: z.number().int().positive(), frozenHash: z.string().regex(/^[a-f0-9]{64}$/), harnessRelease: ImmutableReleaseRefSchema, protectedClosureHash: z.string().regex(/^[a-f0-9]{64}$/) }).strict();
package/dist/rewards.js CHANGED
@@ -101,8 +101,8 @@ export const RewardCompositionContentSchema = z.object({
101
101
  taskHash: ReleaseHashSchema,
102
102
  outputHash: ReleaseHashSchema,
103
103
  results: z.array(BoundRewardResultSchema).max(100),
104
- training: z.object({ status: z.enum(["scored", "unscorable", "not_configured"]), score: z.number().min(0).max(1).nullable(), passed: z.boolean().nullable() }).strict(),
105
- evaluation: z.object({ status: z.enum(["scored", "unscorable", "not_configured"]), score: z.number().min(0).max(1).nullable(), passed: z.boolean().nullable() }).strict(),
104
+ training: z.object({ status: z.enum(["scored", "pending", "unscorable", "not_configured"]), score: z.number().min(0).max(1).nullable(), passed: z.boolean().nullable() }).strict(),
105
+ evaluation: z.object({ status: z.enum(["scored", "pending", "unscorable", "not_configured"]), score: z.number().min(0).max(1).nullable(), passed: z.boolean().nullable() }).strict(),
106
106
  }).strict();
107
107
  export const RewardCompositionSchema = RewardCompositionContentSchema.extend({ contentHash: ReleaseHashSchema }).strict();
108
108
  export function createRewardRelease(input) {
@@ -229,8 +229,10 @@ export function composeBoundRewards(input) {
229
229
  const selected = binding.sources.filter((source) => source.role === role).map((source) => ({ source, result: results.find((candidate) => candidate.graderId === source.graderId) }));
230
230
  if (!selected.length)
231
231
  return { status: "not_configured", score: null, passed: null };
232
- if (selected.some(({ source, result }) => source.required && result.status !== "scored"))
232
+ if (selected.some(({ source, result }) => source.required && result.status !== "scored" && result.status !== "pending"))
233
233
  return { status: "unscorable", score: null, passed: null };
234
+ if (selected.some(({ source, result }) => source.required && result.status === "pending"))
235
+ return { status: "pending", score: null, passed: null };
234
236
  const scored = selected.filter(({ result }) => result.status === "scored");
235
237
  const weight = scored.reduce((sum, { source }) => sum + source.weight, 0);
236
238
  if (weight === 0)
@@ -1,3 +1,4 @@
1
+ import { verifyProfileExternalDatasetBinding, externalDatasetDefinitionId } from "./profile-external-evaluation.js";
1
2
  import { z } from "zod";
2
3
  import { assertContentHash, contentHash, ImmutableReleaseRefSchema, MetadataSchema, ModelRefSchema, ReleaseHashSchema, ReleaseIdSchema, ReleaseTimestampSchema } from "@openpond/harness";
3
4
  import { RunLimitsSchema, RuntimeTargetBindingSchema, verifyAttemptReceipt } from "./runs.js";
@@ -100,6 +101,15 @@ export function assertProfileEvaluationRunAdmission(manifest, taskset, catalogIn
100
101
  if (definition.taskIds.some((id) => tasks.get(id)?.split !== definition.split)) {
101
102
  throw new Error("Profile evaluation case is absent from its declared Taskset split.");
102
103
  }
104
+ if (source.externalDatasetBinding) {
105
+ const binding = verifyProfileExternalDatasetBinding(source.externalDatasetBinding);
106
+ if (source.definitionId !== externalDatasetDefinitionId(binding) || binding.dataset.id !== taskset.id || binding.dataset.revision !== taskset.revision || binding.dataset.contentHash !== taskset.contentHash
107
+ || binding.packageHash !== manifest.packageHash || binding.profileId !== source.profileId || contentHash(binding.target) !== contentHash(source.target) || binding.split !== definition.split
108
+ || binding.environmentHash !== contentHash(taskset.environment) || binding.population.length !== manifest.population.length
109
+ || binding.population.some((member, index) => contentHash(member) !== contentHash({ taskId: manifest.population[index].taskId, seed: manifest.population[index].seed, fixtureId: manifest.population[index].fixtureId })))
110
+ throw new Error("Profile external Dataset execution differs from its exact admitted recipe.");
111
+ return;
112
+ }
103
113
  const expected = new Set(definition.taskIds.flatMap((taskId) => definition.seeds.map((seed) => JSON.stringify([taskId, seed]))));
104
114
  const actual = new Set(manifest.population.map(({ taskId, seed }) => JSON.stringify([taskId, seed])));
105
115
  if (manifest.population.some((member) => member.fixtureId !== null)
package/dist/tasksets.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import { z } from "zod";
2
2
  import { CapabilityRequirementSchema, ImmutableAssetRefSchema, MetadataSchema, ReleaseHashSchema, ReleaseIdSchema, ToolDeclarationSchema, assertContentHash, contentHash, } from "@openpond/harness";
3
3
  import { TasksetMetricPolicySchema } from "./metric-policy.js";
4
+ import { HumanFormSchema } from "./human-review/contracts.js";
4
5
  export const TaskSplitSchema = z.enum(["train", "validation", "test", "frozen_eval"]);
5
6
  export const RequiredOutputContractSchema = z.object({
6
7
  path: z.string().trim().min(1).max(2_000).refine(safeRelativePath),
@@ -58,6 +59,7 @@ export const HumanGraderSpecSchema = GraderBaseSchema.extend({
58
59
  kind: z.literal("human"),
59
60
  rubricRef: ImmutableAssetRefSchema,
60
61
  reviewerRole: z.string().trim().min(1).max(500),
62
+ form: HumanFormSchema.optional(),
61
63
  }).strict();
62
64
  export const GraderSpecSchema = z.union([
63
65
  DeterministicGraderSpecSchema,
@@ -14,7 +14,7 @@ export declare const harnessRefinerBenchmarkRelease: {
14
14
  entrypoint: string;
15
15
  stateful: boolean;
16
16
  deterministicSeeds: boolean;
17
- lifecycle: ("create" | "reset" | "step" | "collect" | "destroy")[];
17
+ lifecycle: ("step" | "create" | "reset" | "collect" | "destroy")[];
18
18
  networkPolicy: "none" | "declared_read_only" | "declared_scoped";
19
19
  defaultTimeoutMs: number;
20
20
  };
@@ -133,6 +133,80 @@ export declare const harnessRefinerBenchmarkRelease: {
133
133
  visibility: "policy" | "verifier" | "host_private";
134
134
  };
135
135
  reviewerRole: string;
136
+ form?: {
137
+ schemaVersion: "openpond.humanForm.v1";
138
+ mode: "individual" | "pairwise";
139
+ instructions: string;
140
+ criteria: ({
141
+ id: string;
142
+ label: string;
143
+ instructions: string;
144
+ required: boolean;
145
+ allowAbstain: boolean;
146
+ kind: "score";
147
+ minimum: number;
148
+ maximum: number;
149
+ step: number;
150
+ requireRationale?: boolean | undefined;
151
+ anchors?: {
152
+ value: string | number | boolean;
153
+ description: string;
154
+ }[] | undefined;
155
+ } | {
156
+ id: string;
157
+ label: string;
158
+ instructions: string;
159
+ required: boolean;
160
+ allowAbstain: boolean;
161
+ kind: "category";
162
+ options: string[];
163
+ requireRationale?: boolean | undefined;
164
+ anchors?: {
165
+ value: string | number | boolean;
166
+ description: string;
167
+ }[] | undefined;
168
+ } | {
169
+ id: string;
170
+ label: string;
171
+ instructions: string;
172
+ required: boolean;
173
+ allowAbstain: boolean;
174
+ kind: "boolean";
175
+ requireRationale?: boolean | undefined;
176
+ anchors?: {
177
+ value: string | number | boolean;
178
+ description: string;
179
+ }[] | undefined;
180
+ } | {
181
+ id: string;
182
+ label: string;
183
+ instructions: string;
184
+ required: boolean;
185
+ allowAbstain: boolean;
186
+ kind: "text";
187
+ maximumLength: number;
188
+ requireRationale?: boolean | undefined;
189
+ anchors?: {
190
+ value: string | number | boolean;
191
+ description: string;
192
+ }[] | undefined;
193
+ minimumLength?: number | undefined;
194
+ } | {
195
+ id: string;
196
+ label: string;
197
+ instructions: string;
198
+ required: boolean;
199
+ allowAbstain: boolean;
200
+ kind: "preference";
201
+ allowTie: boolean;
202
+ requireRationale?: boolean | undefined;
203
+ anchors?: {
204
+ value: string | number | boolean;
205
+ description: string;
206
+ }[] | undefined;
207
+ requireStrength?: boolean | undefined;
208
+ })[];
209
+ } | undefined;
136
210
  })[];
137
211
  metadata: Record<string, unknown>;
138
212
  contentHash: string;
@@ -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"}
@@ -124,7 +124,7 @@ export declare const genericToolConformance: {
124
124
  entrypoint: string;
125
125
  stateful: boolean;
126
126
  deterministicSeeds: boolean;
127
- lifecycle: ("create" | "reset" | "step" | "collect" | "destroy")[];
127
+ lifecycle: ("step" | "create" | "reset" | "collect" | "destroy")[];
128
128
  networkPolicy: "none" | "declared_read_only" | "declared_scoped";
129
129
  defaultTimeoutMs: number;
130
130
  };
@@ -243,6 +243,80 @@ export declare const genericToolConformance: {
243
243
  visibility: "policy" | "verifier" | "host_private";
244
244
  };
245
245
  reviewerRole: string;
246
+ form?: {
247
+ schemaVersion: "openpond.humanForm.v1";
248
+ mode: "individual" | "pairwise";
249
+ instructions: string;
250
+ criteria: ({
251
+ id: string;
252
+ label: string;
253
+ instructions: string;
254
+ required: boolean;
255
+ allowAbstain: boolean;
256
+ kind: "score";
257
+ minimum: number;
258
+ maximum: number;
259
+ step: number;
260
+ requireRationale?: boolean | undefined;
261
+ anchors?: {
262
+ value: string | number | boolean;
263
+ description: string;
264
+ }[] | undefined;
265
+ } | {
266
+ id: string;
267
+ label: string;
268
+ instructions: string;
269
+ required: boolean;
270
+ allowAbstain: boolean;
271
+ kind: "category";
272
+ options: string[];
273
+ requireRationale?: boolean | undefined;
274
+ anchors?: {
275
+ value: string | number | boolean;
276
+ description: string;
277
+ }[] | undefined;
278
+ } | {
279
+ id: string;
280
+ label: string;
281
+ instructions: string;
282
+ required: boolean;
283
+ allowAbstain: boolean;
284
+ kind: "boolean";
285
+ requireRationale?: boolean | undefined;
286
+ anchors?: {
287
+ value: string | number | boolean;
288
+ description: string;
289
+ }[] | undefined;
290
+ } | {
291
+ id: string;
292
+ label: string;
293
+ instructions: string;
294
+ required: boolean;
295
+ allowAbstain: boolean;
296
+ kind: "text";
297
+ maximumLength: number;
298
+ requireRationale?: boolean | undefined;
299
+ anchors?: {
300
+ value: string | number | boolean;
301
+ description: string;
302
+ }[] | undefined;
303
+ minimumLength?: number | undefined;
304
+ } | {
305
+ id: string;
306
+ label: string;
307
+ instructions: string;
308
+ required: boolean;
309
+ allowAbstain: boolean;
310
+ kind: "preference";
311
+ allowTie: boolean;
312
+ requireRationale?: boolean | undefined;
313
+ anchors?: {
314
+ value: string | number | boolean;
315
+ description: string;
316
+ }[] | undefined;
317
+ requireStrength?: boolean | undefined;
318
+ })[];
319
+ } | undefined;
246
320
  })[];
247
321
  metadata: Record<string, unknown>;
248
322
  contentHash: string;
@@ -435,7 +509,7 @@ export declare const marketingPortfolioConformance: {
435
509
  entrypoint: string;
436
510
  stateful: boolean;
437
511
  deterministicSeeds: boolean;
438
- lifecycle: ("create" | "reset" | "step" | "collect" | "destroy")[];
512
+ lifecycle: ("step" | "create" | "reset" | "collect" | "destroy")[];
439
513
  networkPolicy: "none" | "declared_read_only" | "declared_scoped";
440
514
  defaultTimeoutMs: number;
441
515
  };
@@ -554,6 +628,80 @@ export declare const marketingPortfolioConformance: {
554
628
  visibility: "policy" | "verifier" | "host_private";
555
629
  };
556
630
  reviewerRole: string;
631
+ form?: {
632
+ schemaVersion: "openpond.humanForm.v1";
633
+ mode: "individual" | "pairwise";
634
+ instructions: string;
635
+ criteria: ({
636
+ id: string;
637
+ label: string;
638
+ instructions: string;
639
+ required: boolean;
640
+ allowAbstain: boolean;
641
+ kind: "score";
642
+ minimum: number;
643
+ maximum: number;
644
+ step: number;
645
+ requireRationale?: boolean | undefined;
646
+ anchors?: {
647
+ value: string | number | boolean;
648
+ description: string;
649
+ }[] | undefined;
650
+ } | {
651
+ id: string;
652
+ label: string;
653
+ instructions: string;
654
+ required: boolean;
655
+ allowAbstain: boolean;
656
+ kind: "category";
657
+ options: string[];
658
+ requireRationale?: boolean | undefined;
659
+ anchors?: {
660
+ value: string | number | boolean;
661
+ description: string;
662
+ }[] | undefined;
663
+ } | {
664
+ id: string;
665
+ label: string;
666
+ instructions: string;
667
+ required: boolean;
668
+ allowAbstain: boolean;
669
+ kind: "boolean";
670
+ requireRationale?: boolean | undefined;
671
+ anchors?: {
672
+ value: string | number | boolean;
673
+ description: string;
674
+ }[] | undefined;
675
+ } | {
676
+ id: string;
677
+ label: string;
678
+ instructions: string;
679
+ required: boolean;
680
+ allowAbstain: boolean;
681
+ kind: "text";
682
+ maximumLength: number;
683
+ requireRationale?: boolean | undefined;
684
+ anchors?: {
685
+ value: string | number | boolean;
686
+ description: string;
687
+ }[] | undefined;
688
+ minimumLength?: number | undefined;
689
+ } | {
690
+ id: string;
691
+ label: string;
692
+ instructions: string;
693
+ required: boolean;
694
+ allowAbstain: boolean;
695
+ kind: "preference";
696
+ allowTie: boolean;
697
+ requireRationale?: boolean | undefined;
698
+ anchors?: {
699
+ value: string | number | boolean;
700
+ description: string;
701
+ }[] | undefined;
702
+ requireStrength?: boolean | undefined;
703
+ })[];
704
+ } | undefined;
557
705
  })[];
558
706
  metadata: Record<string, unknown>;
559
707
  contentHash: string;
@@ -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"}