openpond-sdk 0.12.7 → 0.12.9
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/TRAINING_WORKFLOWS.md +132 -0
- package/dist/advanced-refiner-evaluations.js +7 -7
- package/dist/candidate-evaluations.js +6 -6
- package/dist/{chunk-ZGZLN4LH.js → chunk-BWFG46HX.js} +2 -2
- package/dist/{chunk-5T76GARR.js → chunk-CJDEVI3T.js} +2 -2
- package/dist/{chunk-RDL6QIQO.js → chunk-CZXN63A4.js} +2 -2
- package/dist/{chunk-QDYHSJT5.js → chunk-EEZ5YHJQ.js} +3 -3
- package/dist/{chunk-HRZLFJXX.js → chunk-EWRWGFKD.js} +3 -3
- package/dist/{chunk-Z4XGSEKC.js → chunk-EYMZQML2.js} +5 -5
- package/dist/chunk-EYMZQML2.js.map +1 -0
- package/dist/{chunk-SMHZT6RM.js → chunk-GGG6H4MK.js} +2 -2
- package/dist/{chunk-HRJKDHHG.js → chunk-GZSQIOAH.js} +3 -3
- package/dist/{chunk-ETFWUMEJ.js → chunk-HYCHLMP7.js} +2 -2
- package/dist/{chunk-ONGOAEY6.js → chunk-IOZCYSJ6.js} +2 -2
- package/dist/{chunk-SER76PQ7.js → chunk-LUFOAMN5.js} +2 -2
- package/dist/{chunk-S2IASCGW.js → chunk-MGFI4226.js} +3 -3
- package/dist/{chunk-LIMTJR3A.js → chunk-MRUDFIB6.js} +7 -5
- package/dist/chunk-MRUDFIB6.js.map +1 -0
- package/dist/{chunk-SQBYHWZU.js → chunk-QHCY4MBG.js} +2 -2
- package/dist/{chunk-KD6MM67B.js → chunk-QVLJFJBU.js} +6 -6
- package/dist/{chunk-2XLKMZH5.js → chunk-RFKZSSLB.js} +2 -2
- package/dist/{chunk-VTAGUWXH.js → chunk-TWJYL5YF.js} +2 -2
- package/dist/{chunk-FPA3AVCP.js → chunk-TZREEZ4C.js} +4 -4
- package/dist/{chunk-XF3JR72U.js → chunk-U4QIGSP5.js} +3 -3
- package/dist/{chunk-Y3I7SN5W.js → chunk-UMK6DH75.js} +3 -3
- package/dist/{chunk-3VGTVZHL.js → chunk-UWM2ZPGS.js} +3 -3
- package/dist/{chunk-B2MKB7NB.js → chunk-WYR3MZHU.js} +2 -2
- package/dist/{chunk-VBVFE33M.js → chunk-XL44IXBO.js} +5 -5
- package/dist/{chunk-VQGTYGZH.js → chunk-YP5DXGGC.js} +2 -2
- package/dist/{chunk-3SIGXGAE.js → chunk-YSEYPMQ3.js} +39 -4
- package/dist/chunk-YSEYPMQ3.js.map +1 -0
- package/dist/connected-evidence.js +13 -13
- package/dist/dataset-workspaces.js +13 -13
- package/dist/experiment-evaluation-schedules.js +17 -17
- package/dist/experiment-improvements.js +7 -7
- package/dist/experiments.js +16 -16
- package/dist/index.js +23 -23
- package/dist/model-projects.js +1 -1
- package/dist/model-starter-attempts.js +2 -2
- package/dist/model-starter-catalog.js +9 -9
- package/dist/model-starters.js +9 -9
- package/dist/model-taskset-runs.js +3 -3
- package/dist/post-training.js +6 -6
- package/dist/taskset-drafts.js +12 -12
- package/dist/taskset-packages.js +14 -14
- package/dist/training-bundle.js +10 -10
- package/dist/training.js +7 -7
- package/dist/types/packages/sdk/src/post-training.d.ts.map +1 -1
- package/dist/types/packages/sdk/src/protocol.d.ts +3 -0
- package/dist/types/packages/sdk/src/protocol.d.ts.map +1 -1
- package/examples/training/continual.ts +81 -0
- package/examples/training/manual.ts +58 -0
- package/fixtures/python-foundation/canonical-identities.json +94 -0
- package/fixtures/python-foundation/operation-matrix.json +1640 -0
- package/fixtures/python-foundation/schemas.json +35780 -0
- package/fixtures/python-foundation/wire-normalization.json +101 -0
- package/package.json +3 -2
- package/dist/chunk-3SIGXGAE.js.map +0 -1
- package/dist/chunk-LIMTJR3A.js.map +0 -1
- package/dist/chunk-Z4XGSEKC.js.map +0 -1
- /package/dist/{chunk-ZGZLN4LH.js.map → chunk-BWFG46HX.js.map} +0 -0
- /package/dist/{chunk-5T76GARR.js.map → chunk-CJDEVI3T.js.map} +0 -0
- /package/dist/{chunk-RDL6QIQO.js.map → chunk-CZXN63A4.js.map} +0 -0
- /package/dist/{chunk-QDYHSJT5.js.map → chunk-EEZ5YHJQ.js.map} +0 -0
- /package/dist/{chunk-HRZLFJXX.js.map → chunk-EWRWGFKD.js.map} +0 -0
- /package/dist/{chunk-SMHZT6RM.js.map → chunk-GGG6H4MK.js.map} +0 -0
- /package/dist/{chunk-HRJKDHHG.js.map → chunk-GZSQIOAH.js.map} +0 -0
- /package/dist/{chunk-ETFWUMEJ.js.map → chunk-HYCHLMP7.js.map} +0 -0
- /package/dist/{chunk-ONGOAEY6.js.map → chunk-IOZCYSJ6.js.map} +0 -0
- /package/dist/{chunk-SER76PQ7.js.map → chunk-LUFOAMN5.js.map} +0 -0
- /package/dist/{chunk-S2IASCGW.js.map → chunk-MGFI4226.js.map} +0 -0
- /package/dist/{chunk-SQBYHWZU.js.map → chunk-QHCY4MBG.js.map} +0 -0
- /package/dist/{chunk-KD6MM67B.js.map → chunk-QVLJFJBU.js.map} +0 -0
- /package/dist/{chunk-2XLKMZH5.js.map → chunk-RFKZSSLB.js.map} +0 -0
- /package/dist/{chunk-VTAGUWXH.js.map → chunk-TWJYL5YF.js.map} +0 -0
- /package/dist/{chunk-FPA3AVCP.js.map → chunk-TZREEZ4C.js.map} +0 -0
- /package/dist/{chunk-XF3JR72U.js.map → chunk-U4QIGSP5.js.map} +0 -0
- /package/dist/{chunk-Y3I7SN5W.js.map → chunk-UMK6DH75.js.map} +0 -0
- /package/dist/{chunk-3VGTVZHL.js.map → chunk-UWM2ZPGS.js.map} +0 -0
- /package/dist/{chunk-B2MKB7NB.js.map → chunk-WYR3MZHU.js.map} +0 -0
- /package/dist/{chunk-VBVFE33M.js.map → chunk-XL44IXBO.js.map} +0 -0
- /package/dist/{chunk-VQGTYGZH.js.map → chunk-YP5DXGGC.js.map} +0 -0
package/dist/training-bundle.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
prepareImportedTasksetPackage,
|
|
3
3
|
projectLearningBatchGraders
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-EEZ5YHJQ.js";
|
|
5
5
|
import {
|
|
6
6
|
projectPortableTaskRecord,
|
|
7
7
|
resolvePortableTasksetRewardExecution
|
|
@@ -10,13 +10,13 @@ import {
|
|
|
10
10
|
TasksetDraftOutputContractSchema,
|
|
11
11
|
TasksetSchema,
|
|
12
12
|
computeTasksetHash
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-IOZCYSJ6.js";
|
|
14
14
|
import {
|
|
15
15
|
LearningBatchDatasetSourceRefSchema,
|
|
16
16
|
MAX_TASKSET_PACKAGE_BYTES,
|
|
17
17
|
decodeTasksetPackageFile,
|
|
18
18
|
validateTasksetPackage
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-RFKZSSLB.js";
|
|
20
20
|
import "./chunk-TK3DXH7A.js";
|
|
21
21
|
import {
|
|
22
22
|
TRAINING_EVALUATION_SOURCE_PATH,
|
|
@@ -30,11 +30,11 @@ import {
|
|
|
30
30
|
trainingEvaluationSourceRef,
|
|
31
31
|
trainingInputArtifactUploadHash,
|
|
32
32
|
trainingJobSubmissionHash
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-EYMZQML2.js";
|
|
34
34
|
import {
|
|
35
35
|
TrainingHandoffOriginSchema
|
|
36
|
-
} from "./chunk-
|
|
37
|
-
import "./chunk-
|
|
36
|
+
} from "./chunk-MRUDFIB6.js";
|
|
37
|
+
import "./chunk-UWM2ZPGS.js";
|
|
38
38
|
import {
|
|
39
39
|
HarnessSourceSelectionSchema,
|
|
40
40
|
createAgentSnapshot,
|
|
@@ -43,12 +43,12 @@ import {
|
|
|
43
43
|
validateHarnessSourcePackage
|
|
44
44
|
} from "./chunk-Q4TKI2MV.js";
|
|
45
45
|
import "./chunk-H3367ISL.js";
|
|
46
|
-
import "./chunk-
|
|
47
|
-
import "./chunk-
|
|
48
|
-
import "./chunk-
|
|
46
|
+
import "./chunk-WYR3MZHU.js";
|
|
47
|
+
import "./chunk-EWRWGFKD.js";
|
|
48
|
+
import "./chunk-CJDEVI3T.js";
|
|
49
49
|
import {
|
|
50
50
|
TrainingGpuSelectionSchema
|
|
51
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-YSEYPMQ3.js";
|
|
52
52
|
import "./chunk-CL3IOOVL.js";
|
|
53
53
|
import {
|
|
54
54
|
ImmutableReleaseRefSchema,
|
package/dist/training.js
CHANGED
|
@@ -70,13 +70,13 @@ import {
|
|
|
70
70
|
trainingExecutionReceiptHash,
|
|
71
71
|
trainingInputArtifactUploadHash,
|
|
72
72
|
trainingJobSubmissionHash
|
|
73
|
-
} from "./chunk-
|
|
74
|
-
import "./chunk-
|
|
75
|
-
import "./chunk-
|
|
73
|
+
} from "./chunk-EYMZQML2.js";
|
|
74
|
+
import "./chunk-MRUDFIB6.js";
|
|
75
|
+
import "./chunk-UWM2ZPGS.js";
|
|
76
76
|
import "./chunk-Q4TKI2MV.js";
|
|
77
|
-
import "./chunk-
|
|
78
|
-
import "./chunk-
|
|
79
|
-
import "./chunk-
|
|
77
|
+
import "./chunk-WYR3MZHU.js";
|
|
78
|
+
import "./chunk-EWRWGFKD.js";
|
|
79
|
+
import "./chunk-CJDEVI3T.js";
|
|
80
80
|
import {
|
|
81
81
|
OPENPOND_TRAINING_MEDIA_TYPE,
|
|
82
82
|
OPENPOND_TRAINING_PROTOCOL_MAJOR,
|
|
@@ -92,7 +92,7 @@ import {
|
|
|
92
92
|
canonicalJsonByteLength,
|
|
93
93
|
canonicalSha256,
|
|
94
94
|
parseBoundedJson
|
|
95
|
-
} from "./chunk-
|
|
95
|
+
} from "./chunk-YSEYPMQ3.js";
|
|
96
96
|
import "./chunk-CL3IOOVL.js";
|
|
97
97
|
import "./chunk-H3JZ3P5T.js";
|
|
98
98
|
import "./chunk-YLJ4XMA6.js";
|
|
@@ -1 +1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"}
|
|
@@ -23,4 +23,7 @@ export declare function canonicalJsonByteLength(value: unknown): number;
|
|
|
23
23
|
export declare function canonicalSha256(value: unknown): Promise<string>;
|
|
24
24
|
export declare function assertCanonicalPayloadSize(value: unknown, maximumBytes: number, label: string): void;
|
|
25
25
|
export declare function parseBoundedJson(text: string, maximumBytes: number, label: string): unknown;
|
|
26
|
+
/** Bound the wire body while consuming it, before allocating the complete JSON
|
|
27
|
+
* string. Reader cleanup must never replace the original transport/JSON error. */
|
|
28
|
+
export declare function readBoundedJsonResponse(response: Response, maximumBytes: number, label: string): Promise<unknown>;
|
|
26
29
|
//# sourceMappingURL=protocol.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../../../../../src/protocol.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,kBAAkB,GAC1B,IAAI,GACJ,OAAO,GACP,MAAM,GACN,MAAM,GACN,kBAAkB,EAAE,GACpB;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,kBAAkB,CAAA;CAAE,CAAC;AAE1C,eAAO,MAAM,gCAAgC,EAAG,CAAU,CAAC;AAC3D,eAAO,MAAM,4BAA4B,EACvC,kDAA2D,CAAC;AAC9D,eAAO,MAAM,iCAAiC,EAC5C,uDAAgE,CAAC;AAEnE,eAAO,MAAM,iCAAiC,UAAY,CAAC;AAC3D,eAAO,MAAM,iCAAiC,WAAa,CAAC;AAC5D,eAAO,MAAM,+BAA+B,UAAY,CAAC;AACzD,eAAO,MAAM,4BAA4B,SAAU,CAAC;AACpD,eAAO,MAAM,oCAAoC,UAAY,CAAC;AAE9D,qBAAa,qBAAsB,SAAQ,KAAK;IAC9C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB,YAAY,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAIxC;CACF;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CA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AAG,MAAM,CAE9D;AAED,wBAAsB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAMrE;AAED,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,OAAO,EACd,YAAY,EAAE,MAAM,EACpB,KAAK,EAAE,MAAM,GACZ,IAAI,CAQN;AAED,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,MAAM,EACZ,YAAY,EAAE,MAAM,EACpB,KAAK,EAAE,MAAM,GACZ,OAAO,CAgBT;AAED;kFACkF;AAClF,wBAAsB,uBAAuB,CAC3C,QAAQ,EAAE,QAAQ,EAClB,YAAY,EAAE,MAAM,EACpB,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,OAAO,CAAC,CA2BlB"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { readFile, writeFile } from "node:fs/promises";
|
|
2
|
+
import { LearningCommandSchema, LearningIterationSchema, LearningRevisionRefSchema, OpenPondLearningClient } from "openpond-sdk/learning";
|
|
3
|
+
import { createTrainingClient } from "openpond-sdk/training";
|
|
4
|
+
|
|
5
|
+
// Each invocation performs one explicit transition or one finite read snapshot.
|
|
6
|
+
const [action, inputPath, outputPath] = process.argv.slice(2);
|
|
7
|
+
if (!["inspect", "command", "reserve", "reconcile", "status", "results", "cancel", "retry"].includes(action ?? "") || !inputPath || !outputPath) throw new Error("Usage: continual.ts <inspect|command|reserve|reconcile|status|results|cancel|retry> <input.json> <new-response.json>");
|
|
8
|
+
const { OPENPOND_API_URL: baseUrl, OPENPOND_API_KEY: apiKey, OPENPOND_TEAM_ID: scope } = process.env;
|
|
9
|
+
if (!baseUrl || !apiKey || !scope) throw new Error("Set OPENPOND_API_URL, OPENPOND_API_KEY and OPENPOND_TEAM_ID.");
|
|
10
|
+
const bytes = await readFile(inputPath);
|
|
11
|
+
if (bytes.byteLength > 16_777_216) throw new Error("Learning input exceeds the protocol limit.");
|
|
12
|
+
const input: unknown = JSON.parse(bytes.toString("utf8"));
|
|
13
|
+
const client = new OpenPondLearningClient({ baseUrl, apiKey, scope });
|
|
14
|
+
const signal = AbortSignal.timeout(120_000);
|
|
15
|
+
const options = { signal };
|
|
16
|
+
const training = createTrainingClient({ baseUrl, headers: { Authorization: `Bearer ${apiKey}`, "X-OpenPond-Team-Id": scope }, fetch: (url, init) => fetch(url, { ...init, signal: init?.signal ? AbortSignal.any([signal, init.signal]) : signal, redirect: "error" }) });
|
|
17
|
+
let result: unknown;
|
|
18
|
+
if (action === "inspect") result = await client.inspectPolicy(LearningRevisionRefSchema.parse(input), options);
|
|
19
|
+
else if (action === "reconcile") {
|
|
20
|
+
const command = LearningCommandSchema.parse(input);
|
|
21
|
+
if (command.action !== "reserve_iteration" || command.trigger.kind !== "manual") throw new Error("Reconcile the original manual reservation command.");
|
|
22
|
+
const triggerIdentity = command.trigger.identity;
|
|
23
|
+
const inspection = await client.inspectPolicy(command.policy, options);
|
|
24
|
+
if (!inspection.chain) throw new Error("No chain observed; do not create another reservation automatically.");
|
|
25
|
+
let afterId: string | undefined;
|
|
26
|
+
let resultFound = false;
|
|
27
|
+
const seen = new Set<string>();
|
|
28
|
+
for (let pageIndex = 0; pageIndex < 10; pageIndex++) {
|
|
29
|
+
const page = await client.list("reservation", { parentId: inspection.chain.id, limit: 100, ...(afterId ? { afterId } : {}) }, options);
|
|
30
|
+
const reservation = page.items.find((item) => item.policy.id === command.policy.id && item.policy.revision === command.policy.revision && item.policy.contentHash === command.policy.contentHash && item.trigger.kind === "manual" && item.trigger.identity === triggerIdentity);
|
|
31
|
+
if (reservation) {
|
|
32
|
+
const iteration = await client.get("iteration", reservation.iterationId, undefined, options);
|
|
33
|
+
result = { reservation, iteration }; resultFound = true; break;
|
|
34
|
+
}
|
|
35
|
+
if (!page.nextCursor) break;
|
|
36
|
+
if (seen.has(page.nextCursor)) throw new Error("Repeated reservation cursor.");
|
|
37
|
+
seen.add(page.nextCursor); afterId = page.nextCursor;
|
|
38
|
+
}
|
|
39
|
+
if (!resultFound) throw new Error("Reservation not observed within finite scan; preserve original command and reconcile with operator before any replay.");
|
|
40
|
+
} else if (action === "command" || action === "reserve") {
|
|
41
|
+
const command = LearningCommandSchema.parse(input);
|
|
42
|
+
if ((action === "reserve") !== (command.action === "reserve_iteration")) throw new Error("Use explicit reserve for reserve_iteration; command is only for reviewed resource/evidence transitions.");
|
|
43
|
+
if (command.action === "reserve_iteration" && command.trigger.kind !== "manual") throw new Error("This example declares manual-trigger continual iterations only.");
|
|
44
|
+
// Reservation may be dispatched automatically by the host and incur compute.
|
|
45
|
+
// The original policy/trigger/operationId is the lost-reply reconciliation key.
|
|
46
|
+
const operation = await client.command(command, options);
|
|
47
|
+
const iteration = operation.resources.find((resource) => resource.schemaVersion === "openpond.learningIteration.v1");
|
|
48
|
+
result = { operation, ...(iteration ? { iteration } : {}) };
|
|
49
|
+
} else {
|
|
50
|
+
if (!input || typeof input !== "object" || !("iteration" in input)) throw new Error("Use a retained response containing iteration; never invent a replacement reservation.");
|
|
51
|
+
const retained = LearningIterationSchema.parse(input.iteration);
|
|
52
|
+
let iteration = await client.get("iteration", retained.id, undefined, options);
|
|
53
|
+
if (iteration.id !== retained.id || (iteration.policy.id !== retained.policy.id || iteration.policy.revision !== retained.policy.revision || iteration.policy.contentHash !== retained.policy.contentHash) || iteration.dispatchId !== retained.dispatchId) throw new Error("Iteration binding changed.");
|
|
54
|
+
if (action === "cancel" || action === "retry") {
|
|
55
|
+
if (!("operationId" in input) || typeof input.operationId !== "string") throw new Error("Add a new stable control operationId to the retained response before dispatch.");
|
|
56
|
+
if (action === "retry") {
|
|
57
|
+
const dispatch = await client.get("dispatch", iteration.dispatchId, undefined, options);
|
|
58
|
+
if (dispatch.iterationId !== iteration.id || dispatch.state !== "blocked") throw new Error("Only the same blocked dispatch can be retried.");
|
|
59
|
+
}
|
|
60
|
+
const command = LearningCommandSchema.parse({ action: action === "cancel" ? "cancel_iteration" : "retry_iteration_dispatch", operationId: input.operationId, iterationId: iteration.id, expectedRevision: iteration.revision });
|
|
61
|
+
const operation = await client.command(command, options);
|
|
62
|
+
result = { operation, iteration: operation.resources.find((resource) => resource.schemaVersion === "openpond.learningIteration.v1") ?? iteration };
|
|
63
|
+
} else {
|
|
64
|
+
// Empty list is legitimate before the worker creates this dispatch.
|
|
65
|
+
const page = await client.list("dispatch", { parentId: iteration.id, limit: 2 }, options);
|
|
66
|
+
if (page.nextCursor || page.items.length > 1 || page.items.some((item) => item.id !== iteration.dispatchId)) throw new Error("Ambiguous dispatch identity.");
|
|
67
|
+
const dispatch = page.items[0] ?? null;
|
|
68
|
+
// Separate HTTP reads can straddle the worker's atomic commit. Refresh once.
|
|
69
|
+
iteration = await client.get("iteration", retained.id, undefined, options);
|
|
70
|
+
if (iteration.policy.id !== retained.policy.id || iteration.policy.revision !== retained.policy.revision || iteration.policy.contentHash !== retained.policy.contentHash || iteration.dispatchId !== retained.dispatchId) throw new Error("Iteration binding changed.");
|
|
71
|
+
if (dispatch && (dispatch.iterationId !== iteration.id || dispatch.policy.id !== iteration.policy.id || dispatch.policy.revision !== iteration.policy.revision || dispatch.policy.contentHash !== iteration.policy.contentHash || dispatch.execution?.id !== iteration.trainingJob?.id || dispatch.execution?.contentHash !== iteration.trainingJob?.contentHash)) throw new Error("Snapshot changed; read status again without mutation.");
|
|
72
|
+
if (!dispatch && iteration.trainingJob) throw new Error("Snapshot changed; read status again.");
|
|
73
|
+
const job = iteration.trainingJob ? await training.getJob(iteration.trainingJob.id) : null;
|
|
74
|
+
if (job && (job.id !== iteration.trainingJob?.id || job.submissionHash !== iteration.trainingJob?.contentHash)) throw new Error("Training execution content identity mismatch.");
|
|
75
|
+
if (action === "results" && (!dispatch || dispatch.state !== "settled" || !dispatch.terminalReceipt)) throw new Error("No settled authoritative execution/cleanup receipt yet; retain status and inspect again.");
|
|
76
|
+
if (action === "results" && !job && (iteration.status !== "cancelled" || dispatch?.execution)) throw new Error("Terminal job not observed.");
|
|
77
|
+
result = { iteration, dispatch, job, ...(action === "results" && job ? { outputs: await training.outputs(job.id) } : {}) };
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
await writeFile(outputPath, JSON.stringify(result, null, 2) + "\n", { flag: "wx", mode: 0o600 });
|
|
81
|
+
console.log("Saved one retained transition/snapshot. Timeout does not cancel remote work; reconcile the same iteration before any explicit retry.");
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { readFile, writeFile } from "node:fs/promises";
|
|
2
|
+
import { createTrainingClient, TrainingPreparationRequestSchema, TrainingPreparationReceiptSchema } from "openpond-sdk/training";
|
|
3
|
+
|
|
4
|
+
// The reviewed request points to existing immutable batch/configuration releases.
|
|
5
|
+
// No training occurs unless the caller explicitly selects `start`.
|
|
6
|
+
const [action, inputPath, outputPath] = process.argv.slice(2);
|
|
7
|
+
if (!["prepare", "start", "status", "results", "cancel"].includes(action ?? "") || !inputPath || !outputPath) {
|
|
8
|
+
throw new Error("Usage: manual.ts <prepare|start|status|results|cancel> <request-or-receipt.json> <new-receipt.json>");
|
|
9
|
+
}
|
|
10
|
+
const baseUrl = process.env.OPENPOND_API_URL;
|
|
11
|
+
const apiKey = process.env.OPENPOND_API_KEY;
|
|
12
|
+
const teamId = process.env.OPENPOND_TEAM_ID;
|
|
13
|
+
if (!baseUrl || !apiKey || !teamId) throw new Error("Set OPENPOND_API_URL, OPENPOND_API_KEY and OPENPOND_TEAM_ID.");
|
|
14
|
+
const bytes = await readFile(inputPath);
|
|
15
|
+
if (bytes.byteLength > 1_048_576) throw new Error("Input exceeds the preparation limit.");
|
|
16
|
+
const input: unknown = JSON.parse(bytes.toString("utf8"));
|
|
17
|
+
const signal = AbortSignal.timeout(120_000);
|
|
18
|
+
const training = createTrainingClient({
|
|
19
|
+
baseUrl,
|
|
20
|
+
headers: { Authorization: `Bearer ${apiKey}`, "X-OpenPond-Team-Id": teamId },
|
|
21
|
+
fetch: (url, init) => fetch(url, { ...init, signal: init?.signal ? AbortSignal.any([signal, init.signal]) : signal, redirect: "error" }),
|
|
22
|
+
});
|
|
23
|
+
let result: unknown;
|
|
24
|
+
if (action === "prepare") {
|
|
25
|
+
const request = TrainingPreparationRequestSchema.parse(input);
|
|
26
|
+
if (request.teamId !== teamId) throw new Error("Request belongs to another workspace.");
|
|
27
|
+
const capabilities = await training.capabilities();
|
|
28
|
+
if (!capabilities.methods.includes("grpo")) throw new Error("This host does not advertise GRPO.");
|
|
29
|
+
result = await training.prepareRun(request);
|
|
30
|
+
} else {
|
|
31
|
+
// Reload and verify from the host instead of trusting a stale local revision.
|
|
32
|
+
const retained = TrainingPreparationReceiptSchema.parse(input);
|
|
33
|
+
const receipt = await training.getPreparation(teamId, retained.plan.id);
|
|
34
|
+
if (receipt.plan.contentHash !== retained.plan.contentHash) throw new Error("Preparation identity changed.");
|
|
35
|
+
if (action === "start") {
|
|
36
|
+
if (receipt.state !== "prepared") throw new Error("Reconcile the retained job before starting again.");
|
|
37
|
+
const catalog = await training.gpuCatalog();
|
|
38
|
+
if (Date.parse(catalog.expiresAt) <= Date.now()) throw new Error("GPU catalog expired; refresh before requesting admission.");
|
|
39
|
+
// Current hosts do not implement the SDK estimate endpoint. Retain the
|
|
40
|
+
// current catalog for review; server admission still owns live price,
|
|
41
|
+
// capacity, funding and the original request's immutable maximum spend.
|
|
42
|
+
await writeFile(`${outputPath}.catalog.json`, JSON.stringify(catalog, null, 2) + "\n", { flag: "wx", mode: 0o600 });
|
|
43
|
+
result = await training.startPreparation(receipt.plan.id, { teamId, planHash: receipt.plan.contentHash,
|
|
44
|
+
expectedRevision: receipt.revision });
|
|
45
|
+
} else if (action === "status") {
|
|
46
|
+
result = { preparation: receipt, job: receipt.jobId ? await training.getJob(receipt.jobId) : null };
|
|
47
|
+
} else if (action === "results") {
|
|
48
|
+
if (!receipt.jobId) throw new Error("The preparation has no submitted job.");
|
|
49
|
+
result = await training.outputs(receipt.jobId);
|
|
50
|
+
} else if (receipt.jobId) {
|
|
51
|
+
const job = await training.getJob(receipt.jobId);
|
|
52
|
+
result = await training.cancelJob(job.id, job.version);
|
|
53
|
+
} else {
|
|
54
|
+
result = await training.cancelPreparation(receipt.plan.id, { teamId, planHash: receipt.plan.contentHash, expectedRevision: receipt.revision });
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
await writeFile(outputPath, JSON.stringify(result, null, 2) + "\n", { flag: "wx", mode: 0o600 });
|
|
58
|
+
console.log("Saved the retained response. A request timeout does not cancel remote compute; reconcile the same preparation before any replay.");
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": "openpond.canonicalIdentities.v1",
|
|
3
|
+
"vectors": [
|
|
4
|
+
{
|
|
5
|
+
"value": "😀",
|
|
6
|
+
"canonical": "\"😀\"",
|
|
7
|
+
"sha256": "7a0c50b92434b015545fe93ab723db2d4b2cdd14a441405624a9ce8be29f1d5a"
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"value": "\ud800",
|
|
11
|
+
"canonical": "\"\\ud800\"",
|
|
12
|
+
"sha256": "8c0c59dd0d275aadcd462a5fe12eb352cbdfeaf961eae4f85a4660521df7d2f5"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"value": {
|
|
16
|
+
"__proto__": {
|
|
17
|
+
"retained": true
|
|
18
|
+
},
|
|
19
|
+
"ordinary": 1
|
|
20
|
+
},
|
|
21
|
+
"canonical": "{\"__proto__\":{\"retained\":true},\"ordinary\":1}",
|
|
22
|
+
"sha256": "8d52a329a7fb2167e4d72deefb9d41ed2c78233596ebff7b240d78eab348c1eb"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"value": {
|
|
26
|
+
"2": 2,
|
|
27
|
+
"10": 1,
|
|
28
|
+
"4294967294": 4,
|
|
29
|
+
"01": 3,
|
|
30
|
+
"4294967295": 5
|
|
31
|
+
},
|
|
32
|
+
"canonical": "{\"2\":2,\"10\":1,\"4294967294\":4,\"01\":3,\"4294967295\":5}",
|
|
33
|
+
"sha256": "7c26965db131091a44f39acaf6c3942dd756609639f983920dc6bdb0142cd42c"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"value": "\ud800",
|
|
37
|
+
"canonical": "\"\\ud800\"",
|
|
38
|
+
"sha256": "8c0c59dd0d275aadcd462a5fe12eb352cbdfeaf961eae4f85a4660521df7d2f5"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"value": null,
|
|
42
|
+
"canonical": "null",
|
|
43
|
+
"sha256": "74234e98afe7498fb5daf1f36ac2d78acc339464f950703b8c019892f982b90b"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"value": {
|
|
47
|
+
"omitted": "kept",
|
|
48
|
+
"present": null
|
|
49
|
+
},
|
|
50
|
+
"canonical": "{\"omitted\":\"kept\",\"present\":null}",
|
|
51
|
+
"sha256": "d0da19ce46bbcb4461108e6f2c2f0516e3318cd7fd92bdff2c03ed22eee8ac83"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"value": {
|
|
55
|
+
"unicode": "雪😀é",
|
|
56
|
+
"keys": {
|
|
57
|
+
"😀": 1,
|
|
58
|
+
"": 2
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
"canonical": "{\"keys\":{\"😀\":1,\"\":2},\"unicode\":\"雪😀é\"}",
|
|
62
|
+
"sha256": "3423a9dd306cadadef53d0a5f3ed563011be1c5535aa070c1cf9241b036acdbe"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"value": [
|
|
66
|
+
0,
|
|
67
|
+
0,
|
|
68
|
+
1,
|
|
69
|
+
0.000001,
|
|
70
|
+
1e-7,
|
|
71
|
+
100000000000000000000,
|
|
72
|
+
1e+21,
|
|
73
|
+
9007199254740991,
|
|
74
|
+
1000000000000000100
|
|
75
|
+
],
|
|
76
|
+
"canonical": "[0,0,1,0.000001,1e-7,100000000000000000000,1e+21,9007199254740991,1000000000000000100]",
|
|
77
|
+
"sha256": "273ae0fdf747be4c44e06422fb5b08eed98820708f932cc3cfc74f749a0978af"
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"value": {
|
|
81
|
+
"nested": [
|
|
82
|
+
true,
|
|
83
|
+
false,
|
|
84
|
+
{
|
|
85
|
+
"b": 2,
|
|
86
|
+
"a": 1
|
|
87
|
+
}
|
|
88
|
+
]
|
|
89
|
+
},
|
|
90
|
+
"canonical": "{\"nested\":[true,false,{\"a\":1,\"b\":2}]}",
|
|
91
|
+
"sha256": "421f4604e52b696d8eb084190e28030fe39187d8d5adced1fa8fadef2dd9ded0"
|
|
92
|
+
}
|
|
93
|
+
]
|
|
94
|
+
}
|