openpond-sdk 0.5.12 → 0.5.13

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/LEARNING.md CHANGED
@@ -43,6 +43,21 @@ All client requests support an optional `AbortSignal`. Aborting a request does
43
43
  not cancel remote compute; use `cancel_grade` and read the authoritative terminal
44
44
  job state. Page through list responses with `nextCursor` as `afterId`.
45
45
 
46
+ ## Configure hosted learning
47
+
48
+ Use `hostedLearningPolicyReferences(project)` from `openpond-sdk/learning` with
49
+ the Model summary returned by the authenticated Model Projects API. It derives
50
+ the exact recipe, training-parent and retained-evaluation references used by the
51
+ hosted policy snapshot. The recipe identifier binds the Model's reviewed etag,
52
+ including its Harness and data settings; the content hash binds the recipe.
53
+ Missing recipe, starting model or retained evaluation is a configuration error.
54
+
55
+ Keep those references when changing a policy's pause state, schedule or limits.
56
+ Recompute them only when explicitly applying a newly reviewed Model configuration.
57
+ The server verifies the references when publishing the policy and retains the
58
+ immutable configuration for later preparation. Use `client.inspectPolicy(ref)`
59
+ for shared readiness counts and blockers without reserving or launching work.
60
+
46
61
  ## Connect an application
47
62
 
48
63
  In the task format, open **Connect an application** and create a source credential.
package/dist/learning.js CHANGED
@@ -14,11 +14,32 @@ import {
14
14
  createSourceCredentialRequest
15
15
  } from "./chunk-5M3PPP7D.js";
16
16
  import "./chunk-5FBPNWT4.js";
17
- import "./chunk-QUOW6URQ.js";
17
+ import {
18
+ contentHash
19
+ } from "./chunk-QUOW6URQ.js";
18
20
 
19
21
  // src/learning.ts
20
22
  export * from "@openpond/evals/learning";
21
23
  export * from "@openpond/evals/rewards";
