openpond-sdk 0.11.4 → 0.11.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -0
- package/dist/advanced-refiner-evaluations.js +8 -8
- package/dist/candidate-evaluations.js +6 -7
- package/dist/{chunk-X64BSFXJ.js → chunk-2DLFHAGW.js} +7 -7
- package/dist/{chunk-SX767BS2.js → chunk-2G4WBMYI.js} +270 -60
- package/dist/chunk-2G4WBMYI.js.map +7 -0
- package/dist/{chunk-KJ5VENYN.js → chunk-35OVUYPI.js} +3 -3
- package/dist/{chunk-K4C5QOSV.js → chunk-3LP7DNLQ.js} +2 -2
- package/dist/{chunk-HKAR3VPB.js → chunk-4IWDOYKR.js} +2 -2
- package/dist/{chunk-HWLO3V7R.js → chunk-5GMY4TTF.js} +3 -3
- package/dist/{chunk-SLS3GFPG.js → chunk-AG5DDL7T.js} +2 -2
- package/dist/{chunk-QVCMFQKA.js → chunk-AQGFJLIV.js} +6 -6
- package/dist/chunk-COPVBJPL.js +272 -0
- package/dist/chunk-COPVBJPL.js.map +7 -0
- package/dist/{chunk-Z3PPZRK2.js → chunk-DUJXF7YI.js} +2 -2
- package/dist/{chunk-SGRYMU4C.js → chunk-DUPHBKVV.js} +3 -3
- package/dist/{chunk-CPEOFPPF.js → chunk-FDHIL2CV.js} +9 -6
- package/dist/chunk-FDHIL2CV.js.map +7 -0
- package/dist/{chunk-WPPHGWFA.js → chunk-FZH2M4G6.js} +4 -4
- package/dist/{chunk-GMVYYRMR.js → chunk-HAOPRFYQ.js} +3 -3
- package/dist/chunk-JOKRT4CK.js +296 -0
- package/dist/chunk-JOKRT4CK.js.map +7 -0
- package/dist/{chunk-6O3UMEJL.js → chunk-K2OH56BH.js} +7 -7
- package/dist/chunk-KAE7AMYE.js +44 -0
- package/dist/chunk-KAE7AMYE.js.map +7 -0
- package/dist/{chunk-JEUHIQWF.js → chunk-LQ5Q35IF.js} +6 -8
- package/dist/{chunk-JEUHIQWF.js.map → chunk-LQ5Q35IF.js.map} +2 -2
- package/dist/chunk-O4GE6VTR.js +378 -0
- package/dist/chunk-O4GE6VTR.js.map +7 -0
- package/dist/{chunk-YTGRET2L.js → chunk-P3BRSSRD.js} +3 -3
- package/dist/{chunk-MPAEWI5T.js → chunk-PHETIB6R.js} +3 -3
- package/dist/{chunk-5LFLXFPT.js → chunk-PMBBNQ2J.js} +3 -3
- package/dist/{chunk-MW2N3BX5.js → chunk-PXNHL3SH.js} +3 -3
- package/dist/{chunk-RIX56CJL.js → chunk-VEU3IXAQ.js} +2 -2
- package/dist/{chunk-RGGI5O4R.js → chunk-WTHJ3H4M.js} +4 -4
- package/dist/{chunk-RGGI5O4R.js.map → chunk-WTHJ3H4M.js.map} +2 -2
- package/dist/{chunk-55E4THHN.js → chunk-XYVPLV6Z.js} +6 -6
- package/dist/{chunk-4SZKRRTO.js → chunk-YGLTO26A.js} +3 -3
- package/dist/{chunk-6ZDQ7HSA.js → chunk-Z4JJS6KE.js} +3 -3
- package/dist/{chunk-LFH4EKWH.js → chunk-Z4OLAEPL.js} +5 -5
- package/dist/{chunk-OWWDSG27.js → chunk-ZOXHSJWU.js} +3 -3
- package/dist/connected-evidence.js +16 -15
- package/dist/dataset-workspaces.js +15 -14
- package/dist/dataset-workspaces.js.map +1 -1
- package/dist/experiment-evaluation-schedules.js +20 -19
- package/dist/experiment-improvements.js +8 -8
- package/dist/experiments.js +41 -20
- package/dist/human-review.js +2 -3
- package/dist/index.js +41 -40
- package/dist/index.js.map +1 -1
- package/dist/learning.js +2 -3
- package/dist/learning.js.map +1 -1
- package/dist/model-starter-attempts.js +2 -3
- package/dist/model-starter-catalog.js +11 -10
- package/dist/model-starter-catalog.js.map +1 -1
- package/dist/model-starters.js +11 -10
- package/dist/model-taskset-runs.js +3 -4
- package/dist/model-taskset-runs.js.map +1 -1
- package/dist/post-training.js +6 -7
- package/dist/refiner.js +2 -2
- package/dist/taskset-drafts.js +13 -12
- package/dist/taskset-drafts.js.map +1 -1
- package/dist/taskset-packages.js +17 -16
- package/dist/training-bundle.js +15 -14
- package/dist/training-bundle.js.map +1 -1
- package/dist/training-projects.js +1 -2
- package/dist/training-projects.js.map +1 -1
- package/dist/training.js +8 -8
- package/dist/types/packages/sdk/src/advanced-refiner-evaluations.d.ts +6 -6
- package/dist/types/packages/sdk/src/connected-evidence-client.d.ts +2 -2
- package/dist/types/packages/sdk/src/dataset-workspace-client.d.ts +7 -7
- package/dist/types/packages/sdk/src/dataset-workspace-contracts.d.ts +4 -4
- package/dist/types/packages/sdk/src/dataset-workspace-operations.d.ts +4 -4
- package/dist/types/packages/sdk/src/experiment-client.d.ts +107 -2
- package/dist/types/packages/sdk/src/experiment-client.d.ts.map +1 -1
- package/dist/types/packages/sdk/src/experiments.d.ts +1 -0
- package/dist/types/packages/sdk/src/experiments.d.ts.map +1 -1
- package/dist/types/packages/sdk/src/model-starter-catalog.d.ts +4 -4
- package/dist/types/packages/sdk/src/model-starters.d.ts +5 -5
- package/dist/types/packages/sdk/src/model-taskset-runs-contracts.d.ts.map +1 -1
- package/dist/types/packages/sdk/src/run-diagnostics.d.ts +281 -0
- package/dist/types/packages/sdk/src/run-diagnostics.d.ts.map +1 -0
- package/dist/types/packages/sdk/src/taskset-authored-contracts.d.ts +6 -6
- package/dist/types/packages/sdk/src/taskset-authored-files.d.ts +2 -2
- package/dist/types/packages/sdk/src/taskset-authored-validation.d.ts +1 -0
- package/dist/types/packages/sdk/src/taskset-authored-validation.d.ts.map +1 -1
- package/dist/types/packages/sdk/src/taskset-draft-api-contracts.d.ts +4 -4
- package/dist/types/packages/sdk/src/taskset-draft-authoring.d.ts.map +1 -1
- package/dist/types/packages/sdk/src/taskset-draft-client.d.ts +6 -6
- package/dist/types/packages/sdk/src/taskset-draft-core.d.ts +4 -4
- package/dist/types/packages/sdk/src/taskset-draft-document.d.ts +2 -2
- package/dist/types/packages/sdk/src/taskset-draft-source.d.ts +3 -3
- package/dist/types/packages/sdk/src/taskset-draft-workspace.d.ts +4 -4
- package/dist/types/packages/sdk/src/taskset-package-grader-projection.d.ts +1 -1
- package/dist/types/packages/sdk/src/taskset-package-projection.d.ts +2 -2
- package/dist/types/packages/sdk/src/training-learning-batch.d.ts +4 -4
- package/package.json +3 -2
- package/dist/chunk-4NZW4LFB.js +0 -1635
- package/dist/chunk-4NZW4LFB.js.map +0 -7
- package/dist/chunk-CPEOFPPF.js.map +0 -7
- package/dist/chunk-LXXQVGQY.js +0 -1
- package/dist/chunk-LXXQVGQY.js.map +0 -7
- package/dist/chunk-QUOW6URQ.js +0 -591
- package/dist/chunk-QUOW6URQ.js.map +0 -7
- package/dist/chunk-SX767BS2.js.map +0 -7
- /package/dist/{chunk-X64BSFXJ.js.map → chunk-2DLFHAGW.js.map} +0 -0
- /package/dist/{chunk-KJ5VENYN.js.map → chunk-35OVUYPI.js.map} +0 -0
- /package/dist/{chunk-K4C5QOSV.js.map → chunk-3LP7DNLQ.js.map} +0 -0
- /package/dist/{chunk-HKAR3VPB.js.map → chunk-4IWDOYKR.js.map} +0 -0
- /package/dist/{chunk-HWLO3V7R.js.map → chunk-5GMY4TTF.js.map} +0 -0
- /package/dist/{chunk-SLS3GFPG.js.map → chunk-AG5DDL7T.js.map} +0 -0
- /package/dist/{chunk-QVCMFQKA.js.map → chunk-AQGFJLIV.js.map} +0 -0
- /package/dist/{chunk-Z3PPZRK2.js.map → chunk-DUJXF7YI.js.map} +0 -0
- /package/dist/{chunk-SGRYMU4C.js.map → chunk-DUPHBKVV.js.map} +0 -0
- /package/dist/{chunk-WPPHGWFA.js.map → chunk-FZH2M4G6.js.map} +0 -0
- /package/dist/{chunk-GMVYYRMR.js.map → chunk-HAOPRFYQ.js.map} +0 -0
- /package/dist/{chunk-6O3UMEJL.js.map → chunk-K2OH56BH.js.map} +0 -0
- /package/dist/{chunk-YTGRET2L.js.map → chunk-P3BRSSRD.js.map} +0 -0
- /package/dist/{chunk-MPAEWI5T.js.map → chunk-PHETIB6R.js.map} +0 -0
- /package/dist/{chunk-5LFLXFPT.js.map → chunk-PMBBNQ2J.js.map} +0 -0
- /package/dist/{chunk-MW2N3BX5.js.map → chunk-PXNHL3SH.js.map} +0 -0
- /package/dist/{chunk-RIX56CJL.js.map → chunk-VEU3IXAQ.js.map} +0 -0
- /package/dist/{chunk-55E4THHN.js.map → chunk-XYVPLV6Z.js.map} +0 -0
- /package/dist/{chunk-4SZKRRTO.js.map → chunk-YGLTO26A.js.map} +0 -0
- /package/dist/{chunk-6ZDQ7HSA.js.map → chunk-Z4JJS6KE.js.map} +0 -0
- /package/dist/{chunk-LFH4EKWH.js.map → chunk-Z4OLAEPL.js.map} +0 -0
- /package/dist/{chunk-OWWDSG27.js.map → chunk-ZOXHSJWU.js.map} +0 -0
package/README.md
CHANGED
|
@@ -372,3 +372,18 @@ identity and all snapshot hashes. Use `acceptanceGroupVerdict` from
|
|
|
372
372
|
These methods only read evidence. They do not dispatch checks, bypass server-side
|
|
373
373
|
acceptance, start training or activate serving. An empty page means this Job has
|
|
374
374
|
no recorded independent group; its existing trainer validation is separate.
|
|
375
|
+
|
|
376
|
+
### Experiment spending defaults and comparisons
|
|
377
|
+
|
|
378
|
+
`OpenPondExperimentsClient.defaults()` returns the hosted global spend defaults.
|
|
379
|
+
`prepareHarness()` and `run()` accept an omitted `maximumCostUsd`; explicit
|
|
380
|
+
per-run limits and retained run limits take precedence. Token allocation is
|
|
381
|
+
managed within model capacity and the available monetary reservation.
|
|
382
|
+
|
|
383
|
+
Use `createComparisonBudget({ id, operationIds, maximumSpendUsd? })` before
|
|
384
|
+
admitting any member runs to enforce one aggregate cap across a comparison.
|
|
385
|
+
Register fresh, unique operation IDs and retain the returned grant. Membership
|
|
386
|
+
is immutable and owner-scoped. `comparisonBudget(id)` returns each operation's
|
|
387
|
+
run ID, known settled spend, pending reservations and remaining allowance.
|
|
388
|
+
Registering a comparison does not start any work. Independent experiments do
|
|
389
|
+
not implicitly share a spending cap.
|
|
@@ -12,18 +12,18 @@ import {
|
|
|
12
12
|
sealAdvancedRefinerEvaluationPin,
|
|
13
13
|
sealAdvancedRefinerReviewReceipt,
|
|
14
14
|
verifyAdvancedRefinerEvaluationPin
|
|
15
|
-
} from "./chunk-
|
|
16
|
-
import "./chunk-
|
|
15
|
+
} from "./chunk-FZH2M4G6.js";
|
|
16
|
+
import "./chunk-PMBBNQ2J.js";
|
|
17
17
|
import "./chunk-YCQVVFE5.js";
|
|
18
|
-
import "./chunk-
|
|
18
|
+
import "./chunk-KAE7AMYE.js";
|
|
19
|
+
import "./chunk-Z4JJS6KE.js";
|
|
19
20
|
import "./chunk-T4APHDES.js";
|
|
20
|
-
import "./chunk-
|
|
21
|
-
import "./chunk-
|
|
22
|
-
import "./chunk-
|
|
21
|
+
import "./chunk-HAOPRFYQ.js";
|
|
22
|
+
import "./chunk-WTHJ3H4M.js";
|
|
23
|
+
import "./chunk-DUJXF7YI.js";
|
|
23
24
|
import "./chunk-TCHAWJMB.js";
|
|
24
25
|
import "./chunk-3KXDH6OB.js";
|
|
25
|
-
import "./chunk-
|
|
26
|
-
import "./chunk-QUOW6URQ.js";
|
|
26
|
+
import "./chunk-COPVBJPL.js";
|
|
27
27
|
export {
|
|
28
28
|
AdvancedRefinerEvaluationAccountingSchema,
|
|
29
29
|
AdvancedRefinerEvaluationCommandSchema,
|
|
@@ -5,15 +5,14 @@ import {
|
|
|
5
5
|
CandidateEvaluationPreparationSchema,
|
|
6
6
|
CandidateEvaluationRequestSchema,
|
|
7
7
|
createCandidateEvaluationClient
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-ZOXHSJWU.js";
|
|
9
|
+
import "./chunk-35OVUYPI.js";
|
|
10
|
+
import "./chunk-HAOPRFYQ.js";
|
|
11
|
+
import "./chunk-WTHJ3H4M.js";
|
|
12
|
+
import "./chunk-DUJXF7YI.js";
|
|
13
13
|
import "./chunk-TCHAWJMB.js";
|
|
14
14
|
import "./chunk-3KXDH6OB.js";
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-QUOW6URQ.js";
|
|
15
|
+
import "./chunk-COPVBJPL.js";
|
|
17
16
|
export {
|
|
18
17
|
CandidateEvaluationControlSchema,
|
|
19
18
|
CandidateEvaluationOptionSchema,
|
|
@@ -7,10 +7,10 @@ import {
|
|
|
7
7
|
importedPackageGraders,
|
|
8
8
|
learningVerifierModule,
|
|
9
9
|
projectLearningBatchGraders
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-VEU3IXAQ.js";
|
|
11
11
|
import {
|
|
12
12
|
AuthoredTasksetFileInventorySchema
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-AQGFJLIV.js";
|
|
14
14
|
import {
|
|
15
15
|
TasksetDraftSchema,
|
|
16
16
|
configuredTasksetDraftFiles,
|
|
@@ -18,11 +18,11 @@ import {
|
|
|
18
18
|
createTasksetDraftWorkspace,
|
|
19
19
|
decodeTasksetDraftWorkspaceFile,
|
|
20
20
|
isManagedTasksetDraftFilePath
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-LQ5Q35IF.js";
|
|
22
22
|
import {
|
|
23
23
|
TasksetSchema,
|
|
24
24
|
computeTasksetHash
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-FDHIL2CV.js";
|
|
26
26
|
import {
|
|
27
27
|
GraderFixtureSchema,
|
|
28
28
|
TasksetEnvironmentResourceSchema,
|
|
@@ -33,7 +33,7 @@ import {
|
|
|
33
33
|
resolveTasksetPackageExecution,
|
|
34
34
|
resolveTasksetPackageInstructions,
|
|
35
35
|
validateTasksetPackage
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-Z4OLAEPL.js";
|
|
37
37
|
import {
|
|
38
38
|
ModelTasksetDraftPreparationSchema,
|
|
39
39
|
TasksetDraftFilePathSchema
|
|
@@ -41,7 +41,7 @@ import {
|
|
|
41
41
|
import {
|
|
42
42
|
contentHash,
|
|
43
43
|
sha256
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-COPVBJPL.js";
|
|
45
45
|
|
|
46
46
|
// src/model-ordinary-taskset-reward.ts
|
|
47
47
|
import { LearningTextAssetSchema, TaskDefinitionSchema, learningRef, sealLearningContent } from "@openpond/evals/learning";
|
|
@@ -585,4 +585,4 @@ export {
|
|
|
585
585
|
prepareTasksetDraftSource,
|
|
586
586
|
materializeTasksetDraftWorkspace
|
|
587
587
|
};
|
|
588
|
-
//# sourceMappingURL=chunk-
|
|
588
|
+
//# sourceMappingURL=chunk-2DLFHAGW.js.map
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
validateTasksetPackage
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-Z4OLAEPL.js";
|
|
4
4
|
import {
|
|
5
5
|
RunExperimentSchema
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-35OVUYPI.js";
|
|
7
7
|
import {
|
|
8
8
|
ExperimentScoringRequestSchema,
|
|
9
9
|
verifyExperimentScoringPass
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-Z4JJS6KE.js";
|
|
11
11
|
import {
|
|
12
12
|
fetchConnectedJson
|
|
13
13
|
} from "./chunk-T4APHDES.js";
|
|
@@ -18,20 +18,20 @@ import {
|
|
|
18
18
|
ExperimentListQuerySchema,
|
|
19
19
|
PrepareHarnessExperimentSchema,
|
|
20
20
|
PreparedHarnessExperimentSchema
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-HAOPRFYQ.js";
|
|
22
22
|
import {
|
|
23
23
|
ModelTasksetRunDetailsSchema,
|
|
24
24
|
ModelTasksetRunRequestSchema,
|
|
25
25
|
verifyHarnessExperimentManifest,
|
|
26
26
|
verifyModelTasksetRunDetails
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-WTHJ3H4M.js";
|
|
28
28
|
import {
|
|
29
29
|
ImmutableReleaseRefSchema,
|
|
30
30
|
contentHash
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-COPVBJPL.js";
|
|
32
32
|
|
|
33
33
|
// src/experiment-client.ts
|
|
34
|
-
import { z as
|
|
34
|
+
import { z as z4 } from "zod";
|
|
35
35
|
import { compareExperiments, verifyExperimentEvidence } from "@openpond/evals/experiments";
|
|
36
36
|
|
|
37
37
|
// src/experiment-run-details.ts
|
|
@@ -91,8 +91,184 @@ var ExperimentHarnessCatalogSchema = z2.object({
|
|
|
91
91
|
nextCursor: z2.string().min(1).max(8192).nullable()
|
|
92
92
|
}).strict();
|
|
93
93
|
|
|
94
|
+
// src/run-diagnostics.ts
|
|
95
|
+
import { z as z3 } from "zod";
|
|
96
|
+
var Id = z3.string().min(1).max(500);
|
|
97
|
+
var Hash2 = z3.string().regex(/^[a-f0-9]{64}$/);
|
|
98
|
+
var Time = z3.iso.datetime();
|
|
99
|
+
var Amount = z3.number().finite().nonnegative().nullable();
|
|
100
|
+
var Count = z3.number().int().nonnegative().nullable();
|
|
101
|
+
var DiagnosticEventSchema = z3.object({
|
|
102
|
+
id: Id,
|
|
103
|
+
sequence: z3.number().int().nonnegative(),
|
|
104
|
+
at: Time.nullable(),
|
|
105
|
+
type: z3.string().max(160),
|
|
106
|
+
action: z3.string().max(160).nullable(),
|
|
107
|
+
correlationId: Id.nullable(),
|
|
108
|
+
attempt: Count,
|
|
109
|
+
taskId: Id.nullable(),
|
|
110
|
+
status: z3.string().max(100).nullable(),
|
|
111
|
+
errorCode: z3.string().max(200).nullable(),
|
|
112
|
+
cleanupComplete: z3.boolean().nullable()
|
|
113
|
+
}).strict();
|
|
114
|
+
var DiagnosticCallSchema = z3.object({
|
|
115
|
+
id: Id,
|
|
116
|
+
kind: z3.string().max(100),
|
|
117
|
+
status: z3.string().max(100),
|
|
118
|
+
receiptId: Id.nullable(),
|
|
119
|
+
maximumUsd: Amount,
|
|
120
|
+
settledUsd: Amount,
|
|
121
|
+
model: z3.string().max(200).nullable(),
|
|
122
|
+
durationMs: Count,
|
|
123
|
+
inputTokens: Count,
|
|
124
|
+
outputTokens: Count,
|
|
125
|
+
totalTokens: Count
|
|
126
|
+
}).strict();
|
|
127
|
+
var Content = z3.object({
|
|
128
|
+
schemaVersion: z3.literal("openpond.runDiagnostics.v1"),
|
|
129
|
+
teamId: Id,
|
|
130
|
+
runId: Id,
|
|
131
|
+
location: z3.enum(["local", "hosted"]),
|
|
132
|
+
manifestHash: Hash2,
|
|
133
|
+
observedAt: Time,
|
|
134
|
+
status: z3.string().max(100),
|
|
135
|
+
startedAt: Time.nullable(),
|
|
136
|
+
completedAt: Time.nullable(),
|
|
137
|
+
error: z3.string().max(8192).nullable(),
|
|
138
|
+
resultAvailable: z3.boolean(),
|
|
139
|
+
parent: z3.object({
|
|
140
|
+
id: Id,
|
|
141
|
+
status: z3.string().max(100),
|
|
142
|
+
attempt: Count,
|
|
143
|
+
heartbeatAt: Time.nullable(),
|
|
144
|
+
leaseExpiresAt: Time.nullable(),
|
|
145
|
+
releasedAt: Time.nullable(),
|
|
146
|
+
errorCode: z3.string().max(200).nullable()
|
|
147
|
+
}).strict().nullable(),
|
|
148
|
+
accounting: z3.object({
|
|
149
|
+
maximumUsd: Amount,
|
|
150
|
+
settledUsd: Amount,
|
|
151
|
+
outstandingUsd: Amount,
|
|
152
|
+
outstandingCount: Count,
|
|
153
|
+
final: z3.boolean(),
|
|
154
|
+
receiptCount: Count
|
|
155
|
+
}).strict(),
|
|
156
|
+
events: z3.array(DiagnosticEventSchema).max(100),
|
|
157
|
+
nextEventCursor: z3.number().int().nonnegative().nullable(),
|
|
158
|
+
eventCount: z3.number().int().nonnegative(),
|
|
159
|
+
calls: z3.array(DiagnosticCallSchema).max(100),
|
|
160
|
+
nextCallCursor: Id.nullable(),
|
|
161
|
+
callCount: z3.number().int().nonnegative(),
|
|
162
|
+
limitations: z3.array(z3.string().max(1e3)).max(30)
|
|
163
|
+
}).strict();
|
|
164
|
+
var RunDiagnosticsSchema = Content.extend({ contentHash: Hash2 }).strict();
|
|
165
|
+
var RunDiagnosticsQuerySchema = z3.object({
|
|
166
|
+
afterSequence: z3.number().int().nonnegative().optional(),
|
|
167
|
+
afterCallId: Id.optional()
|
|
168
|
+
}).strict();
|
|
169
|
+
function sealRunDiagnostics(value) {
|
|
170
|
+
const content = Content.parse(value);
|
|
171
|
+
return { ...content, contentHash: contentHash(content) };
|
|
172
|
+
}
|
|
173
|
+
function verifyRunDiagnostics(raw, scope) {
|
|
174
|
+
const value = RunDiagnosticsSchema.parse(raw);
|
|
175
|
+
const { contentHash: hash, ...content } = value;
|
|
176
|
+
if (hash !== contentHash(content) || value.teamId !== scope.teamId || value.runId !== scope.runId || scope.manifestHash && value.manifestHash !== scope.manifestHash)
|
|
177
|
+
throw new Error("Diagnostics differ from the selected workspace, run or retained evidence.");
|
|
178
|
+
if (value.events.length > value.eventCount || value.calls.length > value.callCount || new Set(value.events.map((event) => event.id)).size !== value.events.length || value.events.some(
|
|
179
|
+
(event, index) => event.sequence <= (index ? value.events[index - 1].sequence : scope.afterSequence ?? -1)
|
|
180
|
+
) || value.calls.some(
|
|
181
|
+
(call, index) => call.id <= (index ? value.calls[index - 1].id : scope.afterCallId ?? "")
|
|
182
|
+
) || value.nextEventCursor !== null && value.nextEventCursor !== value.events.at(-1)?.sequence || value.nextCallCursor !== null && value.nextCallCursor !== value.calls.at(-1)?.id || value.accounting.final && (value.accounting.outstandingCount !== 0 || value.accounting.settledUsd === null || !value.accounting.receiptCount))
|
|
183
|
+
throw new Error("Diagnostic evidence pagination or final accounting is inconsistent.");
|
|
184
|
+
return value;
|
|
185
|
+
}
|
|
186
|
+
function diagnosticEvent(input) {
|
|
187
|
+
const record = (raw) => raw !== null && typeof raw === "object" && !Array.isArray(raw) ? raw : {};
|
|
188
|
+
const payload = record(input.payload), data = record(payload.data);
|
|
189
|
+
const token = (raw, maximum) => typeof raw === "string" && /^[a-zA-Z0-9_.:/-]+$/.test(raw) ? raw.slice(0, maximum) : null;
|
|
190
|
+
return DiagnosticEventSchema.parse({
|
|
191
|
+
id: input.id,
|
|
192
|
+
sequence: input.sequence,
|
|
193
|
+
at: input.at,
|
|
194
|
+
type: input.type.slice(0, 160),
|
|
195
|
+
action: token(payload.action, 160),
|
|
196
|
+
correlationId: token(data.callId ?? data.toolCallId, 500),
|
|
197
|
+
attempt: typeof payload.attempt === "number" && Number.isInteger(payload.attempt) && payload.attempt >= 0 ? payload.attempt : null,
|
|
198
|
+
taskId: token(payload.taskId ?? data.taskId, 500),
|
|
199
|
+
status: token(payload.status, 100),
|
|
200
|
+
errorCode: token(payload.errorCode ?? payload.code, 200),
|
|
201
|
+
cleanupComplete: typeof payload.complete === "boolean" && input.type === "experiment.harness.cleanup" ? payload.complete : null
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
function diagnosticSpans(events) {
|
|
205
|
+
const spans = [], active = /* @__PURE__ */ new Map();
|
|
206
|
+
for (const event of [...events].sort((a, b) => a.sequence - b.sequence)) {
|
|
207
|
+
if (event.type.startsWith("training.")) {
|
|
208
|
+
spans.push({
|
|
209
|
+
id: event.id,
|
|
210
|
+
label: event.action ?? event.type,
|
|
211
|
+
taskId: event.taskId,
|
|
212
|
+
startedAt: event.at,
|
|
213
|
+
completedAt: null,
|
|
214
|
+
durationMs: null,
|
|
215
|
+
status: "observed",
|
|
216
|
+
evidenceIds: [event.id]
|
|
217
|
+
});
|
|
218
|
+
continue;
|
|
219
|
+
}
|
|
220
|
+
if (!["tool.started", "tool.completed", "tool.failed"].includes(event.type)) continue;
|
|
221
|
+
const key = JSON.stringify([event.correlationId ?? event.action, event.taskId, event.attempt]);
|
|
222
|
+
if (event.type === "tool.started") {
|
|
223
|
+
const span = {
|
|
224
|
+
id: event.id,
|
|
225
|
+
label: event.action ?? "Operation",
|
|
226
|
+
taskId: event.taskId,
|
|
227
|
+
startedAt: event.at,
|
|
228
|
+
completedAt: null,
|
|
229
|
+
durationMs: null,
|
|
230
|
+
status: "running",
|
|
231
|
+
evidenceIds: [event.id]
|
|
232
|
+
};
|
|
233
|
+
active.set(key, span);
|
|
234
|
+
spans.push(span);
|
|
235
|
+
} else {
|
|
236
|
+
const span = active.get(key);
|
|
237
|
+
if (span) {
|
|
238
|
+
span.completedAt = event.at;
|
|
239
|
+
span.status = event.type === "tool.failed" ? "failed" : "completed";
|
|
240
|
+
span.durationMs = span.startedAt && event.at ? Math.max(0, Date.parse(event.at) - Date.parse(span.startedAt)) : null;
|
|
241
|
+
span.evidenceIds.push(event.id);
|
|
242
|
+
active.delete(key);
|
|
243
|
+
} else
|
|
244
|
+
spans.push({
|
|
245
|
+
id: event.id,
|
|
246
|
+
label: event.action ?? "Operation",
|
|
247
|
+
taskId: event.taskId,
|
|
248
|
+
startedAt: null,
|
|
249
|
+
completedAt: event.at,
|
|
250
|
+
durationMs: null,
|
|
251
|
+
status: event.type === "tool.failed" ? "failed" : "completed",
|
|
252
|
+
evidenceIds: [event.id]
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
return spans;
|
|
257
|
+
}
|
|
258
|
+
function diagnosticAnalysisPrompt(value, events = value.events, calls = value.calls) {
|
|
259
|
+
const { contentHash: pageHash, ...metadata } = value;
|
|
260
|
+
return `Investigate this OpenPond run using the retained metadata below. Start read-only. Separate observed facts, hypotheses, missing evidence and recommended investigations. Cite event/call IDs. Do not infer zero costs or successful grading from missing evidence; gateway duration is not pure inference. Do not replay, regrade, edit source, change configuration, restart or deploy without a separate user instruction. Never request credentials or private grader content. This snapshot may be partial.
|
|
261
|
+
|
|
262
|
+
${JSON.stringify({ ...metadata, sourcePageHash: pageHash, error: diagnosticFailure(value.error), events: events.slice(0, 100), calls: calls.slice(0, 100), analysisCoverage: { eventCount: events.length, callCount: calls.length, maximumIncluded: 100 } }, null, 2)}`;
|
|
263
|
+
}
|
|
264
|
+
function diagnosticFailure(value) {
|
|
265
|
+
if (!value) return null;
|
|
266
|
+
const codes = value.match(/\b[a-z][a-z0-9]+(?:_[a-z0-9]+){1,12}\b/g);
|
|
267
|
+
return codes?.slice(0, 6).join(" / ") || "Failure recorded. Inspect the authorized run for its exact message.";
|
|
268
|
+
}
|
|
269
|
+
|
|
94
270
|
// src/experiment-client.ts
|
|
95
|
-
var
|
|
271
|
+
var Id2 = z4.string().trim().min(1).max(200);
|
|
96
272
|
var OpenPondExperimentError = class extends Error {
|
|
97
273
|
constructor(status, code, message) {
|
|
98
274
|
super(message);
|
|
@@ -113,9 +289,27 @@ var OpenPondExperimentsClient = class {
|
|
|
113
289
|
}
|
|
114
290
|
options;
|
|
115
291
|
baseUrl;
|
|
292
|
+
async defaults(signal) {
|
|
293
|
+
return z4.object({ maximumSpendUsd: z4.number().finite().min(1e-6).max(1e4), maximumComparisonSpendUsd: z4.number().finite().min(1e-6).max(1e4), initialOutputTokens: z4.number().int().positive() }).strict().parse(await this.request("/defaults", "GET", void 0, signal));
|
|
294
|
+
}
|
|
295
|
+
async createComparisonBudget(value, signal) {
|
|
296
|
+
const request = z4.object({ id: Id2, operationIds: z4.array(Id2).min(1).max(100), maximumSpendUsd: z4.number().finite().min(1e-6).max(1e4).optional() }).strict().parse(value);
|
|
297
|
+
const result = this.comparisonBudgetResult(await this.request("/comparison-budgets", "POST", request, signal), request.id);
|
|
298
|
+
if (contentHash(result.operations.map((item) => item.operationId).sort()) !== contentHash([...request.operationIds].sort()) || request.maximumSpendUsd !== void 0 && result.maximumSpendUsd !== request.maximumSpendUsd)
|
|
299
|
+
throw new Error("Comparison admission differs from its requested operations or ceiling.");
|
|
300
|
+
return result;
|
|
301
|
+
}
|
|
302
|
+
async comparisonBudget(id, signal) {
|
|
303
|
+
return this.comparisonBudgetResult(await this.request(`/comparison-budgets/${encodeURIComponent(Id2.parse(id))}`, "GET", void 0, signal), id);
|
|
304
|
+
}
|
|
305
|
+
comparisonBudgetResult(value, id) {
|
|
306
|
+
const result = z4.object({ id: Id2, teamId: Id2, maximumSpendUsd: z4.number().finite().positive(), settledUsd: z4.number().finite().nonnegative(), reservedUsd: z4.number().finite().nonnegative(), remainingUsd: z4.number().finite().nonnegative(), operations: z4.array(z4.object({ operationId: Id2, runId: Id2.nullable() }).strict()).min(1).max(100) }).strict().parse(value);
|
|
307
|
+
if (result.id !== id || result.teamId !== this.options.teamId) throw new Error("Comparison budget scope mismatch.");
|
|
308
|
+
return result;
|
|
309
|
+
}
|
|
116
310
|
/** Discover released workspace Harnesses independently of Project targets. */
|
|
117
311
|
async harnessSources(options = {}) {
|
|
118
|
-
const cursor = options.cursor === void 0 ? void 0 :
|
|
312
|
+
const cursor = options.cursor === void 0 ? void 0 : z4.string().min(1).max(8192).parse(options.cursor);
|
|
119
313
|
const query = new URLSearchParams(cursor ? { cursor } : {});
|
|
120
314
|
const page = ExperimentHarnessCatalogSchema.parse(await this.request(`/harness-sources?${query}`, "GET", void 0, options.signal));
|
|
121
315
|
if (page.teamId !== this.options.teamId || new Set(page.items.map((item) => contentHash(item.source))).size !== page.items.length || page.nextCursor !== null && page.nextCursor === cursor || page.items.some((item) => item.ready !== (item.reason === null)))
|
|
@@ -124,7 +318,7 @@ var OpenPondExperimentsClient = class {
|
|
|
124
318
|
}
|
|
125
319
|
/** Resolves a released target without saving a definition or dispatching it. */
|
|
126
320
|
async prepareHarness(value, signal) {
|
|
127
|
-
const request = PrepareHarnessExperimentSchema.parse(value);
|
|
321
|
+
const request = PrepareHarnessExperimentSchema.parse({ ...value, maximumCostUsd: value.maximumCostUsd ?? (await this.defaults(signal)).maximumSpendUsd });
|
|
128
322
|
const result = PreparedHarnessExperimentSchema.parse(await this.request("/harness-setup", "POST", request, signal));
|
|
129
323
|
verifyHarnessExperimentManifest(result.request, result.manifest);
|
|
130
324
|
const policy = result.request.policy;
|
|
@@ -133,9 +327,10 @@ var OpenPondExperimentsClient = class {
|
|
|
133
327
|
return result;
|
|
134
328
|
}
|
|
135
329
|
async run(value, signal) {
|
|
136
|
-
const request = RunExperimentSchema.parse(value);
|
|
330
|
+
const request = RunExperimentSchema.parse({ ...value, maximumCostUsd: value.maximumCostUsd ?? (await this.defaults(signal)).maximumSpendUsd });
|
|
137
331
|
if (request.request.teamId !== this.options.teamId) throw new Error("Experiment workspace mismatch.");
|
|
138
|
-
const result = await this.details(await this.request("", "POST", request, signal));
|
|
332
|
+
const result = await this.details(await this.request("", "POST", { ...request, maximumCostUsd: value.maximumCostUsd }, signal));
|
|
333
|
+
if (value.maximumCostUsd === void 0) request.maximumCostUsd = result.configuration.maximumCostUsd;
|
|
139
334
|
if (contentHash(experimentConfigurationRequest(result.request)) !== contentHash(experimentConfigurationRequest(request.request)) || result.configuration.maximumCostUsd !== request.maximumCostUsd || result.configuration.sourceExperimentId !== request.sourceExperimentId || result.configuration.admissionRequestHash !== contentHash(request))
|
|
140
335
|
throw new Error("Experiment admission differs from its submitted configuration.");
|
|
141
336
|
if (request.graders && contentHash(request.graders) !== contentHash(result.configuration.graders.map((grader) => ({
|
|
@@ -147,29 +342,34 @@ var OpenPondExperimentsClient = class {
|
|
|
147
342
|
return result;
|
|
148
343
|
}
|
|
149
344
|
async get(id, options = {}) {
|
|
150
|
-
return this.details(await this.request(`/${encodeURIComponent(
|
|
345
|
+
return this.details(await this.request(`/${encodeURIComponent(Id2.parse(id))}`, "GET", void 0, options.signal), id);
|
|
346
|
+
}
|
|
347
|
+
async diagnostics(id, options = {}) {
|
|
348
|
+
const query = RunDiagnosticsQuerySchema.parse({ afterSequence: options.afterSequence, afterCallId: options.afterCallId });
|
|
349
|
+
const params = new URLSearchParams(Object.entries(query).filter(([, value]) => value !== void 0).map(([key, value]) => [key, String(value)]));
|
|
350
|
+
return verifyRunDiagnostics(await this.request(`/${encodeURIComponent(Id2.parse(id))}/diagnostics?${params}`, "GET", void 0, options.signal), { teamId: this.options.teamId, runId: id, manifestHash: options.manifestHash, afterSequence: options.afterSequence, afterCallId: options.afterCallId });
|
|
151
351
|
}
|
|
152
352
|
async list(value = {}, signal) {
|
|
153
353
|
const query = ExperimentListQuerySchema.parse(value);
|
|
154
354
|
const params = new URLSearchParams(Object.entries(query).filter(([, value2]) => value2 !== void 0).map(([key, value2]) => [key, String(value2)]));
|
|
155
|
-
const page =
|
|
355
|
+
const page = z4.object({ items: z4.array(z4.unknown()).max(100), nextCursor: Id2.nullable() }).strict().parse(await this.request(`?${params}`, "GET", void 0, signal));
|
|
156
356
|
const items = await Promise.all(page.items.map((value2) => this.details(value2)));
|
|
157
357
|
if (items.length > query.limit || new Set(items.map((item) => item.summary.id)).size !== items.length || page.nextCursor !== null && page.nextCursor !== items.at(-1)?.summary.id || items.some((item) => query.projectId && item.request.project?.id !== query.projectId || query.datasetHash && item.request.taskset.contentHash !== query.datasetHash || query.status && item.summary.status !== query.status))
|
|
158
358
|
throw new Error("Experiment page differs from its selected scope.");
|
|
159
359
|
return { items, nextCursor: page.nextCursor };
|
|
160
360
|
}
|
|
161
361
|
async result(executionId, signal) {
|
|
162
|
-
const value =
|
|
362
|
+
const value = z4.object({ executionId: Id2, passId: Id2.nullable(), manifest: z4.unknown(), result: z4.unknown() }).strict().parse(await this.request(`/${encodeURIComponent(Id2.parse(executionId))}/result`, "GET", void 0, signal));
|
|
163
363
|
const evidence = verifyExperimentEvidence(value);
|
|
164
364
|
if (value.executionId !== executionId || evidence.manifest.teamId !== this.options.teamId || evidence.manifest.lineage?.execution.id !== executionId || evidence.manifest.lineage.scoringPassId !== value.passId) throw new Error("Experiment result identity mismatch.");
|
|
165
365
|
return { ...evidence, executionId, passId: value.passId };
|
|
166
366
|
}
|
|
167
367
|
async cancel(id, signal) {
|
|
168
|
-
return this.details(await this.request(`/${encodeURIComponent(
|
|
368
|
+
return this.details(await this.request(`/${encodeURIComponent(Id2.parse(id))}/cancel`, "POST", {}, signal), id);
|
|
169
369
|
}
|
|
170
370
|
/** Duplicate uses the original run snapshot; edits are submitted with run(). */
|
|
171
371
|
async duplicate(id, operationId, signal) {
|
|
172
|
-
const result = await this.details(await this.request(`/${encodeURIComponent(
|
|
372
|
+
const result = await this.details(await this.request(`/${encodeURIComponent(Id2.parse(id))}/duplicate`, "POST", { operationId: Id2.parse(operationId) }, signal));
|
|
173
373
|
if (result.request.operationId !== operationId || result.configuration.sourceExperimentId !== id || result.summary.id === id)
|
|
174
374
|
throw new Error("Duplicate Experiment admission differs from its source or operation.");
|
|
175
375
|
return result;
|
|
@@ -181,13 +381,13 @@ var OpenPondExperimentsClient = class {
|
|
|
181
381
|
return pass;
|
|
182
382
|
}
|
|
183
383
|
async scoringPass(id, signal) {
|
|
184
|
-
return this.pass(await this.request(`/scoring-passes/${encodeURIComponent(
|
|
384
|
+
return this.pass(await this.request(`/scoring-passes/${encodeURIComponent(Id2.parse(id))}`, "GET", void 0, signal), id);
|
|
185
385
|
}
|
|
186
386
|
async scoringPasses(executionId, options = {}) {
|
|
187
|
-
const params = new URLSearchParams(options.afterId ? { afterId:
|
|
188
|
-
if (options.executionKind) params.set("executionKind",
|
|
189
|
-
const page =
|
|
190
|
-
await this.request(`/${encodeURIComponent(
|
|
387
|
+
const params = new URLSearchParams(options.afterId ? { afterId: Id2.parse(options.afterId) } : {});
|
|
388
|
+
if (options.executionKind) params.set("executionKind", z4.literal("recorded_evidence").parse(options.executionKind));
|
|
389
|
+
const page = z4.object({ items: z4.array(z4.unknown()).max(30), nextCursor: Id2.nullable() }).strict().parse(
|
|
390
|
+
await this.request(`/${encodeURIComponent(Id2.parse(executionId))}/scoring-passes?${params}`, "GET", void 0, options.signal)
|
|
191
391
|
);
|
|
192
392
|
const items = page.items.map((value) => this.pass(value));
|
|
193
393
|
if (items.some((item) => item.request.execution.id !== executionId || item.request.executionKind !== options.executionKind) || new Set(items.map((item) => item.id)).size !== items.length)
|
|
@@ -195,11 +395,11 @@ var OpenPondExperimentsClient = class {
|
|
|
195
395
|
return { items, nextCursor: page.nextCursor };
|
|
196
396
|
}
|
|
197
397
|
async cancelScoringPass(id, signal) {
|
|
198
|
-
return this.pass(await this.request(`/scoring-passes/${encodeURIComponent(
|
|
398
|
+
return this.pass(await this.request(`/scoring-passes/${encodeURIComponent(Id2.parse(id))}/cancel`, "POST", {}, signal), id);
|
|
199
399
|
}
|
|
200
400
|
async scoringResult(id, signal) {
|
|
201
|
-
const value =
|
|
202
|
-
await this.request(`/scoring-passes/${encodeURIComponent(
|
|
401
|
+
const value = z4.object({ executionId: Id2, passId: Id2, manifest: z4.unknown(), result: z4.unknown() }).strict().parse(
|
|
402
|
+
await this.request(`/scoring-passes/${encodeURIComponent(Id2.parse(id))}/result`, "GET", void 0, signal)
|
|
203
403
|
);
|
|
204
404
|
const evidence = verifyExperimentEvidence(value);
|
|
205
405
|
if (value.passId !== id || evidence.manifest.teamId !== this.options.teamId || evidence.manifest.id !== id || evidence.manifest.lineage?.execution.id !== value.executionId || evidence.manifest.lineage.scoringPassId !== id)
|
|
@@ -232,7 +432,7 @@ var OpenPondExperimentsClient = class {
|
|
|
232
432
|
});
|
|
233
433
|
const value = await response.json();
|
|
234
434
|
if (!response.ok) {
|
|
235
|
-
const parsed =
|
|
435
|
+
const parsed = z4.object({ code: z4.string(), message: z4.string() }).safeParse(value);
|
|
236
436
|
throw new OpenPondExperimentError(response.status, parsed.success ? parsed.data.code : "experiment_request_failed", parsed.success ? parsed.data.message : "Experiment request failed.");
|
|
237
437
|
}
|
|
238
438
|
return value;
|
|
@@ -240,11 +440,11 @@ var OpenPondExperimentsClient = class {
|
|
|
240
440
|
};
|
|
241
441
|
|
|
242
442
|
// src/experiment-inspection.ts
|
|
243
|
-
import { z as
|
|
244
|
-
var
|
|
245
|
-
var
|
|
246
|
-
var
|
|
247
|
-
var ExperimentCaseInspectionSchema =
|
|
443
|
+
import { z as z5 } from "zod";
|
|
444
|
+
var Id3 = z5.string().trim().min(1).max(500);
|
|
445
|
+
var Hash3 = z5.string().regex(/^[a-f0-9]{64}$/);
|
|
446
|
+
var Content2 = z5.object({ schemaVersion: z5.literal("openpond.experimentCaseInspection.v1"), teamId: Id3, executionId: Id3, manifestHash: Hash3, receiptId: Id3, taskId: Id3, seed: z5.string().min(1), input: z5.record(z5.string(), z5.unknown()).nullable(), output: z5.unknown().nullable(), error: z5.string().nullable(), events: z5.array(z5.record(z5.string(), z5.unknown())).max(25), nextEventCursor: Id3.nullable(), eventCount: z5.number().int().nonnegative() }).strict();
|
|
447
|
+
var ExperimentCaseInspectionSchema = Content2.extend({ contentHash: Hash3 }).strict();
|
|
248
448
|
var OpenPondExperimentInspectionClient = class {
|
|
249
449
|
constructor(options) {
|
|
250
450
|
this.options = options;
|
|
@@ -256,10 +456,10 @@ var OpenPondExperimentInspectionClient = class {
|
|
|
256
456
|
baseUrl;
|
|
257
457
|
/** Retained, policy-facing evidence only. Reading a page never dispatches. */
|
|
258
458
|
async case(executionId, receiptId, options = {}) {
|
|
259
|
-
const params = new URLSearchParams(options.afterId ? { afterId:
|
|
260
|
-
const response = await (this.options.fetch ?? fetch)(`${this.baseUrl}/v1/experiments/${encodeURIComponent(
|
|
459
|
+
const params = new URLSearchParams(options.afterId ? { afterId: Id3.parse(options.afterId) } : {});
|
|
460
|
+
const response = await (this.options.fetch ?? fetch)(`${this.baseUrl}/v1/experiments/${encodeURIComponent(Id3.parse(executionId))}/cases/${encodeURIComponent(Id3.parse(receiptId))}?${params}`, { signal: options.signal, redirect: "error", headers: { Authorization: `Bearer ${this.options.apiKey}`, "X-OpenPond-Team-Id": this.options.teamId, Accept: "application/json" } });
|
|
261
461
|
const value = await response.json();
|
|
262
|
-
if (!response.ok) throw new Error(
|
|
462
|
+
if (!response.ok) throw new Error(z5.object({ message: z5.string() }).parse(value).message);
|
|
263
463
|
const result = ExperimentCaseInspectionSchema.parse(value);
|
|
264
464
|
const { contentHash: actual, ...content } = result;
|
|
265
465
|
if (contentHash(content) !== actual || result.teamId !== this.options.teamId || result.executionId !== executionId || result.receiptId !== receiptId || options.manifestHash && result.manifestHash !== options.manifestHash || result.events.length > result.eventCount) throw new Error("Case inspection differs from its requested workspace, execution or retained content.");
|
|
@@ -318,7 +518,7 @@ function experimentExecutionSelection(policy) {
|
|
|
318
518
|
}
|
|
319
519
|
|
|
320
520
|
// src/profile-external-dataset-package.ts
|
|
321
|
-
import { z as
|
|
521
|
+
import { z as z6 } from "zod";
|
|
322
522
|
import { verifyExperimentEvidence as verifyExperimentEvidence2 } from "@openpond/evals/experiments";
|
|
323
523
|
import { verifyProfileExternalDatasetBinding } from "@openpond/evals";
|
|
324
524
|
function verifyExternalDatasetPackage(input) {
|
|
@@ -333,7 +533,7 @@ function verifyExternalDatasetPackage(input) {
|
|
|
333
533
|
}
|
|
334
534
|
if (binding.gradingSource) {
|
|
335
535
|
if (!input.actualGrading) throw new Error("The actual selected scoring owner is required for this recipe.");
|
|
336
|
-
const pass = verifyExperimentScoringPass(input.actualGrading.pass), evidence = verifyExperimentEvidence2(
|
|
536
|
+
const pass = verifyExperimentScoringPass(input.actualGrading.pass), evidence = verifyExperimentEvidence2(z6.object({ manifest: z6.unknown(), result: z6.unknown() }).strict().parse(input.actualGrading.evidence));
|
|
337
537
|
if (pass.status !== "completed" || pass.id !== binding.gradingSource.pass.id || pass.contentHash !== binding.gradingSource.pass.contentHash || evidence.manifest.id !== binding.gradingSource.evidence.id || evidence.result.contentHash !== binding.gradingSource.evidence.contentHash || evidence.manifest.lineage?.scoringPassId !== pass.id || contentHash(evidence.manifest.dataset) !== contentHash(binding.dataset) || contentHash(evidence.manifest.evaluators) !== contentHash(binding.evaluators) || contentHash(binding.fieldMappings) !== contentHash(pass.graders.map((pin) => ({ graderId: pin.id, fields: pin.mappings ?? [] })))) throw new Error("The selected scoring owner changed its exact Dataset, measurements or mappings.");
|
|
338
538
|
const actual = evidence.manifest.population, expected = binding.recordedOrigin ? binding.recordedOrigin.members.map((member) => ({ caseId: member.caseId, seed: member.seed, fixtureId: member.fixtureId })) : binding.population.map((member) => ({ caseId: member.taskId, seed: member.seed, fixtureId: member.fixtureId }));
|
|
339
539
|
if (actual.length !== expected.length || actual.some((member, index) => contentHash(member) !== contentHash(expected[index]))) throw new Error("The selected scoring population differs from the exact ordered original cases and cutoffs.");
|
|
@@ -361,7 +561,7 @@ function verifyExternalDatasetPackage(input) {
|
|
|
361
561
|
}
|
|
362
562
|
|
|
363
563
|
// src/profile-evaluation-discovery.ts
|
|
364
|
-
import { z as
|
|
564
|
+
import { z as z7 } from "zod";
|
|
365
565
|
import {
|
|
366
566
|
ProfileEvaluationDefinitionSchema,
|
|
367
567
|
ProfileEvaluationSuiteSchema,
|
|
@@ -371,33 +571,33 @@ import {
|
|
|
371
571
|
TasksetRunManifestSchema,
|
|
372
572
|
TasksetMetricResultSchema
|
|
373
573
|
} from "@openpond/evals";
|
|
374
|
-
var
|
|
375
|
-
var ProfileEvaluationDiscoverySchema =
|
|
376
|
-
profileRef:
|
|
377
|
-
sourceRevision:
|
|
574
|
+
var Id4 = z7.string().trim().min(1).max(240);
|
|
575
|
+
var ProfileEvaluationDiscoverySchema = z7.object({
|
|
576
|
+
profileRef: z7.object({ source: z7.enum(["local", "github", "openpond_git"]), repositoryId: Id4, profileId: Id4 }).strict(),
|
|
577
|
+
sourceRevision: z7.string().min(1).max(500),
|
|
378
578
|
harnessRelease: ImmutableReleaseRefSchema,
|
|
379
|
-
catalogHash:
|
|
380
|
-
definitions:
|
|
381
|
-
suites:
|
|
382
|
-
runs:
|
|
383
|
-
profileRef:
|
|
579
|
+
catalogHash: z7.string().regex(/^[a-f0-9]{64}$/).nullable(),
|
|
580
|
+
definitions: z7.array(ProfileEvaluationDefinitionSchema).max(1e3),
|
|
581
|
+
suites: z7.array(ProfileEvaluationSuiteSchema).max(100),
|
|
582
|
+
runs: z7.array(z7.object({
|
|
583
|
+
profileRef: z7.object({ source: z7.enum(["local", "github", "openpond_git"]), repositoryId: Id4, profileId: Id4 }).strict(),
|
|
384
584
|
manifest: TasksetRunManifestSchema,
|
|
385
585
|
metric: TasksetMetricResultSchema,
|
|
386
|
-
gradeRefs:
|
|
387
|
-
receiptRefs:
|
|
388
|
-
passRate:
|
|
389
|
-
passed:
|
|
390
|
-
completedAt:
|
|
391
|
-
contentHash:
|
|
586
|
+
gradeRefs: z7.array(ImmutableReleaseRefSchema),
|
|
587
|
+
receiptRefs: z7.array(ImmutableReleaseRefSchema),
|
|
588
|
+
passRate: z7.number().min(0).max(1),
|
|
589
|
+
passed: z7.boolean(),
|
|
590
|
+
completedAt: z7.iso.datetime(),
|
|
591
|
+
contentHash: z7.string().regex(/^[a-f0-9]{64}$/)
|
|
392
592
|
}).strict()).max(1e3),
|
|
393
|
-
comparisons:
|
|
394
|
-
suiteRuns:
|
|
395
|
-
reports:
|
|
593
|
+
comparisons: z7.array(ProfileEvaluationComparisonSchema).max(1e3),
|
|
594
|
+
suiteRuns: z7.array(ProfileEvaluationSuiteRunSchema).max(1e3),
|
|
595
|
+
reports: z7.array(ProfileEvaluationReportSchema).max(1e3)
|
|
396
596
|
}).strict();
|
|
397
|
-
var ProfileEvaluationDiscoveryRequestSchema =
|
|
398
|
-
teamId:
|
|
399
|
-
profileRepositoryId:
|
|
400
|
-
trainingProjectId:
|
|
597
|
+
var ProfileEvaluationDiscoveryRequestSchema = z7.object({
|
|
598
|
+
teamId: Id4,
|
|
599
|
+
profileRepositoryId: Id4,
|
|
600
|
+
trainingProjectId: Id4.optional()
|
|
401
601
|
}).strict();
|
|
402
602
|
var OpenPondProfileEvaluationDiscoveryClient = class {
|
|
403
603
|
constructor(options) {
|
|
@@ -429,6 +629,16 @@ export {
|
|
|
429
629
|
experimentRunConfigurationHash,
|
|
430
630
|
verifyExperimentRunDetails,
|
|
431
631
|
ExperimentHarnessCatalogSchema,
|
|
632
|
+
DiagnosticEventSchema,
|
|
633
|
+
DiagnosticCallSchema,
|
|
634
|
+
RunDiagnosticsSchema,
|
|
635
|
+
RunDiagnosticsQuerySchema,
|
|
636
|
+
sealRunDiagnostics,
|
|
637
|
+
verifyRunDiagnostics,
|
|
638
|
+
diagnosticEvent,
|
|
639
|
+
diagnosticSpans,
|
|
640
|
+
diagnosticAnalysisPrompt,
|
|
641
|
+
diagnosticFailure,
|
|
432
642
|
OpenPondExperimentError,
|
|
433
643
|
OpenPondExperimentsClient,
|
|
434
644
|
ExperimentCaseInspectionSchema,
|
|
@@ -442,4 +652,4 @@ export {
|
|
|
442
652
|
ProfileEvaluationDiscoveryRequestSchema,
|
|
443
653
|
OpenPondProfileEvaluationDiscoveryClient
|
|
444
654
|
};
|
|
445
|
-
//# sourceMappingURL=chunk-
|
|
655
|
+
//# sourceMappingURL=chunk-2G4WBMYI.js.map
|