@openpond/evals 0.10.10 → 0.11.1

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 (80) hide show
  1. package/CONTRACT.md +13 -0
  2. package/LEARNING.md +20 -0
  3. package/dist/javascript-verifier-contract.js +5 -0
  4. package/dist/javascript-verifier-node.js +3 -1
  5. package/dist/javascript-verifier.js +2 -1
  6. package/dist/learning/contracts.js +2 -0
  7. package/dist/learning/index.js +2 -0
  8. package/dist/learning/iteration-eligibility.js +5 -2
  9. package/dist/learning/iteration-reservation-contracts.js +1 -0
  10. package/dist/learning/iteration-reservation-service.js +11 -2
  11. package/dist/learning/nightly-schedule.js +69 -0
  12. package/dist/learning/reward-authoring.js +2 -1
  13. package/dist/learning/reward-fixture-executor.js +1 -1
  14. package/dist/learning/schedule-contracts.js +5 -1
  15. package/dist/learning/schedule-service.js +9 -5
  16. package/dist/learning/schedule-worker.js +22 -7
  17. package/dist/learning/service.js +10 -1
  18. package/dist/learning/task-queue-inspection.js +48 -0
  19. package/dist/learning/transport.js +1 -0
  20. package/dist/tasksets.js +3 -0
  21. package/dist/types/builtin-benchmarks/harness-refiner.d.ts +1 -0
  22. package/dist/types/builtin-benchmarks/harness-refiner.d.ts.map +1 -1
  23. package/dist/types/conformance.d.ts +2 -0
  24. package/dist/types/conformance.d.ts.map +1 -1
  25. package/dist/types/execution-contracts.d.ts +8 -0
  26. package/dist/types/execution-contracts.d.ts.map +1 -1
  27. package/dist/types/javascript-verifier-contract.d.ts +2 -0
  28. package/dist/types/javascript-verifier-contract.d.ts.map +1 -1
  29. package/dist/types/javascript-verifier-node.d.ts.map +1 -1
  30. package/dist/types/javascript-verifier.d.ts +1 -0
  31. package/dist/types/javascript-verifier.d.ts.map +1 -1
  32. package/dist/types/learning/admission.d.ts +4 -0
  33. package/dist/types/learning/admission.d.ts.map +1 -1
  34. package/dist/types/learning/batch-service.d.ts +1 -0
  35. package/dist/types/learning/batch-service.d.ts.map +1 -1
  36. package/dist/types/learning/contracts.d.ts +16 -0
  37. package/dist/types/learning/contracts.d.ts.map +1 -1
  38. package/dist/types/learning/index.d.ts +2 -0
  39. package/dist/types/learning/index.d.ts.map +1 -1
  40. package/dist/types/learning/iteration-eligibility.d.ts +8 -1
  41. package/dist/types/learning/iteration-eligibility.d.ts.map +1 -1
  42. package/dist/types/learning/iteration-reservation-contracts.d.ts +6 -0
  43. package/dist/types/learning/iteration-reservation-contracts.d.ts.map +1 -1
  44. package/dist/types/learning/iteration-reservation-service.d.ts.map +1 -1
  45. package/dist/types/learning/nightly-schedule.d.ts +13 -0
  46. package/dist/types/learning/nightly-schedule.d.ts.map +1 -0
  47. package/dist/types/learning/operations.d.ts +38 -0
  48. package/dist/types/learning/operations.d.ts.map +1 -1
  49. package/dist/types/learning/repository.d.ts +19 -0
  50. package/dist/types/learning/repository.d.ts.map +1 -1
  51. package/dist/types/learning/reward-authoring.d.ts.map +1 -1
  52. package/dist/types/learning/reward-calibration.d.ts +1 -0
  53. package/dist/types/learning/reward-calibration.d.ts.map +1 -1
  54. package/dist/types/learning/schedule-contracts.d.ts +4 -0
  55. package/dist/types/learning/schedule-contracts.d.ts.map +1 -1
  56. package/dist/types/learning/schedule-service.d.ts +4 -0
  57. package/dist/types/learning/schedule-service.d.ts.map +1 -1
  58. package/dist/types/learning/schedule-worker.d.ts.map +1 -1
  59. package/dist/types/learning/service.d.ts +10 -0
  60. package/dist/types/learning/service.d.ts.map +1 -1
  61. package/dist/types/learning/task-queue-inspection.d.ts +25 -0
  62. package/dist/types/learning/task-queue-inspection.d.ts.map +1 -0
  63. package/dist/types/learning/transport.d.ts +42 -0
  64. package/dist/types/learning/transport.d.ts.map +1 -1
  65. package/dist/types/review-conformance.d.ts +5 -5
  66. package/dist/types/rewards.d.ts +12 -0
  67. package/dist/types/rewards.d.ts.map +1 -1
  68. package/dist/types/tasksets.d.ts +20 -0
  69. package/dist/types/tasksets.d.ts.map +1 -1
  70. package/dist/types/telemetry-bundle.d.ts +2 -2
  71. package/dist/types/telemetry.d.ts +3 -3
  72. package/package.json +1 -1
  73. package/schemas/learning/v1/command-request.schema.json +48 -0
  74. package/schemas/learning/v1/package.schema.json +7 -0
  75. package/schemas/learning/v1/policy.schema.json +24 -0
  76. package/schemas/learning/v1/read-request.schema.json +28 -0
  77. package/schemas/learning/v1/reservation.schema.json +17 -0
  78. package/schemas/learning/v1/reward.schema.json +7 -0
  79. package/schemas/learning/v1/schedule.schema.json +44 -13
  80. package/schemas/learning/v1/task-queue-inspection.schema.json +72 -0
package/CONTRACT.md CHANGED
@@ -32,6 +32,19 @@ runtime processes.
32
32
 
33
33
  ## Compatibility policy
34
34
 
