@openpond/evals 0.12.4 → 0.12.6
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 +21 -0
- package/dist/javascript-isolate-process-entry.js +4 -1
- package/dist/javascript-isolate-process-source.js +1 -1
- package/dist/javascript-isolate-process.js +36 -2
- package/dist/javascript-isolate.js +8 -2
- package/dist/javascript-verifier-node.js +1 -0
- package/dist/javascript-verifier-worker-source.js +1 -1
- package/dist/learning/admission.js +1 -1
- package/dist/learning/contracts.js +12 -0
- package/dist/learning/index.js +1 -0
- package/dist/learning/iteration-dispatch-commands.js +1 -1
- package/dist/learning/iteration-dispatch-contracts.js +27 -0
- package/dist/learning/iteration-dispatch-deferral.js +28 -0
- package/dist/learning/iteration-dispatch-worker.js +34 -5
- package/dist/learning/reward-authoring.js +4 -2
- package/dist/types/javascript-isolate-process.d.ts +7 -0
- package/dist/types/javascript-isolate-process.d.ts.map +1 -1
- package/dist/types/javascript-isolate.d.ts +3 -1
- package/dist/types/javascript-isolate.d.ts.map +1 -1
- package/dist/types/javascript-verifier-node.d.ts +1 -0
- package/dist/types/javascript-verifier-node.d.ts.map +1 -1
- package/dist/types/learning/batch-service.d.ts +1 -0
- package/dist/types/learning/batch-service.d.ts.map +1 -1
- package/dist/types/learning/contracts.d.ts +42 -0
- package/dist/types/learning/contracts.d.ts.map +1 -1
- package/dist/types/learning/index.d.ts +1 -0
- package/dist/types/learning/index.d.ts.map +1 -1
- package/dist/types/learning/iteration-dispatch-contracts.d.ts +45 -0
- package/dist/types/learning/iteration-dispatch-contracts.d.ts.map +1 -1
- package/dist/types/learning/iteration-dispatch-deferral.d.ts +71 -0
- package/dist/types/learning/iteration-dispatch-deferral.d.ts.map +1 -0
- package/dist/types/learning/iteration-dispatch-worker.d.ts +7 -2
- package/dist/types/learning/iteration-dispatch-worker.d.ts.map +1 -1
- package/dist/types/learning/operations.d.ts +38 -0
- package/dist/types/learning/operations.d.ts.map +1 -1
- package/dist/types/learning/repository.d.ts +30 -0
- package/dist/types/learning/repository.d.ts.map +1 -1
- package/dist/types/learning/reward-authoring.d.ts.map +1 -1
- package/dist/types/learning/transport.d.ts +49 -0
- package/dist/types/learning/transport.d.ts.map +1 -1
- package/package.json +2 -2
- package/schemas/learning/v1/command-request.schema.json +119 -93
- package/schemas/learning/v1/dispatch.schema.json +100 -1
- package/schemas/learning/v1/evidence.schema.json +3 -0
- package/schemas/learning/v1/example-submission.schema.json +3 -0
- package/schemas/learning/v1/source.schema.json +20 -0
|
@@ -88,7 +88,7 @@ export function taskRecordFromEvidence(evidence, definition) {
|
|
|
88
88
|
return TaskRecordSchema.parse({
|
|
89
89
|
id: evidence.id, clusterKey: evidence.submission.familyKey, split: evidence.submission.split,
|
|
90
90
|
input: evidence.submission.input, expectedOutput: evidence.submission.expected,
|
|
91
|
-
policyVisibleContext: { instructions: definition.instructions },
|
|
91
|
+
policyVisibleContext: evidence.submission.policyVisibleContext ?? { instructions: definition.instructions },
|
|
92
92
|
privilegedContextRef: evidence.submission.evaluatorContext === null ? null : `task-evidence:${evidence.contentHash}`,
|
|
93
93
|
artifactRefs: evidence.submission.assets, tags: [definition.category],
|
|
94
94
|
...(requiredOutputs === undefined ? {} : { requiredOutputs }),
|
|
@@ -89,6 +89,13 @@ export const LearningReviewOriginSchema = z
|
|
|
89
89
|
rewardBinding: LearningRevisionRefSchema,
|
|
90
90
|
})
|
|
91
91
|
.strict();
|
|
92
|
+
/** A host must verify this retained import receipt before resolving package
|
|
93
|
+
* bytes. This portable reference is neither an approval nor an access grant. */
|
|
94
|
+
export const LearningDatasetOriginSchema = z.object({
|
|
95
|
+
receiptId: ReleaseIdSchema,
|
|
96
|
+
packageHash: ReleaseHashSchema,
|
|
97
|
+
taskset: LearningRevisionRefSchema,
|
|
98
|
+
}).strict();
|
|
92
99
|
export const LearningSourceContentSchema = z
|
|
93
100
|
.object({
|
|
94
101
|
schemaVersion: z.literal("openpond.learningSource.v1"),
|
|
@@ -102,6 +109,7 @@ export const LearningSourceContentSchema = z
|
|
|
102
109
|
mapping: TaskSourceMappingSchema.nullable(),
|
|
103
110
|
adapterVersion: z.string().trim().min(1).max(200).nullable(),
|
|
104
111
|
reviewOrigin: LearningReviewOriginSchema.optional(),
|
|
112
|
+
datasetOrigin: LearningDatasetOriginSchema.optional(),
|
|
105
113
|
/** Host-retained authorization for materializing neutral conversation
|
|
106
114
|
* evidence. The receipt is reauthorized at preparation and paid admission;
|
|
107
115
|
* this portable reference alone never grants access or training consent. */
|
|
@@ -115,6 +123,8 @@ export const LearningSourceContentSchema = z
|
|
|
115
123
|
})
|
|
116
124
|
.strict()
|
|
117
125
|
.superRefine((source, context) => {
|
|
126
|
+
if (source.datasetOrigin && (source.reviewOrigin || source.capturedOrigin))
|
|
127
|
+
context.addIssue({ code: "custom", path: ["datasetOrigin"], message: "Choose one retained source origin." });
|
|
118
128
|
if (source.kind !== "direct" && !source.mapping)
|
|
119
129
|
context.addIssue({
|
|
120
130
|
code: "custom",
|
|
@@ -149,6 +159,8 @@ export const TaskExampleSubmissionSchema = z
|
|
|
149
159
|
familyKey: ReleaseIdSchema.nullable(),
|
|
150
160
|
split: TaskSplitSchema,
|
|
151
161
|
input: LearningJsonObjectSchema,
|
|
162
|
+
/** Per-example policy context remains separate from evaluator-only data. */
|
|
163
|
+
policyVisibleContext: LearningJsonObjectSchema.optional(),
|
|
152
164
|
observedOutput: LearningJsonObjectSchema.nullable(),
|
|
153
165
|
expected: LearningJsonObjectSchema.nullable(),
|
|
154
166
|
evaluatorContext: LearningJsonObjectSchema.nullable(),
|
package/dist/learning/index.js
CHANGED
|
@@ -25,6 +25,7 @@ export * from "./reward-fixture-executor.js";
|
|
|
25
25
|
export * from "./iteration-reservation-contracts.js";
|
|
26
26
|
export * from "./iteration-dispatch-contracts.js";
|
|
27
27
|
export * from "./iteration-dispatch-worker.js";
|
|
28
|
+
export * from "./iteration-dispatch-deferral.js";
|
|
28
29
|
export * from "./iteration-candidate-decision.js";
|
|
29
30
|
export { resolveLearningTrainingParent } from "./iteration-training-parent.js";
|
|
30
31
|
export * from "./schedule-contracts.js";
|
|
@@ -22,7 +22,7 @@ export async function commandLearningIterationDispatch(tx, input, now) {
|
|
|
22
22
|
const resumed = LearningIterationDispatchSchema.parse({ ...dispatch, revision: dispatch.revision + 1,
|
|
23
23
|
state: dispatch.execution ? "submitted" : dispatch.submission ? "prepared" : "preparing",
|
|
24
24
|
cancelRequestedAt: cancelling ? dispatch.cancelRequestedAt ?? now : null,
|
|
25
|
-
consecutiveFailures: 0, nextAttemptAt: null, lastError: null, updatedAt: now });
|
|
25
|
+
consecutiveFailures: 0, nextAttemptAt: null, lastError: null, admission: null, updatedAt: now });
|
|
26
26
|
// Preserve an in-flight lease. Its owner observes cancellation on the next
|
|
27
27
|
// transition, and a replacement worker may claim only after that lease ends.
|
|
28
28
|
await tx.put("dispatch", resumed, dispatch.revision, { parentId: iteration.id, status: resumed.state });
|
|
@@ -8,6 +8,24 @@ export const LearningIterationSubmissionSchema = z.object({
|
|
|
8
8
|
protocol: ReleaseIdSchema,
|
|
9
9
|
payload: LearningJsonObjectSchema,
|
|
10
10
|
}).strict();
|
|
11
|
+
/** Normal capacity/calendar waits are not failed execution attempts. */
|
|
12
|
+
export const LearningIterationAdmissionSchema = z.discriminatedUnion("status", [
|
|
13
|
+
z.object({ status: z.literal("ready") }).strict(),
|
|
14
|
+
z.object({ status: z.literal("deferred"), retryAt: ReleaseTimestampSchema,
|
|
15
|
+
reason: z.string().trim().min(1).max(2_000) }).strict(),
|
|
16
|
+
]);
|
|
17
|
+
/** The execution owner has durably rejected/fenced this exact attempt before
|
|
18
|
+
* creating an execution or spending. A timeout/absence read is not this proof. */
|
|
19
|
+
export const LearningIterationSubmissionDeferralSchema = z.object({
|
|
20
|
+
scope: ReleaseIdSchema,
|
|
21
|
+
dispatchId: ReleaseIdSchema,
|
|
22
|
+
submissionHash: z.string().regex(/^[a-f0-9]{64}$/),
|
|
23
|
+
leaseGeneration: z.number().int().positive(),
|
|
24
|
+
status: z.literal("deferred"),
|
|
25
|
+
retryAt: ReleaseTimestampSchema,
|
|
26
|
+
reason: z.string().trim().min(1).max(2_000),
|
|
27
|
+
receipt: ImmutableReleaseRefSchema,
|
|
28
|
+
}).strict();
|
|
11
29
|
export const LearningIterationDispatchSchema = z.object({
|
|
12
30
|
schemaVersion: z.literal("openpond.learningIterationDispatch.v1"),
|
|
13
31
|
id: ReleaseIdSchema,
|
|
@@ -28,6 +46,8 @@ export const LearningIterationDispatchSchema = z.object({
|
|
|
28
46
|
leaseExpiresAt: ReleaseTimestampSchema.nullable(),
|
|
29
47
|
consecutiveFailures: z.number().int().nonnegative(),
|
|
30
48
|
nextAttemptAt: ReleaseTimestampSchema.nullable(),
|
|
49
|
+
admission: LearningIterationAdmissionSchema.nullable().optional(),
|
|
50
|
+
lastSubmissionDeferral: LearningIterationSubmissionDeferralSchema.optional(),
|
|
31
51
|
lastError: z.string().max(20_000).nullable(),
|
|
32
52
|
createdAt: ReleaseTimestampSchema,
|
|
33
53
|
updatedAt: ReleaseTimestampSchema,
|
|
@@ -37,6 +57,13 @@ export const LearningIterationDispatchSchema = z.object({
|
|
|
37
57
|
}
|
|
38
58
|
if (value.submissionStartedAt && !value.submission)
|
|
39
59
|
context.addIssue({ code: "custom", path: ["submission"], message: "A started dispatch requires its persisted submission." });
|
|
60
|
+
if (value.admission?.status === "deferred" && (value.submissionStartedAt || value.state !== "prepared" || value.nextAttemptAt !== value.admission.retryAt)) {
|
|
61
|
+
context.addIssue({ code: "custom", path: ["admission"], message: "Admission deferral requires an unstarted prepared dispatch and its retry time." });
|
|
62
|
+
}
|
|
63
|
+
if (value.lastSubmissionDeferral && (value.lastSubmissionDeferral.dispatchId !== value.id ||
|
|
64
|
+
value.lastSubmissionDeferral.submissionHash !== value.submissionHash || value.lastSubmissionDeferral.leaseGeneration >= value.leaseGeneration)) {
|
|
65
|
+
context.addIssue({ code: "custom", path: ["lastSubmissionDeferral"], message: "A retained deferral must identify an earlier fenced attempt of this submission." });
|
|
66
|
+
}
|
|
40
67
|
if (value.execution && !value.submissionStartedAt)
|
|
41
68
|
context.addIssue({ code: "custom", path: ["execution"], message: "An execution requires a started dispatch." });
|
|
42
69
|
if (["prepared", "submitted"].includes(value.state) && !value.submission)
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { LearningIterationSchema } from "./contracts.js";
|
|
2
|
+
import { LearningDomainError } from "./errors.js";
|
|
3
|
+
import { LearningIterationDispatchSchema, LearningIterationSubmissionDeferralSchema } from "./iteration-dispatch-contracts.js";
|
|
4
|
+
/** Call under the dispatch's scope lock. The execution owner must first fence
|
|
5
|
+
* this attempt and prove no execution/charge exists. When the owner shares this
|
|
6
|
+
* repository, commit this mutation in its native admission transaction instead:
|
|
7
|
+
* late submits then fail the same generation fence as lease replacement.
|
|
8
|
+
*/
|
|
9
|
+
export async function deferLearningIterationSubmission(tx, scope, current, iteration, value, now) {
|
|
10
|
+
const outcome = LearningIterationSubmissionDeferralSchema.parse(value);
|
|
11
|
+
if (outcome.scope !== scope || outcome.dispatchId !== current.id || outcome.submissionHash !== current.submissionHash ||
|
|
12
|
+
outcome.leaseGeneration !== current.leaseGeneration || !current.submissionStartedAt || current.execution ||
|
|
13
|
+
current.state !== "prepared" || !current.leaseOwner ||
|
|
14
|
+
!current.leaseExpiresAt || Date.parse(current.leaseExpiresAt) <= Date.parse(now) ||
|
|
15
|
+
iteration.id !== current.iterationId || (iteration.status !== "dispatching" && !(current.cancelRequestedAt && iteration.status === "cancelling")))
|
|
16
|
+
throw new LearningDomainError("learning_submission_deferral_fenced", 409);
|
|
17
|
+
const retryAt = new Date(Math.max(Date.parse(outcome.retryAt), Date.parse(now) + 1_000)).toISOString();
|
|
18
|
+
const dispatch = LearningIterationDispatchSchema.parse({ ...current, revision: current.revision + 1,
|
|
19
|
+
submissionStartedAt: null, leaseGeneration: current.leaseGeneration + 1, leaseOwner: null, leaseExpiresAt: null,
|
|
20
|
+
admission: current.cancelRequestedAt ? null : { status: "deferred", reason: outcome.reason, retryAt },
|
|
21
|
+
nextAttemptAt: current.cancelRequestedAt ? null : retryAt, lastSubmissionDeferral: outcome,
|
|
22
|
+
consecutiveFailures: 0, lastError: null, updatedAt: now });
|
|
23
|
+
await tx.put("dispatch", dispatch, current.revision, { parentId: current.iterationId, status: dispatch.state });
|
|
24
|
+
if (iteration.failure)
|
|
25
|
+
await tx.put("iteration", LearningIterationSchema.parse({ ...iteration,
|
|
26
|
+
revision: iteration.revision + 1, failure: null, updatedAt: now }), iteration.revision, { parentId: current.chainId, status: iteration.status });
|
|
27
|
+
return dispatch;
|
|
28
|
+
}
|
|
@@ -2,8 +2,10 @@ import { contentHash } from "@openpond/harness";
|
|
|
2
2
|
import { LearningIterationSchema } from "./contracts.js";
|
|
3
3
|
import { LearningDomainError } from "./errors.js";
|
|
4
4
|
import { LearningChainSchema, LearningIterationReservationSchema } from "./iteration-reservation-contracts.js";
|
|
5
|
-
import { LearningIterationDispatchSchema, LearningIterationObservationSchema, LearningIterationSubmissionSchema, } from "./iteration-dispatch-contracts.js";
|
|
5
|
+
import { LearningIterationAdmissionSchema, LearningIterationDispatchSchema, LearningIterationObservationSchema, LearningIterationSubmissionSchema, } from "./iteration-dispatch-contracts.js";
|
|
6
6
|
import { requireLearningRelease, requireLearningResource } from "./repository.js";
|
|
7
|
+
import { deferLearningIterationSubmission } from "./iteration-dispatch-deferral.js";
|
|
8
|
+
import { LearningIterationSubmissionDeferralSchema } from "./iteration-dispatch-contracts.js";
|
|
7
9
|
const closed = new Set(["accepted", "rejected", "failed", "cancelled", "completed_without_candidate"]);
|
|
8
10
|
export function createLearningIterationWorker(repository, executor, options) {
|
|
9
11
|
const now = options.now ?? (() => new Date().toISOString());
|
|
@@ -20,7 +22,7 @@ export function createLearningIterationWorker(repository, executor, options) {
|
|
|
20
22
|
const stamp = now();
|
|
21
23
|
if (current?.state === "settled" || (current?.state === "blocked" && !current.cancelRequestedAt)
|
|
22
24
|
|| (current?.leaseExpiresAt && Date.parse(current.leaseExpiresAt) > Date.parse(stamp))
|
|
23
|
-
|| (current?.nextAttemptAt && Date.parse(current.nextAttemptAt) > Date.parse(stamp)))
|
|
25
|
+
|| (!current?.cancelRequestedAt && current?.nextAttemptAt && Date.parse(current.nextAttemptAt) > Date.parse(stamp)))
|
|
24
26
|
return null;
|
|
25
27
|
const policy = await requireLearningRelease(tx, "policy", iteration.policy);
|
|
26
28
|
if (policy.executionOwner !== options.executionOwner)
|
|
@@ -80,7 +82,7 @@ export function createLearningIterationWorker(repository, executor, options) {
|
|
|
80
82
|
});
|
|
81
83
|
await tx.put("iteration", updated, iteration.revision, { parentId: current.chainId, status });
|
|
82
84
|
await saveDispatch(tx, current, { state: terminal ? "settled" : "submitted", execution: outcome?.execution ?? current.execution,
|
|
83
|
-
terminalReceipt: outcome?.receipt ?? null, leaseOwner: null, leaseExpiresAt: null,
|
|
85
|
+
terminalReceipt: outcome?.receipt ?? null, leaseOwner: null, leaseExpiresAt: null, admission: null,
|
|
84
86
|
nextAttemptAt: terminal ? null : new Date(Date.parse(now()) + 5_000).toISOString(), consecutiveFailures: 0, lastError: null });
|
|
85
87
|
if (terminal) {
|
|
86
88
|
const reservation = await requireLearningResource(tx, "reservation", iteration.id);
|
|
@@ -124,6 +126,25 @@ export function createLearningIterationWorker(repository, executor, options) {
|
|
|
124
126
|
return read();
|
|
125
127
|
dispatch = prepared;
|
|
126
128
|
}
|
|
129
|
+
if (!dispatch.submissionStartedAt && !dispatch.cancelRequestedAt && executor.admit) {
|
|
130
|
+
const checkedAt = now();
|
|
131
|
+
const admission = LearningIterationAdmissionSchema.parse(await bounded(input => executor.admit(input)));
|
|
132
|
+
if (admission.status === "deferred") {
|
|
133
|
+
if (Date.parse(admission.retryAt) <= Date.parse(checkedAt))
|
|
134
|
+
throw new LearningDomainError("learning_admission_retry_time_invalid", 409);
|
|
135
|
+
await fenced(scope, dispatch, async (tx, current, iteration) => {
|
|
136
|
+
if (current.cancelRequestedAt)
|
|
137
|
+
return settle(tx, current, iteration, null);
|
|
138
|
+
const retryAt = new Date(Math.max(Date.parse(admission.retryAt), Date.parse(now()) + 1_000)).toISOString();
|
|
139
|
+
await saveDispatch(tx, current, { admission: { ...admission, retryAt }, nextAttemptAt: retryAt,
|
|
140
|
+
consecutiveFailures: 0, lastError: null, leaseOwner: null, leaseExpiresAt: null });
|
|
141
|
+
if (iteration.failure)
|
|
142
|
+
await tx.put("iteration", LearningIterationSchema.parse({ ...iteration,
|
|
143
|
+
revision: iteration.revision + 1, failure: null, updatedAt: now() }), iteration.revision, { parentId: current.chainId, status: iteration.status });
|
|
144
|
+
});
|
|
145
|
+
return read();
|
|
146
|
+
}
|
|
147
|
+
}
|
|
127
148
|
const starting = await fenced(scope, dispatch, async (tx, current, iteration) => {
|
|
128
149
|
if (current.cancelRequestedAt && !current.submissionStartedAt) {
|
|
129
150
|
await settle(tx, current, iteration, null);
|
|
@@ -134,7 +155,7 @@ export function createLearningIterationWorker(repository, executor, options) {
|
|
|
134
155
|
await saveDispatch(tx, current, { leaseOwner: null, leaseExpiresAt: null });
|
|
135
156
|
return null;
|
|
136
157
|
}
|
|
137
|
-
return saveDispatch(tx, current, { submissionStartedAt: current.submissionStartedAt ?? now() });
|
|
158
|
+
return saveDispatch(tx, current, { submissionStartedAt: current.submissionStartedAt ?? now(), admission: null });
|
|
138
159
|
});
|
|
139
160
|
if (!starting)
|
|
140
161
|
return read();
|
|
@@ -147,6 +168,14 @@ export function createLearningIterationWorker(repository, executor, options) {
|
|
|
147
168
|
dispatch = refreshed;
|
|
148
169
|
observed = dispatch.cancelRequestedAt ? await bounded(input => executor.cancel(input)) : await bounded(input => executor.submit(input));
|
|
149
170
|
}
|
|
171
|
+
if (observed.status === "deferred") {
|
|
172
|
+
const outcome = LearningIterationSubmissionDeferralSchema.parse(observed);
|
|
173
|
+
if (outcome.scope !== scope || outcome.dispatchId !== dispatch.id || outcome.submissionHash !== dispatch.submissionHash ||
|
|
174
|
+
outcome.leaseGeneration !== dispatch.leaseGeneration)
|
|
175
|
+
throw new LearningDomainError("learning_execution_identity_mismatch", 409);
|
|
176
|
+
await fenced(scope, dispatch, (tx, current, iteration) => deferLearningIterationSubmission(tx, scope, current, iteration, outcome, now()));
|
|
177
|
+
return read();
|
|
178
|
+
}
|
|
150
179
|
const outcome = LearningIterationObservationSchema.parse(observed);
|
|
151
180
|
if (outcome.scope !== scope || outcome.dispatchId !== dispatch.id || outcome.submissionHash !== dispatch.submissionHash
|
|
152
181
|
|| (dispatch.execution && contentHash(outcome.execution) !== contentHash(dispatch.execution)))
|
|
@@ -165,7 +194,7 @@ export function createLearningIterationWorker(repository, executor, options) {
|
|
|
165
194
|
const blocked = failures > acquired.policy.limits.maxRetries;
|
|
166
195
|
const message = (error instanceof Error ? error.message : "Learning dispatch failed.").slice(0, 20_000);
|
|
167
196
|
await saveDispatch(tx, current, { state: blocked ? "blocked" : current.state, consecutiveFailures: failures,
|
|
168
|
-
lastError: message, leaseOwner: null, leaseExpiresAt: null,
|
|
197
|
+
lastError: message, leaseOwner: null, leaseExpiresAt: null, admission: null,
|
|
169
198
|
nextAttemptAt: blocked ? null : new Date(Date.parse(now()) + Math.min(60_000, 1_000 * 2 ** Math.min(failures, 6))).toISOString() });
|
|
170
199
|
const updated = LearningIterationSchema.parse({ ...iteration, revision: iteration.revision + 1, retryCount: iteration.retryCount + 1,
|
|
171
200
|
failure: { code: blocked ? "learning_dispatch_attention_required" : "learning_dispatch_retry_pending", message }, updatedAt: now() });
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RewardReleaseSchema, createRewardRelease
|
|
1
|
+
import { RewardReleaseSchema, createRewardRelease } from "../rewards.js";
|
|
2
2
|
import { assertBoundedTaskJson } from "../task-schema.js";
|
|
3
3
|
import { RewardAuthoringFieldsSchema, RewardFixtureAuthoringFieldsSchema } from "./authoring.js";
|
|
4
4
|
import { createLearningTextAsset, verifyLearningTextAsset } from "./assets.js";
|
|
@@ -65,7 +65,9 @@ export function compileRewardAuthoring(input) {
|
|
|
65
65
|
const assets = [...(asset ? [asset] : []), ...(fixtureAsset ? [fixtureAsset] : [])];
|
|
66
66
|
const reward = createRewardRelease({
|
|
67
67
|
schemaVersion: "openpond.rewardRelease.v1", id: input.id, revision: (base?.revision ?? 0) + 1,
|
|
68
|
-
|
|
68
|
+
// Derived defaults belong to feedbackKeyForReward at read time. Adding an
|
|
69
|
+
// unauthored field here changes the immutable calibration snapshot.
|
|
70
|
+
name: fields.name, description: fields.description, ...(fields.feedbackKey === undefined ? {} : { feedbackKey: fields.feedbackKey }), implementation,
|
|
69
71
|
rawScore: fields.kind === "learned_model" ? { minimum: authoringNumber(fields.minimum, "Minimum score"), maximum: authoringNumber(fields.maximum, "Maximum score") } : { minimum: 0, maximum: 1 },
|
|
70
72
|
assets: assets.map(value => value.asset), ...(fixtureAsset ? { fixtureSetRef: fixtureAsset.asset } : {}),
|
|
71
73
|
...(calibrationCheckRef ? { calibrationCheckRef } : {}),
|
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
import { type JavaScriptIsolateInput } from "./javascript-isolate.js";
|
|
2
|
+
/** Created only by the trusted parent wall timer, never from guest error text.
|
|
3
|
+
* The process executor rejects with this error only after child exit. */
|
|
4
|
+
export declare class JavaScriptVerifierHostTimeoutError extends Error {
|
|
5
|
+
readonly timeoutMs: number;
|
|
6
|
+
readonly elapsedMs: number;
|
|
7
|
+
constructor(timeoutMs: number, elapsedMs: number);
|
|
8
|
+
}
|
|
2
9
|
/** A Node subprocess owns the interpreter; completion always waits for its exit. */
|
|
3
10
|
export declare function executeJavaScriptIsolateInProcess(input: JavaScriptIsolateInput & {
|
|
4
11
|
stripTypeScript?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"javascript-isolate-process.d.ts","sourceRoot":"","sources":["../../src/javascript-isolate-process.ts"],"names":[],"mappings":"AACA,OAAO,EAAmE,KAAK,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAGvI,oFAAoF;AACpF,wBAAsB,iCAAiC,CAAC,KAAK,EAAE,sBAAsB,GAAG;IAAE,eAAe,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,OAAO,CAAC,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"javascript-isolate-process.d.ts","sourceRoot":"","sources":["../../src/javascript-isolate-process.ts"],"names":[],"mappings":"AACA,OAAO,EAAmE,KAAK,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAGvI;yEACyE;AACzE,qBAAa,kCAAmC,SAAQ,KAAK;IAC/C,QAAQ,CAAC,SAAS,EAAE,MAAM;IAAE,QAAQ,CAAC,SAAS,EAAE,MAAM;IAAlE,YAAqB,SAAS,EAAE,MAAM,EAAW,SAAS,EAAE,MAAM,EAGjE;CACF;AAED,oFAAoF;AACpF,wBAAsB,iCAAiC,CAAC,KAAK,EAAE,sBAAsB,GAAG;IAAE,eAAe,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,OAAO,CAAC,OAAO,CAAC,CA8EvI"}
|
|
@@ -12,6 +12,8 @@ export declare class JavaScriptIsolateExecutionError extends Error {
|
|
|
12
12
|
constructor(message: string);
|
|
13
13
|
}
|
|
14
14
|
/** Authored code is interpreter data, with no host functions or module loader. */
|
|
15
|
-
export declare function executeJavaScriptIsolate(input: JavaScriptIsolateInput
|
|
15
|
+
export declare function executeJavaScriptIsolate(input: JavaScriptIsolateInput, host?: {
|
|
16
|
+
onExecutionReady(): void;
|
|
17
|
+
}): Promise<unknown>;
|
|
16
18
|
export declare function validateJavaScriptIsolateInput(input: JavaScriptIsolateInput): void;
|
|
17
19
|
//# sourceMappingURL=javascript-isolate.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"javascript-isolate.d.ts","sourceRoot":"","sources":["../../src/javascript-isolate.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,OAAO,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,WAAW,EAAE,UAAU,GAAG,aAAa,GAAG,WAAW,GAAG,QAAQ,CAAC;CAClE;AAED,qBAAa,+BAAgC,SAAQ,KAAK;IACxD,YAAY,OAAO,EAAE,MAAM,EAAoE;CAChG;AAED,kFAAkF;AAClF,wBAAsB,wBAAwB,CAAC,KAAK,EAAE,sBAAsB,GAAG,OAAO,CAAC,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"javascript-isolate.d.ts","sourceRoot":"","sources":["../../src/javascript-isolate.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,OAAO,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,WAAW,EAAE,UAAU,GAAG,aAAa,GAAG,WAAW,GAAG,QAAQ,CAAC;CAClE;AAED,qBAAa,+BAAgC,SAAQ,KAAK;IACxD,YAAY,OAAO,EAAE,MAAM,EAAoE;CAChG;AAED,kFAAkF;AAClF,wBAAsB,wBAAwB,CAAC,KAAK,EAAE,sBAAsB,EAAE,IAAI,CAAC,EAAE;IAAE,gBAAgB,IAAI,IAAI,CAAA;CAAE,GAAG,OAAO,CAAC,OAAO,CAAC,CA0CnI;AAED,wBAAgB,8BAA8B,CAAC,KAAK,EAAE,sBAAsB,GAAG,IAAI,CAKlF"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { executeJavaScriptVerifier } from "./javascript-verifier.js";
|
|
2
2
|
import { type JavaScriptVerifierResult } from "./javascript-verifier-contract.js";
|
|
3
|
+
export { JavaScriptVerifierHostTimeoutError } from "./javascript-isolate-process.js";
|
|
3
4
|
/** Resolves/rejects only after the execution owner has stopped the worker. */
|
|
4
5
|
export declare function executeJavaScriptVerifierInWorker(input: Parameters<typeof executeJavaScriptVerifier>[0]): Promise<JavaScriptVerifierResult>;
|
|
5
6
|
/** Uses a Node child process and waits for exit on success, failure, or cancellation. */
|
|
@@ -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,EAAiE,KAAK,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;
|
|
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;AAGjJ,OAAO,EAAE,kCAAkC,EAAE,MAAM,iCAAiC,CAAC;AAErF,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"}
|
|
@@ -306,6 +306,7 @@ export declare function prepareLearningBatch(transaction: LearningTransaction, i
|
|
|
306
306
|
familyKey: string | null;
|
|
307
307
|
split: "frozen_eval" | "test" | "train" | "validation";
|
|
308
308
|
input: Record<string, import("zod").JSONType>;
|
|
309
|
+
policyVisibleContext?: Record<string, import("zod").JSONType> | undefined;
|
|
309
310
|
observedOutput: Record<string, import("zod").JSONType> | null;
|
|
310
311
|
expected: Record<string, import("zod").JSONType> | null;
|
|
311
312
|
evaluatorContext: Record<string, import("zod").JSONType> | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"batch-service.d.ts","sourceRoot":"","sources":["../../../src/learning/batch-service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAgC,KAAK,mBAAmB,EAAE,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE3G,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAA8E,KAAK,uBAAuB,EAAE,KAAK,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAErK,wBAAsB,iBAAiB,CAAC,WAAW,EAAE,mBAAmB,EAAE,KAAK,EAAE,OAAO,CAAC,eAAe,EAAE;IAAE,MAAM,EAAE,YAAY,CAAA;CAAE,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,uBAAuB,EAAE,CAAC,CAQ3M;AAED,kGAAkG;AAClG,wBAAsB,oBAAoB,CAAC,WAAW,EAAE,mBAAmB,EAAE,KAAK,EAAE,OAAO,CAAC,eAAe,EAAE;IAAE,MAAM,EAAE,YAAY,CAAA;CAAE,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM
|
|
1
|
+
{"version":3,"file":"batch-service.d.ts","sourceRoot":"","sources":["../../../src/learning/batch-service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAgC,KAAK,mBAAmB,EAAE,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE3G,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAA8E,KAAK,uBAAuB,EAAE,KAAK,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAErK,wBAAsB,iBAAiB,CAAC,WAAW,EAAE,mBAAmB,EAAE,KAAK,EAAE,OAAO,CAAC,eAAe,EAAE;IAAE,MAAM,EAAE,YAAY,CAAA;CAAE,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,uBAAuB,EAAE,CAAC,CAQ3M;AAED,kGAAkG;AAClG,wBAAsB,oBAAoB,CAAC,WAAW,EAAE,mBAAmB,EAAE,KAAK,EAAE,OAAO,CAAC,eAAe,EAAE;IAAE,MAAM,EAAE,YAAY,CAAA;CAAE,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsBzK;AAED,wBAAsB,8BAA8B,CAAC,WAAW,EAAE,mBAAmB,EAAE,GAAG,EAAE,mBAAmB,GAAG,OAAO,CAAC,YAAY,CAAC,CAKtI"}
|
|
@@ -265,6 +265,17 @@ export declare const LearningReviewOriginSchema: z.ZodObject<{
|
|
|
265
265
|
revision: z.ZodNumber;
|
|
266
266
|
}, z.core.$strict>;
|
|
267
267
|
}, z.core.$strict>;
|
|
268
|
+
/** A host must verify this retained import receipt before resolving package
|
|
269
|
+
* bytes. This portable reference is neither an approval nor an access grant. */
|
|
270
|
+
export declare const LearningDatasetOriginSchema: z.ZodObject<{
|
|
271
|
+
receiptId: z.ZodString;
|
|
272
|
+
packageHash: z.ZodString;
|
|
273
|
+
taskset: z.ZodObject<{
|
|
274
|
+
id: z.ZodString;
|
|
275
|
+
contentHash: z.ZodString;
|
|
276
|
+
revision: z.ZodNumber;
|
|
277
|
+
}, z.core.$strict>;
|
|
278
|
+
}, z.core.$strict>;
|
|
268
279
|
export declare const LearningSourceContentSchema: z.ZodObject<{
|
|
269
280
|
schemaVersion: z.ZodLiteral<"openpond.learningSource.v1">;
|
|
270
281
|
id: z.ZodString;
|
|
@@ -326,6 +337,15 @@ export declare const LearningSourceContentSchema: z.ZodObject<{
|
|
|
326
337
|
revision: z.ZodNumber;
|
|
327
338
|
}, z.core.$strict>;
|
|
328
339
|
}, z.core.$strict>>;
|
|
340
|
+
datasetOrigin: z.ZodOptional<z.ZodObject<{
|
|
341
|
+
receiptId: z.ZodString;
|
|
342
|
+
packageHash: z.ZodString;
|
|
343
|
+
taskset: z.ZodObject<{
|
|
344
|
+
id: z.ZodString;
|
|
345
|
+
contentHash: z.ZodString;
|
|
346
|
+
revision: z.ZodNumber;
|
|
347
|
+
}, z.core.$strict>;
|
|
348
|
+
}, z.core.$strict>>;
|
|
329
349
|
capturedOrigin: z.ZodOptional<z.ZodObject<{
|
|
330
350
|
receiptId: z.ZodString;
|
|
331
351
|
ownerUserId: z.ZodString;
|
|
@@ -399,6 +419,15 @@ export declare const LearningSourceSchema: z.ZodObject<{
|
|
|
399
419
|
revision: z.ZodNumber;
|
|
400
420
|
}, z.core.$strict>;
|
|
401
421
|
}, z.core.$strict>>;
|
|
422
|
+
datasetOrigin: z.ZodOptional<z.ZodObject<{
|
|
423
|
+
receiptId: z.ZodString;
|
|
424
|
+
packageHash: z.ZodString;
|
|
425
|
+
taskset: z.ZodObject<{
|
|
426
|
+
id: z.ZodString;
|
|
427
|
+
contentHash: z.ZodString;
|
|
428
|
+
revision: z.ZodNumber;
|
|
429
|
+
}, z.core.$strict>;
|
|
430
|
+
}, z.core.$strict>>;
|
|
402
431
|
capturedOrigin: z.ZodOptional<z.ZodObject<{
|
|
403
432
|
receiptId: z.ZodString;
|
|
404
433
|
ownerUserId: z.ZodString;
|
|
@@ -432,6 +461,7 @@ export declare const TaskExampleSubmissionSchema: z.ZodObject<{
|
|
|
432
461
|
validation: "validation";
|
|
433
462
|
}>;
|
|
434
463
|
input: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
|
|
464
|
+
policyVisibleContext: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
|
|
435
465
|
observedOutput: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
|
|
436
466
|
expected: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
|
|
437
467
|
evaluatorContext: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
|
|
@@ -500,6 +530,7 @@ export declare const TaskEvidenceContentSchema: z.ZodObject<{
|
|
|
500
530
|
validation: "validation";
|
|
501
531
|
}>;
|
|
502
532
|
input: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
|
|
533
|
+
policyVisibleContext: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
|
|
503
534
|
observedOutput: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
|
|
504
535
|
expected: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
|
|
505
536
|
evaluatorContext: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
|
|
@@ -576,6 +607,7 @@ export declare const TaskEvidenceSchema: z.ZodObject<{
|
|
|
576
607
|
validation: "validation";
|
|
577
608
|
}>;
|
|
578
609
|
input: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
|
|
610
|
+
policyVisibleContext: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
|
|
579
611
|
observedOutput: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
|
|
580
612
|
expected: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
|
|
581
613
|
evaluatorContext: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
|
|
@@ -2684,6 +2716,15 @@ export declare const LearningResourceSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
2684
2716
|
revision: z.ZodNumber;
|
|
2685
2717
|
}, z.core.$strict>;
|
|
2686
2718
|
}, z.core.$strict>>;
|
|
2719
|
+
datasetOrigin: z.ZodOptional<z.ZodObject<{
|
|
2720
|
+
receiptId: z.ZodString;
|
|
2721
|
+
packageHash: z.ZodString;
|
|
2722
|
+
taskset: z.ZodObject<{
|
|
2723
|
+
id: z.ZodString;
|
|
2724
|
+
contentHash: z.ZodString;
|
|
2725
|
+
revision: z.ZodNumber;
|
|
2726
|
+
}, z.core.$strict>;
|
|
2727
|
+
}, z.core.$strict>>;
|
|
2687
2728
|
capturedOrigin: z.ZodOptional<z.ZodObject<{
|
|
2688
2729
|
receiptId: z.ZodString;
|
|
2689
2730
|
ownerUserId: z.ZodString;
|
|
@@ -2725,6 +2766,7 @@ export declare const LearningResourceSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
2725
2766
|
validation: "validation";
|
|
2726
2767
|
}>;
|
|
2727
2768
|
input: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
|
|
2769
|
+
policyVisibleContext: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
|
|
2728
2770
|
observedOutput: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
|
|
2729
2771
|
expected: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
|
|
2730
2772
|
evaluatorContext: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../../../src/learning/contracts.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAqBxB,eAAO,MAAM,wBAAwB,2CAAiC,CAAC;AACvE,eAAO,MAAM,yBAAyB;;;;kBAAyB,CAAC;AAChE,eAAO,MAAM,yBAAyB,aAMnC,CAAC;AAEJ,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAgDpC,CAAC;AACL,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAEtB,CAAC;AAEZ,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;kBAazB,CAAC;AACZ;0EAC0E;AAC1E,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;kBAQ5B,CAAC;AACZ,eAAO,MAAM,2BAA2B
|
|
1
|
+
{"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../../../src/learning/contracts.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAqBxB,eAAO,MAAM,wBAAwB,2CAAiC,CAAC;AACvE,eAAO,MAAM,yBAAyB;;;;kBAAyB,CAAC;AAChE,eAAO,MAAM,yBAAyB,aAMnC,CAAC;AAEJ,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAgDpC,CAAC;AACL,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;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E,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAC9D,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AACtE,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE5E,wBAAgB,WAAW,CAAC,QAAQ,EAAE;IACpC,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;CACrB,GAAG,mBAAmB,CAMtB;AACD,wBAAgB,eAAe,CAAC,IAAI,EAAE,mBAAmB,EAAE,KAAK,EAAE,mBAAmB,GAAG,OAAO,CAM9F;AACD,wBAAgB,mBAAmB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACnE,OAAO,EAAE,CAAC,GACT,CAAC,GAAG;IAAE,WAAW,EAAE,MAAM,CAAA;CAAE,CAG7B;AACD,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE;IAAE,WAAW,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAKjF"}
|
|
@@ -25,6 +25,7 @@ export * from "./reward-fixture-executor.js";
|
|
|
25
25
|
export * from "./iteration-reservation-contracts.js";
|
|
26
26
|
export * from "./iteration-dispatch-contracts.js";
|
|
27
27
|
export * from "./iteration-dispatch-worker.js";
|
|
28
|
+
export * from "./iteration-dispatch-deferral.js";
|
|
28
29
|
export * from "./iteration-candidate-decision.js";
|
|
29
30
|
export { resolveLearningTrainingParent } from "./iteration-training-parent.js";
|
|
30
31
|
export * from "./schedule-contracts.js";
|
|
@@ -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,gBAA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
8
8
|
}, z.core.$strict>;
|
|
9
|
+
/** Normal capacity/calendar waits are not failed execution attempts. */
|
|
10
|
+
export declare const LearningIterationAdmissionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
11
|
+
status: z.ZodLiteral<"ready">;
|
|
12
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
13
|
+
status: z.ZodLiteral<"deferred">;
|
|
14
|
+
retryAt: z.ZodString;
|
|
15
|
+
reason: z.ZodString;
|
|
16
|
+
}, z.core.$strict>], "status">;
|
|
17
|
+
/** The execution owner has durably rejected/fenced this exact attempt before
|
|
18
|
+
* creating an execution or spending. A timeout/absence read is not this proof. */
|
|
19
|
+
export declare const LearningIterationSubmissionDeferralSchema: z.ZodObject<{
|
|
20
|
+
scope: z.ZodString;
|
|
21
|
+
dispatchId: z.ZodString;
|
|
22
|
+
submissionHash: z.ZodString;
|
|
23
|
+
leaseGeneration: z.ZodNumber;
|
|
24
|
+
status: z.ZodLiteral<"deferred">;
|
|
25
|
+
retryAt: z.ZodString;
|
|
26
|
+
reason: z.ZodString;
|
|
27
|
+
receipt: z.ZodObject<{
|
|
28
|
+
id: z.ZodString;
|
|
29
|
+
contentHash: z.ZodString;
|
|
30
|
+
}, z.core.$strict>;
|
|
31
|
+
}, z.core.$strict>;
|
|
32
|
+
export type LearningIterationSubmissionDeferral = z.infer<typeof LearningIterationSubmissionDeferralSchema>;
|
|
9
33
|
export declare const LearningIterationDispatchSchema: z.ZodObject<{
|
|
10
34
|
schemaVersion: z.ZodLiteral<"openpond.learningIterationDispatch.v1">;
|
|
11
35
|
id: z.ZodString;
|
|
@@ -50,6 +74,26 @@ export declare const LearningIterationDispatchSchema: z.ZodObject<{
|
|
|
50
74
|
leaseExpiresAt: z.ZodNullable<z.ZodString>;
|
|
51
75
|
consecutiveFailures: z.ZodNumber;
|
|
52
76
|
nextAttemptAt: z.ZodNullable<z.ZodString>;
|
|
77
|
+
admission: z.ZodOptional<z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
78
|
+
status: z.ZodLiteral<"ready">;
|
|
79
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
80
|
+
status: z.ZodLiteral<"deferred">;
|
|
81
|
+
retryAt: z.ZodString;
|
|
82
|
+
reason: z.ZodString;
|
|
83
|
+
}, z.core.$strict>], "status">>>;
|
|
84
|
+
lastSubmissionDeferral: z.ZodOptional<z.ZodObject<{
|
|
85
|
+
scope: z.ZodString;
|
|
86
|
+
dispatchId: z.ZodString;
|
|
87
|
+
submissionHash: z.ZodString;
|
|
88
|
+
leaseGeneration: z.ZodNumber;
|
|
89
|
+
status: z.ZodLiteral<"deferred">;
|
|
90
|
+
retryAt: z.ZodString;
|
|
91
|
+
reason: z.ZodString;
|
|
92
|
+
receipt: z.ZodObject<{
|
|
93
|
+
id: z.ZodString;
|
|
94
|
+
contentHash: z.ZodString;
|
|
95
|
+
}, z.core.$strict>;
|
|
96
|
+
}, z.core.$strict>>;
|
|
53
97
|
lastError: z.ZodNullable<z.ZodString>;
|
|
54
98
|
createdAt: z.ZodString;
|
|
55
99
|
updatedAt: z.ZodString;
|
|
@@ -90,4 +134,5 @@ export declare const LearningIterationObservationSchema: z.ZodObject<{
|
|
|
90
134
|
export type LearningIterationSubmission = z.infer<typeof LearningIterationSubmissionSchema>;
|
|
91
135
|
export type LearningIterationDispatch = z.infer<typeof LearningIterationDispatchSchema>;
|
|
92
136
|
export type LearningIterationObservation = z.infer<typeof LearningIterationObservationSchema>;
|
|
137
|
+
export type LearningIterationAdmission = z.infer<typeof LearningIterationAdmissionSchema>;
|
|
93
138
|
//# sourceMappingURL=iteration-dispatch-contracts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"iteration-dispatch-contracts.d.ts","sourceRoot":"","sources":["../../../src/learning/iteration-dispatch-contracts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB;kFACkF;AAClF,eAAO,MAAM,iCAAiC;;;;kBAInC,CAAC;AAEZ,eAAO,MAAM,+BAA+B
|
|
1
|
+
{"version":3,"file":"iteration-dispatch-contracts.d.ts","sourceRoot":"","sources":["../../../src/learning/iteration-dispatch-contracts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB;kFACkF;AAClF,eAAO,MAAM,iCAAiC;;;;kBAInC,CAAC;AAEZ,wEAAwE;AACxE,eAAO,MAAM,gCAAgC;;;;;;8BAI3C,CAAC;AAEH;kFACkF;AAClF,eAAO,MAAM,yCAAyC;;;;;;;;;;;;kBAS3C,CAAC;AACZ,MAAM,MAAM,mCAAmC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yCAAyC,CAAC,CAAC;AAE5G,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBA0C1C,CAAC;AAEH;wEACwE;AACxE,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAkB7C,CAAC;AAEH,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAC;AAC5F,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC;AACxF,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAC;AAC9F,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { type LearningIteration } from "./contracts.js";
|
|
2
|
+
import { type LearningIterationDispatch } from "./iteration-dispatch-contracts.js";
|
|
3
|
+
import type { LearningTransaction } from "./repository.js";
|
|
4
|
+
/** Call under the dispatch's scope lock. The execution owner must first fence
|
|
5
|
+
* this attempt and prove no execution/charge exists. When the owner shares this
|
|
6
|
+
* repository, commit this mutation in its native admission transaction instead:
|
|
7
|
+
* late submits then fail the same generation fence as lease replacement.
|
|
8
|
+
*/
|
|
9
|
+
export declare function deferLearningIterationSubmission(tx: LearningTransaction, scope: string, current: LearningIterationDispatch, iteration: LearningIteration, value: unknown, now: string): Promise<{
|
|
10
|
+
schemaVersion: "openpond.learningIterationDispatch.v1";
|
|
11
|
+
id: string;
|
|
12
|
+
revision: number;
|
|
13
|
+
iterationId: string;
|
|
14
|
+
chainId: string;
|
|
15
|
+
policy: {
|
|
16
|
+
id: string;
|
|
17
|
+
contentHash: string;
|
|
18
|
+
revision: number;
|
|
19
|
+
};
|
|
20
|
+
batch: {
|
|
21
|
+
id: string;
|
|
22
|
+
contentHash: string;
|
|
23
|
+
revision: number;
|
|
24
|
+
};
|
|
25
|
+
state: "blocked" | "prepared" | "preparing" | "settled" | "submitted";
|
|
26
|
+
submission: {
|
|
27
|
+
provider: string;
|
|
28
|
+
protocol: string;
|
|
29
|
+
payload: Record<string, import("zod").JSONType>;
|
|
30
|
+
} | null;
|
|
31
|
+
submissionHash: string | null;
|
|
32
|
+
submissionStartedAt: string | null;
|
|
33
|
+
execution: {
|
|
34
|
+
id: string;
|
|
35
|
+
contentHash: string;
|
|
36
|
+
} | null;
|
|
37
|
+
terminalReceipt: {
|
|
38
|
+
id: string;
|
|
39
|
+
contentHash: string;
|
|
40
|
+
} | null;
|
|
41
|
+
cancelRequestedAt: string | null;
|
|
42
|
+
leaseOwner: string | null;
|
|
43
|
+
leaseGeneration: number;
|
|
44
|
+
leaseExpiresAt: string | null;
|
|
45
|
+
consecutiveFailures: number;
|
|
46
|
+
nextAttemptAt: string | null;
|
|
47
|
+
admission?: {
|
|
48
|
+
status: "ready";
|
|
49
|
+
} | {
|
|
50
|
+
status: "deferred";
|
|
51
|
+
retryAt: string;
|
|
52
|
+
reason: string;
|
|
53
|
+
} | null | undefined;
|
|
54
|
+
lastSubmissionDeferral?: {
|
|
55
|
+
scope: string;
|
|
56
|
+
dispatchId: string;
|
|
57
|
+
submissionHash: string;
|
|
58
|
+
leaseGeneration: number;
|
|
59
|
+
status: "deferred";
|
|
60
|
+
retryAt: string;
|
|
61
|
+
reason: string;
|
|
62
|
+
receipt: {
|
|
63
|
+
id: string;
|
|
64
|
+
contentHash: string;
|
|
65
|
+
};
|
|
66
|
+
} | undefined;
|
|
67
|
+
lastError: string | null;
|
|
68
|
+
createdAt: string;
|
|
69
|
+
updatedAt: string;
|
|
70
|
+
}>;
|
|
71
|
+
//# sourceMappingURL=iteration-dispatch-deferral.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"iteration-dispatch-deferral.d.ts","sourceRoot":"","sources":["../../../src/learning/iteration-dispatch-deferral.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2B,KAAK,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEjF,OAAO,EACL,KAAK,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AAC5E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAE3D;;;;GAIG;AACH,wBAAsB,gCAAgC,CAAC,EAAE,EAAE,mBAAmB,EAAE,KAAK,EAAE,MAAM,EAC3F,OAAO,EAAE,yBAAyB,EAAE,SAAS,EAAE,iBAAiB,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmB9F"}
|