openpond-sdk 0.2.3 → 0.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/TASKSETS.md CHANGED
@@ -38,6 +38,14 @@ the service's error code.
38
38
  and Verifier Set releases, binary files encoded as canonical base64, and the
39
39
  complete model resource graph when the Taskset declares a model binding.
40
40
 
41
+ Reviewed learning batches instead carry `learningResources`: the sealed batch,
42
+ exact evidence and admission decisions, source snapshots, and Reward source
43
+ assets. Validation recompiles the batch and checks its tasks, execution policy,
44
+ and private context files against those snapshots. These are portable review
45
+ records; importing a package does not enable an intake source, issue credentials,
46
+ or grant training approval in the receiving workspace. Local import and grading
47
+ can use the package without contacting a hosted service.
48
+
41
49
  Validation verifies release hashes, dependency references, file bytes and
42
50
  visibility. The package content hash seals the whole graph, including files
43
51
  outside the Taskset manifest. The 64 MiB limit includes the JSON envelope and
@@ -78,3 +86,33 @@ release/package hashes; Profile provenance makes these different identities.
78
86
  Persist the exact publication intent and immutable package before sending it.
79
87
  After an uncertain response, replay that intent before publishing later local
80
88
  edits, then merge the recovered hosted receipt without reverting those edits.