35
+ Custom verifiers may declare `runtime: "sandbox_process"` when their private
36
+ module needs filesystem or subprocess access. The requirement belongs to the
37
+ immutable Reward implementation and compiled grader, so Model derivation,
38
+ Reward rebinding, reviewed learning batches and training export retain it.
39
+ Omitting `runtime` keeps the original isolated JavaScript behavior and hashes.
40
+
41
+ A runtime declaration grants no execution permission. The host must use a
42
+ quiescent sandbox with network egress blocked, keep the verifier private from
43
+ the policy, enforce its deadline, stop its process group and complete cleanup
44
+ before accepting a result. Isolated JavaScript executors reject a declared
45
+ process runtime; callers must pass the grader's `runtime` to those executors.
46
+ Declaring the runtime does not qualify a source package or its dependencies.
47
+
35
48
  - Schema versions are literal and independent from package semver.
36
49
  - `openpond.harnessRunManifest.v1` and `openpond.taskAttempt.v1` remain accepted
37
50
  host persistence formats during migration, but are not emitted as new public
package/LEARNING.md CHANGED
@@ -339,3 +339,23 @@ Taskset output paths, media types, schema references and size bounds. Evidence
339
339
  conversion copies them into every task before grading or sealing a batch, so a
340
340
  changed output contract requires a new definition and new matching evidence and
341
341
  review receipts. Definitions without this field retain their existing hashes.
342
+
343
+ ## Nightly and task-count triggers
344
+
345
+ Policies may use `trigger: { kind: "nightly", localTime: "20:00", timeZone:
346
+ "America/New_York" }`. The durable timer computes the next local date in that
347
+ IANA timezone. DST repeats use the earlier occurrence once; missing local times
348
+ advance by the DST gap. Calendar edits recompute the due time; unchanged calendars
349
+ retain it. Existing `schedule` policies retain elapsed-interval semantics.
350
+
351
+ `trigger: { kind: "approved_count" }` uses `admission.minimumApprovedExamples`
352
+ as its threshold and checks once per minute. Below-threshold checks advance the
353
+ timer without creating iterations or fire records. Once ready, the same atomic
354
+ reservation, consumption, budget, cooldown and execution-owner checks apply.
355
+ Both new automatic triggers require reviewer authorization to enable.
356
+
357
+ `service.inspectTaskQueue(context, modelProjectId?)` is a read-only snapshot of
358
+ unique eligible, unconsumed training attempts across current policies. It
359
+ deduplicates shared sources and excludes held-out family reservations. Paused
360
+ policies retain pending tasks. An invalid policy yields a null count and explicit
361
+ issues rather than a misleading zero. Source credentials cannot read the queue.
@@ -5,3 +5,8 @@ export const JavaScriptVerifierResultSchema = z.object({
5
5
  feedback: z.string().max(20_000),
6
6
  evidenceRefs: z.array(z.string().max(240)).max(1_000).default([]),
7
7
  }).strict();
8
+ /** A process checker must never silently execute under different semantics. */
9
+ export function assertIsolatedVerifierRuntime(runtime) {
10
+ if (runtime === "sandbox_process")
11
+ throw new Error("verifier_sandbox_process_required");
12
+ }
@@ -1,11 +1,13 @@
1
- import { JavaScriptVerifierResultSchema } from "./javascript-verifier-contract.js";
1
+ import { assertIsolatedVerifierRuntime, JavaScriptVerifierResultSchema } from "./javascript-verifier-contract.js";
2
2
  import { executeJavaScriptIsolateInWorker } from "./javascript-isolate-node.js";
3
3
  import { executeJavaScriptIsolateInProcess } from "./javascript-isolate-process.js";
4
4
  /** Resolves/rejects only after the execution owner has stopped the worker. */
5
5
  export async function executeJavaScriptVerifierInWorker(input) {
6
+ assertIsolatedVerifierRuntime(input.runtime);
6
7
  return JavaScriptVerifierResultSchema.parse(await executeJavaScriptIsolateInWorker({ ...input, exportName: input.exportName ?? "verify", maxResultBytes: 65_536, errorPrefix: "verifier" }));
7
8
  }
8
9
  /** Uses a Node child process and waits for exit on success, failure, or cancellation. */
9
10
  export async function executeJavaScriptVerifierInProcess(input) {
11
+ assertIsolatedVerifierRuntime(input.runtime);
10
12
  return JavaScriptVerifierResultSchema.parse(await executeJavaScriptIsolateInProcess({ ...input, exportName: input.exportName ?? "verify", maxResultBytes: 65_536, errorPrefix: "verifier" }));
11
13
  }
@@ -1,9 +1,10 @@
1
1
  import { executeJavaScriptIsolate } from "./javascript-isolate.js";
2
- import { JavaScriptVerifierResultSchema } from "./javascript-verifier-contract.js";
2
+ import { assertIsolatedVerifierRuntime, JavaScriptVerifierResultSchema } from "./javascript-verifier-contract.js";
3
3
  export { JavaScriptVerifierResultSchema } from "./javascript-verifier-contract.js";
4
4
  /** A fresh interpreter with no filesystem, network, timers or module loader.
5
5
  * Hosts should use the worker entrypoint for cancellation and responsiveness. */
6
6
  export async function executeJavaScriptVerifier(input) {
7
+ assertIsolatedVerifierRuntime(input.runtime);
7
8
  const result = await executeJavaScriptIsolate({ ...input, exportName: input.exportName ?? "verify", maxResultBytes: 65_536, errorPrefix: "verifier" });
8
9
  return JavaScriptVerifierResultSchema.parse(result);
9
10
  }
