openpond-sdk 0.2.5 → 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 +66 -0
- package/dist/model-taskset-authoring.js +56 -0
- package/dist/model-taskset-authoring.js.map +7 -0
- package/dist/taskset-packages.js +305 -105
- package/dist/taskset-packages.js.map +4 -4
- package/dist/types/packages/sdk/src/model-batch-review-preparation.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 +50 -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 +52 -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-packages.d.ts +1 -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 +6 -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
|
|
@@ -116,3 +123,62 @@ task changes clear the observed response because that response was produced for
|
|
|
116
123
|
the original task. New evidence needs fresh grading and review before sealing;
|
|
117
124
|
the helper does not attach a batch or start training. A host must separately
|
|
118
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,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"],
|
|
5
|
+
"mappings": ";AAAA,SAAS,SAAS;AAClB,SAAS,iCAAiC;AAE1C,IAAM,WAAW,0BAA0B,MAAM;AACjD,IAAM,aAAa,EAAE,OAAO,EAAE,MAAM,gBAAgB;AAC7C,IAAM,mCAAmC,EAAE,OAAO,EAAE,SAAS,UAAU,SAAS,SAAS,CAAC,EAAE,OAAO;AAInG,IAAM,8BAA8B,EAAE,OAAO;AAAA,EAClD,eAAe,EAAE,QAAQ,mCAAmC;AAAA,EAC5D,OAAO;AAAA,EACP,MAAM;AAAA,EACN,QAAQ;AACV,CAAC,EAAE,OAAO;AAEH,IAAM,iCAAiC,EAAE,OAAO;AAAA,EACrD,eAAe,EAAE,QAAQ,sCAA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