openpond-sdk 0.2.4 → 0.3.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.
- package/TASKSETS.md +96 -0
- package/dist/model-batch-review.js +48 -0
- package/dist/model-batch-review.js.map +7 -0
- package/dist/model-taskset-authoring.js +56 -0
- package/dist/model-taskset-authoring.js.map +7 -0
- package/dist/taskset-packages.js +566 -75
- package/dist/taskset-packages.js.map +4 -4
- package/dist/types/packages/sdk/src/model-batch-review-contracts.d.ts +568 -0
- package/dist/types/packages/sdk/src/model-batch-review-contracts.d.ts.map +1 -0
- package/dist/types/packages/sdk/src/model-batch-review-preparation.d.ts +351 -0
- package/dist/types/packages/sdk/src/model-batch-review-preparation.d.ts.map +1 -0
- package/dist/types/packages/sdk/src/model-batch-review.d.ts +543 -0
- package/dist/types/packages/sdk/src/model-batch-review.d.ts.map +1 -0
- package/dist/types/packages/sdk/src/model-projects.d.ts +2 -2
- package/dist/types/packages/sdk/src/model-starter-catalog.d.ts +16 -2
- package/dist/types/packages/sdk/src/model-starter-catalog.d.ts.map +1 -1
- package/dist/types/packages/sdk/src/model-starters.d.ts +41 -5
- package/dist/types/packages/sdk/src/model-starters.d.ts.map +1 -1
- package/dist/types/packages/sdk/src/model-taskset-authoring-contracts.d.ts +107 -0
- package/dist/types/packages/sdk/src/model-taskset-authoring-contracts.d.ts.map +1 -0
- package/dist/types/packages/sdk/src/model-taskset-authoring-lineage.d.ts +27 -0
- package/dist/types/packages/sdk/src/model-taskset-authoring-lineage.d.ts.map +1 -0
- package/dist/types/packages/sdk/src/model-taskset-authoring.d.ts +20 -0
- package/dist/types/packages/sdk/src/model-taskset-authoring.d.ts.map +1 -0
- package/dist/types/packages/sdk/src/model-taskset-derivation.d.ts +25 -3
- package/dist/types/packages/sdk/src/model-taskset-derivation.d.ts.map +1 -1
- package/dist/types/packages/sdk/src/taskset-package-client.d.ts +88 -6
- package/dist/types/packages/sdk/src/taskset-package-client.d.ts.map +1 -1
- package/dist/types/packages/sdk/src/taskset-package-contracts.d.ts +90 -24
- package/dist/types/packages/sdk/src/taskset-package-contracts.d.ts.map +1 -1
- package/dist/types/packages/sdk/src/taskset-package-execution.d.ts +19 -0
- package/dist/types/packages/sdk/src/taskset-package-execution.d.ts.map +1 -0
- package/dist/types/packages/sdk/src/taskset-package-files.d.ts +21 -0
- package/dist/types/packages/sdk/src/taskset-package-files.d.ts.map +1 -0
- package/dist/types/packages/sdk/src/taskset-package-learning.d.ts +38 -0
- package/dist/types/packages/sdk/src/taskset-package-learning.d.ts.map +1 -1
- package/dist/types/packages/sdk/src/taskset-packages.d.ts +2 -0
- package/dist/types/packages/sdk/src/taskset-packages.d.ts.map +1 -1
- package/dist/types/packages/sdk/src/training.d.ts +3 -3
- package/package.json +10 -2
package/TASKSETS.md
CHANGED
|
@@ -52,6 +52,13 @@ outside the Taskset manifest. The 64 MiB limit includes the JSON envelope and
|
|
|
52
52
|
base64 encoding. Validation does not establish execution readiness or authorize
|
|
53
53
|
access to private resources.
|
|
54
54
|
|
|
55
|
+
Authored aggregation is declared by `taskset.metrics` in the shared Evals
|
|
56
|
+
contract. A custom metric's module must appear once in the package at its
|
|
57
|
+
declared path, retain private visibility, match its content hash and stay within
|
|
58
|
+
the 512 KiB source limit. Imports and owned revisions preserve that policy.
|
|
59
|
+
Evaluations use the shared isolated executor and retain its named result
|
|
60
|
+
separately from ordinary mean-score accounting.
|
|
61
|
+
|
|
55
62
|
The client defines authenticated `POST /v1/taskset-packages` publication and
|
|
56
63
|
`GET /v1/taskset-packages/{model}/{taskset}/{revision}/{hash}` readback. These
|
|
57
64
|
operations require a host that implements the package protocol; availability
|
|
@@ -86,3 +93,92 @@ release/package hashes; Profile provenance makes these different identities.
|
|
|
86
93
|
Persist the exact publication intent and immutable package before sending it.
|
|
87
94
|
After an uncertain response, replay that intent before publishing later local
|
|
88
95
|
edits, then merge the recovered hosted receipt without reverting those edits.
|
|
96
|
+
|
|
97
|
+
## Revising an approved batch
|
|
98
|
+
|
|
99
|
+
Browser editors import schemas and types from `openpond-sdk/model-batch-review`.
|
|
100
|
+
Servers use `inspectModelBatchPackage` from `openpond-sdk/taskset-packages` to
|
|
101
|
+
validate the complete package and return its definition, binding, evidence, and
|
|
102
|
+
decisions without portable file bytes. The inspection includes the sealed package
|
|
103
|
+
hash. Full package validation and compilation remain on the server.
|
|
104
|
+
|
|
105
|
+
`ModelBatchReviewRequestSchema`, `findModelBatchReview`, and
|
|
106
|
+
`beginModelBatchReview` define explicit editing of a Model's selected reviewed
|
|
107
|
+
batch. The host runs these helpers inside its authorized workspace transaction,
|
|
108
|
+
checks the Model revision and selected Taskset reference, and verifies that the
|
|
109
|
+
supplied package belongs to that immutable selection. An operation ID identifies
|
|
110
|
+
one exact request; retries return the original receipt, while changed requests
|
|
111
|
+
with the same operation ID conflict.
|
|
112
|
+
|
|
113
|
+
The request can change task instructions, schemas, inputs, evaluator-only context,
|
|
114
|
+
expected answers, and the selected published Reward binding. The helper creates
|
|
115
|
+
a new definition, Reward graph, enabled direct source, and evidence with parent
|
|
116
|
+
references. Sources record the original Model, package, batch, and Reward binding
|
|
117
|
+
in `reviewOrigin`. Original source credentials and admission decisions are never
|
|
118
|
+
imported. Attempts receive new IDs so matching example/attempt IDs from different
|
|
119
|
+
parent sources remain distinct.
|
|
120
|
+
|
|
121
|
+
Previously approved targets become pending feedback proposals. Policy-visible
|
|
122
|
+
task changes clear the observed response because that response was produced for
|
|
123
|
+
the original task. New evidence needs fresh grading and review before sealing;
|
|
124
|
+
the helper does not attach a batch or start training. A host must separately
|
|
125
|
+
compare the Model revision when attaching the newly prepared batch.
|
|
126
|
+
|
|
127
|
+
## Revising an ordinary package
|
|
128
|
+
|
|
129
|
+
SDK `0.3.0` adds ordinary package authoring and requires Evals `0.9.0` for
|
|
130
|
+
authored metric policies. JavaScript packages must include a complete private
|
|
131
|
+
execution graph: ordinary packages carry `environment/execution.json`, while
|
|
132
|
+
bound packages retain their declared Model execution resources. A JavaScript
|
|
133
|
+
entrypoint alone no longer passes package validation. Use
|
|
134
|
+
`createTasksetPackageExecutionFile` to serialize the declaration, include every
|
|
135
|
+
referenced module/schema/state file, and call `validateTasksetPackage` before
|
|
136
|
+
publication. Existing immutable packages must be revised to add missing assets;
|
|
137
|
+
do not overwrite files retained by historical runs.
|
|
138
|
+
|
|
139
|
+
The browser-safe `openpond-sdk/model-taskset-authoring` entry point also exports
|
|
140
|
+
`TasksetDraftFileInfoSchema`, `TasksetDraftFileSchema`, and
|
|
141
|
+
`TasksetDraftFileMutationSchema`. File mutations carry the draft revision and
|
|
142
|
+
the prior file hash (`null` for a new file). A null content deletes a file;
|
|
143
|
+
otherwise content uses UTF-8 text or canonical base64. Hosts must authorize the
|
|
144
|
+
draft, serialize mutations against form saves/publication/deletion, reject stale
|
|
145
|
+
versions, and protect generated manifests and retained source history. Desktop
|
|
146
|
+
currently supports editing files up to 6 MB; larger dependencies remain listed
|
|
147
|
+
and are preserved in packages.
|
|
148
|
+
|
|
149
|
+
`openpond-sdk/model-taskset-authoring` exposes the draft request, preparation,
|
|
150
|
+
and ownership schemas for editors. Server helpers `prepareModelTasksetDraft`
|
|
151
|
+
and `publishModelTasksetDraftPackage` are exported from
|
|
152
|
+
`openpond-sdk/taskset-packages`.
|
|
153
|
+
|
|
154
|
+
Preparation pins a complete source package hash, an operation ID and the expected
|
|
155
|
+
Model revision. The host authorizes the selected Model/package and resolves its
|
|
156
|
+
canonical owner before calling the helper. Persist the returned preparation and
|
|
157
|
+
request hash before copying files into the draft workspace; a reused operation
|
|
158
|
+
with different input must conflict. A matching portable Model ID alone does not
|
|
159
|
+
establish a cross-workspace ownership link.
|
|
160
|
+
|
|
161
|
+
The first revision forks a shared source into an owned identity. Subsequent
|
|
162
|
+
revisions retain that identity and record the exact parent. Publication accepts
|
|
163
|
+
a validated edited package, preserves its binary/private files and execution
|
|
164
|
+
environment, and seals its owned Taskset and verifier set. Qualification,
|
|
165
|
+
privacy attestations and verifier calibration for different bytes are cleared;
|
|
166
|
+
authored fixtures remain available to run again. Package validation checks the
|
|
167
|
+
declared identity and parent lineage.
|
|
168
|
+
|
|
169
|
+
Ordinary JavaScript environments carry a private `environment/execution.json`
|
|
170
|
+
declaration created with `createTasksetPackageExecutionFile`. It binds the
|
|
171
|
+
environment release, verifier set and JavaScript definition to the module and
|
|
172
|
+
each task's private initial state. `validateTasksetPackage` verifies this graph;
|
|
173
|
+
`resolveTasksetPackageExecution` returns its verified text assets for an
|
|
174
|
+
authorized execution host. Bound packages retain their existing execution
|
|
175
|
+
resource graph. Publication regenerates the ordinary declaration when it seals
|
|
176
|
+
the owned verifier set. Local file authoring also pins changed module bytes and
|
|
177
|
+
reseals the environment before publication, while historical revisions keep
|
|
178
|
+
their original executable files.
|
|
179
|
+
|
|
180
|
+
These pure helpers require the host to persist draft files and commit publication,
|
|
181
|
+
Model selection and retry receipts atomically. Bound Reward packages and reviewed
|
|
182
|
+
batches use their respective authoring graphs and are rejected by this ordinary
|
|
183
|
+
package compiler. Draft persistence, HTTP operations and editor controls are host
|
|
184
|
+
integration work.
|
|
@@ -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;AAAA,EAC9C,YAAY;AAAA,EACZ,SAAS;AAAA,EACT,UAAU,EAAE,MAAM,kBAAkB,EAAE,IAAI,CAAC,EAAE,IAAI,GAAM;AAAA,EACvD,WAAW,EAAE,MAAM,2BAA2B,EAAE,IAAI,CAAC,EAAE,IAAI,GAAM;AACnE,CAAC,EAAE,OAAO;AAGH,IAAM,gCAAgC,EAAE,OAAO;AAAA,EACpD,eAAe,EAAE,QAAQ,qCAAqC;AAAA,EAC9D,aAAa;AAAA,EACb,SAAS;AAAA,EACT,uBAAuB,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS;AAAA,EACjD,YAAY;AAAA,EACZ,kBAAkB,0BAA0B,SAAS;AAAA,EACrD,YAAY,EAAE,OAAO;AAAA,IACnB,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG,EAAE,SAAS;AAAA,IACjD,cAAc,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,IAAI,GAAM,EAAE,SAAS;AAAA,IAC5D,aAAa,yBAAyB,SAAS;AAAA,IAC/C,cAAc,yBAAyB,SAAS;AAAA,EAClD,CAAC,EAAE,OAAO;AAAA,EACV,UAAU,EAAE,MAAM,EAAE,OAAO;AAAA,IACzB,UAAU;AAAA,IACV,OAAO,yBAAyB,SAAS;AAAA,IACzC,UAAU,yBAAyB,SAAS,EAAE,SAAS;AAAA,IACvD,kBAAkB,yBAAyB,SAAS,EAAE,SAAS;AAAA,IAC/D,gBAAgB,yBAAyB,SAAS,EAAE,SAAS;AAAA,EAC/D,CAAC,EAAE,OAAO,CAAC,EAAE,IAAI,GAAM;AACzB,CAAC,EAAE,OAAO;AAIH,IAAM,gCAAgC,EAAE,OAAO;AAAA,EACpD,eAAe,EAAE,QAAQ,qCAAqC;AAAA,EAC9D,aAAa;AAAA,EACb,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,UAAU,EAAE,MAAM,kBAAkB,EAAE,IAAI,CAAC,EAAE,IAAI,GAAM;AAAA,EACvD,WAAW,EAAE,MAAM,kBAAkB,EAAE,IAAI,GAAM;AACnD,CAAC,EAAE,OAAO;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
// src/model-taskset-authoring-contracts.ts
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { LearningRevisionRefSchema } from "@openpond/evals/learning";
|
|
4
|
+
var IdSchema = LearningRevisionRefSchema.shape.id;
|
|
5
|
+
var HashSchema = z.string().regex(/^[a-f0-9]{64}$/);
|
|
6
|
+
var ModelTasksetAuthoringOwnerSchema = z.object({ scopeId: IdSchema, modelId: IdSchema }).strict();
|
|
7
|
+
var ModelTasksetAuthoringSchema = z.object({
|
|
8
|
+
schemaVersion: z.literal("openpond.modelTasksetAuthoring.v1"),
|
|
9
|
+
owner: ModelTasksetAuthoringOwnerSchema,
|
|
10
|
+
root: LearningRevisionRefSchema,
|
|
11
|
+
parent: LearningRevisionRefSchema
|
|
12
|
+
}).strict();
|
|
13
|
+
var ModelTasksetDraftRequestSchema = z.object({
|
|
14
|
+
schemaVersion: z.literal("openpond.modelTasksetDraftRequest.v1"),
|
|
15
|
+
operationId: IdSchema,
|
|
16
|
+
modelId: IdSchema,
|
|
17
|
+
expectedModelRevision: z.number().int().positive(),
|
|
18
|
+
sourcePackageHash: HashSchema
|
|
19
|
+
}).strict();
|
|
20
|
+
var ModelTasksetDraftPreparationSchema = z.object({
|
|
21
|
+
schemaVersion: z.literal("openpond.modelTasksetDraftPreparation.v1"),
|
|
22
|
+
draftId: IdSchema,
|
|
23
|
+
requestHash: HashSchema,
|
|
24
|
+
sourcePackageHash: HashSchema,
|
|
25
|
+
sourceTasksetRef: LearningRevisionRefSchema,
|
|
26
|
+
tasksetId: IdSchema,
|
|
27
|
+
tasksetRevision: z.number().int().positive(),
|
|
28
|
+
lineage: ModelTasksetAuthoringSchema
|
|
29
|
+
}).strict();
|
|
30
|
+
var TasksetDraftFilePathSchema = z.string().min(1).max(1024).refine((value) => !value.includes("\\") && !value.includes(":") && !value.includes("\0") && !value.startsWith("/") && !value.split("/").some((part) => !part || part === "." || part === ".." || part.startsWith(".env")), "Use a relative Taskset file path without environment files.");
|
|
31
|
+
var TasksetDraftFileInfoSchema = z.object({
|
|
32
|
+
path: TasksetDraftFilePathSchema,
|
|
33
|
+
sizeBytes: z.number().int().nonnegative(),
|
|
34
|
+
writable: z.boolean()
|
|
35
|
+
}).strict();
|
|
36
|
+
var TasksetDraftFileContentSchema = z.object({ encoding: z.enum(["utf8", "base64"]), data: z.string().max(8e6) }).strict();
|
|
37
|
+
var TasksetDraftFileSchema = TasksetDraftFileInfoSchema.extend({ contentHash: HashSchema, content: TasksetDraftFileContentSchema }).strict();
|
|
38
|
+
var TasksetDraftFileMutationSchema = z.object({
|
|
39
|
+
draftId: IdSchema,
|
|
40
|
+
expectedDraftRevision: z.number().int().positive(),
|
|
41
|
+
path: TasksetDraftFilePathSchema,
|
|
42
|
+
expectedFileHash: HashSchema.nullable(),
|
|
43
|
+
content: TasksetDraftFileContentSchema.nullable()
|
|
44
|
+
}).strict();
|
|
45
|
+
export {
|
|
46
|
+
ModelTasksetAuthoringOwnerSchema,
|
|
47
|
+
ModelTasksetAuthoringSchema,
|
|
48
|
+
ModelTasksetDraftPreparationSchema,
|
|
49
|
+
ModelTasksetDraftRequestSchema,
|
|
50
|
+
TasksetDraftFileContentSchema,
|
|
51
|
+
TasksetDraftFileInfoSchema,
|
|
52
|
+
TasksetDraftFileMutationSchema,
|
|
53
|
+
TasksetDraftFilePathSchema,
|
|
54
|
+
TasksetDraftFileSchema
|
|
55
|
+
};
|
|
56
|
+
//# sourceMappingURL=model-taskset-authoring.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/model-taskset-authoring-contracts.ts"],
|
|
4
|
+
"sourcesContent": ["import { z } from \"zod\";\nimport { LearningRevisionRefSchema } from \"@openpond/evals/learning\";\n\nconst IdSchema = LearningRevisionRefSchema.shape.id;\nconst HashSchema = z.string().regex(/^[a-f0-9]{64}$/);\nexport const ModelTasksetAuthoringOwnerSchema = z.object({ scopeId: IdSchema, modelId: IdSchema }).strict();\n\n/** Ordinary authoring preserves its own lineage without inventing a Reward\n * binding or replacing an admitted learning graph. Hosts authorize the owner. */\nexport const ModelTasksetAuthoringSchema = z.object({\n schemaVersion: z.literal(\"openpond.modelTasksetAuthoring.v1\"),\n owner: ModelTasksetAuthoringOwnerSchema,\n root: LearningRevisionRefSchema,\n parent: LearningRevisionRefSchema,\n}).strict();\n\nexport const ModelTasksetDraftRequestSchema = z.object({\n schemaVersion: z.literal(\"openpond.modelTasksetDraftRequest.v1\"),\n operationId: IdSchema,\n modelId: IdSchema,\n expectedModelRevision: z.number().int().positive(),\n sourcePackageHash: HashSchema,\n}).strict();\nexport type ModelTasksetDraftRequest = z.infer<typeof ModelTasksetDraftRequestSchema>;\n\n/** Persist this preparation before materializing the editable workspace. */\nexport const ModelTasksetDraftPreparationSchema = z.object({\n schemaVersion: z.literal(\"openpond.modelTasksetDraftPreparation.v1\"),\n draftId: IdSchema,\n requestHash: HashSchema,\n sourcePackageHash: HashSchema,\n sourceTasksetRef: LearningRevisionRefSchema,\n tasksetId: IdSchema,\n tasksetRevision: z.number().int().positive(),\n lineage: ModelTasksetAuthoringSchema,\n}).strict();\nexport type ModelTasksetDraftPreparation = z.infer<typeof ModelTasksetDraftPreparationSchema>;\n\nexport const TasksetDraftFilePathSchema = z.string().min(1).max(1024).refine(value =>\n !value.includes(\"\\\\\") && !value.includes(\":\") && !value.includes(\"\\0\") && !value.startsWith(\"/\")\n && !value.split(\"/\").some(part => !part || part === \".\" || part === \"..\" || part.startsWith(\".env\")), \"Use a relative Taskset file path without environment files.\");\nexport const TasksetDraftFileInfoSchema = z.object({\n path: TasksetDraftFilePathSchema,\n sizeBytes: z.number().int().nonnegative(),\n writable: z.boolean(),\n}).strict();\nexport const TasksetDraftFileContentSchema = z.object({ encoding: z.enum([\"utf8\", \"base64\"]), data: z.string().max(8_000_000) }).strict();\nexport const TasksetDraftFileSchema = TasksetDraftFileInfoSchema.extend({ contentHash: HashSchema, content: TasksetDraftFileContentSchema }).strict();\nexport const TasksetDraftFileMutationSchema = z.object({\n draftId: IdSchema,\n expectedDraftRevision: z.number().int().positive(),\n path: TasksetDraftFilePathSchema,\n expectedFileHash: HashSchema.nullable(),\n content: TasksetDraftFileContentSchema.nullable(),\n}).strict();\nexport type TasksetDraftFileInfo = z.infer<typeof TasksetDraftFileInfoSchema>;\nexport type TasksetDraftFile = z.infer<typeof TasksetDraftFileSchema>;\nexport type TasksetDraftFileMutation = z.infer<typeof TasksetDraftFileMutationSchema>;\n"],
|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