89
+
90
+ ## Revising an approved batch
91
+
92
+ Browser editors import schemas and types from `openpond-sdk/model-batch-review`.
93
+ Servers use `inspectModelBatchPackage` from `openpond-sdk/taskset-packages` to
94
+ validate the complete package and return its definition, binding, evidence, and
95
+ decisions without portable file bytes. The inspection includes the sealed package
96
+ hash. Full package validation and compilation remain on the server.
97
+
98
+ `ModelBatchReviewRequestSchema`, `findModelBatchReview`, and
99
+ `beginModelBatchReview` define explicit editing of a Model's selected reviewed
100
+ batch. The host runs these helpers inside its authorized workspace transaction,
101
+ checks the Model revision and selected Taskset reference, and verifies that the
102
+ supplied package belongs to that immutable selection. An operation ID identifies
103
+ one exact request; retries return the original receipt, while changed requests
104
+ with the same operation ID conflict.
105
+
106
+ The request can change task instructions, schemas, inputs, evaluator-only context,
107
+ expected answers, and the selected published Reward binding. The helper creates
108
+ a new definition, Reward graph, enabled direct source, and evidence with parent
109
+ references. Sources record the original Model, package, batch, and Reward binding
110
+ in `reviewOrigin`. Original source credentials and admission decisions are never
111
+ imported. Attempts receive new IDs so matching example/attempt IDs from different
112
+ parent sources remain distinct.
113
+
114
+ Previously approved targets become pending feedback proposals. Policy-visible
115
+ task changes clear the observed response because that response was produced for
116
+ the original task. New evidence needs fresh grading and review before sealing;
117
+ the helper does not attach a batch or start training. A host must separately
118
+ compare the Model revision when attaching the newly prepared batch.
@@ -0,0 +1,48 @@
1
+ // src/model-batch-review-contracts.ts
2
+ import { z } from "zod";
3
+ import { LearningJsonObjectSchema, LearningRevisionRefSchema, LearningSourceSchema, TaskEvidenceSchema, TaskFeedbackSchema, TaskDefinitionSchema, TaskAdmissionDecisionSchema } from "@openpond/evals/learning";
4
+ import { RewardBindingSchema } from "@openpond/evals/rewards";
5
+ var ReleaseIdSchema = LearningRevisionRefSchema.shape.id;
6
+ var ModelBatchReviewInspectionSchema = z.object({
7
+ schemaVersion: z.literal("openpond.modelBatchReviewInspection.v1"),
8
+ packageHash: z.string().regex(/^[a-f0-9]{64}$/),
9
+ definition: TaskDefinitionSchema,
10
+ binding: RewardBindingSchema,
11
+ evidence: z.array(TaskEvidenceSchema).min(1).max(1e4),
12
+ decisions: z.array(TaskAdmissionDecisionSchema).min(1).max(1e4)
13
+ }).strict();
14
+ var ModelBatchReviewRequestSchema = z.object({
15
+ schemaVersion: z.literal("openpond.modelBatchReviewRequest.v1"),
16
+ operationId: ReleaseIdSchema,
17
+ modelId: ReleaseIdSchema,
18
+ expectedModelRevision: z.number().int().positive(),
19
+ tasksetRef: LearningRevisionRefSchema,
20
+ rewardBindingRef: LearningRevisionRefSchema.nullable(),
21
+ definition: z.object({
22
+ name: z.string().trim().min(1).max(500).optional(),
23
+ instructions: z.string().trim().min(1).max(2e4).optional(),
24
+ inputSchema: LearningJsonObjectSchema.optional(),
25
+ outputSchema: LearningJsonObjectSchema.optional()
26
+ }).strict(),
27
+ examples: z.array(z.object({
28
+ evidence: LearningRevisionRefSchema,
29
+ input: LearningJsonObjectSchema.optional(),
30
+ expected: LearningJsonObjectSchema.nullable().optional(),
31
+ evaluatorContext: LearningJsonObjectSchema.nullable().optional(),
32
+ proposedTarget: LearningJsonObjectSchema.nullable().optional()
33
+ }).strict()).max(1e4)
34
+ }).strict();
35
+ var ModelBatchReviewReceiptSchema = z.object({
36
+ schemaVersion: z.literal("openpond.modelBatchReviewReceipt.v1"),
37
+ operationId: ReleaseIdSchema,
38
+ modelId: ReleaseIdSchema,
39
+ source: LearningSourceSchema,
40
+ evidence: z.array(TaskEvidenceSchema).min(1).max(1e4),
41
+ proposals: z.array(TaskFeedbackSchema).max(1e4)
42
+ }).strict();
43
+ export {
44
+ ModelBatchReviewInspectionSchema,
45
+ ModelBatchReviewReceiptSchema,
46
+ ModelBatchReviewRequestSchema
47
+ };
48
+ //# sourceMappingURL=model-batch-review.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/model-batch-review-contracts.ts"],
4
+ "sourcesContent": ["import { z } from \"zod\";\nimport { LearningJsonObjectSchema, LearningRevisionRefSchema, LearningSourceSchema, TaskEvidenceSchema, TaskFeedbackSchema, TaskDefinitionSchema, TaskAdmissionDecisionSchema } from \"@openpond/evals/learning\";\nimport { RewardBindingSchema } from \"@openpond/evals/rewards\";\n// Reuse the canonical release ID already exposed by Evals without bundling a\n// second copy of Harness's schema graph into the browser contract entrypoint.\nconst ReleaseIdSchema = LearningRevisionRefSchema.shape.id;\n\n/** Editor data from a server-validated package; excludes portable file bytes. */\nexport const ModelBatchReviewInspectionSchema = z.object({\n schemaVersion: z.literal(\"openpond.modelBatchReviewInspection.v1\"),\n packageHash: z.string().regex(/^[a-f0-9]{64}$/),\n definition: TaskDefinitionSchema,\n binding: RewardBindingSchema,\n evidence: z.array(TaskEvidenceSchema).min(1).max(10_000),\n decisions: z.array(TaskAdmissionDecisionSchema).min(1).max(10_000),\n}).strict();\nexport type ModelBatchReviewInspection = z.infer<typeof ModelBatchReviewInspectionSchema>;\n\nexport const ModelBatchReviewRequestSchema = z.object({\n schemaVersion: z.literal(\"openpond.modelBatchReviewRequest.v1\"),\n operationId: ReleaseIdSchema,\n modelId: ReleaseIdSchema,\n expectedModelRevision: z.number().int().positive(),\n tasksetRef: LearningRevisionRefSchema,\n rewardBindingRef: LearningRevisionRefSchema.nullable(),\n definition: z.object({\n name: z.string().trim().min(1).max(500).optional(),\n instructions: z.string().trim().min(1).max(20_000).optional(),\n inputSchema: LearningJsonObjectSchema.optional(),\n outputSchema: LearningJsonObjectSchema.optional(),\n }).strict(),\n examples: z.array(z.object({\n evidence: LearningRevisionRefSchema,\n input: LearningJsonObjectSchema.optional(),\n expected: LearningJsonObjectSchema.nullable().optional(),\n evaluatorContext: LearningJsonObjectSchema.nullable().optional(),\n proposedTarget: LearningJsonObjectSchema.nullable().optional(),\n }).strict()).max(10_000),\n}).strict();\nexport type ModelBatchReviewRequest = z.infer<typeof ModelBatchReviewRequestSchema>;\n\n/** These are editable evidence and unapproved proposals, never admissions. */\nexport const ModelBatchReviewReceiptSchema = z.object({\n schemaVersion: z.literal(\"openpond.modelBatchReviewReceipt.v1\"),\n operationId: ReleaseIdSchema,\n modelId: ReleaseIdSchema,\n source: LearningSourceSchema,\n evidence: z.array(TaskEvidenceSchema).min(1).max(10_000),\n proposals: z.array(TaskFeedbackSchema).max(10_000),\n}).strict();\nexport type ModelBatchReviewReceipt = z.infer<typeof ModelBatchReviewReceiptSchema>;\n"],
5
+ "mappings": ";AAAA,SAAS,SAAS;AAClB,SAAS,0BAA0B,2BAA2B,sBAAsB,oBAAoB,oBAAoB,sBAAsB,mCAAmC;AACrL,SAAS,2BAA2B;AAGpC,IAAM,kBAAkB,0BAA0B,MAAM;AAGjD,IAAM,mCAAmC,EAAE,OAAO;AAAA,EACvD,eAAe,EAAE,QAAQ,wCAAwC;AAAA,EACjE,aAAa,EAAE,OAAO,EAAE,MAAM,gBAAgB;AAA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