@@ -5,6 +5,7 @@ import { RewardBindingSchema, RewardCompositionSchema, RewardReleaseRefSchema, R
5
5
  import { TaskRecordSchema, TaskSplitSchema, TasksetReleaseContentSchema } from "../tasksets.js";
6
6
  import { assertBoundedTaskJson, validateTaskSchema } from "../task-schema.js";
7
7
  import { JudgeCallReservationSchema } from "./judge-budget.js";
8
+ import { NightlyScheduleSchema } from "./nightly-schedule.js";
8
9
  export const LearningJsonObjectSchema = z.record(z.string(), z.json());
9
10
  export const LearningRevisionRefSchema = RewardReleaseRefSchema;
10
11
  export const LearningJsonPointerSchema = z.string().max(2_000).refine((value) => value === "" || (value.startsWith("/") && !/~(?![01])/u.test(value)), "Use an RFC 6901 JSON pointer.");
@@ -222,6 +223,7 @@ export const LearningPolicyContentSchema = z.object({
222
223
  z.object({ kind: z.literal("manual") }).strict(),
223
224
  z.object({ kind: z.literal("approved_count") }).strict(),
224
225
  z.object({ kind: z.literal("schedule"), intervalSeconds: z.number().int().min(60).max(31_536_000) }).strict(),
226
+ NightlyScheduleSchema.extend({ kind: z.literal("nightly") }).strict(),
225
227
  z.object({ kind: z.literal("upstream_accepted"), modelProjectId: ReleaseIdSchema }).strict(),
226
228
  ]),
227
229
  trainingParent: ImmutableReleaseRefSchema,
@@ -29,4 +29,6 @@ export { resolveLearningTrainingParent } from "./iteration-training-parent.js";
29
29
  export * from "./schedule-contracts.js";
30
30
  export * from "./schedule-service.js";
31
31
  export * from "./schedule-worker.js";
32
+ export * from "./nightly-schedule.js";
32
33
  export * from "./policy-inspection.js";
34
+ export * from "./task-queue-inspection.js";
@@ -9,7 +9,7 @@ export function learningChainId(modelProjectId) {
9
9
  export function learningConsumptionId(chainId, evidence) {
10
10
  return `consumption-${contentHash([chainId, evidence.id, evidence.revision])}`;
11
11
  }
12
- export async function inspectIterationEligibility(transaction, policy) {
12
+ export async function inspectIterationEligibility(transaction, policy, options = {}) {
13
13
  // These are the methods supported by the approved-batch materializer.
14
14
  const purpose = policy.training.method === "sft" ? "supervised_training" : "reward_training";
15
15
  if (!["sft", "grpo", "ppo"].includes(policy.training.method)) {
@@ -24,6 +24,7 @@ export async function inspectIterationEligibility(transaction, policy) {
24
24
  throw new LearningDomainError("learning_policy_binding_mismatch", 422);
25
25
  const counts = { eligible: 0, awaitingReview: 0, excluded: 0, consumed: 0 };
26
26
  const selected = [];
27
+ const eligibleEvidence = [];
27
28
  const chainId = learningChainId(policy.modelProjectId);
28
29
  const seen = new Set();
29
30
  let backlog = 0;
@@ -66,11 +67,13 @@ export async function inspectIterationEligibility(transaction, policy) {
66
67
  continue;
67
68
  }
68
69
  counts.eligible += 1;
70
+ if (options.collectEligible)
71
+ eligibleEvidence.push(learningRef(evidence));
69
72
  if (selected.length < policy.limits.maxBatchExamples)
70
73
  selected.push({ evidence, decision });
71
74
  }
72
75
  afterId = page.nextCursor ?? undefined;
73
76
  } while (afterId);
74
77
  }
75
- return { counts, selected, purpose };
78
+ return { counts, selected, purpose, eligibleEvidence };
76
79
  }
@@ -4,6 +4,7 @@ import { LearningAcceptedParentSchema, LearningRevisionRefSchema } from "./contr
4
4
  export const LearningIterationTriggerSchema = z.discriminatedUnion("kind", [
5
5
  z.object({ kind: z.literal("manual"), identity: ReleaseIdSchema }).strict(),
6
6
  z.object({ kind: z.literal("schedule"), scheduledAt: ReleaseTimestampSchema }).strict(),
7
+ z.object({ kind: z.literal("approved_count"), checkedAt: ReleaseTimestampSchema }).strict(),
7
8
  ]);
8
9
  /** Stable across policy edits: a Model owns one learning chain in its scope. */
9
10
  export const LearningChainSchema = z.object({
@@ -11,7 +11,8 @@ import { latestAcceptedLearningParent, resolveLearningTrainingParent } from "./i
11
11
  export async function reserveLearningIteration(transaction, input, actorId, now) {
12
12
  const policy = await requireLearningRelease(transaction, "policy", input.policy);
13
13
  const chainId = learningChainId(policy.modelProjectId);
14
- const trigger = input.trigger.kind === "schedule" ? { ...input.trigger, scheduledAt: new Date(input.trigger.scheduledAt).toISOString() } : input.trigger;
14
+ const trigger = input.trigger.kind === "schedule" ? { ...input.trigger, scheduledAt: new Date(input.trigger.scheduledAt).toISOString() }
15
+ : input.trigger.kind === "approved_count" ? { ...input.trigger, checkedAt: new Date(input.trigger.checkedAt).toISOString() } : input.trigger;
15
16
  const triggerIdentity = contentHash([input.policy.id, trigger]);
16
17
  const id = `iteration-${contentHash([chainId, triggerIdentity])}`;
17
18
  const requestHash = contentHash({ policy: input.policy, trigger });
@@ -30,11 +31,17 @@ export async function reserveLearningIteration(transaction, input, actorId, now)
30
31
  if (policy.automation.accept || policy.automation.serve)
31
32
  throw new LearningDomainError("learning_automatic_acceptance_not_available", 422);
32
33
  if (input.trigger.kind === "schedule") {
33
- if (policy.trigger.kind !== "schedule" || !policy.automation.train)
34
+ if (!["schedule", "nightly"].includes(policy.trigger.kind) || !policy.automation.train)
34
35
  throw new LearningDomainError("learning_schedule_not_enabled", 409);
35
36
  if (Date.parse(input.trigger.scheduledAt) > Date.parse(now))
36
37
  throw new LearningDomainError("learning_schedule_not_due", 409);
37
38
  }
39
+ if (input.trigger.kind === "approved_count") {
40
+ if (policy.trigger.kind !== "approved_count" || !policy.automation.train)
41
+ throw new LearningDomainError("learning_count_trigger_not_enabled", 409);
42
+ if (Date.parse(input.trigger.checkedAt) > Date.parse(now))
43
+ throw new LearningDomainError("learning_count_trigger_not_due", 409);
44
+ }
38
45
  const chain = await transaction.get("chain", chainId);
39
46
  if (chain?.activeIterationId)
40
47
  throw new LearningDomainError("learning_iteration_active", 409, chain.activeIterationId);
@@ -43,6 +50,8 @@ export async function reserveLearningIteration(transaction, input, actorId, now)
43
50
  }
44
51
  const eligibility = await inspectIterationEligibility(transaction, policy);
45
52
  const ready = eligibility.counts.eligible >= policy.admission.minimumApprovedExamples;
53
+ if (input.trigger.kind === "approved_count" && !ready)
54
+ throw new LearningDomainError("learning_count_threshold_not_met", 409);
46
55
  const status = ready ? "ready" : eligibility.counts.awaitingReview > 0 ? "waiting_for_review" : "waiting_for_data";
47
56
  const pointers = [];
48
57
  const acceptedParent = await latestAcceptedLearningParent(transaction, chainId, true);
@@ -0,0 +1,69 @@
1
+ import { z } from "zod";
2
+ export const NightlyScheduleSchema = z.object({
3
+ localTime: z.string().regex(/^(?:[01]\d|2[0-3]):[0-5]\d$/),
4
+ timeZone: z.string().min(1).max(200).refine(value => {
5
+ try {
6
+ new Intl.DateTimeFormat("en", { timeZone: value });
7
+ return true;
8
+ }
9
+ catch {
10
+ return false;
11
+ }
12
+ }, "Choose a valid IANA timezone."),
13
+ }).strict();
14
+ const DAY = 86_400_000;
15
+ function formatter(calendar) {
16
+ return new Intl.DateTimeFormat("en-US", { timeZone: calendar.timeZone, year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", hourCycle: "h23" });
17
+ }
18
+ function wallTime(format, instant) {
19
+ const parts = Object.fromEntries(format.formatToParts(instant).filter(part => part.type !== "literal").map(part => [part.type, Number(part.value)]));
20
+ return Date.UTC(parts.year, parts.month - 1, parts.day, parts.hour, parts.minute);
21
+ }
22
+ function localDay(format, instant) { return Math.floor(wallTime(format, instant) / DAY) * DAY; }
23
+ /** One occurrence per local date. A repeated time uses its first occurrence;
24
+ * a missing time advances by the DST gap. Entirely skipped dates have no fire. */
25
+ function occurrence(format, calendar, date) {
26
+ const [hour, minute] = calendar.localTime.split(":").map(Number);
27
+ const requested = date + hour * 3_600_000 + minute * 60_000;
28
+ const offsets = new Set();
29
+ for (let hours = -36; hours <= 36; hours += 6) {
30
+ const probe = requested + hours * 3_600_000;
31
+ offsets.add(wallTime(format, probe) - probe);
32
+ }
33
+ const candidates = [...offsets].map(offset => requested - offset).sort((a, b) => a - b);
34
+ const exact = candidates.find(instant => wallTime(format, instant) === requested);
35
+ if (exact !== undefined)
36
+ return exact;
37
+ const shifted = candidates.filter(instant => localDay(format, instant) === date && wallTime(format, instant) > requested);
38
+ return shifted.sort((a, b) => wallTime(format, a) - wallTime(format, b))[0] ?? null;
39
+ }
40
+ export function nextNightlyOccurrence(calendar, after) {
41
+ const parsed = NightlyScheduleSchema.parse(calendar);
42
+ const time = Date.parse(after);
43
+ if (!Number.isFinite(time))
44
+ throw new Error("A nightly schedule requires a valid timestamp.");
45
+ const format = formatter(parsed);
46
+ const date = localDay(format, time);
47
+ for (let days = 0; days < 4; days++) {
48
+ const candidate = occurrence(format, parsed, date + days * DAY);
49
+ if (candidate !== null && candidate > time)
50
+ return new Date(candidate).toISOString();
51
+ }
52
+ throw new Error("Unable to resolve the next nightly occurrence.");
53
+ }
54
+ export function coalesceNightlyOccurrences(calendar, due, now) {
55
+ const parsed = NightlyScheduleSchema.parse(calendar);
56
+ const format = formatter(parsed);
57
+ const time = Date.parse(now);
58
+ const date = localDay(format, time);
59
+ for (let days = 0; days < 4; days++) {
60
+ const candidate = occurrence(format, parsed, date - days * DAY);
61
+ if (candidate !== null && candidate <= time)
62
+ return {
63
+ coalescedThroughAt: new Date(candidate).toISOString(),
64
+ coalescedCount: Math.max(0, Math.round((localDay(format, candidate) - localDay(format, Date.parse(due))) / DAY)),
65
+ nextRunAt: nextNightlyOccurrence(parsed, now),
66
+ };
67
+ }
68
+ throw new Error("Unable to resolve the due nightly occurrence.");
69
+ }
@@ -24,7 +24,8 @@ export function compileRewardAuthoring(input) {
24
24
  let calibrationCheckRef;
25
25
  if (fields.kind === "custom_verifier") {
26
26
  asset = createLearningTextAsset({ text: fields.code, path: "verifier.mjs", mediaType: "application/javascript", visibility: "verifier" });
27
- implementation = { kind: fields.kind, verifierRef: asset.asset, exportName: fields.exportName, timeoutMs: authoringNumber(fields.timeout, "Time limit"), networkPolicy: "none" };
27
+ implementation = { kind: fields.kind, verifierRef: asset.asset, exportName: fields.exportName, timeoutMs: authoringNumber(fields.timeout, "Time limit"), networkPolicy: "none",
28
+ ...(base?.implementation.kind === "custom_verifier" && base.implementation.runtime !== undefined ? { runtime: base.implementation.runtime } : {}) };
28
29
  }
29
30
  else if (fields.kind === "model_judge" || fields.kind === "human") {
30
31
  if (!fields.rubric.trim())
@@ -14,7 +14,7 @@ export function createIsolatedRewardFixtureExecutor(options) {
14
14
  throw new Error("reward_check_source_missing");
15
15
  const source = verifyLearningTextAsset(asset, grader.verifierRef);
16
16
  const result = await options.executeJavaScript({
17
- source, exportName: grader.exportName, signal: input.signal,
17
+ source, exportName: grader.exportName, runtime: grader.runtime, signal: input.signal,
18
18
  timeoutMs: Math.min(grader.timeoutMs, input.run.timeoutMs),
19
19
  value: { task, attempt: evidence, input: task.input, output: evidence.output, expectedOutput: task.expectedOutput,
20
20
  evaluatorContext: input.fixture.evaluatorContext, infrastructureError: evidence.infrastructureError ?? null },
@@ -1,6 +1,7 @@
1
1
  import { z } from "zod";
2
2
  import { ReleaseHashSchema, ReleaseIdSchema, ReleaseTimestampSchema } from "@openpond/harness";
3
3
  import { LearningRevisionRefSchema } from "./contracts.js";
4
+ import { NightlyScheduleSchema } from "./nightly-schedule.js";
4
5
  /** The durable timer is operational state; every fire retains its own policy. */
5
6
  export const LearningScheduleSchema = z.object({
6
7
  schemaVersion: z.literal("openpond.learningSchedule.v1"),
@@ -11,6 +12,7 @@ export const LearningScheduleSchema = z.object({
11
12
  executionOwner: z.enum(["local", "hosted"]),
12
13
  state: z.enum(["scheduled", "disabled", "blocked"]),
13
14
  intervalSeconds: z.number().int().min(60).max(31_536_000).nullable(),
15
+ calendar: NightlyScheduleSchema.nullable().default(null),
14
16
  nextRunAt: ReleaseTimestampSchema.nullable(),
15
17
  lastFire: LearningRevisionRefSchema.nullable(),
16
18
  consecutiveFailures: z.number().int().nonnegative(),
@@ -19,10 +21,12 @@ export const LearningScheduleSchema = z.object({
19
21
  createdAt: ReleaseTimestampSchema,
20
22
  updatedAt: ReleaseTimestampSchema,
21
23
  }).strict().superRefine((value, context) => {
22
- if (value.state !== "disabled" && (!value.intervalSeconds || !value.nextRunAt))
24
+ if (value.state !== "disabled" && ((!value.intervalSeconds && !value.calendar) || !value.nextRunAt))
23
25
  context.addIssue({ code: "custom", path: ["nextRunAt"], message: "An active timer must retain its cadence and due time." });
24
26
  if (value.state === "disabled" && value.nextRunAt)
25
27
  context.addIssue({ code: "custom", path: ["nextRunAt"], message: "A disabled timer cannot have a pending occurrence." });
28
+ if (value.intervalSeconds && value.calendar)
29
+ context.addIssue({ code: "custom", path: ["calendar"], message: "A timer uses either an interval or a nightly calendar." });
26
30
  });
27
31
  /** Immutable occurrence evidence survives timer edits and coalesced downtime. */
28
32
  export const LearningScheduleFireSchema = z.object({
@@ -2,7 +2,8 @@ import { contentHash } from "@openpond/harness";
2
2
  import { assertLearningContentHash, learningRef, sameLearningRef } from "./contracts.js";
3
3
  import { LearningScheduleSchema } from "./schedule-contracts.js";
4
4
  import { LearningDomainError } from "./errors.js";
5
- import { requireLearningResource } from "./repository.js";
5
+ import { requireLearningRelease, requireLearningResource } from "./repository.js";
6
+ import { nextNightlyOccurrence } from "./nightly-schedule.js";
6
7
  export function learningScheduleId(policyId) { return `schedule-${contentHash(policyId)}`; }
7
8
  /** Called atomically with policy publication. No external timer or Work is made. */
8
9
  export async function synchronizeLearningSchedule(tx, policy, now) {
@@ -14,15 +15,18 @@ export async function synchronizeLearningSchedule(tx, policy, now) {
14
15
  const previous = await tx.get("schedule", id);
15
16
  if (previous && sameLearningRef(previous.policy, learningRef(policy)))
16
17
  return previous;
17
- const intervalSeconds = policy.trigger.kind === "schedule" ? policy.trigger.intervalSeconds : null;
18
- const enabled = policy.enabled && policy.automation.train && intervalSeconds !== null;
18
+ const intervalSeconds = policy.trigger.kind === "schedule" ? policy.trigger.intervalSeconds : policy.trigger.kind === "approved_count" ? 60 : null;
19
+ const calendar = policy.trigger.kind === "nightly" ? { localTime: policy.trigger.localTime, timeZone: policy.trigger.timeZone } : null;
20
+ const enabled = policy.enabled && policy.automation.train && (intervalSeconds !== null || calendar !== null);
21
+ const previousPolicy = previous ? await requireLearningRelease(tx, "policy", previous.policy) : null;
19
22
  const preserveDue = previous?.nextRunAt && previous.intervalSeconds === intervalSeconds
23
+ && JSON.stringify(previous.calendar) === JSON.stringify(calendar) && previousPolicy?.trigger.kind === policy.trigger.kind
20
24
  && previous.executionOwner === policy.executionOwner;
21
25
  const schedule = LearningScheduleSchema.parse({
22
26
  schemaVersion: "openpond.learningSchedule.v1", id, revision: (previous?.revision ?? 0) + 1,
23
27
  policy: learningRef(policy), modelProjectId: policy.modelProjectId, executionOwner: policy.executionOwner,
24
- state: enabled ? "scheduled" : "disabled", intervalSeconds,
25
- nextRunAt: enabled ? preserveDue ? previous.nextRunAt : new Date(Date.parse(now) + intervalSeconds * 1_000).toISOString() : null,
28
+ state: enabled ? "scheduled" : "disabled", intervalSeconds, calendar,
29
+ nextRunAt: enabled ? preserveDue ? previous.nextRunAt : calendar ? nextNightlyOccurrence(calendar, now) : new Date(Date.parse(now) + intervalSeconds * 1_000).toISOString() : null,
26
30
  lastFire: previous?.lastFire ?? null, consecutiveFailures: 0, nextAttemptAt: null, lastError: null,
27
31
  createdAt: previous?.createdAt ?? now, updatedAt: now,
28
32
  });
@@ -4,6 +4,8 @@ import { LearningDomainError } from "./errors.js";
4
4
  import { reserveLearningIteration } from "./iteration-reservation-service.js";
5
5
  import { LearningScheduleFireSchema, LearningScheduleSchema } from "./schedule-contracts.js";
6
6
  import { requireLearningRelease, requireLearningResource } from "./repository.js";
7
+ import { inspectIterationEligibility } from "./iteration-eligibility.js";
8
+ import { coalesceNightlyOccurrences } from "./nightly-schedule.js";
7
9
  const skipReasons = new Map([
8
10
  ["learning_iteration_active", "active_iteration"], ["learning_iteration_cooldown", "cooldown"],
9
11
  ["learning_daily_budget_exhausted", "daily_budget"],
@@ -28,20 +30,33 @@ export function createLearningScheduleWorker(repository, options) {
28
30
  attempt = { schedule, maxRetries: 0 };
29
31
  const policy = await requireLearningRelease(tx, "policy", schedule.policy);
30
32
  attempt.maxRetries = policy.limits.maxRetries;
31
- if (policy.executionOwner !== schedule.executionOwner || policy.trigger.kind !== "schedule"
32
- || policy.trigger.intervalSeconds !== schedule.intervalSeconds)
33
+ const matches = policy.trigger.kind === "nightly" ? schedule.intervalSeconds === null && schedule.calendar?.localTime === policy.trigger.localTime && schedule.calendar.timeZone === policy.trigger.timeZone
34
+ : policy.trigger.kind === "schedule" ? schedule.calendar === null && policy.trigger.intervalSeconds === schedule.intervalSeconds
35
+ : policy.trigger.kind === "approved_count" && schedule.calendar === null && schedule.intervalSeconds === 60;
36
+ if (policy.executionOwner !== schedule.executionOwner || !matches)
33
37
  throw new LearningDomainError("learning_schedule_policy_mismatch", 409);
34
38
  const scheduledAt = schedule.nextRunAt;
35
- const interval = schedule.intervalSeconds * 1_000;
39
+ const interval = (schedule.intervalSeconds ?? 86_400) * 1_000;
36
40
  const due = Date.parse(scheduledAt);
37
41
  const coalescedCount = Math.floor((time - due) / interval);
42
+ const occurrence = schedule.calendar ? coalesceNightlyOccurrences(schedule.calendar, scheduledAt, timestamp) : {
43
+ coalescedCount, coalescedThroughAt: new Date(due + coalescedCount * interval).toISOString(), nextRunAt: new Date(due + (coalescedCount + 1) * interval).toISOString(),
44
+ };
45
+ // Below-threshold count checks advance their timer without filling the
46
+ // Model's history with empty iterations or consuming any evidence.
47
+ if (policy.trigger.kind === "approved_count" && (await inspectIterationEligibility(tx, policy)).counts.eligible < policy.admission.minimumApprovedExamples) {
48
+ const updated = LearningScheduleSchema.parse({ ...schedule, revision: schedule.revision + 1, nextRunAt: occurrence.nextRunAt,
49
+ consecutiveFailures: 0, nextAttemptAt: null, lastError: null, updatedAt: timestamp });
50
+ await tx.put("schedule", updated, schedule.revision, { parentId: schedule.modelProjectId, status: updated.state });
51
+ return updated;
52
+ }
38
53
  const id = `schedule-fire-${contentHash([schedule.id, scheduledAt])}`;
39
54
  let outcome = "skipped";
40
55
  let reason = null;
41
56
  let iteration = null;
42
57
  try {
43
58
  const pointers = await reserveLearningIteration(tx, { action: "reserve_iteration", operationId: id,
44
- policy: schedule.policy, trigger: { kind: "schedule", scheduledAt } }, actorId, timestamp);
59
+ policy: schedule.policy, trigger: policy.trigger.kind === "approved_count" ? { kind: "approved_count", checkedAt: scheduledAt } : { kind: "schedule", scheduledAt } }, actorId, timestamp);
45
60
  const pointer = pointers.find(value => value.kind === "iteration");
46
61
  if (!pointer)
47
62
  throw new LearningDomainError("learning_schedule_reservation_missing", 409);
@@ -59,12 +74,12 @@ export function createLearningScheduleWorker(repository, options) {
59
74
  }
60
75
  const fire = LearningScheduleFireSchema.parse(sealLearningContent({
61
76
  schemaVersion: "openpond.learningScheduleFire.v1", id, revision: 1, scheduleId,
62
- policy: schedule.policy, scheduledAt, coalescedThroughAt: new Date(due + coalescedCount * interval).toISOString(),
63
- coalescedCount, outcome, reason, iteration, createdAt: timestamp,
77
+ policy: schedule.policy, scheduledAt, coalescedThroughAt: occurrence.coalescedThroughAt,
78
+ coalescedCount: occurrence.coalescedCount, outcome, reason, iteration, createdAt: timestamp,
64
79
  }));
65
80
  await tx.put("schedule_fire", fire, 0, { parentId: schedule.id, status: outcome });
66
81
  const updated = LearningScheduleSchema.parse({ ...schedule, revision: schedule.revision + 1,
67
- nextRunAt: new Date(due + (coalescedCount + 1) * interval).toISOString(), lastFire: learningRef(fire),
82
+ nextRunAt: occurrence.nextRunAt, lastFire: learningRef(fire),
68
83
  consecutiveFailures: 0, nextAttemptAt: null, lastError: null, updatedAt: timestamp });
69
84
  await tx.put("schedule", updated, schedule.revision, { parentId: schedule.modelProjectId, status: updated.state });
70
85
  return updated;
@@ -9,6 +9,8 @@ import { assertRewardCalibration, qualifyRewardCheck } from "./reward-calibratio
9
9
  import { queueRewardCheck, cancelRewardCheck } from "./reward-check-service.js";
10
10
  import { LearningDomainError } from "./errors.js";
11
11
  import { contentHash } from "@openpond/harness";
12
+ import { inspectLearningTaskQueue } from "./task-queue-inspection.js";
13
+ import { LearningReadRequestSchema } from "./transport.js";
12
14
  import { createRewardBinding, createRewardRelease } from "../rewards.js";
13
15
  import { assertBoundedTaskJson, validateTaskValue } from "../task-schema.js";
14
16
  import { assertAdmissionDecision, assertGradeIdentity, inspectTaskEvidence } from "./admission.js";
@@ -360,6 +362,13 @@ export function createLearningService(repository, options = {}) {
360
362
  }
361
363
  return {
362
364
  command,
365
+ async inspectTaskQueue(context, modelProjectId = null) {
366
+ authorizeRead(context);
367
+ const input = LearningReadRequestSchema.parse({ action: "inspect_task_queue", scope: context.scope, modelProjectId });
368
+ if (input.action !== "inspect_task_queue")
369
+ throw new LearningDomainError("learning_request_invalid", 400);
370
+ return repository.transaction(context.scope, transaction => inspectLearningTaskQueue(transaction, input.modelProjectId, now()));
371
+ },
363
372
  async inspectPolicy(context, reference) {
364
373
  authorizeRead(context);
365
374
  const ref = LearningRevisionRefSchema.parse(reference);
@@ -407,7 +416,7 @@ function authorize(context, input) {
407
416
  throw new LearningDomainError("learning_scope_required", 400);
408
417
  const publications = input.action === "publish" ? [input] : input.action === "publish_resources" ? input.resources : [];
409
418
  if (context.actor.role !== "reviewer" && publications.some(value => value.kind === "policy" && value.content.enabled
410
- && value.content.automation.train && value.content.trigger.kind === "schedule"))
419
+ && value.content.automation.train && value.content.trigger.kind !== "manual"))
411
420
  throw new LearningDomainError("learning_review_not_authorized", 403);
412
421
  if (context.actor.role === "source") {
413
422
  const sourceId = input.action === "submit_example" ? input.example.sourceId : input.action === "submit_feedback" ? input.feedback.sourceId : null;
@@ -0,0 +1,48 @@
1
+ import { ReleaseIdSchema, ReleaseTimestampSchema } from "@openpond/harness";
2
+ import { z } from "zod";
3
+ import { LearningDomainError } from "./errors.js";
4
+ import { inspectIterationEligibility } from "./iteration-eligibility.js";
5
+ import { taskFamilyReservations } from "./admission.js";
6
+ import { requireLearningRelease } from "./repository.js";
7
+ export const LearningTaskQueueInspectionSchema = z.object({
8
+ modelProjectId: ReleaseIdSchema.nullable(),
9
+ inspectedAt: ReleaseTimestampSchema,
10
+ pendingTrainingCount: z.number().int().nonnegative().nullable(),
11
+ issues: z.array(z.object({ policyId: ReleaseIdSchema, code: z.string(), message: z.string() }).strict()),
12
+ }).strict();
13
+ /** Count exact eligible, unconsumed attempts once across selected policies.
14
+ * Paused policies still have pending work; review-only and held-out tasks do not. */
15
+ export async function inspectLearningTaskQueue(transaction, modelProjectId, now) {
16
+ const eligible = new Set();
17
+ const issues = [];
18
+ let afterId;
19
+ do {
20
+ const page = await transaction.list("policy", { limit: 100, ...(modelProjectId ? { parentId: modelProjectId } : {}), ...(afterId ? { afterId } : {}) });
21
+ for (const policy of page.items) {
22
+ try {
23
+ const inspection = await inspectIterationEligibility(transaction, policy, { collectEligible: true });
24
+ const definition = await requireLearningRelease(transaction, "definition", policy.taskDefinition);
25
+ for (const reference of inspection.eligibleEvidence) {
26
+ const evidence = await requireLearningRelease(transaction, "evidence", reference);
27
+ let heldOut = false;
28
+ for (const family of taskFamilyReservations(evidence, definition)) {
29
+ const split = await transaction.familySplit(family.namespace, family.kind, family.key);
30
+ if (split !== null && split !== "train") {
31
+ heldOut = true;
32
+ break;
33
+ }
34
+ }
35
+ if (!heldOut)
36
+ eligible.add(JSON.stringify([reference.id, reference.revision, reference.contentHash]));
37
+ }
38
+ }
39
+ catch (error) {
40
+ if (!(error instanceof LearningDomainError))
41
+ throw error;
42
+ issues.push({ policyId: policy.id, code: error.code, message: error.message });
43
+ }
44
+ }
45
+ afterId = page.nextCursor ?? undefined;
46
+ } while (afterId);
47
+ return LearningTaskQueueInspectionSchema.parse({ modelProjectId, inspectedAt: now, pendingTrainingCount: issues.length ? null : eligible.size, issues });
48
+ }
@@ -17,6 +17,7 @@ export function assertLearningRequestJson(raw) {
17
17
  /** Scope selection is never authorization; each host resolves its authenticated owner. */
18
18
  export const LearningCommandRequestSchema = z.object({ scope: ReleaseIdSchema, command: LearningCommandSchema }).strict();
19
19
  export const LearningReadRequestSchema = z.discriminatedUnion("action", [
20
+ z.object({ action: z.literal("inspect_task_queue"), scope: ReleaseIdSchema, modelProjectId: ReleaseIdSchema.nullable() }).strict(),
20
21
  z.object({ action: z.literal("inspect_policy"), scope: ReleaseIdSchema, policy: LearningRevisionRefSchema }).strict(),
21
22
  z.object({ action: z.literal("inspect_evidence"), scope: ReleaseIdSchema, evidence: LearningRevisionRefSchema }).strict(),
22
23
  z.object({ action: z.literal("get"), scope: ReleaseIdSchema, kind: LearningResourceKindSchema, id: ReleaseIdSchema, revision: z.number().int().positive().optional() }).strict(),
package/dist/tasksets.js CHANGED
@@ -44,8 +44,11 @@ export const ModelJudgeGraderSpecSchema = GraderBaseSchema.extend({
44
44
  model: z.object({ providerId: ReleaseIdSchema, modelId: ReleaseIdSchema, revision: z.string().trim().min(1).max(500).nullable() }).strict().optional(),
45
45
  temperature: z.number().min(0).max(2).optional(),
46
46
  }).strict();
47
+ export const CustomVerifierRuntimeSchema = z.enum(["isolated_javascript", "sandbox_process"]);
47
48
  export const CustomVerifierGraderSpecSchema = GraderBaseSchema.extend({
48
49
  kind: z.literal("custom_verifier"),
50
+ // Omission retains the original isolated-JavaScript contract and hash.
51
+ runtime: CustomVerifierRuntimeSchema.optional(),
49
52
  verifierRef: ImmutableAssetRefSchema,
50
53
  exportName: z.string().trim().min(1).max(240).optional(),
51
54
  timeoutMs: z.number().int().positive().max(300_000),
@@ -114,6 +114,7 @@ export declare const harnessRefinerBenchmarkRelease: {
114
114
  };
115
115
  timeoutMs: number;
116
116
  networkPolicy: "none";
117
+ runtime?: "isolated_javascript" | "sandbox_process" | undefined;
117
118
  exportName?: string | undefined;
118
119
  } | {
119
120
  id: string;
@@ -1 +1 @@
1
- {"version":3,"file":"harness-refiner.d.ts","sourceRoot":"","sources":["../../../../../src/builtin-benchmarks/harness-refiner.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqqD1C,CAAC;AAEF,eAAO,MAAM,6BAA6B,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CASzE,CAAC"}
1
+ {"version":3,"file":"harness-refiner.d.ts","sourceRoot":"","sources":["../../../../../src/builtin-benchmarks/harness-refiner.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqqD1C,CAAC;AAEF,eAAO,MAAM,6BAA6B,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CASzE,CAAC"}
@@ -224,6 +224,7 @@ export declare const genericToolConformance: {
224
224
  };
225
225
  timeoutMs: number;
226
226
  networkPolicy: "none";
227
+ runtime?: "isolated_javascript" | "sandbox_process" | undefined;
227
228
  exportName?: string | undefined;
228
229
  } | {
229
230
  id: string;
@@ -534,6 +535,7 @@ export declare const marketingPortfolioConformance: {
534
535
  };
535
536
  timeoutMs: number;
536
537
  networkPolicy: "none";
538
+ runtime?: "isolated_javascript" | "sandbox_process" | undefined;
537
539
  exportName?: string | undefined;
538
540
  } | {
539
541
  id: string;
@@ -1 +1 @@
1
- {"version":3,"file":"conformance.d.ts","sourceRoot":"","sources":["../../../../src/conformance.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAEjC,CAAC;AAEH,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAGxC,CAAC"}
1
+ {"version":3,"file":"conformance.d.ts","sourceRoot":"","sources":["../../../../src/conformance.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAEjC,CAAC;AAEH,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAGxC,CAAC"}
@@ -399,6 +399,10 @@ export declare const VerifierSetReleaseContentSchema: z.ZodObject<{
399
399
  rewardEligible: z.ZodDefault<z.ZodBoolean>;
400
400
  privileged: z.ZodDefault<z.ZodBoolean>;
401
401
  kind: z.ZodLiteral<"custom_verifier">;
402
+ runtime: z.ZodOptional<z.ZodEnum<{
403
+ isolated_javascript: "isolated_javascript";
404
+ sandbox_process: "sandbox_process";
405
+ }>>;
402
406
  verifierRef: z.ZodObject<{
403
407
  id: z.ZodString;
404
408
  path: z.ZodString;
@@ -509,6 +513,10 @@ export declare const VerifierSetReleaseSchema: z.ZodObject<{
509
513
  rewardEligible: z.ZodDefault<z.ZodBoolean>;
510
514
  privileged: z.ZodDefault<z.ZodBoolean>;
511
515
  kind: z.ZodLiteral<"custom_verifier">;
516
+ runtime: z.ZodOptional<z.ZodEnum<{
517
+ isolated_javascript: "isolated_javascript";
518
+ sandbox_process: "sandbox_process";
519
+ }>>;
512
520
  verifierRef: z.ZodObject<{
513
521
  id: z.ZodString;
514
522
  path: z.ZodString;
@@ -1 +1 @@
1
- {"version":3,"file":"execution-contracts.d.ts","sourceRoot":"","sources":["../../../../src/execution-contracts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAcxB,eAAO,MAAM,mBAAmB;;;EAAmC,CAAC;AACpE,eAAO,MAAM,kBAAkB;;;;;;;;;EAS7B,CAAC;AACH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;EAYpC,CAAC;AAEH,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAcjC,CAAC;AACZ,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAE1B,CAAC;AAEZ,eAAO,MAAM,8BAA8B;;;;;EAKzC,CAAC;AACH,eAAO,MAAM,8BAA8B;;;;EAIzC,CAAC;AACH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAa7B,CAAC;AACZ,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAO/B,CAAC;AACZ,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAExB,CAAC;AAEZ,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAClF,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
@@ -6,4 +6,6 @@ export declare const JavaScriptVerifierResultSchema: z.ZodObject<{
6
6
  evidenceRefs: z.ZodDefault<z.ZodArray<z.ZodString>>;
7
7
  }, z.core.$strict>;
8
8
  export type JavaScriptVerifierResult = z.infer<typeof JavaScriptVerifierResultSchema>;
9
+ /** A process checker must never silently execute under different semantics. */
10
+ export declare function assertIsolatedVerifierRuntime(runtime?: "isolated_javascript" | "sandbox_process"): void;
9
11
  //# sourceMappingURL=javascript-verifier-contract.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"javascript-verifier-contract.d.ts","sourceRoot":"","sources":["../../../../src/javascript-verifier-contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,8BAA8B;;;;;kBAKhC,CAAC;AACZ,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC"}
1
+ {"version":3,"file":"javascript-verifier-contract.d.ts","sourceRoot":"","sources":["../../../../src/javascript-verifier-contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,8BAA8B;;;;;kBAKhC,CAAC;AACZ,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AACtF,+EAA+E;AAC/E,wBAAgB,6BAA6B,CAAC,OAAO,CAAC,EAAE,qBAAqB,GAAG,iBAAiB,GAAG,IAAI,CAEvG"}
@@ -1 +1 @@
1
- {"version":3,"file":"javascript-verifier-node.d.ts","sourceRoot":"","sources":["../../../../src/javascript-verifier-node.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAC1E,OAAO,EAAkC,KAAK,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAIlH,8EAA8E;AAC9E,wBAAsB,iCAAiC,CAAC,KAAK,EAAE,UAAU,CAAC,OAAO,yBAAyB,CAAC,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAEjJ;AAED,yFAAyF;AACzF,wBAAsB,kCAAkC,CAAC,KAAK,EAAE,UAAU,CAAC,OAAO,yBAAyB,CAAC,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAElJ"}
1
+ {"version":3,"file":"javascript-verifier-node.d.ts","sourceRoot":"","sources":["../../../../src/javascript-verifier-node.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAC1E,OAAO,EAAiE,KAAK,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAIjJ,8EAA8E;AAC9E,wBAAsB,iCAAiC,CAAC,KAAK,EAAE,UAAU,CAAC,OAAO,yBAAyB,CAAC,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAGjJ;AAED,yFAAyF;AACzF,wBAAsB,kCAAkC,CAAC,KAAK,EAAE,UAAU,CAAC,OAAO,yBAAyB,CAAC,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAGlJ"}