@openpond/evals 0.3.0 → 0.4.1

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 (53) hide show
  1. package/CONTRACT.md +11 -3
  2. package/README.md +45 -9
  3. package/RELEASING.md +13 -46
  4. package/dist/benchmarks.js +218 -0
  5. package/dist/builtin-benchmarks/harness-refiner.js +1267 -0
  6. package/dist/compatibility.js +2 -2
  7. package/dist/conformance.js +1 -2
  8. package/dist/evidence/authoring.js +1 -1
  9. package/dist/evidence/conformance.js +1 -1
  10. package/dist/evidence/contracts.js +1 -2
  11. package/dist/evidence/eligibility.js +1 -1
  12. package/dist/graders.js +1 -1
  13. package/dist/harness.js +33 -101
  14. package/dist/index.js +3 -3
  15. package/dist/model-improvement-qualification.js +125 -0
  16. package/dist/review-conformance.js +209 -0
  17. package/dist/runs.js +1 -9
  18. package/dist/tasksets.js +2 -15
  19. package/dist/types/benchmarks.d.ts +293 -0
  20. package/dist/types/benchmarks.d.ts.map +1 -0
  21. package/dist/types/builtin-benchmarks/harness-refiner.d.ts +119 -0
  22. package/dist/types/builtin-benchmarks/harness-refiner.d.ts.map +1 -0
  23. package/dist/types/compatibility.d.ts +1 -1
  24. package/dist/types/compatibility.d.ts.map +1 -1
  25. package/dist/types/conformance.d.ts +2 -0
  26. package/dist/types/conformance.d.ts.map +1 -1
  27. package/dist/types/evidence/conformance.d.ts +24 -24
  28. package/dist/types/evidence/contracts.d.ts +26 -26
  29. package/dist/types/harness.d.ts +3 -409
  30. package/dist/types/harness.d.ts.map +1 -1
  31. package/dist/types/index.d.ts +3 -3
  32. package/dist/types/index.d.ts.map +1 -1
  33. package/dist/types/model-improvement-qualification.d.ts +222 -0
  34. package/dist/types/model-improvement-qualification.d.ts.map +1 -0
  35. package/dist/types/review-conformance.d.ts +607 -0
  36. package/dist/types/review-conformance.d.ts.map +1 -0
  37. package/dist/types/runs.d.ts +1 -9
  38. package/dist/types/runs.d.ts.map +1 -1
  39. package/dist/types/tasksets.d.ts +2 -25
  40. package/dist/types/tasksets.d.ts.map +1 -1
  41. package/package.json +18 -10
  42. package/dist/common.js +0 -67
  43. package/dist/harness-improvements.js +0 -329
  44. package/dist/harness-workspaces.js +0 -368
  45. package/dist/sha256.js +0 -91
  46. package/dist/types/common.d.ts +0 -51
  47. package/dist/types/common.d.ts.map +0 -1
  48. package/dist/types/harness-improvements.d.ts +0 -523
  49. package/dist/types/harness-improvements.d.ts.map +0 -1
  50. package/dist/types/harness-workspaces.d.ts +0 -802
  51. package/dist/types/harness-workspaces.d.ts.map +0 -1
  52. package/dist/types/sha256.d.ts +0 -2
  53. package/dist/types/sha256.d.ts.map +0 -1
@@ -1,5 +1,5 @@
1
- import { assertContentHash, contentHash } from "./common.js";
2
- import { HarnessReleaseSchema, } from "./harness.js";
1
+ import { assertContentHash, contentHash } from "@openpond/harness";
2
+ import { HarnessReleaseSchema, } from "@openpond/harness";
3
3
  import { createHarnessCompatibilityReceipt, } from "./runs.js";
4
4
  import { TasksetReleaseSchema, } from "./tasksets.js";