24
+
25
+ // src/model-learning-policy.ts
26
+ import { LearningDomainError } from "@openpond/evals/learning";
27
+ function hostedLearningPolicyReferences(project) {
28
+ const setup = project.trainingSetup;
29
+ const base = setup.baseModel ?? project.defaultBaseModel;
30
+ if (!setup.recipe || !base || !setup.evaluationTasksetRef) {
31
+ throw new LearningDomainError(
32
+ "learning_model_configuration_incomplete",
33
+ 422,
34
+ "Select a training recipe, starting model and retained evaluation before enabling hosted learning."
35
+ );
36
+ }
37
+ return {
38
+ recipe: { id: `model-recipe-${project.etag}`, contentHash: contentHash(setup.recipe) },
39
+ trainingParent: { id: base.modelId, contentHash: contentHash(base) },
40
+ retentionEvaluation: { id: setup.evaluationTasksetRef.id, contentHash: setup.evaluationTasksetRef.contentHash }
41
+ };
42
+ }
22
43
  export {
23
44
  LearningBatchPublicationResultSchema,
24
45
  LearningBatchPublicationSchema,
@@ -32,6 +53,7 @@ export {
32
53
  OpenPondLearningClient,
33
54
  OpenPondLearningError,
34
55
  assertLearningCredentialExpiry,
35
- createSourceCredentialRequest
56
+ createSourceCredentialRequest,
57
+ hostedLearningPolicyReferences
36
58
  };
37
59
  //# sourceMappingURL=learning.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../src/learning.ts"],
4
- "sourcesContent": ["export * from \"@openpond/evals/learning\";\nexport * from \"@openpond/evals/rewards\";\nexport * from \"./learning-credentials.js\";\nexport * from \"./learning-client.js\";\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;AAAA,cAAc;AACd,cAAc;",
3
+ "sources": ["../src/learning.ts", "../src/model-learning-policy.ts"],
4
+ "sourcesContent": ["export * from \"@openpond/evals/learning\";\nexport * from \"@openpond/evals/rewards\";\nexport * from \"./learning-credentials.js\";\nexport * from \"./learning-client.js\";\nexport * from \"./model-learning-policy.js\";\n", "import { LearningDomainError } from \"@openpond/evals/learning\";\nimport { contentHash } from \"@openpond/harness\";\n\nimport type { HostedModelProjectSummary } from \"./model-projects.js\";\n\n/** Bind a reviewed hosted Model configuration before asynchronous preparation.\n * Keep the established recipe identity: its id binds the whole Model revision,\n * including Harness and retention selections, while its hash binds the recipe.\n * Callers must obtain the summary from the authenticated Model API. */\nexport function hostedLearningPolicyReferences(project: HostedModelProjectSummary) {\n const setup = project.trainingSetup;\n const base = setup.baseModel ?? project.defaultBaseModel;\n if (!setup.recipe || !base || !setup.evaluationTasksetRef) {\n throw new LearningDomainError(\"learning_model_configuration_incomplete\", 422,\n \"Select a training recipe, starting model and retained evaluation before enabling hosted learning.\");\n }\n return {\n recipe: { id: `model-recipe-${project.etag}`, contentHash: contentHash(setup.recipe) },\n trainingParent: { id: base.modelId, contentHash: contentHash(base) },\n retentionEvaluation: { id: setup.evaluationTasksetRef.id, contentHash: setup.evaluationTasksetRef.contentHash },\n };\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;AAAA,cAAc;AACd,cAAc;;;ACDd,SAAS,2BAA2B;AAS7B,SAAS,+BAA+B,SAAoC;AACjF,QAAM,QAAQ,QAAQ;AACtB,QAAM,OAAO,MAAM,aAAa,QAAQ;AACxC,MAAI,CAAC,MAAM,UAAU,CAAC,QAAQ,CAAC,MAAM,sBAAsB;AACzD,UAAM,IAAI;AAAA,MAAoB;AAAA,MAA2C;AAAA,MACvE;AAAA,IAAmG;AAAA,EACvG;AACA,SAAO;AAAA,IACL,QAAQ,EAAE,IAAI,gBAAgB,QAAQ,IAAI,IAAI,aAAa,YAAY,MAAM,MAAM,EAAE;AAAA,IACrF,gBAAgB,EAAE,IAAI,KAAK,SAAS,aAAa,YAAY,IAAI,EAAE;AAAA,IACnE,qBAAqB,EAAE,IAAI,MAAM,qBAAqB,IAAI,aAAa,MAAM,qBAAqB,YAAY;AAAA,EAChH;AACF;",
6
6
  "names": []
7
7
  }
@@ -2,4 +2,5 @@ export * from "@openpond/evals/learning";
2
2
  export * from "@openpond/evals/rewards";
3
3
  export * from "./learning-credentials.js";
4
4
  export * from "./learning-client.js";
5
+ export * from "./model-learning-policy.js";
5
6
  //# sourceMappingURL=learning.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"learning.d.ts","sourceRoot":"","sources":["../../../../../src/learning.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,sBAAsB,CAAC"}
1
+ {"version":3,"file":"learning.d.ts","sourceRoot":"","sources":["../../../../../src/learning.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,sBAAsB,CAAC;AACrC,cAAc,4BAA4B,CAAC"}
@@ -0,0 +1,20 @@
1
+ import type { HostedModelProjectSummary } from "./model-projects.js";
2
+ /** Bind a reviewed hosted Model configuration before asynchronous preparation.
3
+ * Keep the established recipe identity: its id binds the whole Model revision,
4
+ * including Harness and retention selections, while its hash binds the recipe.
5
+ * Callers must obtain the summary from the authenticated Model API. */
6
+ export declare function hostedLearningPolicyReferences(project: HostedModelProjectSummary): {
7
+ recipe: {
8
+ id: string;
9
+ contentHash: string;
10
+ };
11
+ trainingParent: {
12
+ id: string;
13
+ contentHash: string;
14
+ };
15
+ retentionEvaluation: {
16
+ id: string;
17
+ contentHash: string;
18
+ };
19
+ };
20
+ //# sourceMappingURL=model-learning-policy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"model-learning-policy.d.ts","sourceRoot":"","sources":["../../../../../src/model-learning-policy.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAErE;;;uEAGuE;AACvE,wBAAgB,8BAA8B,CAAC,OAAO,EAAE,yBAAyB;;;;;;;;;;;;;EAYhF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openpond-sdk",
3
- "version": "0.5.12",
3
+ "version": "0.5.13",
4
4
  "description": "Server-side TypeScript SDK for OpenPond sandboxes and agentic work",
5
5
  "license": "MIT",
6
6
  "type": "module",