@openpond/evals 0.12.4 → 0.12.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.
Files changed (32) hide show
  1. package/LEARNING.md +21 -0
  2. package/dist/javascript-isolate-process-entry.js +4 -1
  3. package/dist/javascript-isolate-process-source.js +1 -1
  4. package/dist/javascript-isolate-process.js +36 -2
  5. package/dist/javascript-isolate.js +8 -2
  6. package/dist/javascript-verifier-node.js +1 -0
  7. package/dist/javascript-verifier-worker-source.js +1 -1
  8. package/dist/learning/index.js +1 -0
  9. package/dist/learning/iteration-dispatch-commands.js +1 -1
  10. package/dist/learning/iteration-dispatch-contracts.js +27 -0
  11. package/dist/learning/iteration-dispatch-deferral.js +28 -0
  12. package/dist/learning/iteration-dispatch-worker.js +34 -5
  13. package/dist/types/javascript-isolate-process.d.ts +7 -0
  14. package/dist/types/javascript-isolate-process.d.ts.map +1 -1
  15. package/dist/types/javascript-isolate.d.ts +3 -1
  16. package/dist/types/javascript-isolate.d.ts.map +1 -1
  17. package/dist/types/javascript-verifier-node.d.ts +1 -0
  18. package/dist/types/javascript-verifier-node.d.ts.map +1 -1
  19. package/dist/types/learning/index.d.ts +1 -0
  20. package/dist/types/learning/index.d.ts.map +1 -1
  21. package/dist/types/learning/iteration-dispatch-contracts.d.ts +45 -0
  22. package/dist/types/learning/iteration-dispatch-contracts.d.ts.map +1 -1
  23. package/dist/types/learning/iteration-dispatch-deferral.d.ts +71 -0
  24. package/dist/types/learning/iteration-dispatch-deferral.d.ts.map +1 -0
  25. package/dist/types/learning/iteration-dispatch-worker.d.ts +7 -2
  26. package/dist/types/learning/iteration-dispatch-worker.d.ts.map +1 -1
  27. package/dist/types/learning/repository.d.ts +20 -0
  28. package/dist/types/learning/repository.d.ts.map +1 -1
  29. package/dist/types/learning/transport.d.ts +20 -0
  30. package/dist/types/learning/transport.d.ts.map +1 -1
  31. package/package.json +1 -1
  32. package/schemas/learning/v1/dispatch.schema.json +100 -1
package/LEARNING.md CHANGED
@@ -251,6 +251,27 @@ state is `dispatching`; only a provider observation establishes `training` or
251
251
  `evaluating`. A paused policy stops new submissions while existing executions
252
252
  continue to be observed.
253
253
 
254
+ Executors can implement `admit` to defer an unstarted, persisted submission for
255
+ calendar or capacity reasons. Return `{ status: "deferred", retryAt, reason }`
256
+ with a future timestamp, or `{ status: "ready" }`. This check must not create an
257
+ execution, launch compute or spend. A wait persists its reason and retry time,
258
+ releases the worker lease and retains the same sealed batch and reservation
259
+ without increasing failure retries. Restarted workers respect that timestamp;
260
+ cancellation bypasses it and can settle an unstarted dispatch at zero spend.
261
+ Once submission has started, retries reconcile its existing identity without
262
+ repeating admission. The executor must still verify current authority atomically
263
+ when creating an execution; a prior ready decision is not authorization to spend.
264
+
265
+ If admission closes during transport, `submit` may return a `deferred` result
266
+ with the exact scope, dispatch/hash, lease generation, retry time and immutable
267
+ receipt. The owner must atomically prove no execution or charge was created and
268
+ durably fence every late submission from that attempt before returning it. A
269
+ timeout or a read that finds no Job cannot establish this. The shared worker
270
+ retains the receipt, clears the started marker and releases/increments the
271
+ lease generation without spending a failure retry. Owners sharing the learning
272
+ repository use `deferLearningIterationSubmission` inside their native admission
273
+ transaction; the older worker then observes the committed generation change.
274
+
254
275
  The executor must deduplicate `submit` by `dispatch.id`, verify observation
255
276
  identity and provider receipts, and use `reconcile` to recover an existing Job
256
277
  after a lost reply. An unreachable owner is an error, never proof of absence.
@@ -5,4 +5,7 @@ const input = owner.__openpondIsolateInput;
5
5
  delete owner.__openpondIsolateInput;
6
6
  if (!input)
7
7
  throw new Error("JavaScript process requires its execution owner.");
8
- void executeJavaScriptIsolate(input).then((result) => process.stdout.write(JSON.stringify({ ok: true, result })), (error) => process.stdout.write(JSON.stringify({ ok: false, executionError: error instanceof JavaScriptIsolateExecutionError, error: (error instanceof Error ? error.message : "JavaScript execution failed.").slice(0, 8_192) })));
8
+ void executeJavaScriptIsolate(input, input.errorPrefix === "verifier" ? {
9
+ onExecutionReady: () => { if (!process.send)
10
+ throw new Error("Verifier process requires its startup channel."); process.send({ type: "execution_ready" }); },
11
+ } : undefined).then((result) => process.stdout.write(JSON.stringify({ ok: true, result })), (error) => process.stdout.write(JSON.stringify({ ok: false, executionError: error instanceof JavaScriptIsolateExecutionError, error: (error instanceof Error ? error.message : "JavaScript execution failed.").slice(0, 8_192) })));