5
5
  export function createVerifiedHarnessCompatibilityReceipt(input) {
@@ -1,5 +1,4 @@
1
- import { contentHash, withContentHash } from "./common.js";
2
- import { createAgentSnapshot, createHarnessRelease } from "./harness.js";
1
+ import { contentHash, createAgentSnapshot, createHarnessRelease, withContentHash, } from "@openpond/harness";
3
2
  import { createRunManifest } from "./runs.js";
4
3
  import { TasksetReleaseSchema } from "./tasksets.js";
5
4
  const EMPTY_HASH = contentHash("");
@@ -1,5 +1,5 @@
1
1
  import { z } from "zod";
2
- import { ImmutableReleaseRefSchema, ReleaseHashSchema } from "../common.js";
2
+ import { ImmutableReleaseRefSchema, ReleaseHashSchema } from "@openpond/harness";
3
3
  import { EvidenceArtifactRefSchema, WorkEvidenceReceiptSchema, evidenceArtifactRef, } from "./contracts.js";
4
4
  import { WorkEvidenceEligibilitySchema } from "./eligibility.js";
5
5
  export const WorkEvidenceAuthoringInputSchema = z.object({
@@ -1,4 +1,4 @@
1
- import { canonicalJson, contentHash } from "../common.js";
1
+ import { canonicalJson, contentHash } from "@openpond/harness";
2
2
  import { createWorkEvidenceReceipt, createWorkFeedbackReceipt, createWorkProcessTrace, evidenceArtifactRef, workEvidenceReceiptRef, workSourceOpaqueRef, } from "./contracts.js";
3
3
  import { classifyWorkEvidence } from "./eligibility.js";
4
4
  const startedAt = "2026-08-04T12:00:00.000Z";
@@ -1,6 +1,5 @@
1
1
  import { z } from "zod";
2
- import { ImmutableArtifactRefSchema, ImmutableReleaseRefSchema, ReleaseHashSchema, ReleaseIdSchema, ReleaseTimestampSchema, contentHash, } from "../common.js";
3
- import { ModelRefSchema } from "../runs.js";
2
+ import { ImmutableArtifactRefSchema, ImmutableReleaseRefSchema, ModelRefSchema, ReleaseHashSchema, ReleaseIdSchema, ReleaseTimestampSchema, contentHash, } from "@openpond/harness";
4
3
  export const WORK_EVIDENCE_SCHEMA_VERSION = "openpond.workEvidenceReceipt.v1";
5
4
  export const WORK_PROCESS_TRACE_SCHEMA_VERSION = "openpond.workProcessTrace.v1";
6
5
  export const WORK_FEEDBACK_SCHEMA_VERSION = "openpond.workFeedbackReceipt.v1";
@@ -1,5 +1,5 @@
1
1
  import { z } from "zod";
2
- import { contentHash, ReleaseHashSchema } from "../common.js";
2
+ import { contentHash, ReleaseHashSchema } from "@openpond/harness";
3
3
  import { AttemptReceiptSchema, verifyAttemptReceipt } from "../runs.js";
4
4
  import { WORK_EVIDENCE_ELIGIBILITY_SCHEMA_VERSION, WorkFeedbackReceiptSchema, createWorkFeedbackReceipt, verifyWorkEvidenceReceipt, } from "./contracts.js";
5
5
  export const WorkEvidencePolicyStateSchema = z.enum([
package/dist/graders.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { z } from "zod";
2
- import { FailureClassSchema, ReleaseHashSchema, ReleaseIdSchema, contentHash } from "./common.js";
2
+ import { FailureClassSchema, ReleaseHashSchema, ReleaseIdSchema, contentHash } from "@openpond/harness";
3
3
  export const GraderEvidenceContentSchema = z.object({
4
4
  schemaVersion: z.literal("openpond.graderEvidence.v1"),
5
5
  graderId: ReleaseIdSchema,
package/dist/harness.js CHANGED
@@ -1,71 +1,6 @@
1
- import { z } from "zod";
2
- import { FailureClassSchema, ImmutableArtifactRefSchema, ImmutableAssetRefSchema, ImmutableReleaseRefSchema, MetadataSchema, ReleaseHashSchema, ReleaseIdSchema, contentHash, } from "./common.js";
3
- import { ToolDeclarationSchema } from "./tasksets.js";
4
- import { createAttemptReceipt } from "./runs.js";
5
- export const PortabilityReportSchema = z.object({
6
- portable: z.boolean(),
7
- blockers: z.array(z.string().trim().min(1).max(2_000)).max(1_000),
8
- localOnlyAssetRefs: z.array(ReleaseIdSchema).max(10_000),
9
- hostPrivateAssetRefs: z.array(ReleaseIdSchema).max(10_000),
10
- }).strict();
11
- export const AgentSnapshotContentSchema = z.object({
12
- schemaVersion: z.literal("openpond.agentSnapshot.v2"),
13
- id: ReleaseIdSchema,
14
- sourceRelease: ImmutableReleaseRefSchema.nullable(),
15
- instructions: z.array(ImmutableAssetRefSchema).max(10_000),
16
- skills: z.array(ImmutableAssetRefSchema).max(10_000),
17
- agents: z.array(ImmutableAssetRefSchema).max(10_000),
18
- toolDeclarations: z.array(ToolDeclarationSchema).max(200),
19
- capabilityRequirements: z.array(z.object({
20
- id: ReleaseIdSchema,
21
- required: z.boolean(),
22
- scopes: z.array(z.string().trim().min(1).max(500)).max(100),
23
- }).strict()).max(200),
24
- dependencyLock: ImmutableAssetRefSchema,
25
- portability: PortabilityReportSchema,
26
- metadata: MetadataSchema,
27
- }).strict();
28
- export const AgentSnapshotSchema = AgentSnapshotContentSchema.extend({ contentHash: ReleaseHashSchema }).strict();
29
- export const LifecycleContractSchema = z.object({
30
- create: z.literal(true),
31
- reset: z.literal(true),
32
- step: z.literal(true),
33
- collect: z.literal(true),
34
- destroy: z.literal(true),
35
- resetScope: z.enum(["task", "attempt"]),
36
- }).strict();
37
- export const GraderInterfaceContractSchema = z.object({
38
- visibleEvidence: z.array(ReleaseIdSchema).max(1_000),
39
- privilegedEvidence: z.array(ReleaseIdSchema).max(1_000),
40
- privateVerifierIsolation: z.boolean(),
41
- }).strict();
42
- export const HarnessReleaseContentSchema = z.object({
43
- schemaVersion: z.literal("openpond.harnessRelease.v2"),
44
- id: ReleaseIdSchema,
45
- agentSnapshot: ImmutableReleaseRefSchema,
46
- program: ImmutableAssetRefSchema,
47
- tools: z.array(ToolDeclarationSchema).max(200),
48
- lifecycle: LifecycleContractSchema,
49
- graderInterface: GraderInterfaceContractSchema,
50
- files: z.array(ImmutableAssetRefSchema).max(100_000),
51
- metadata: MetadataSchema,
52
- }).strict();
53
- export const HarnessReleaseSchema = HarnessReleaseContentSchema.extend({ contentHash: ReleaseHashSchema }).strict();
54
- export const ModelActionSchema = z.object({
55
- id: ReleaseIdSchema,
56
- turn: z.number().int().nonnegative(),
57
- kind: z.enum(["message", "tool_call", "terminal"]),
58
- name: ReleaseIdSchema.nullable(),
59
- arguments: z.record(z.string(), z.unknown()),
60
- content: z.string().max(1_000_000).nullable(),
61
- }).strict();
62
- export const ToolObservationSchema = z.object({
63
- actionId: ReleaseIdSchema,
64
- turn: z.number().int().nonnegative(),
65
- terminal: z.boolean(),
66
- output: z.record(z.string(), z.unknown()),
67
- artifactRefs: z.array(ImmutableArtifactRefSchema).max(100_000),
68
- }).strict();
1
+ import { HarnessTraceSchema, ModelActionSchema, ToolObservationSchema, contentHash, } from "@openpond/harness";
2
+ import { createAttemptReceipt, } from "./runs.js";
3
+ export * from "@openpond/harness/harness";
69
4
  export async function executeRuntimeProtocol(input) {
70
5
  const now = input.now ?? (() => new Date().toISOString());
71
6
  const startedAt = now();
@@ -84,12 +19,25 @@ export async function executeRuntimeProtocol(input) {
84
19
  let output = {};
85
20
  let artifactRefs = [];
86
21
  const event = (type, payload, metadata = {}) => {
87
- events.push({ sequence: sequence++, type, payloadHash: contentHash(payload), metadata });
22
+ events.push({
23
+ sequence: sequence++,
24
+ type,
25
+ payloadHash: contentHash(payload),
26
+ metadata,
27
+ });
88
28
  };
89
29
  try {
90
- lease = await input.runtime.create({ manifest: input.manifest, taskId: input.taskId, seed: input.seed, signal: controller.signal });
30
+ lease = await input.runtime.create({
31
+ manifest: input.manifest,
32
+ taskId: input.taskId,
33
+ seed: input.seed,
34
+ signal: controller.signal,
35
+ });
91
36
  event("created", { leaseId: lease.id });
92
- await input.runtime.reset(lease, { seed: input.seed, signal: controller.signal });
37
+ await input.runtime.reset(lease, {
38
+ seed: input.seed,
39
+ signal: controller.signal,
40
+ });
93
41
  event("reset", { seed: input.seed });
94
42
  for (const candidate of input.actions.slice(0, input.manifest.limits.maxTurns)) {
95
43
  if (controller.signal.aborted)
@@ -152,12 +100,23 @@ export async function executeRuntimeProtocol(input) {
152
100
  failureClass,
153
101
  output,
154
102
  };
155
- const trace = HarnessTraceSchema.parse({ ...traceContent, contentHash: contentHash(traceContent) });
103
+ const trace = HarnessTraceSchema.parse({
104
+ ...traceContent,
105
+ contentHash: contentHash(traceContent),
106
+ });
156
107
  const completedAt = now();
157
108
  const receipt = createAttemptReceipt({
158
109
  schemaVersion: "openpond.attemptReceipt.v1",
159
- id: `attempt-${contentHash([input.manifest.contentHash, input.taskId, input.seed, trace.contentHash]).slice(0, 24)}`,
160
- runManifest: { id: input.manifest.id, contentHash: input.manifest.contentHash },
110
+ id: `attempt-${contentHash([
111
+ input.manifest.contentHash,
112
+ input.taskId,
113
+ input.seed,
114
+ trace.contentHash,
115
+ ]).slice(0, 24)}`,
116
+ runManifest: {
117
+ id: input.manifest.id,
118
+ contentHash: input.manifest.contentHash,
119
+ },
161
120
  taskId: input.taskId,
162
121
  seed: input.seed,
163
122
  terminal,
@@ -175,30 +134,3 @@ export async function executeRuntimeProtocol(input) {
175
134
  });
176
135
  return { receipt, trace, output };
177
136
  }
178
- export function createAgentSnapshot(input) {
179
- const content = AgentSnapshotContentSchema.parse(input);
180
- return AgentSnapshotSchema.parse({ ...content, contentHash: contentHash(content) });
181
- }
182
- export function createHarnessRelease(input) {
183
- const content = HarnessReleaseContentSchema.parse(input);
184
- return HarnessReleaseSchema.parse({ ...content, contentHash: contentHash(content) });
185
- }
186
- export const HarnessLifecycleEventSchema = z.object({
187
- sequence: z.number().int().nonnegative(),
188
- type: z.enum(["created", "reset", "action", "observation", "terminal", "failure", "collected", "destroyed"]),
189
- payloadHash: ReleaseHashSchema,
190
- metadata: MetadataSchema,
191
- }).strict();
192
- export const HarnessTraceSchema = z.object({
193
- schemaVersion: z.literal("openpond.harnessTrace.v1"),
194
- manifest: ImmutableReleaseRefSchema,
195
- taskId: ReleaseIdSchema,
196
- seed: z.string().trim().min(1).max(500),
197
- events: z.array(HarnessLifecycleEventSchema).max(1_000_000),
198
- actions: z.array(ModelActionSchema).max(100_000),
199
- observations: z.array(ToolObservationSchema).max(100_000),
200
- terminal: z.boolean(),
201
- failureClass: FailureClassSchema.nullable(),
202
- output: z.record(z.string(), z.unknown()),
203
- contentHash: ReleaseHashSchema,
204
- }).strict();
package/dist/index.js CHANGED
@@ -1,9 +1,9 @@
1
- export * from "./common.js";
2
1
  export * from "./compatibility.js";
2
+ export * from "./benchmarks.js";
3
3
  export * from "./evidence/index.js";
4
4
  export * from "./graders.js";
5
5
  export * from "./harness.js";
6
- export * from "./harness-improvements.js";
7
- export * from "./harness-workspaces.js";
8
6
  export * from "./runs.js";
7
+ export * from "./model-improvement-qualification.js";
8
+ export * from "./review-conformance.js";
9
9
  export * from "./tasksets.js";
@@ -0,0 +1,125 @@
1
+ import { z } from "zod";
2
+ import { HarnessReviewSourcePolicyRefSchema, ImmutableReleaseRefSchema, MetadataSchema, ModelRefSchema, ReleaseHashSchema, ReleaseIdSchema, ReleaseTimestampSchema, contentHash, } from "@openpond/harness";
3
+ const BoundedTextSchema = z.string().trim().min(1).max(100_000);
4
+ export const ModelImprovementDecisionSchema = z.enum([
5
+ "no_training",
6
+ "sft",
7
+ "preference",
8
+ "rl",
9
+ ]);
10
+ export const ModelImprovementSignalSchema = z
11
+ .object({
12
+ kind: z.enum(["none", "demonstrations", "chosen_rejected", "scalar_reward"]),
13
+ strength: z.enum(["absent", "weak", "usable"]),
14
+ calibrated: z.boolean(),
15
+ confounded: z.boolean(),
16
+ variance: z.number().finite().nonnegative().nullable(),
17
+ evidenceRefs: z.array(ImmutableReleaseRefSchema).max(100_000),
18
+ })
19
+ .strict();
20
+ export const ModelImprovementQualificationReceiptContentSchema = z
21
+ .object({
22
+ schemaVersion: z.literal("openpond.modelImprovementQualificationReceipt.v1"),
23
+ id: ReleaseIdSchema,
24
+ review: ImmutableReleaseRefSchema,
25
+ harnessRelease: ImmutableReleaseRefSchema,
26
+ tasksetRelease: ImmutableReleaseRefSchema.nullable(),
27
+ baselineEvaluation: ImmutableReleaseRefSchema.nullable(),
28
+ model: ModelRefSchema,
29
+ environmentHash: ReleaseHashSchema.nullable(),
30
+ toolContractHash: ReleaseHashSchema.nullable(),
31
+ permissionContractHash: ReleaseHashSchema.nullable(),
32
+ policyHash: ReleaseHashSchema.nullable(),
33
+ verifierRef: ImmutableReleaseRefSchema.nullable(),
34
+ sourcePolicies: z.array(HarnessReviewSourcePolicyRefSchema).max(10_000),
35
+ trainingEvidenceRefs: z.array(ImmutableReleaseRefSchema).max(100_000),
36
+ frozenEvaluationEvidenceRefs: z.array(ImmutableReleaseRefSchema).max(100_000),
37
+ privacyApproval: ImmutableReleaseRefSchema.nullable(),
38
+ budgetApproval: ImmutableReleaseRefSchema.nullable(),
39
+ maximumCostUsd: z.number().finite().nonnegative(),
40
+ signal: ModelImprovementSignalSchema,
41
+ decision: ModelImprovementDecisionSchema,
42
+ reasons: z.array(BoundedTextSchema).min(1).max(100),
43
+ createdAt: ReleaseTimestampSchema,
44
+ metadata: MetadataSchema,
45
+ })
46
+ .strict()
47
+ .superRefine((receipt, context) => {
48
+ const trainingKeys = new Set(receipt.trainingEvidenceRefs.map(refKey));
49
+ if (receipt.frozenEvaluationEvidenceRefs.some((reference) => trainingKeys.has(refKey(reference)))) {
50
+ context.addIssue({
51
+ code: "custom",
52
+ message: "frozen Evaluation evidence cannot be used as training evidence",
53
+ path: ["frozenEvaluationEvidenceRefs"],
54
+ });
55
+ }
56
+ if (receipt.decision === "no_training")
57
+ return;
58
+ const missingGate = !receipt.tasksetRelease ||
59
+ !receipt.baselineEvaluation ||
60
+ !receipt.environmentHash ||
61
+ !receipt.toolContractHash ||
62
+ !receipt.permissionContractHash ||
63
+ !receipt.policyHash ||
64
+ !receipt.verifierRef ||
65
+ !receipt.privacyApproval ||
66
+ !receipt.budgetApproval ||
67
+ receipt.sourcePolicies.length === 0 ||
68
+ receipt.sourcePolicies.some((policy) => policy.state !== "authorized") ||
69
+ receipt.trainingEvidenceRefs.length === 0 ||
70
+ receipt.signal.strength !== "usable" ||
71
+ !receipt.signal.calibrated ||
72
+ receipt.signal.confounded;
73
+ if (missingGate) {
74
+ context.addIssue({
75
+ code: "custom",
76
+ message: "qualified model improvement requires frozen lineage, authorized signal, privacy, and budget gates",
77
+ });
78
+ }
79
+ if (receipt.decision === "sft" &&
80
+ receipt.signal.kind !== "demonstrations") {
81
+ context.addIssue({
82
+ code: "custom",
83
+ message: "SFT qualification requires demonstration signal",
84
+ path: ["signal", "kind"],
85
+ });
86
+ }
87
+ if (receipt.decision === "preference" &&
88
+ receipt.signal.kind !== "chosen_rejected") {
89
+ context.addIssue({
90
+ code: "custom",
91
+ message: "preference qualification requires chosen/rejected signal",
92
+ path: ["signal", "kind"],
93
+ });
94
+ }
95
+ if (receipt.decision === "rl" &&
96
+ (receipt.signal.kind !== "scalar_reward" ||
97
+ receipt.signal.variance === null ||
98
+ receipt.signal.variance <= 0)) {
99
+ context.addIssue({
100
+ code: "custom",
101
+ message: "RL qualification requires a usable scalar reward with variance",
102
+ path: ["signal"],
103
+ });
104
+ }
105
+ });
106
+ export const ModelImprovementQualificationReceiptSchema = ModelImprovementQualificationReceiptContentSchema.extend({
107
+ contentHash: ReleaseHashSchema,
108
+ }).strict();
109
+ export function createModelImprovementQualificationReceipt(input) {
110
+ const content = ModelImprovementQualificationReceiptContentSchema.parse(input);
111
+ return ModelImprovementQualificationReceiptSchema.parse({
112
+ ...content,
113
+ contentHash: contentHash(content),
114
+ });
115
+ }
116
+ export function verifyModelImprovementQualificationReceipt(value) {
117
+ const parsed = ModelImprovementQualificationReceiptSchema.safeParse(value);
118
+ if (!parsed.success)
119
+ return false;
120
+ const { contentHash: actual, ...content } = parsed.data;
121
+ return (contentHash(ModelImprovementQualificationReceiptContentSchema.parse(content)) === actual);
122
+ }
123
+ function refKey(reference) {
124
+ return `${reference.id}:${reference.contentHash}`;
125
+ }
@@ -0,0 +1,209 @@
1
+ import { contentHash, createHarnessEvaluationReviewReceipt, } from "@openpond/harness";
2
+ import { createModelImprovementQualificationReceipt } from "./model-improvement-qualification.js";
3
+ const createdAt = "2026-08-08T12:00:00.000Z";
4
+ const harnessRelease = ref("harness-release");
5
+ const sourcePolicy = {
6
+ policy: ref("source-policy"),
7
+ state: "authorized",
8
+ checkedAt: createdAt,
9
+ };
10
+ const evidence = (id, kind) => ({
11
+ evidence: ref(id),
12
+ kind,
13
+ sourceRef: `source-${id}`,
14
+ sourcePolicy,
15
+ occurrenceKey: contentHash(`occurrence-${id}`),
16
+ occurredAt: createdAt,
17
+ });
18
+ const watermark = {
19
+ cursor: contentHash("review-watermark"),
20
+ throughCreatedAt: createdAt,
21
+ };
22
+ const claim = (family, count = 3) => ({
23
+ fingerprint: contentHash(`claim-${family}`),
24
+ recurrenceFamily: family,
25
+ statement: `The ${family} behavior remains unresolved after smaller-layer triage.`,
26
+ independentOccurrences: count,
27
+ unresolvedOccurrences: count,
28
+ });
29
+ const noAction = createHarnessEvaluationReviewReceipt({
30
+ schemaVersion: "openpond.harnessEvaluationReviewReceipt.v1",
31
+ id: "review-no-action",
32
+ ownerScope: { kind: "personal", id: "owner-1" },
33
+ workspaceRef: "workspace-1",
34
+ harnessRelease,
35
+ previousWatermark: null,
36
+ nextWatermark: watermark,
37
+ selectedEvidence: [],
38
+ excludedEvidence: [],
39
+ claim: null,
40
+ classification: "no_action",
41
+ triage: [],
42
+ reason: "The bounded evidence window contains no unresolved reusable claim.",
43
+ nextAuthority: "none",
44
+ maxEstimatedCostUsd: 0,
45
+ tasksetProposal: null,
46
+ evaluation: null,
47
+ trainingQualification: null,
48
+ policyVersion: "harness-review-policy-v1",
49
+ createdAt,
50
+ metadata: {},
51
+ });
52
+ const runtime = createHarnessEvaluationReviewReceipt({
53
+ ...withoutHash(noAction),
54
+ id: "review-runtime",
55
+ selectedEvidence: [evidence("runtime-failure", "observation")],
56
+ claim: claim("runtime-transport-failure", 1),
57
+ classification: "runtime",
58
+ triage: [
59
+ {
60
+ layer: "runtime",
61
+ status: "unresolved",
62
+ reason: "The adapter failed before model policy could affect the result.",
63
+ evidenceRefs: [ref("runtime-failure")],
64
+ },
65
+ ],
66
+ reason: "A deterministic runtime regression is the smallest correct fix.",
67
+ nextAuthority: "runtime_service",
68
+ });
69
+ const product = createHarnessEvaluationReviewReceipt({
70
+ ...withoutHash(noAction),
71
+ id: "review-product",
72
+ selectedEvidence: [evidence("product-routing", "route_decision")],
73
+ claim: claim("product-routing-defect", 1),
74
+ classification: "product",
75
+ triage: [
76
+ {
77
+ layer: "product",
78
+ status: "unresolved",
79
+ reason: "The product selected an unrelated Skill for an ordinary Work turn.",
80
+ evidenceRefs: [ref("product-routing")],
81
+ },
82
+ ],
83
+ reason: "Product routing must be corrected before behavioral Evaluation.",
84
+ nextAuthority: "product_team",
85
+ });
86
+ const taskset = createHarnessEvaluationReviewReceipt({
87
+ ...withoutHash(noAction),
88
+ id: "review-taskset",
89
+ selectedEvidence: [
90
+ evidence("failure-1", "work_outcome"),
91
+ evidence("failure-2", "work_outcome"),
92
+ evidence("failure-3", "work_outcome"),
93
+ ],
94
+ claim: claim("search-budget-allocation"),
95
+ classification: "taskset",
96
+ triage: [
97
+ {
98
+ layer: "harness",
99
+ status: "unresolved",
100
+ reason: "The active research Skill did not resolve three independent failures.",
101
+ evidenceRefs: [ref("failure-1"), ref("failure-2"), ref("failure-3")],
102
+ },
103
+ ],
104
+ reason: "The repeated behavioral claim now needs controlled measurement.",
105
+ nextAuthority: "human_review",
106
+ tasksetProposal: ref("taskset-proposal"),
107
+ maxEstimatedCostUsd: 2,
108
+ });
109
+ const blockedRl = createModelImprovementQualificationReceipt({
110
+ schemaVersion: "openpond.modelImprovementQualificationReceipt.v1",
111
+ id: "qualification-rl-blocked",
112
+ review: reference(taskset),
113
+ harnessRelease,
114
+ tasksetRelease: ref("taskset-release"),
115
+ baselineEvaluation: ref("baseline-evaluation"),
116
+ model: modelRef(),
117
+ environmentHash: contentHash("environment"),
118
+ toolContractHash: contentHash("tools"),
119
+ permissionContractHash: contentHash("permissions"),
120
+ policyHash: contentHash("policy"),
121
+ verifierRef: ref("verifier"),
122
+ sourcePolicies: [sourcePolicy],
123
+ trainingEvidenceRefs: [ref("training-evidence")],
124
+ frozenEvaluationEvidenceRefs: [ref("frozen-evidence")],
125
+ privacyApproval: ref("privacy-approval"),
126
+ budgetApproval: ref("budget-approval"),
127
+ maximumCostUsd: 25,
128
+ signal: {
129
+ kind: "scalar_reward",
130
+ strength: "weak",
131
+ calibrated: true,
132
+ confounded: false,
133
+ variance: 0,
134
+ evidenceRefs: [ref("reward-audit")],
135
+ },
136
+ decision: "no_training",
137
+ reasons: ["The observed reward is constant and cannot support RL."],
138
+ createdAt,
139
+ metadata: { blockedMethod: "rl" },
140
+ });
141
+ const qualifiedRl = createModelImprovementQualificationReceipt({
142
+ ...withoutHash(blockedRl),
143
+ id: "qualification-rl-qualified",
144
+ signal: {
145
+ kind: "scalar_reward",
146
+ strength: "usable",
147
+ calibrated: true,
148
+ confounded: false,
149
+ variance: 0.18,
150
+ evidenceRefs: [ref("reward-audit")],
151
+ },
152
+ decision: "rl",
153
+ reasons: [
154
+ "The frozen baseline has usable variance and a calibrated sequential reward.",
155
+ ],
156
+ });
157
+ const modelImprovement = createHarnessEvaluationReviewReceipt({
158
+ ...withoutHash(noAction),
159
+ id: "review-model-improvement",
160
+ selectedEvidence: [
161
+ evidence("baseline-evaluation", "evaluation"),
162
+ evidence("qualification-rl-qualified", "training_qualification"),
163
+ ],
164
+ claim: claim("search-budget-allocation"),
165
+ classification: "model_improvement",
166
+ triage: [
167
+ {
168
+ layer: "model",
169
+ status: "unresolved",
170
+ reason: "Harness, runtime, product, retrieval, and tool triage left a qualified sequential policy gap.",
171
+ evidenceRefs: [ref("baseline-evaluation"), reference(qualifiedRl)],
172
+ },
173
+ ],
174
+ reason: "The qualified claim may proceed to a separately approved managed-training plan.",
175
+ nextAuthority: "training_system",
176
+ tasksetProposal: ref("taskset-proposal"),
177
+ evaluation: ref("baseline-evaluation"),
178
+ trainingQualification: reference(qualifiedRl),
179
+ maxEstimatedCostUsd: 25,
180
+ });
181
+ export const harnessEvaluationReviewConformance = {
182
+ noAction,
183
+ runtime,
184
+ product,
185
+ taskset,
186
+ blockedRl,
187
+ qualifiedRl,
188
+ modelImprovement,
189
+ };
190
+ function ref(id) {
191
+ return { id, contentHash: contentHash(id) };
192
+ }
193
+ function reference(value) {
194
+ return { id: value.id, contentHash: value.contentHash };
195
+ }
196
+ function withoutHash(value) {
197
+ const { contentHash: _contentHash, ...content } = value;
198
+ return content;
199
+ }
200
+ function modelRef() {
201
+ return {
202
+ provider: "openpond",
203
+ model: "openpond-chat",
204
+ revision: "model-revision-1",
205
+ artifactHash: contentHash("model-artifact"),
206
+ tokenizerRevision: "tokenizer-1",
207
+ chatTemplateHash: contentHash("chat-template"),
208
+ };
209
+ }
package/dist/runs.js CHANGED
@@ -1,13 +1,5 @@
1
1
  import { z } from "zod";
2
- import { FailureClassSchema, ImmutableArtifactRefSchema, ImmutableReleaseRefSchema, MetadataSchema, ReleaseHashSchema, ReleaseIdSchema, ReleaseTimestampSchema, assertContentHash, contentHash, } from "./common.js";
3
- export const ModelRefSchema = z.object({
4
- provider: ReleaseIdSchema,
5
- model: ReleaseIdSchema,
6
- revision: z.string().trim().min(1).max(500).nullable().default(null),
7
- artifactHash: ReleaseHashSchema.nullable().default(null),
8
- tokenizerRevision: z.string().trim().min(1).max(500).nullable().default(null),
9
- chatTemplateHash: ReleaseHashSchema.nullable().default(null),
10
- }).strict();
2
+ import { FailureClassSchema, ImmutableArtifactRefSchema, ImmutableReleaseRefSchema, MetadataSchema, ModelRefSchema, ReleaseHashSchema, ReleaseIdSchema, ReleaseTimestampSchema, assertContentHash, contentHash, } from "@openpond/harness";
11
3
  export const RuntimeTargetBindingSchema = z.object({
12
4
  adapterId: ReleaseIdSchema,
13
5
  placement: z.enum(["local", "remote", "colocated", "provider_native"]),
package/dist/tasksets.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { z } from "zod";
2
- import { ImmutableAssetRefSchema, MetadataSchema, ReleaseHashSchema, ReleaseIdSchema, assertContentHash, contentHash, } from "./common.js";
2
+ import { CapabilityRequirementSchema, ImmutableAssetRefSchema, MetadataSchema, ReleaseHashSchema, ReleaseIdSchema, ToolDeclarationSchema, assertContentHash, contentHash, } from "@openpond/harness";
3
3
  export const TaskSplitSchema = z.enum(["train", "validation", "test", "frozen_eval"]);
4
4
  export const PolicyBoundarySchema = z.object({
5
5
  policyVisibleFields: z.array(ReleaseIdSchema).max(1_000).default([]),
@@ -7,20 +7,6 @@ export const PolicyBoundarySchema = z.object({
7
7
  hiddenGraderRefs: z.array(ReleaseIdSchema).max(1_000).default([]),
8
8
  connectedAppScopes: z.array(ReleaseIdSchema).max(100).default([]),
9
9
  }).strict();
10
- export const ToolDeclarationSchema = z.object({
11
- name: z.string().trim().min(1).max(64).regex(/^[a-zA-Z][a-zA-Z0-9_-]*$/),
12
- description: z.string().trim().min(1).max(2_000),
13
- inputSchema: z.record(z.string(), z.unknown()),
14
- inputSchemaHash: ReleaseHashSchema,
15
- sideEffect: z.enum(["read", "write"]),
16
- timeoutMs: z.number().int().positive().max(3_600_000),
17
- }).strict();
18
- export const CapabilityRequirementSchema = z.object({
19
- id: ReleaseIdSchema,
20
- required: z.boolean(),
21
- scopes: z.array(z.string().trim().min(1).max(500)).max(100).default([]),
22
- portability: z.enum(["portable", "host_adapter", "local_only", "hosted_only"]),
23
- }).strict();
24
10
  export const EnvironmentContractSchema = z.object({
25
11
  protocolVersion: z.literal("openpond.environment.v1"),
26
12
  kind: z.enum(["text", "agent", "work", "custom_program"]),
@@ -160,3 +146,4 @@ export function trainingPolicyTaskViews(taskset) {
160
146
  .filter((task) => task.split !== "frozen_eval")
161
147
  .map(policyTaskView);
162
148
  }
149
+ export { CapabilityRequirementSchema, ToolDeclarationSchema, } from "@openpond/harness";