@openpond/evals 0.10.3 → 0.10.4
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 +26 -0
- package/dist/learning/index.js +3 -0
- package/dist/learning/repository.js +2 -0
- package/dist/learning/schedule-contracts.js +45 -0
- package/dist/learning/schedule-service.js +31 -0
- package/dist/learning/schedule-worker.js +96 -0
- package/dist/learning/service.js +7 -0
- package/dist/types/learning/index.d.ts +3 -0
- package/dist/types/learning/index.d.ts.map +1 -1
- package/dist/types/learning/repository.d.ts +66 -1
- package/dist/types/learning/repository.d.ts.map +1 -1
- package/dist/types/learning/schedule-contracts.d.ts +69 -0
- package/dist/types/learning/schedule-contracts.d.ts.map +1 -0
- package/dist/types/learning/schedule-service.d.ts +30 -0
- package/dist/types/learning/schedule-service.d.ts.map +1 -0
- package/dist/types/learning/schedule-worker.d.ts +12 -0
- package/dist/types/learning/schedule-worker.d.ts.map +1 -0
- package/dist/types/learning/service.d.ts.map +1 -1
- package/dist/types/learning/transport.d.ts +67 -2
- package/dist/types/learning/transport.d.ts.map +1 -1
- package/package.json +1 -1
- package/schemas/learning/v1/read-request.schema.json +2 -0
- package/schemas/learning/v1/schedule.schema.json +188 -0
- package/schemas/learning/v1/schedule_fire.schema.json +163 -0
package/LEARNING.md
CHANGED
|
@@ -231,3 +231,29 @@ cleanup receipt, retains the decision reference on the iteration, and records
|
|
|
231
231
|
owns it. Duplicate observations are idempotent, older decision revisions cannot
|
|
232
232
|
overwrite newer ones, and contradictory observations at the same revision fail.
|
|
233
233
|
This operation does not change the training parent or activate serving.
|
|
234
|
+
|
|
235
|
+
### Durable learning schedules
|
|
236
|
+
|
|
237
|
+
Policy publication atomically synchronizes a `schedule` resource. Enabling
|
|
238
|
+
scheduled training requires reviewer authority, including batched publication,
|
|
239
|
+
because it authorizes the same reservation as manual Train. The timer preserves
|
|
240
|
+
its pending occurrence through ordinary policy edits. Pause removes its pending
|
|
241
|
+
due time; resume, cadence changes and execution-owner changes start a future
|
|
242
|
+
occurrence. `synchronizeLearningSchedule` can initialize an existing current
|
|
243
|
+
policy, but refuses stale policies and does not reset an unchanged timer.
|
|
244
|
+
|
|
245
|
+
`createLearningScheduleWorker` runs a typed learning reservation in the same
|
|
246
|
+
repository transaction as an immutable `schedule_fire` and timer advance.
|
|
247
|
+
Duplicate replicas and restarts therefore cannot consume a second batch for an
|
|
248
|
+
occurrence. Downtime retains the original due time and coalesces subsequent
|
|
249
|
+
missed occurrences into one fire, recording the covered time and count.
|
|
250
|
+
Insufficient approved evidence records waiting without reserved spend. An active
|
|
251
|
+
chain, cooldown or daily budget limit records an explicit skip. Review approval
|
|
252
|
+
does not move the next due time or independently start training.
|
|
253
|
+
|
|
254
|
+
Other errors roll back reservation mutations and keep the original occurrence
|
|
255
|
+
for bounded retries. Exhausting the policy retry limit blocks the timer with a
|
|
256
|
+
retained diagnostic; a new reviewed policy revision may resume it. Hosts must
|
|
257
|
+
poll due timers for their execution owner and supply an authorized actor. This
|
|
258
|
+
worker does not execute a Work prompt or submit a provider Job; the existing
|
|
259
|
+
iteration dispatch worker owns that next transition.
|
package/dist/learning/index.js
CHANGED
|
@@ -16,3 +16,6 @@ export * from "./iteration-reservation-contracts.js";
|
|
|
16
16
|
export * from "./iteration-dispatch-contracts.js";
|
|
17
17
|
export * from "./iteration-dispatch-worker.js";
|
|
18
18
|
export * from "./iteration-candidate-decision.js";
|
|
19
|
+
export * from "./schedule-contracts.js";
|
|
20
|
+
export * from "./schedule-service.js";
|
|
21
|
+
export * from "./schedule-worker.js";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { LearningChainSchema, LearningConsumptionSchema, LearningIterationReservationSchema } from "./iteration-reservation-contracts.js";
|
|
2
2
|
import { LearningIterationDispatchSchema } from "./iteration-dispatch-contracts.js";
|
|
3
|
+
import { LearningScheduleSchema, LearningScheduleFireSchema } from "./schedule-contracts.js";
|
|
3
4
|
import { z } from "zod";
|
|
4
5
|
import { contentHash } from "@openpond/harness";
|
|
5
6
|
import { assertLearningContentHash, LearningSourceSchema, TaskAdmissionDecisionSchema, TaskBatchSchema, TaskDefinitionSchema, TaskEvidenceSchema, TaskFeedbackSchema, TaskGradeRunSchema, LearningPolicySchema, LearningIterationSchema } from "./contracts.js";
|
|
@@ -18,6 +19,7 @@ export const learningResourceSchemas = {
|
|
|
18
19
|
decision: TaskAdmissionDecisionSchema, batch: TaskBatchSchema, policy: LearningPolicySchema,
|
|
19
20
|
chain: LearningChainSchema, consumption: LearningConsumptionSchema, reservation: LearningIterationReservationSchema,
|
|
20
21
|
dispatch: LearningIterationDispatchSchema,
|
|
22
|
+
schedule: LearningScheduleSchema, schedule_fire: LearningScheduleFireSchema,
|
|
21
23
|
iteration: LearningIterationSchema, grade: TaskGradeRunSchema, package: TasksetReleaseSchema,
|
|
22
24
|
};
|
|
23
25
|
export const LearningResourceKindSchema = z.enum(Object.keys(learningResourceSchemas));
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { ReleaseHashSchema, ReleaseIdSchema, ReleaseTimestampSchema } from "@openpond/harness";
|
|
3
|
+
import { LearningRevisionRefSchema } from "./contracts.js";
|
|
4
|
+
/** The durable timer is operational state; every fire retains its own policy. */
|
|
5
|
+
export const LearningScheduleSchema = z.object({
|
|
6
|
+
schemaVersion: z.literal("openpond.learningSchedule.v1"),
|
|
7
|
+
id: ReleaseIdSchema,
|
|
8
|
+
revision: z.number().int().positive(),
|
|
9
|
+
policy: LearningRevisionRefSchema,
|
|
10
|
+
modelProjectId: ReleaseIdSchema,
|
|
11
|
+
executionOwner: z.enum(["local", "hosted"]),
|
|
12
|
+
state: z.enum(["scheduled", "disabled", "blocked"]),
|
|
13
|
+
intervalSeconds: z.number().int().min(60).max(31_536_000).nullable(),
|
|
14
|
+
nextRunAt: ReleaseTimestampSchema.nullable(),
|
|
15
|
+
lastFire: LearningRevisionRefSchema.nullable(),
|
|
16
|
+
consecutiveFailures: z.number().int().nonnegative(),
|
|
17
|
+
nextAttemptAt: ReleaseTimestampSchema.nullable(),
|
|
18
|
+
lastError: z.string().max(20_000).nullable(),
|
|
19
|
+
createdAt: ReleaseTimestampSchema,
|
|
20
|
+
updatedAt: ReleaseTimestampSchema,
|
|
21
|
+
}).strict().superRefine((value, context) => {
|
|
22
|
+
if (value.state !== "disabled" && (!value.intervalSeconds || !value.nextRunAt))
|
|
23
|
+
context.addIssue({ code: "custom", path: ["nextRunAt"], message: "An active timer must retain its cadence and due time." });
|
|
24
|
+
if (value.state === "disabled" && value.nextRunAt)
|
|
25
|
+
context.addIssue({ code: "custom", path: ["nextRunAt"], message: "A disabled timer cannot have a pending occurrence." });
|
|
26
|
+
});
|
|
27
|
+
/** Immutable occurrence evidence survives timer edits and coalesced downtime. */
|
|
28
|
+
export const LearningScheduleFireSchema = z.object({
|
|
29
|
+
schemaVersion: z.literal("openpond.learningScheduleFire.v1"),
|
|
30
|
+
id: ReleaseIdSchema,
|
|
31
|
+
revision: z.literal(1),
|
|
32
|
+
scheduleId: ReleaseIdSchema,
|
|
33
|
+
policy: LearningRevisionRefSchema,
|
|
34
|
+
scheduledAt: ReleaseTimestampSchema,
|
|
35
|
+
coalescedThroughAt: ReleaseTimestampSchema,
|
|
36
|
+
coalescedCount: z.number().int().nonnegative(),
|
|
37
|
+
outcome: z.enum(["reserved", "waiting_for_data", "waiting_for_review", "skipped"]),
|
|
38
|
+
reason: z.enum(["active_iteration", "cooldown", "daily_budget"]).nullable(),
|
|
39
|
+
iteration: z.object({ id: ReleaseIdSchema, revision: z.number().int().positive() }).strict().nullable(),
|
|
40
|
+
createdAt: ReleaseTimestampSchema,
|
|
41
|
+
contentHash: ReleaseHashSchema,
|
|
42
|
+
}).strict().superRefine((value, context) => {
|
|
43
|
+
if ((value.outcome === "skipped") !== Boolean(value.reason) || (value.outcome !== "skipped") !== Boolean(value.iteration))
|
|
44
|
+
context.addIssue({ code: "custom", path: ["outcome"], message: "A fire retains either its reservation or its explicit skip reason." });
|
|
45
|
+
});
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { contentHash } from "@openpond/harness";
|
|
2
|
+
import { assertLearningContentHash, learningRef, sameLearningRef } from "./contracts.js";
|
|
3
|
+
import { LearningScheduleSchema } from "./schedule-contracts.js";
|
|
4
|
+
import { LearningDomainError } from "./errors.js";
|
|
5
|
+
import { requireLearningResource } from "./repository.js";
|
|
6
|
+
export function learningScheduleId(policyId) { return `schedule-${contentHash(policyId)}`; }
|
|
7
|
+
/** Called atomically with policy publication. No external timer or Work is made. */
|
|
8
|
+
export async function synchronizeLearningSchedule(tx, policy, now) {
|
|
9
|
+
assertLearningContentHash(policy);
|
|
10
|
+
const current = await requireLearningResource(tx, "policy", policy.id);
|
|
11
|
+
if (!sameLearningRef(learningRef(current), learningRef(policy)))
|
|
12
|
+
throw new LearningDomainError("learning_policy_revision_stale", 409);
|
|
13
|
+
const id = learningScheduleId(policy.id);
|
|
14
|
+
const previous = await tx.get("schedule", id);
|
|
15
|
+
if (previous && sameLearningRef(previous.policy, learningRef(policy)))
|
|
16
|
+
return previous;
|
|
17
|
+
const intervalSeconds = policy.trigger.kind === "schedule" ? policy.trigger.intervalSeconds : null;
|
|
18
|
+
const enabled = policy.enabled && policy.automation.train && intervalSeconds !== null;
|
|
19
|
+
const preserveDue = previous?.nextRunAt && previous.intervalSeconds === intervalSeconds
|
|
20
|
+
&& previous.executionOwner === policy.executionOwner;
|
|
21
|
+
const schedule = LearningScheduleSchema.parse({
|
|
22
|
+
schemaVersion: "openpond.learningSchedule.v1", id, revision: (previous?.revision ?? 0) + 1,
|
|
23
|
+
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,
|
|
26
|
+
lastFire: previous?.lastFire ?? null, consecutiveFailures: 0, nextAttemptAt: null, lastError: null,
|
|
27
|
+
createdAt: previous?.createdAt ?? now, updatedAt: now,
|
|
28
|
+
});
|
|
29
|
+
await tx.put("schedule", schedule, previous?.revision ?? 0, { parentId: policy.modelProjectId, status: schedule.state });
|
|
30
|
+
return schedule;
|
|
31
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { contentHash } from "@openpond/harness";
|
|
2
|
+
import { learningRef, sealLearningContent } from "./contracts.js";
|
|
3
|
+
import { LearningDomainError } from "./errors.js";
|
|
4
|
+
import { reserveLearningIteration } from "./iteration-reservation-service.js";
|
|
5
|
+
import { LearningScheduleFireSchema, LearningScheduleSchema } from "./schedule-contracts.js";
|
|
6
|
+
import { requireLearningRelease, requireLearningResource } from "./repository.js";
|
|
7
|
+
const skipReasons = new Map([
|
|
8
|
+
["learning_iteration_active", "active_iteration"], ["learning_iteration_cooldown", "cooldown"],
|
|
9
|
+
["learning_daily_budget_exhausted", "daily_budget"],
|
|
10
|
+
]);
|
|
11
|
+
/** Like a durable scheduled Work fire, the occurrence and timer advance commit
|
|
12
|
+
* together. Here the typed target is a learning reservation, never a prompt or
|
|
13
|
+
* provider submission. All work inside the transaction is repository-only. */
|
|
14
|
+
export function createLearningScheduleWorker(repository, options) {
|
|
15
|
+
const now = options.now ?? (() => new Date().toISOString());
|
|
16
|
+
async function run(scope, scheduleId, actorId) {
|
|
17
|
+
let attempt = null;
|
|
18
|
+
try {
|
|
19
|
+
return await repository.transaction(scope, async (tx) => {
|
|
20
|
+
const schedule = await requireLearningResource(tx, "schedule", scheduleId);
|
|
21
|
+
if (schedule.executionOwner !== options.executionOwner)
|
|
22
|
+
throw new LearningDomainError("learning_execution_owner_mismatch", 409);
|
|
23
|
+
const timestamp = now();
|
|
24
|
+
const time = Date.parse(timestamp);
|
|
25
|
+
if (schedule.state !== "scheduled" || !schedule.nextRunAt || Date.parse(schedule.nextRunAt) > time
|
|
26
|
+
|| (schedule.nextAttemptAt && Date.parse(schedule.nextAttemptAt) > time))
|
|
27
|
+
return schedule;
|
|
28
|
+
attempt = { schedule, maxRetries: 0 };
|
|
29
|
+
const policy = await requireLearningRelease(tx, "policy", schedule.policy);
|
|
30
|
+
attempt.maxRetries = policy.limits.maxRetries;
|
|
31
|
+
if (policy.executionOwner !== schedule.executionOwner || policy.trigger.kind !== "schedule"
|
|
32
|
+
|| policy.trigger.intervalSeconds !== schedule.intervalSeconds)
|
|
33
|
+
throw new LearningDomainError("learning_schedule_policy_mismatch", 409);
|
|
34
|
+
const scheduledAt = schedule.nextRunAt;
|
|
35
|
+
const interval = schedule.intervalSeconds * 1_000;
|
|
36
|
+
const due = Date.parse(scheduledAt);
|
|
37
|
+
const coalescedCount = Math.floor((time - due) / interval);
|
|
38
|
+
const id = `schedule-fire-${contentHash([schedule.id, scheduledAt])}`;
|
|
39
|
+
let outcome = "skipped";
|
|
40
|
+
let reason = null;
|
|
41
|
+
let iteration = null;
|
|
42
|
+
try {
|
|
43
|
+
const pointers = await reserveLearningIteration(tx, { action: "reserve_iteration", operationId: id,
|
|
44
|
+
policy: schedule.policy, trigger: { kind: "schedule", scheduledAt } }, actorId, timestamp);
|
|
45
|
+
const pointer = pointers.find(value => value.kind === "iteration");
|
|
46
|
+
if (!pointer)
|
|
47
|
+
throw new LearningDomainError("learning_schedule_reservation_missing", 409);
|
|
48
|
+
const reservation = await requireLearningResource(tx, "reservation", pointer.id);
|
|
49
|
+
outcome = reservation.outcome;
|
|
50
|
+
iteration = { id: pointer.id, revision: pointer.revision };
|
|
51
|
+
}
|
|
52
|
+
catch (error) {
|
|
53
|
+
// These admission checks run before reservation mutations. Every other
|
|
54
|
+
// error must roll back the whole fire, including any partial batch.
|
|
55
|
+
const skip = error instanceof LearningDomainError ? skipReasons.get(error.code) : undefined;
|
|
56
|
+
if (!skip)
|
|
57
|
+
throw error;
|
|
58
|
+
reason = skip;
|
|
59
|
+
}
|
|
60
|
+
const fire = LearningScheduleFireSchema.parse(sealLearningContent({
|
|
61
|
+
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,
|
|
64
|
+
}));
|
|
65
|
+
await tx.put("schedule_fire", fire, 0, { parentId: schedule.id, status: outcome });
|
|
66
|
+
const updated = LearningScheduleSchema.parse({ ...schedule, revision: schedule.revision + 1,
|
|
67
|
+
nextRunAt: new Date(due + (coalescedCount + 1) * interval).toISOString(), lastFire: learningRef(fire),
|
|
68
|
+
consecutiveFailures: 0, nextAttemptAt: null, lastError: null, updatedAt: timestamp });
|
|
69
|
+
await tx.put("schedule", updated, schedule.revision, { parentId: schedule.modelProjectId, status: updated.state });
|
|
70
|
+
return updated;
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
catch (error) {
|
|
74
|
+
// Failed transactions keep the original due time and exact fire identity.
|
|
75
|
+
// A concurrent policy edit owns its new timer; never overwrite that state.
|
|
76
|
+
const failed = attempt;
|
|
77
|
+
if (!failed)
|
|
78
|
+
throw error;
|
|
79
|
+
return repository.transaction(scope, async (tx) => {
|
|
80
|
+
const current = await requireLearningResource(tx, "schedule", scheduleId);
|
|
81
|
+
if (current.revision !== failed.schedule.revision)
|
|
82
|
+
return current;
|
|
83
|
+
const timestamp = now();
|
|
84
|
+
const consecutiveFailures = current.consecutiveFailures + 1;
|
|
85
|
+
const blocked = consecutiveFailures > failed.maxRetries;
|
|
86
|
+
const updated = LearningScheduleSchema.parse({ ...current, revision: current.revision + 1,
|
|
87
|
+
state: blocked ? "blocked" : "scheduled", consecutiveFailures,
|
|
88
|
+
nextAttemptAt: blocked ? null : new Date(Date.parse(timestamp) + Math.min(60_000, 1_000 * 2 ** Math.min(consecutiveFailures - 1, 10))).toISOString(),
|
|
89
|
+
lastError: (error instanceof Error ? error.message : String(error)).slice(0, 20_000), updatedAt: timestamp });
|
|
90
|
+
await tx.put("schedule", updated, current.revision, { parentId: current.modelProjectId, status: updated.state });
|
|
91
|
+
return updated;
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
return { run };
|
|
96
|
+
}
|
package/dist/learning/service.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { cancelLearningIterationReservation } from "./iteration-reservation-cancellation.js";
|
|
2
2
|
import { commandLearningIterationDispatch } from "./iteration-dispatch-commands.js";
|
|
3
3
|
import { reserveLearningIteration } from "./iteration-reservation-service.js";
|
|
4
|
+
import { synchronizeLearningSchedule } from "./schedule-service.js";
|
|
4
5
|
import { requireCurrentLearningEvidence as currentEvidence, sealLearningBatch } from "./batch-service.js";
|
|
5
6
|
import { saveAuthoringDraft, archiveAuthoringDraft, finalizeAuthoringDraft } from "./authoring-service.js";
|
|
6
7
|
import { queueRewardCheck, cancelRewardCheck } from "./reward-check-service.js";
|
|
@@ -158,6 +159,8 @@ export function createLearningService(repository, options = {}) {
|
|
|
158
159
|
}
|
|
159
160
|
}
|
|
160
161
|
await transaction.put(input.kind, resource, input.expectedRevision, input.kind === "policy" ? { parentId: input.content.modelProjectId } : undefined);
|
|
162
|
+
if (input.kind === "policy")
|
|
163
|
+
await synchronizeLearningSchedule(transaction, LearningPolicySchema.parse(resource), now());
|
|
161
164
|
return pointer(input.kind, resource);
|
|
162
165
|
}
|
|
163
166
|
async function submit(transaction, input) {
|
|
@@ -362,6 +365,10 @@ function authorizeRead(context) {
|
|
|
362
365
|
function authorize(context, input) {
|
|
363
366
|
if (!context.scope.trim() || !context.actor.id.trim())
|
|
364
367
|
throw new LearningDomainError("learning_scope_required", 400);
|
|
368
|
+
const publications = input.action === "publish" ? [input] : input.action === "publish_resources" ? input.resources : [];
|
|
369
|
+
if (context.actor.role !== "reviewer" && publications.some(value => value.kind === "policy" && value.content.enabled
|
|
370
|
+
&& value.content.automation.train && value.content.trigger.kind === "schedule"))
|
|
371
|
+
throw new LearningDomainError("learning_review_not_authorized", 403);
|
|
365
372
|
if (context.actor.role === "source") {
|
|
366
373
|
const sourceId = input.action === "submit_example" ? input.example.sourceId : input.action === "submit_feedback" ? input.feedback.sourceId : null;
|
|
367
374
|
if (!sourceId || sourceId !== context.actor.sourceId)
|
|
@@ -16,4 +16,7 @@ export * from "./iteration-reservation-contracts.js";
|
|
|
16
16
|
export * from "./iteration-dispatch-contracts.js";
|
|
17
17
|
export * from "./iteration-dispatch-worker.js";
|
|
18
18
|
export * from "./iteration-candidate-decision.js";
|
|
19
|
+
export * from "./schedule-contracts.js";
|
|
20
|
+
export * from "./schedule-service.js";
|
|
21
|
+
export * from "./schedule-worker.js";
|
|
19
22
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/learning/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC;AACzC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,sCAAsC,CAAC;AACrD,cAAc,mCAAmC,CAAC;AAClD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,mCAAmC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/learning/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC;AACzC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,sCAAsC,CAAC;AACrD,cAAc,mCAAmC,CAAC;AAClD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,mCAAmC,CAAC;AAClD,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC"}
|
|
@@ -1152,6 +1152,69 @@ export declare const learningResourceSchemas: {
|
|
|
1152
1152
|
createdAt: z.ZodString;
|
|
1153
1153
|
updatedAt: z.ZodString;
|
|
1154
1154
|
}, z.core.$strict>;
|
|
1155
|
+
readonly schedule: z.ZodObject<{
|
|
1156
|
+
schemaVersion: z.ZodLiteral<"openpond.learningSchedule.v1">;
|
|
1157
|
+
id: z.ZodString;
|
|
1158
|
+
revision: z.ZodNumber;
|
|
1159
|
+
policy: z.ZodObject<{
|
|
1160
|
+
id: z.ZodString;
|
|
1161
|
+
contentHash: z.ZodString;
|
|
1162
|
+
revision: z.ZodNumber;
|
|
1163
|
+
}, z.core.$strict>;
|
|
1164
|
+
modelProjectId: z.ZodString;
|
|
1165
|
+
executionOwner: z.ZodEnum<{
|
|
1166
|
+
local: "local";
|
|
1167
|
+
hosted: "hosted";
|
|
1168
|
+
}>;
|
|
1169
|
+
state: z.ZodEnum<{
|
|
1170
|
+
blocked: "blocked";
|
|
1171
|
+
scheduled: "scheduled";
|
|
1172
|
+
disabled: "disabled";
|
|
1173
|
+
}>;
|
|
1174
|
+
intervalSeconds: z.ZodNullable<z.ZodNumber>;
|
|
1175
|
+
nextRunAt: z.ZodNullable<z.ZodString>;
|
|
1176
|
+
lastFire: z.ZodNullable<z.ZodObject<{
|
|
1177
|
+
id: z.ZodString;
|
|
1178
|
+
contentHash: z.ZodString;
|
|
1179
|
+
revision: z.ZodNumber;
|
|
1180
|
+
}, z.core.$strict>>;
|
|
1181
|
+
consecutiveFailures: z.ZodNumber;
|
|
1182
|
+
nextAttemptAt: z.ZodNullable<z.ZodString>;
|
|
1183
|
+
lastError: z.ZodNullable<z.ZodString>;
|
|
1184
|
+
createdAt: z.ZodString;
|
|
1185
|
+
updatedAt: z.ZodString;
|
|
1186
|
+
}, z.core.$strict>;
|
|
1187
|
+
readonly schedule_fire: z.ZodObject<{
|
|
1188
|
+
schemaVersion: z.ZodLiteral<"openpond.learningScheduleFire.v1">;
|
|
1189
|
+
id: z.ZodString;
|
|
1190
|
+
revision: z.ZodLiteral<1>;
|
|
1191
|
+
scheduleId: z.ZodString;
|
|
1192
|
+
policy: z.ZodObject<{
|
|
1193
|
+
id: z.ZodString;
|
|
1194
|
+
contentHash: z.ZodString;
|
|
1195
|
+
revision: z.ZodNumber;
|
|
1196
|
+
}, z.core.$strict>;
|
|
1197
|
+
scheduledAt: z.ZodString;
|
|
1198
|
+
coalescedThroughAt: z.ZodString;
|
|
1199
|
+
coalescedCount: z.ZodNumber;
|
|
1200
|
+
outcome: z.ZodEnum<{
|
|
1201
|
+
skipped: "skipped";
|
|
1202
|
+
waiting_for_data: "waiting_for_data";
|
|
1203
|
+
waiting_for_review: "waiting_for_review";
|
|
1204
|
+
reserved: "reserved";
|
|
1205
|
+
}>;
|
|
1206
|
+
reason: z.ZodNullable<z.ZodEnum<{
|
|
1207
|
+
active_iteration: "active_iteration";
|
|
1208
|
+
cooldown: "cooldown";
|
|
1209
|
+
daily_budget: "daily_budget";
|
|
1210
|
+
}>>;
|
|
1211
|
+
iteration: z.ZodNullable<z.ZodObject<{
|
|
1212
|
+
id: z.ZodString;
|
|
1213
|
+
revision: z.ZodNumber;
|
|
1214
|
+
}, z.core.$strict>>;
|
|
1215
|
+
createdAt: z.ZodString;
|
|
1216
|
+
contentHash: z.ZodString;
|
|
1217
|
+
}, z.core.$strict>;
|
|
1155
1218
|
readonly iteration: z.ZodObject<{
|
|
1156
1219
|
schemaVersion: z.ZodLiteral<"openpond.learningIteration.v1">;
|
|
1157
1220
|
id: z.ZodString;
|
|
@@ -1550,14 +1613,16 @@ export declare const LearningResourceKindSchema: z.ZodEnum<{
|
|
|
1550
1613
|
binding: "binding";
|
|
1551
1614
|
batch: "batch";
|
|
1552
1615
|
grade: "grade";
|
|
1616
|
+
schedule: "schedule";
|
|
1553
1617
|
definition: "definition";
|
|
1554
1618
|
draft: "draft";
|
|
1619
|
+
iteration: "iteration";
|
|
1555
1620
|
reward_check: "reward_check";
|
|
1556
1621
|
chain: "chain";
|
|
1557
1622
|
consumption: "consumption";
|
|
1558
1623
|
reservation: "reservation";
|
|
1559
1624
|
dispatch: "dispatch";
|
|
1560
|
-
|
|
1625
|
+
schedule_fire: "schedule_fire";
|
|
1561
1626
|
package: "package";
|
|
1562
1627
|
}>;
|
|
1563
1628
|
export type LearningResourceFor<K extends LearningResourceKind> = z.infer<(typeof learningResourceSchemas)[K]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repository.d.ts","sourceRoot":"","sources":["../../../../../src/learning/repository.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"repository.d.ts","sourceRoot":"","sources":["../../../../../src/learning/repository.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAkO,KAAK,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAG1R,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAKlD,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,WAAW,EAAE,MAAM,GAAG,MAAM,CAEhF"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/** The durable timer is operational state; every fire retains its own policy. */
|
|
3
|
+
export declare const LearningScheduleSchema: z.ZodObject<{
|
|
4
|
+
schemaVersion: z.ZodLiteral<"openpond.learningSchedule.v1">;
|
|
5
|
+
id: z.ZodString;
|
|
6
|
+
revision: z.ZodNumber;
|
|
7
|
+
policy: z.ZodObject<{
|
|
8
|
+
id: z.ZodString;
|
|
9
|
+
contentHash: z.ZodString;
|
|
10
|
+
revision: z.ZodNumber;
|
|
11
|
+
}, z.core.$strict>;
|
|
12
|
+
modelProjectId: z.ZodString;
|
|
13
|
+
executionOwner: z.ZodEnum<{
|
|
14
|
+
local: "local";
|
|
15
|
+
hosted: "hosted";
|
|
16
|
+
}>;
|
|
17
|
+
state: z.ZodEnum<{
|
|
18
|
+
blocked: "blocked";
|
|
19
|
+
scheduled: "scheduled";
|
|
20
|
+
disabled: "disabled";
|
|
21
|
+
}>;
|
|
22
|
+
intervalSeconds: z.ZodNullable<z.ZodNumber>;
|
|
23
|
+
nextRunAt: z.ZodNullable<z.ZodString>;
|
|
24
|
+
lastFire: z.ZodNullable<z.ZodObject<{
|
|
25
|
+
id: z.ZodString;
|
|
26
|
+
contentHash: z.ZodString;
|
|
27
|
+
revision: z.ZodNumber;
|
|
28
|
+
}, z.core.$strict>>;
|
|
29
|
+
consecutiveFailures: z.ZodNumber;
|
|
30
|
+
nextAttemptAt: z.ZodNullable<z.ZodString>;
|
|
31
|
+
lastError: z.ZodNullable<z.ZodString>;
|
|
32
|
+
createdAt: z.ZodString;
|
|
33
|
+
updatedAt: z.ZodString;
|
|
34
|
+
}, z.core.$strict>;
|
|
35
|
+
/** Immutable occurrence evidence survives timer edits and coalesced downtime. */
|
|
36
|
+
export declare const LearningScheduleFireSchema: z.ZodObject<{
|
|
37
|
+
schemaVersion: z.ZodLiteral<"openpond.learningScheduleFire.v1">;
|
|
38
|
+
id: z.ZodString;
|
|
39
|
+
revision: z.ZodLiteral<1>;
|
|
40
|
+
scheduleId: z.ZodString;
|
|
41
|
+
policy: z.ZodObject<{
|
|
42
|
+
id: z.ZodString;
|
|
43
|
+
contentHash: z.ZodString;
|
|
44
|
+
revision: z.ZodNumber;
|
|
45
|
+
}, z.core.$strict>;
|
|
46
|
+
scheduledAt: z.ZodString;
|
|
47
|
+
coalescedThroughAt: z.ZodString;
|
|
48
|
+
coalescedCount: z.ZodNumber;
|
|
49
|
+
outcome: z.ZodEnum<{
|
|
50
|
+
skipped: "skipped";
|
|
51
|
+
waiting_for_data: "waiting_for_data";
|
|
52
|
+
waiting_for_review: "waiting_for_review";
|
|
53
|
+
reserved: "reserved";
|
|
54
|
+
}>;
|
|
55
|
+
reason: z.ZodNullable<z.ZodEnum<{
|
|
56
|
+
active_iteration: "active_iteration";
|
|
57
|
+
cooldown: "cooldown";
|
|
58
|
+
daily_budget: "daily_budget";
|
|
59
|
+
}>>;
|
|
60
|
+
iteration: z.ZodNullable<z.ZodObject<{
|
|
61
|
+
id: z.ZodString;
|
|
62
|
+
revision: z.ZodNumber;
|
|
63
|
+
}, z.core.$strict>>;
|
|
64
|
+
createdAt: z.ZodString;
|
|
65
|
+
contentHash: z.ZodString;
|
|
66
|
+
}, z.core.$strict>;
|
|
67
|
+
export type LearningSchedule = z.infer<typeof LearningScheduleSchema>;
|
|
68
|
+
export type LearningScheduleFire = z.infer<typeof LearningScheduleFireSchema>;
|
|
69
|
+
//# sourceMappingURL=schedule-contracts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schedule-contracts.d.ts","sourceRoot":"","sources":["../../../../../src/learning/schedule-contracts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,iFAAiF;AACjF,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAqBjC,CAAC;AAEH,iFAAiF;AACjF,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAiBrC,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AACtE,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type LearningPolicy } from "./contracts.js";
|
|
2
|
+
import { type LearningTransaction } from "./repository.js";
|
|
3
|
+
export declare function learningScheduleId(policyId: string): string;
|
|
4
|
+
/** Called atomically with policy publication. No external timer or Work is made. */
|
|
5
|
+
export declare function synchronizeLearningSchedule(tx: LearningTransaction, policy: LearningPolicy, now: string): Promise<{
|
|
6
|
+
schemaVersion: "openpond.learningSchedule.v1";
|
|
7
|
+
id: string;
|
|
8
|
+
revision: number;
|
|
9
|
+
policy: {
|
|
10
|
+
id: string;
|
|
11
|
+
contentHash: string;
|
|
12
|
+
revision: number;
|
|
13
|
+
};
|
|
14
|
+
modelProjectId: string;
|
|
15
|
+
executionOwner: "local" | "hosted";
|
|
16
|
+
state: "blocked" | "scheduled" | "disabled";
|
|
17
|
+
intervalSeconds: number | null;
|
|
18
|
+
nextRunAt: string | null;
|
|
19
|
+
lastFire: {
|
|
20
|
+
id: string;
|
|
21
|
+
contentHash: string;
|
|
22
|
+
revision: number;
|
|
23
|
+
} | null;
|
|
24
|
+
consecutiveFailures: number;
|
|
25
|
+
nextAttemptAt: string | null;
|
|
26
|
+
lastError: string | null;
|
|
27
|
+
createdAt: string;
|
|
28
|
+
updatedAt: string;
|
|
29
|
+
}>;
|
|
30
|
+
//# sourceMappingURL=schedule-service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schedule-service.d.ts","sourceRoot":"","sources":["../../../../../src/learning/schedule-service.ts"],"names":[],"mappings":"AACA,OAAO,EAA2D,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAG9G,OAAO,EAA2B,KAAK,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAEpF,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,UAAiD;AAEpG,oFAAoF;AACpF,wBAAsB,2BAA2B,CAAC,EAAE,EAAE,mBAAmB,EAAE,MAAM,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;GAqB7G"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type LearningSchedule } from "./schedule-contracts.js";
|
|
2
|
+
import { type LearningRepository } from "./repository.js";
|
|
3
|
+
/** Like a durable scheduled Work fire, the occurrence and timer advance commit
|
|
4
|
+
* together. Here the typed target is a learning reservation, never a prompt or
|
|
5
|
+
* provider submission. All work inside the transaction is repository-only. */
|
|
6
|
+
export declare function createLearningScheduleWorker(repository: LearningRepository, options: {
|
|
7
|
+
executionOwner: "local" | "hosted";
|
|
8
|
+
now?: () => string;
|
|
9
|
+
}): {
|
|
10
|
+
run: (scope: string, scheduleId: string, actorId: string) => Promise<LearningSchedule>;
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=schedule-worker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schedule-worker.d.ts","sourceRoot":"","sources":["../../../../../src/learning/schedule-worker.ts"],"names":[],"mappings":"AAIA,OAAO,EAAsD,KAAK,gBAAgB,EAA6B,MAAM,yBAAyB,CAAC;AAC/I,OAAO,EAAmD,KAAK,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAO3G;;8EAE8E;AAC9E,wBAAgB,4BAA4B,CAAC,UAAU,EAAE,kBAAkB,EAAE,OAAO,EAAE;IACpF,cAAc,EAAE,OAAO,GAAG,QAAQ,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;CACxD;iBAG2B,MAAM,cAAc,MAAM,WAAW,MAAM,KAAG,OAAO,CAAC,gBAAgB,CAAC;EAuElG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../../../../src/learning/service.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../../../../src/learning/service.ts"],"names":[],"mappings":"AAaA,OAAO,EAA+Q,KAAK,mBAAmB,EAAwC,MAAM,gBAAgB,CAAC;AAE7W,OAAO,EAAmH,KAAK,kBAAkB,EAAE,KAAK,mBAAmB,EAAE,KAAK,oBAAoB,EAAE,KAAK,oBAAoB,EAAgC,KAAK,qBAAqB,EAAE,KAAK,sBAAsB,EAA4B,MAAM,iBAAiB,CAAC;AAK5W,MAAM,MAAM,aAAa,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,QAAQ,GAAG,UAAU,GAAG,QAAQ,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AACtG,MAAM,MAAM,sBAAsB,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,aAAa,CAAA;CAAE,CAAC;AAC7E,MAAM,MAAM,uBAAuB,GAAG;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,sBAAsB,EAAE,CAAA;CAAE,CAAC;AAEnG,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,kBAAkB,EAAE,OAAO,GAAE;IAAE,GAAG,CAAC,EAAE,MAAM,MAAM,CAAA;CAAO;uBAGxE,sBAAsB,OAAO,OAAO,KAAG,OAAO,CAAC,uBAAuB,CAAC;6BA0PtE,sBAAsB,aAAa,mBAAmB;;;;;;;;;;;;;QAS3E,CAAC,SAAS,oBAAoB,WAAW,sBAAsB,QAAQ,CAAC,MAAM,MAAM,aAAa,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC;SAIxI,CAAC,SAAS,oBAAoB,WAAW,sBAAsB,QAAQ,CAAC,UAAS,OAAO,CAAC,qBAAqB,CAAC,GAAQ,OAAO,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC;EAMrK"}
|
|
@@ -1459,14 +1459,16 @@ export declare const LearningReadRequestSchema: z.ZodDiscriminatedUnion<[z.ZodOb
|
|
|
1459
1459
|
binding: "binding";
|
|
1460
1460
|
batch: "batch";
|
|
1461
1461
|
grade: "grade";
|
|
1462
|
+
schedule: "schedule";
|
|
1462
1463
|
definition: "definition";
|
|
1463
1464
|
draft: "draft";
|
|
1465
|
+
iteration: "iteration";
|
|
1464
1466
|
reward_check: "reward_check";
|
|
1465
1467
|
chain: "chain";
|
|
1466
1468
|
consumption: "consumption";
|
|
1467
1469
|
reservation: "reservation";
|
|
1468
1470
|
dispatch: "dispatch";
|
|
1469
|
-
|
|
1471
|
+
schedule_fire: "schedule_fire";
|
|
1470
1472
|
package: "package";
|
|
1471
1473
|
}>;
|
|
1472
1474
|
id: z.ZodString;
|
|
@@ -1485,14 +1487,16 @@ export declare const LearningReadRequestSchema: z.ZodDiscriminatedUnion<[z.ZodOb
|
|
|
1485
1487
|
binding: "binding";
|
|
1486
1488
|
batch: "batch";
|
|
1487
1489
|
grade: "grade";
|
|
1490
|
+
schedule: "schedule";
|
|
1488
1491
|
definition: "definition";
|
|
1489
1492
|
draft: "draft";
|
|
1493
|
+
iteration: "iteration";
|
|
1490
1494
|
reward_check: "reward_check";
|
|
1491
1495
|
chain: "chain";
|
|
1492
1496
|
consumption: "consumption";
|
|
1493
1497
|
reservation: "reservation";
|
|
1494
1498
|
dispatch: "dispatch";
|
|
1495
|
-
|
|
1499
|
+
schedule_fire: "schedule_fire";
|
|
1496
1500
|
package: "package";
|
|
1497
1501
|
}>;
|
|
1498
1502
|
parentId: z.ZodOptional<z.ZodString>;
|
|
@@ -2973,6 +2977,67 @@ export declare const LearningOperationResultSchema: z.ZodObject<{
|
|
|
2973
2977
|
lastError: z.ZodNullable<z.ZodString>;
|
|
2974
2978
|
createdAt: z.ZodString;
|
|
2975
2979
|
updatedAt: z.ZodString;
|
|
2980
|
+
}, z.core.$strict> | z.ZodObject<{
|
|
2981
|
+
schemaVersion: z.ZodLiteral<"openpond.learningSchedule.v1">;
|
|
2982
|
+
id: z.ZodString;
|
|
2983
|
+
revision: z.ZodNumber;
|
|
2984
|
+
policy: z.ZodObject<{
|
|
2985
|
+
id: z.ZodString;
|
|
2986
|
+
contentHash: z.ZodString;
|
|
2987
|
+
revision: z.ZodNumber;
|
|
2988
|
+
}, z.core.$strict>;
|
|
2989
|
+
modelProjectId: z.ZodString;
|
|
2990
|
+
executionOwner: z.ZodEnum<{
|
|
2991
|
+
local: "local";
|
|
2992
|
+
hosted: "hosted";
|
|
2993
|
+
}>;
|
|
2994
|
+
state: z.ZodEnum<{
|
|
2995
|
+
blocked: "blocked";
|
|
2996
|
+
scheduled: "scheduled";
|
|
2997
|
+
disabled: "disabled";
|
|
2998
|
+
}>;
|
|
2999
|
+
intervalSeconds: z.ZodNullable<z.ZodNumber>;
|
|
3000
|
+
nextRunAt: z.ZodNullable<z.ZodString>;
|
|
3001
|
+
lastFire: z.ZodNullable<z.ZodObject<{
|
|
3002
|
+
id: z.ZodString;
|
|
3003
|
+
contentHash: z.ZodString;
|
|
3004
|
+
revision: z.ZodNumber;
|
|
3005
|
+
}, z.core.$strict>>;
|
|
3006
|
+
consecutiveFailures: z.ZodNumber;
|
|
3007
|
+
nextAttemptAt: z.ZodNullable<z.ZodString>;
|
|
3008
|
+
lastError: z.ZodNullable<z.ZodString>;
|
|
3009
|
+
createdAt: z.ZodString;
|
|
3010
|
+
updatedAt: z.ZodString;
|
|
3011
|
+
}, z.core.$strict> | z.ZodObject<{
|
|
3012
|
+
schemaVersion: z.ZodLiteral<"openpond.learningScheduleFire.v1">;
|
|
3013
|
+
id: z.ZodString;
|
|
3014
|
+
revision: z.ZodLiteral<1>;
|
|
3015
|
+
scheduleId: z.ZodString;
|
|
3016
|
+
policy: z.ZodObject<{
|
|
3017
|
+
id: z.ZodString;
|
|
3018
|
+
contentHash: z.ZodString;
|
|
3019
|
+
revision: z.ZodNumber;
|
|
3020
|
+
}, z.core.$strict>;
|
|
3021
|
+
scheduledAt: z.ZodString;
|
|
3022
|
+
coalescedThroughAt: z.ZodString;
|
|
3023
|
+
coalescedCount: z.ZodNumber;
|
|
3024
|
+
outcome: z.ZodEnum<{
|
|
3025
|
+
skipped: "skipped";
|
|
3026
|
+
waiting_for_data: "waiting_for_data";
|
|
3027
|
+
waiting_for_review: "waiting_for_review";
|
|
3028
|
+
reserved: "reserved";
|
|
3029
|
+
}>;
|
|
3030
|
+
reason: z.ZodNullable<z.ZodEnum<{
|
|
3031
|
+
active_iteration: "active_iteration";
|
|
3032
|
+
cooldown: "cooldown";
|
|
3033
|
+
daily_budget: "daily_budget";
|
|
3034
|
+
}>>;
|
|
3035
|
+
iteration: z.ZodNullable<z.ZodObject<{
|
|
3036
|
+
id: z.ZodString;
|
|
3037
|
+
revision: z.ZodNumber;
|
|
3038
|
+
}, z.core.$strict>>;
|
|
3039
|
+
createdAt: z.ZodString;
|
|
3040
|
+
contentHash: z.ZodString;
|
|
2976
3041
|
}, z.core.$strict> | z.ZodObject<{
|
|
2977
3042
|
schemaVersion: z.ZodLiteral<"openpond.rewardCheckRun.v1">;
|
|
2978
3043
|
id: z.ZodString;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../../../../../src/learning/transport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB,mFAAmF;AACnF,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,OAAO,GAAG,IAAI,CAG5D;AAED,0FAA0F;AAC1F,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAG/B,CAAC"}
|
package/package.json
CHANGED
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"type": "object",
|
|
4
|
+
"properties": {
|
|
5
|
+
"schemaVersion": {
|
|
6
|
+
"$ref": "#/$defs/__schema0"
|
|
7
|
+
},
|
|
8
|
+
"id": {
|
|
9
|
+
"$ref": "#/$defs/__schema1"
|
|
10
|
+
},
|
|
11
|
+
"revision": {
|
|
12
|
+
"$ref": "#/$defs/__schema2"
|
|
13
|
+
},
|
|
14
|
+
"policy": {
|
|
15
|
+
"$ref": "#/$defs/__schema3"
|
|
16
|
+
},
|
|
17
|
+
"modelProjectId": {
|
|
18
|
+
"$ref": "#/$defs/__schema1"
|
|
19
|
+
},
|
|
20
|
+
"executionOwner": {
|
|
21
|
+
"$ref": "#/$defs/__schema4"
|
|
22
|
+
},
|
|
23
|
+
"state": {
|
|
24
|
+
"$ref": "#/$defs/__schema5"
|
|
25
|
+
},
|
|
26
|
+
"intervalSeconds": {
|
|
27
|
+
"$ref": "#/$defs/__schema6"
|
|
28
|
+
},
|
|
29
|
+
"nextRunAt": {
|
|
30
|
+
"$ref": "#/$defs/__schema7"
|
|
31
|
+
},
|
|
32
|
+
"lastFire": {
|
|
33
|
+
"$ref": "#/$defs/__schema9"
|
|
34
|
+
},
|
|
35
|
+
"consecutiveFailures": {
|
|
36
|
+
"$ref": "#/$defs/__schema10"
|
|
37
|
+
},
|
|
38
|
+
"nextAttemptAt": {
|
|
39
|
+
"$ref": "#/$defs/__schema11"
|
|
40
|
+
},
|
|
41
|
+
"lastError": {
|
|
42
|
+
"$ref": "#/$defs/__schema12"
|
|
43
|
+
},
|
|
44
|
+
"createdAt": {
|
|
45
|
+
"$ref": "#/$defs/__schema8"
|
|
46
|
+
},
|
|
47
|
+
"updatedAt": {
|
|
48
|
+
"$ref": "#/$defs/__schema8"
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"required": [
|
|
52
|
+
"schemaVersion",
|
|
53
|
+
"id",
|
|
54
|
+
"revision",
|
|
55
|
+
"policy",
|
|
56
|
+
"modelProjectId",
|
|
57
|
+
"executionOwner",
|
|
58
|
+
"state",
|
|
59
|
+
"intervalSeconds",
|
|
60
|
+
"nextRunAt",
|
|
61
|
+
"lastFire",
|
|
62
|
+
"consecutiveFailures",
|
|
63
|
+
"nextAttemptAt",
|
|
64
|
+
"lastError",
|
|
65
|
+
"createdAt",
|
|
66
|
+
"updatedAt"
|
|
67
|
+
],
|
|
68
|
+
"additionalProperties": false,
|
|
69
|
+
"$defs": {
|
|
70
|
+
"__schema0": {
|
|
71
|
+
"type": "string",
|
|
72
|
+
"const": "openpond.learningSchedule.v1"
|
|
73
|
+
},
|
|
74
|
+
"__schema1": {
|
|
75
|
+
"type": "string",
|
|
76
|
+
"minLength": 1,
|
|
77
|
+
"maxLength": 240
|
|
78
|
+
},
|
|
79
|
+
"__schema2": {
|
|
80
|
+
"type": "integer",
|
|
81
|
+
"exclusiveMinimum": 0,
|
|
82
|
+
"maximum": 9007199254740991
|
|
83
|
+
},
|
|
84
|
+
"__schema3": {
|
|
85
|
+
"type": "object",
|
|
86
|
+
"properties": {
|
|
87
|
+
"id": {
|
|
88
|
+
"$ref": "#/$defs/__schema1"
|
|
89
|
+
},
|
|
90
|
+
"contentHash": {
|
|
91
|
+
"type": "string",
|
|
92
|
+
"pattern": "^[a-f0-9]{64}$"
|
|
93
|
+
},
|
|
94
|
+
"revision": {
|
|
95
|
+
"type": "integer",
|
|
96
|
+
"exclusiveMinimum": 0,
|
|
97
|
+
"maximum": 9007199254740991
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
"required": [
|
|
101
|
+
"id",
|
|
102
|
+
"contentHash",
|
|
103
|
+
"revision"
|
|
104
|
+
],
|
|
105
|
+
"additionalProperties": false
|
|
106
|
+
},
|
|
107
|
+
"__schema4": {
|
|
108
|
+
"type": "string",
|
|
109
|
+
"enum": [
|
|
110
|
+
"local",
|
|
111
|
+
"hosted"
|
|
112
|
+
]
|
|
113
|
+
},
|
|
114
|
+
"__schema5": {
|
|
115
|
+
"type": "string",
|
|
116
|
+
"enum": [
|
|
117
|
+
"scheduled",
|
|
118
|
+
"disabled",
|
|
119
|
+
"blocked"
|
|
120
|
+
]
|
|
121
|
+
},
|
|
122
|
+
"__schema6": {
|
|
123
|
+
"anyOf": [
|
|
124
|
+
{
|
|
125
|
+
"type": "integer",
|
|
126
|
+
"minimum": 60,
|
|
127
|
+
"maximum": 31536000
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
"type": "null"
|
|
131
|
+
}
|
|
132
|
+
]
|
|
133
|
+
},
|
|
134
|
+
"__schema7": {
|
|
135
|
+
"anyOf": [
|
|
136
|
+
{
|
|
137
|
+
"$ref": "#/$defs/__schema8"
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
"type": "null"
|
|
141
|
+
}
|
|
142
|
+
]
|
|
143
|
+
},
|
|
144
|
+
"__schema8": {
|
|
145
|
+
"type": "string",
|
|
146
|
+
"format": "date-time",
|
|
147
|
+
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
|
|
148
|
+
},
|
|
149
|
+
"__schema9": {
|
|
150
|
+
"anyOf": [
|
|
151
|
+
{
|
|
152
|
+
"$ref": "#/$defs/__schema3"
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
"type": "null"
|
|
156
|
+
}
|
|
157
|
+
]
|
|
158
|
+
},
|
|
159
|
+
"__schema10": {
|
|
160
|
+
"type": "integer",
|
|
161
|
+
"minimum": 0,
|
|
162
|
+
"maximum": 9007199254740991
|
|
163
|
+
},
|
|
164
|
+
"__schema11": {
|
|
165
|
+
"anyOf": [
|
|
166
|
+
{
|
|
167
|
+
"$ref": "#/$defs/__schema8"
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
"type": "null"
|
|
171
|
+
}
|
|
172
|
+
]
|
|
173
|
+
},
|
|
174
|
+
"__schema12": {
|
|
175
|
+
"anyOf": [
|
|
176
|
+
{
|
|
177
|
+
"type": "string",
|
|
178
|
+
"maxLength": 20000
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
"type": "null"
|
|
182
|
+
}
|
|
183
|
+
]
|
|
184
|
+
}
|
|
185
|
+
},
|
|
186
|
+
"$id": "urn:openpond:learning:v1:schedule",
|
|
187
|
+
"$comment": "Generated from @openpond/evals. Cross-resource identity, authorization, idempotency, admission, grading and split constraints are enforced by the shared domain service in addition to this structural schema."
|
|
188
|
+
}
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"type": "object",
|
|
4
|
+
"properties": {
|
|
5
|
+
"schemaVersion": {
|
|
6
|
+
"$ref": "#/$defs/__schema0"
|
|
7
|
+
},
|
|
8
|
+
"id": {
|
|
9
|
+
"$ref": "#/$defs/__schema1"
|
|
10
|
+
},
|
|
11
|
+
"revision": {
|
|
12
|
+
"$ref": "#/$defs/__schema2"
|
|
13
|
+
},
|
|
14
|
+
"scheduleId": {
|
|
15
|
+
"$ref": "#/$defs/__schema1"
|
|
16
|
+
},
|
|
17
|
+
"policy": {
|
|
18
|
+
"$ref": "#/$defs/__schema3"
|
|
19
|
+
},
|
|
20
|
+
"scheduledAt": {
|
|
21
|
+
"$ref": "#/$defs/__schema5"
|
|
22
|
+
},
|
|
23
|
+
"coalescedThroughAt": {
|
|
24
|
+
"$ref": "#/$defs/__schema5"
|
|
25
|
+
},
|
|
26
|
+
"coalescedCount": {
|
|
27
|
+
"$ref": "#/$defs/__schema6"
|
|
28
|
+
},
|
|
29
|
+
"outcome": {
|
|
30
|
+
"$ref": "#/$defs/__schema7"
|
|
31
|
+
},
|
|
32
|
+
"reason": {
|
|
33
|
+
"$ref": "#/$defs/__schema8"
|
|
34
|
+
},
|
|
35
|
+
"iteration": {
|
|
36
|
+
"$ref": "#/$defs/__schema9"
|
|
37
|
+
},
|
|
38
|
+
"createdAt": {
|
|
39
|
+
"$ref": "#/$defs/__schema5"
|
|
40
|
+
},
|
|
41
|
+
"contentHash": {
|
|
42
|
+
"$ref": "#/$defs/__schema4"
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
"required": [
|
|
46
|
+
"schemaVersion",
|
|
47
|
+
"id",
|
|
48
|
+
"revision",
|
|
49
|
+
"scheduleId",
|
|
50
|
+
"policy",
|
|
51
|
+
"scheduledAt",
|
|
52
|
+
"coalescedThroughAt",
|
|
53
|
+
"coalescedCount",
|
|
54
|
+
"outcome",
|
|
55
|
+
"reason",
|
|
56
|
+
"iteration",
|
|
57
|
+
"createdAt",
|
|
58
|
+
"contentHash"
|
|
59
|
+
],
|
|
60
|
+
"additionalProperties": false,
|
|
61
|
+
"$defs": {
|
|
62
|
+
"__schema0": {
|
|
63
|
+
"type": "string",
|
|
64
|
+
"const": "openpond.learningScheduleFire.v1"
|
|
65
|
+
},
|
|
66
|
+
"__schema1": {
|
|
67
|
+
"type": "string",
|
|
68
|
+
"minLength": 1,
|
|
69
|
+
"maxLength": 240
|
|
70
|
+
},
|
|
71
|
+
"__schema2": {
|
|
72
|
+
"type": "number",
|
|
73
|
+
"const": 1
|
|
74
|
+
},
|
|
75
|
+
"__schema3": {
|
|
76
|
+
"type": "object",
|
|
77
|
+
"properties": {
|
|
78
|
+
"id": {
|
|
79
|
+
"$ref": "#/$defs/__schema1"
|
|
80
|
+
},
|
|
81
|
+
"contentHash": {
|
|
82
|
+
"$ref": "#/$defs/__schema4"
|
|
83
|
+
},
|
|
84
|
+
"revision": {
|
|
85
|
+
"type": "integer",
|
|
86
|
+
"exclusiveMinimum": 0,
|
|
87
|
+
"maximum": 9007199254740991
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
"required": [
|
|
91
|
+
"id",
|
|
92
|
+
"contentHash",
|
|
93
|
+
"revision"
|
|
94
|
+
],
|
|
95
|
+
"additionalProperties": false
|
|
96
|
+
},
|
|
97
|
+
"__schema4": {
|
|
98
|
+
"type": "string",
|
|
99
|
+
"pattern": "^[a-f0-9]{64}$"
|
|
100
|
+
},
|
|
101
|
+
"__schema5": {
|
|
102
|
+
"type": "string",
|
|
103
|
+
"format": "date-time",
|
|
104
|
+
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
|
|
105
|
+
},
|
|
106
|
+
"__schema6": {
|
|
107
|
+
"type": "integer",
|
|
108
|
+
"minimum": 0,
|
|
109
|
+
"maximum": 9007199254740991
|
|
110
|
+
},
|
|
111
|
+
"__schema7": {
|
|
112
|
+
"type": "string",
|
|
113
|
+
"enum": [
|
|
114
|
+
"reserved",
|
|
115
|
+
"waiting_for_data",
|
|
116
|
+
"waiting_for_review",
|
|
117
|
+
"skipped"
|
|
118
|
+
]
|
|
119
|
+
},
|
|
120
|
+
"__schema8": {
|
|
121
|
+
"anyOf": [
|
|
122
|
+
{
|
|
123
|
+
"type": "string",
|
|
124
|
+
"enum": [
|
|
125
|
+
"active_iteration",
|
|
126
|
+
"cooldown",
|
|
127
|
+
"daily_budget"
|
|
128
|
+
]
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"type": "null"
|
|
132
|
+
}
|
|
133
|
+
]
|
|
134
|
+
},
|
|
135
|
+
"__schema9": {
|
|
136
|
+
"anyOf": [
|
|
137
|
+
{
|
|
138
|
+
"type": "object",
|
|
139
|
+
"properties": {
|
|
140
|
+
"id": {
|
|
141
|
+
"$ref": "#/$defs/__schema1"
|
|
142
|
+
},
|
|
143
|
+
"revision": {
|
|
144
|
+
"type": "integer",
|
|
145
|
+
"exclusiveMinimum": 0,
|
|
146
|
+
"maximum": 9007199254740991
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
"required": [
|
|
150
|
+
"id",
|
|
151
|
+
"revision"
|
|
152
|
+
],
|
|
153
|
+
"additionalProperties": false
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
"type": "null"
|
|
157
|
+
}
|
|
158
|
+
]
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
"$id": "urn:openpond:learning:v1:schedule_fire",
|
|
162
|
+
"$comment": "Generated from @openpond/evals. Cross-resource identity, authorization, idempotency, admission, grading and split constraints are enforced by the shared domain service in addition to this structural schema."
|
|
163
|
+
}
|